From 8b767c2a85815dad5bbc338a95881546b2973063 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Tue, 31 May 2022 10:20:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HaiLiangFeedingTrunkDeviceDriver.java | 63 +++- .../ProduceshiftorderdetailController.java | 76 +++++ .../service/ProduceshiftorderService.java | 11 +- .../ProduceshiftorderdetailService.java | 87 +++++ .../dto/ProduceshiftorderdetailDto.java | 4 + .../impl/ProduceshiftorderServiceImpl.java | 51 +-- .../ProduceshiftorderdetailServiceImpl.java | 299 ++++++++++++++++++ .../org/nl/acs/order/service/wql/order.xls | Bin 191488 -> 191488 bytes .../run/LetteringSocketConnectionAutoRun.java | 21 +- 9 files changed, 552 insertions(+), 60 deletions(-) create mode 100644 nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderdetailController.java create mode 100644 nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java create mode 100644 nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java index 641d041..d06d964 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java @@ -10,8 +10,11 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.opc.Device; import org.nl.acs.order.service.ProduceshiftorderService; +import org.nl.acs.order.service.ProduceshiftorderdetailService; import org.nl.acs.order.service.dto.ProduceshiftorderDto; +import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto; import org.nl.exception.BadRequestException; +import org.nl.utils.SpringContextHolder; import org.openscada.opc.lib.da.Server; import org.springframework.beans.factory.annotation.Autowired; @@ -28,7 +31,10 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired - ProduceshiftorderService produceshiftorderService; + ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); + + @Autowired + ProduceshiftorderdetailService produceshiftorderdetailService = SpringContextHolder.getBean(ProduceshiftorderdetailService.class); @Override public Device getDevice() { @@ -47,6 +53,8 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im int ready = 0; int pause = 0; int clear = 0; + Boolean send_letter_flag_back = false; + Boolean send_letter_flag = false; @Override public void execute() throws Exception { @@ -88,11 +96,15 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im break; case 3: //申请工单 - apply_order(); + if(!requireSucess && ready == 1 ){ + apply_order(); + } break; case 4: //申请工单明细 - apply_orderDetail(); + if(!requireSucess && ready == 1 && order != 0 ) { + apply_orderDetail(order); + } break; } } @@ -120,6 +132,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im String wall_thickness = dto.getWall_thickness(); String length = dto.getLength(); String qty = dto.getQty(); + writing(ItemProtocol.item_to_order,order); writing(ItemProtocol.item_to_order_feeding_qty,qty); writing(ItemProtocol.item_to_outer_diameter,outer_diameter); @@ -130,14 +143,52 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im writing(ItemProtocol.item_to_is_strapping,is_strapping); writing(ItemProtocol.item_to_is_coating,is_coating); writing(ItemProtocol.item_to_is_lettering,is_lettering); + writing(ItemProtocol.item_to_command,String.valueOf(mode)); + dto.setOrder_status("02"); produceshiftorderService.update(dto); - + requireSucess = true; return true; } - public boolean apply_orderDetail() throws Exception { + public boolean apply_orderDetail(int order) throws Exception { + ProduceshiftorderdetailDto dto = produceshiftorderdetailService.apply_orderDetail(String.valueOf(order)); + if(ObjectUtil.isEmpty(dto)){ + throw new BadRequestException("未找到可下发工单明细!"); + } + String orderDetail = dto.getOrder_detail_code(); + String feeding_qty = dto.getFeeding_qty(); + String strap_pack_number = dto.getStrap_pack_number(); + String strap_number = dto.getStrap_number(); + String str = dto.getLabeling_message(); + //判断是否最后一个客户 + boolean last_detail = produceshiftorderdetailService.isLastOrderDetail(String.valueOf(order)); + + //下发激光刻字信息 + //判断下发刻字成功 + if(!send_letter_flag){ + send_letter_flag = produceshiftorderdetailService.sendLetteringMess(str); + } + if(send_letter_flag_back) { + if(last_detail){ + writing(ItemProtocol.item_to_is_last,"1"); + } else { + writing(ItemProtocol.item_to_is_last,"0"); + } + writing(ItemProtocol.item_to_order_detail,orderDetail); + writing(ItemProtocol.item_to_detail_feeding_qty,feeding_qty); + writing(ItemProtocol.item_to_strapping_qty,strap_pack_number); + writing(ItemProtocol.item_to_one_strapping_qty,strap_number); + writing(ItemProtocol.item_to_coating_qty,strap_pack_number); + writing(ItemProtocol.item_to_labeling_qty,strap_pack_number); + writing(ItemProtocol.item_to_command,String.valueOf(mode)); + dto.setOrder_detail_status("01"); + produceshiftorderdetailService.update(dto); + send_letter_flag = false; + send_letter_flag_back = false; + requireSucess = true; + } return true; } @@ -148,7 +199,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im String opcservcerid = this.getDevice().getOpc_server_id(); Server server = ReadUtil.getServer(opcservcerid); Map itemMap = new HashMap(); - itemMap.put(to_param, Integer.parseInt(value)); + itemMap.put(to_param, Double.parseDouble(value)); ReadUtil.write(itemMap, server); } diff --git a/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderdetailController.java b/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderdetailController.java new file mode 100644 index 0000000..4a13bf1 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderdetailController.java @@ -0,0 +1,76 @@ + +package org.nl.acs.order.rest; + + +import org.nl.acs.order.service.ProduceshiftorderdetailService; +import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto; +import org.springframework.data.domain.Pageable; +import lombok.RequiredArgsConstructor; +import org.nl.annotation.Log; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.*; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; +import lombok.extern.slf4j.Slf4j; + +/** + * @author wangs + * @date 2022-05-30 + **/ +@RestController +@RequiredArgsConstructor +@Api(tags = "order管理") +@RequestMapping("/api/produceshiftorderdetail") +@Slf4j +public class ProduceshiftorderdetailController { + + private final ProduceshiftorderdetailService produceshiftorderdetailService; + + @GetMapping + @Log("查询order") + @ApiOperation("查询order") + //@PreAuthorize("@el.check('produceshiftorderdetail:list')") + public ResponseEntity query(@RequestParam Map whereJson, Pageable page){ + return new ResponseEntity<>(produceshiftorderdetailService.queryAll(whereJson,page),HttpStatus.OK); + } + + @PostMapping + @Log("新增order") + @ApiOperation("新增order") + //@PreAuthorize("@el.check('produceshiftorderdetail:add')") + public ResponseEntity create(@Validated @RequestBody ProduceshiftorderdetailDto dto){ + produceshiftorderdetailService.create(dto); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改order") + @ApiOperation("修改order") + //@PreAuthorize("@el.check('produceshiftorderdetail:edit')") + public ResponseEntity update(@Validated @RequestBody ProduceshiftorderdetailDto dto){ + produceshiftorderdetailService.update(dto); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除order") + @ApiOperation("删除order") + //@PreAuthorize("@el.check('produceshiftorderdetail:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody String[] ids) { + produceshiftorderdetailService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } + + @Log("导出order") + @ApiOperation("导出order") + @GetMapping(value = "/download") + //@PreAuthorize("@el.check('produceshiftorderdetail:list')") + public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { + produceshiftorderdetailService.download(produceshiftorderdetailService.queryAll(whereJson), response); + } +} diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java index d50a992..01789f9 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java @@ -62,13 +62,6 @@ public interface ProduceshiftorderService { */ List queryAllOrder(String whereJson); - /** - * 查询所有未完成工单明细 - * - * @param whereJson 条件参数 - * @return List - */ - List queryAllOrderDteail(String whereJson); /** @@ -102,6 +95,7 @@ public interface ProduceshiftorderService { */ void update(ProduceshiftorderDto dto); + /** * 多选删除 * @@ -188,12 +182,11 @@ public interface ProduceshiftorderService { ProduceshiftorderDto findOrderByOrderIdFromCache(String order_code); - List findOrderDetailByOrderIdFromCache(String order_id); - List findOrderDetailByOrderCodeFromCache(String order_code); ProduceshiftorderDto apply_order(); + List findOrderByOrderStatusFromCache(String order_status); } diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java new file mode 100644 index 0000000..8d94490 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java @@ -0,0 +1,87 @@ +package org.nl.acs.order.service; + +import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +/** + * @description 服务接口 + * @author wangs + * @date 2022-05-30 + **/ +public interface ProduceshiftorderdetailService { + + /** + * 查询数据分页 + * @param whereJson 条件 + * @param page 分页参数 + * @return Map + */ + Map queryAll(Map whereJson, Pageable page); + + /** + * 查询所有数据不分页 + * @param whereJson 条件参数 + * @return List + */ + List queryAll(Map whereJson); + + /** + * 根据ID查询 + * @param orderDetail_id ID + * @return Produceshiftorderdetail + */ + ProduceshiftorderdetailDto findById(String orderDetail_id); + + /** + * 根据编码查询 + * @param code code + * @return Produceshiftorderdetail + */ + ProduceshiftorderdetailDto findByCode(String code); + + + /** + * 创建 + * @param dto / + */ + void create(ProduceshiftorderdetailDto dto); + + /** + * 编辑 + * @param dto / + */ + void update(ProduceshiftorderdetailDto dto); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(String[] ids); + + /** + * 导出数据 + * @param dtos 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List dtos, HttpServletResponse response) throws IOException; + + List queryAllOrderDteail(String whereJson); + + ProduceshiftorderdetailDto findOrderDetailByOrderFromCache(String order,String orderdetail_status); + + ProduceshiftorderdetailDto apply_orderDetail(String order); + + List findOrderDetailByOrderIdFromCache(String order_id); + + List findOrderDetailByOrderCodeFromCache(String order_code); + + Boolean sendLetteringMess(String message) throws IOException; + + Boolean isLastOrderDetail(String order); + +} diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java b/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java index b30170e..b8cfb6d 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java @@ -106,6 +106,10 @@ public class ProduceshiftorderdetailDto implements Serializable { private String length; /** 工单明细状态 */ + //00-就绪、01-分拣中 + //02-下发工单明细暂停 03-工单明细暂停 + //04-下发强制完成 05-强制完成 + //06-自动完成 private String order_detail_status; /** 上料数量 */ diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java index 8d70481..25a3392 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java @@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.device_driver.hailiang.hailiang_feeding_trunk.HaiLiangFeedingTrunkDeviceDriver; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.order.service.ProduceshiftorderService; +import org.nl.acs.order.service.ProduceshiftorderdetailService; import org.nl.acs.order.service.dto.ProduceshiftorderDto; import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto; import org.nl.exception.BadRequestException; @@ -47,13 +48,14 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A List order = new ArrayList(); - List detail = new ArrayList(); private final MongoTemplate mongoTemplate; @Autowired DeviceAppService deviceAppService; + @Autowired + ProduceshiftorderdetailService produceshiftorderdetailService; @Override public void autoInitial() throws Exception { @@ -62,7 +64,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A public synchronized void reload() { this.order = this.queryAllOrder("(order_status !='04' or order_status !='05' ) and is_deleted =0"); - this.detail = this.queryAllOrderDteail(" (order_detail_status != '04' or order_detail_status != '05') and is_deleted =0"); } @Override @@ -175,13 +176,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A return list; } - @Override - public List queryAllOrderDteail(String whereJson) { - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); - JSONArray arr = wo.query(whereJson).getResultJSONArray(0); - List list = arr.toJavaList(ProduceshiftorderdetailDto.class); - return list; - } + @Override @@ -311,9 +306,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A if (StrUtil.equals(dto.getOrder_id(), "07") || StrUtil.equals(dto.getOrder_id(), "08")) { order.add(dto); } - - - } @Override @@ -569,40 +561,14 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A return null; } - @Override - public List findOrderDetailByOrderIdFromCache(String order_id) { - List list = null; - Iterator var3 = detail.iterator(); - while (var3.hasNext()) { - ProduceshiftorderdetailDto oneorderDetail = (ProduceshiftorderdetailDto) var3.next(); - if (StrUtil.equals(oneorderDetail.getOrder_id(), order_id)) { - list.add(oneorderDetail); - } - } - return list; - } - - @Override - public List findOrderDetailByOrderCodeFromCache(String order_code) { - List list = null; - Iterator var3 = detail.iterator(); - while (var3.hasNext()) { - ProduceshiftorderdetailDto oneorderDetail = (ProduceshiftorderdetailDto) var3.next(); - if (StrUtil.equals(oneorderDetail.getOrder_code(), order_code)) { - list.add(oneorderDetail); - } - } - return list; - } - @Override public ProduceshiftorderDto apply_order() { List list = this.findOrderByOrderStatusFromCache("01"); if(ObjectUtil.isEmpty(list)){ - throw new BadRequestException("未找到处于已下发状态的工单!"); + throw new BadRequestException("未找到处于已下发状态的工单!"); } if(list.size() !=1){ - throw new BadRequestException("已下发状态的工单数量不唯一,请校验!"); + throw new BadRequestException("已下发状态的工单数量不唯一,请校验!"); } ProduceshiftorderDto dto = list.get(0); return dto; @@ -610,8 +576,8 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A @Override public List findOrderByOrderStatusFromCache(String order_status) { - List list = null; - Iterator var3 = detail.iterator(); + List list = new ArrayList(); + Iterator var3 = order.iterator(); while (var3.hasNext()) { ProduceshiftorderDto oneorder = (ProduceshiftorderDto) var3.next(); if (StrUtil.equals(oneorder.getOrder_status(), order_status)) { @@ -622,6 +588,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A } + @Override public Map querySorting(Map whereJson, Pageable page) { WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java new file mode 100644 index 0000000..9d89141 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java @@ -0,0 +1,299 @@ +package org.nl.acs.order.service.impl; + + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import lombok.RequiredArgsConstructor; +import org.nl.acs.order.service.ProduceshiftorderService; +import org.nl.acs.order.service.ProduceshiftorderdetailService; +import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto; +import org.nl.exception.BadRequestException; +import org.nl.start.auto.initial.ApplicationAutoInitial; +import org.nl.start.auto.run.LetteringSocketConnectionAutoRun; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import org.springframework.data.domain.Pageable; + +import java.util.*; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.nl.utils.SecurityUtils; +import org.nl.wql.core.bean.ResultBean; +import org.nl.wql.core.bean.WQLObject; +import org.nl.wql.util.WqlUtil; +import org.nl.utils.FileUtil; +import lombok.extern.slf4j.Slf4j; + +/** + * @description 服务实现 + * @author wangs + * @date 2022-05-30 + **/ +@Service +@RequiredArgsConstructor +@Slf4j +public class ProduceshiftorderdetailServiceImpl implements ProduceshiftorderdetailService, ApplicationAutoInitial { + + List detail = new ArrayList(); + + @Autowired + ProduceshiftorderService produceshiftorderService; + + @Override + public Map queryAll(Map whereJson, Pageable page){ + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "", "update_time desc"); + final JSONObject json = rb.pageResult(); + return json; + } + + @Override + public List queryAll(Map whereJson){ + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + JSONArray arr = wo.query().getResultJSONArray(0); + List list = arr.toJavaList(ProduceshiftorderdetailDto.class); + + return list; + } + + @Override + public ProduceshiftorderdetailDto findById(String orderDetail_id) { + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + JSONObject json = wo.query("order_detail_id ='" + orderDetail_id + "'").uniqueResult(0); + final ProduceshiftorderdetailDto obj = (ProduceshiftorderdetailDto) JSONObject.toJavaObject(json, ProduceshiftorderdetailDto.class); + return obj; + } + + @Override + public ProduceshiftorderdetailDto findByCode(String code) { + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); + final ProduceshiftorderdetailDto obj = (ProduceshiftorderdetailDto) JSONObject.toJavaObject(json, ProduceshiftorderdetailDto.class); + return obj; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(ProduceshiftorderdetailDto dto) { + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + + dto.setOrder_detail_id(IdUtil.simpleUUID()); + dto.setCreate_by(currentUsername); + dto.setUpdate_by(currentUsername); + dto.setUpdate_time(now); + dto.setCreate_time(now); + + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.insert(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ProduceshiftorderdetailDto dto) { + ProduceshiftorderdetailDto entity = this.findById(dto.getOrder_detail_id()); + if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + dto.setUpdate_time(now); + dto.setUpdate_by(currentUsername); + + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.update(json); + + + Iterator iterator = detail.iterator(); + while (iterator.hasNext()) { + ProduceshiftorderdetailDto produceshiftorderdetailDto = iterator.next(); + if (produceshiftorderdetailDto.getOrder_detail_id().equals(dto.getOrder_detail_id())) { + iterator.remove(); + } + } + if (StrUtil.equals(dto.getOrder_detail_status(), "07") || StrUtil.equals(dto.getOrder_detail_status(), "08")) { + detail.add(dto); + } + + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(String[] ids) { + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + for (String orderDetail_id: ids) { + wo.delete("orderDetail_id = '" + orderDetail_id + "'"); + } + } + + @Override + public void download(List all, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (ProduceshiftorderdetailDto produceshiftorderdetail : all) { + Map map = new LinkedHashMap<>(); + map.put("工单明细编码", produceshiftorderdetail.getOrder_detail_code()); + map.put("工单明细类型", produceshiftorderdetail.getOrder_detail_type()); + map.put("优先级", produceshiftorderdetail.getPriority()); + map.put("顺序号", produceshiftorderdetail.getSequence_number()); + map.put("工单标识", produceshiftorderdetail.getOrder_id()); + map.put("工单编码", produceshiftorderdetail.getOrder_code()); + map.put("工单数量", produceshiftorderdetail.getOrder_qty()); + map.put("捆扎包数", produceshiftorderdetail.getStrap_pack_number()); + map.put("当前捆扎包数", produceshiftorderdetail.getPresent_strap_pack_number()); + map.put("每捆数量", produceshiftorderdetail.getStrap_number()); + map.put("捆扎尾料数量", produceshiftorderdetail.getStrap_tailint_number()); + map.put("刻字信息", produceshiftorderdetail.getLettering_message()); + map.put("当前刻字数量", produceshiftorderdetail.getPresent_lettering_numer()); + map.put("贴标信息", produceshiftorderdetail.getLabeling_message()); + map.put("当前贴标数量", produceshiftorderdetail.getPresent_labeling_number()); + map.put("创建者", produceshiftorderdetail.getCreate_by()); + map.put("创建时间", produceshiftorderdetail.getCreate_time()); + map.put("修改者", produceshiftorderdetail.getUpdate_by()); + map.put("修改时间", produceshiftorderdetail.getUpdate_time()); + map.put("是否删除", produceshiftorderdetail.getIs_deleted()); + map.put("客户信息", produceshiftorderdetail.getCust_name()); + map.put("客户标识", produceshiftorderdetail.getCust_id()); + map.put("客户编码", produceshiftorderdetail.getCust_code()); + map.put("物料标识", produceshiftorderdetail.getMaterial_id()); + map.put("物料编码", produceshiftorderdetail.getMaterial_code()); + map.put("物料名称 ", produceshiftorderdetail.getMaterial_name()); + map.put("外径", produceshiftorderdetail.getOuter_diameter()); + map.put("壁厚", produceshiftorderdetail.getWall_thickness()); + map.put("物料长度", produceshiftorderdetail.getLength()); + map.put("工单明细状态", produceshiftorderdetail.getOrder_detail_status()); + map.put("上料数量", produceshiftorderdetail.getFeeding_qty()); + map.put("上料合格数量", produceshiftorderdetail.getLettering_qualified_qty()); + map.put("上料开始时间", produceshiftorderdetail.getFeeding_start_time()); + map.put("上料完成时间", produceshiftorderdetail.getFeeding_end_time()); + map.put("刻字合格数量", produceshiftorderdetail.getQualified_lettering_numer()); + map.put("刻字开始时间", produceshiftorderdetail.getLettering_start_time()); + map.put("刻字完成时间", produceshiftorderdetail.getLettering_finish_time()); + map.put("当前套冒数量", produceshiftorderdetail.getPresent_sleeveing_numer()); + map.put("套冒合格数量", produceshiftorderdetail.getQualified_sleeveing_number()); + map.put("套冒开始时间", produceshiftorderdetail.getSleeveing_start_time()); + map.put("套冒完成时间", produceshiftorderdetail.getSleeveing_finish_time()); + map.put("捆扎开始时间", produceshiftorderdetail.getStarp_start_time()); + map.put("捆扎完成时间", produceshiftorderdetail.getStarp_finish_time()); + map.put("裹膜数量", produceshiftorderdetail.getWraping_number()); + map.put("当前裹膜数量", produceshiftorderdetail.getPresent_wraping_number()); + map.put("裹膜合格数量", produceshiftorderdetail.getQualified_wraping_number()); + map.put("裹膜开始时间", produceshiftorderdetail.getWraping_start_time()); + map.put("裹膜完成时间", produceshiftorderdetail.getWraping_finish_time()); + map.put("贴标开始时间", produceshiftorderdetail.getLabeling_start_time()); + map.put("贴标完成时间", produceshiftorderdetail.getLabeling_finish_time()); + map.put("开始时间", produceshiftorderdetail.getStart_time()); + map.put("结束时间", produceshiftorderdetail.getEnd_time()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } + + @Override + public void autoInitial() throws Exception { + this.reload(); + } + + public synchronized void reload() { + this.detail = this.queryAllOrderDteail(" (order_detail_status != '04' or order_detail_status != '05') and is_deleted =0"); + } + + @Override + public List queryAllOrderDteail(String whereJson) { + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + JSONArray arr = wo.query(whereJson).getResultJSONArray(0); + List list = arr.toJavaList(ProduceshiftorderdetailDto.class); + return list; + } + + @Override + public List findOrderDetailByOrderIdFromCache(String order_id) { + List list = null; + Iterator var3 = detail.iterator(); + while (var3.hasNext()) { + ProduceshiftorderdetailDto oneorderDetail = (ProduceshiftorderdetailDto) var3.next(); + if (StrUtil.equals(oneorderDetail.getOrder_id(), order_id)) { + list.add(oneorderDetail); + } + } + return list; + } + + @Override + public List findOrderDetailByOrderCodeFromCache(String order_code) { + List list = null; + Iterator var3 = detail.iterator(); + while (var3.hasNext()) { + ProduceshiftorderdetailDto oneorderDetail = (ProduceshiftorderdetailDto) var3.next(); + if (StrUtil.equals(oneorderDetail.getOrder_code(), order_code)) { + list.add(oneorderDetail); + } + } + return list; + } + + @Override + public Boolean sendLetteringMess(String message) { + //清缓存 + try { + LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n"); + String yh = "\""; + String strInst = "SETTEXT " + "S1" + " " + yh + message + yh + "\r\n"; //2个变量 + LetteringSocketConnectionAutoRun.write(strInst + "\r\n"); + + } catch (Exception e) { + return false; + } + return true; + } + + + @Override + public ProduceshiftorderdetailDto findOrderDetailByOrderFromCache(String order,String orderdetail_status) { + Iterator var3 = detail.iterator(); + while (var3.hasNext()) { + ProduceshiftorderdetailDto onedetail = (ProduceshiftorderdetailDto) var3.next(); + if (StrUtil.equals(onedetail.getOrder_code(), order) && StrUtil.equals(onedetail.getOrder_detail_status(), orderdetail_status) ) { + return onedetail; + } + } + return null; + } + + @Override + public ProduceshiftorderdetailDto apply_orderDetail(String order) { + ProduceshiftorderdetailDto order_detail = this.findOrderDetailByOrderFromCache(order,"00"); + if(ObjectUtil.isEmpty(order_detail)){ + throw new BadRequestException("未找到处于就绪状态的工单明细!"); + } + + return order_detail; + } + + @Override + public Boolean isLastOrderDetail(String order) { + List list = new ArrayList<>(); + Iterator var3 = detail.iterator(); + while (var3.hasNext()) { + ProduceshiftorderdetailDto onedetail = (ProduceshiftorderdetailDto) var3.next(); + if (StrUtil.equals(onedetail.getOrder_code(), order) && StrUtil.equals(onedetail.getOrder_detail_status(), "00") ) { + list.add(onedetail); + } + } + if(list.size() != 1){ + return false; + } else { + return true; + } + } +} diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls b/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls index cf6cb49a61e8707003ecea8677f1659e2b963784..cc1c2fd128f807d5cb506d12e7f86589ec91f8c0 100644 GIT binary patch delta 7976 zcmbtZd0dp$*FX1}jU8kgP=SX51Z10GQAmYh76exm3|x_Az)?0?5;Pr5b0Zafs&OG9 z&D6}TQAbT#Qc^(yH4V|k+)960FVl2V)&`{j0xd*reQl1>qG+3fb=O^WFeh~RgHBzR%R>bm?;#;%ylhl zBNRV{$o3(r-rYX`s3w!E&5e4*_!?GaTcMq|=L zi}U(aAjEHqCHu`Y?f$+z)4kARE(Uwu_m<&Y#@fkN;6`6X93)JOSiTa`@XLA z?ABJ;2}v-s)ou&3#nDy}&^>;cy%1+)$}F+B{#V*zAN#Mm|LXhy)vt7PBB3n8B#fzZ z9O^va+3Y{;)k|xxH3zPvVI~6^S}0^j3*DI$HrC88p(&Fuj3R@W-9n-B;FtQ;y4AWp z>obJ8Dhy&q+uOQD8Zmli_k0b_y0Mcw{U@@zB~FWZB$Bal4I)vD)Ky5NOuo0_i|uHp z&P~X;(R^mJt1U~33u8qKne)h1x$+q=+LlDFc4N&eyx6bU(58Kb=(5^X$Y=~*a$oB5 z(94#UG7WC53s>eL(iT@IB4cPeh{^NjGvjEZ^9DC3gH}VEGU0BB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zSe>OjD5~MC&i_314F^Vn?$&u~A^}}uI~9aE(N(llfh>O6PJKzFy0iQ$QP`-FdL_$?+T#O`26_pSf z6)%g73z0=C%_qu+Dq|$^@$t$8MVM5oNC*j6B!seORG7hdnHtTttkOi9-oQA_a-Nr= J>IPNC|1U(U-@E_- diff --git a/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java b/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java index 33943ab..2ad8649 100644 --- a/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java +++ b/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java @@ -5,7 +5,12 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.config.server.impl.AcsConfigServiceImpl; +import org.nl.acs.device_driver.hailiang.hailiang_feeding_trunk.HaiLiangFeedingTrunkDeviceDriver; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; +import org.nl.exception.BadRequestException; import org.nl.utils.SpringContextHolder; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.io.DataInputStream; @@ -14,6 +19,7 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.Socket; import java.util.Date; +import java.util.List; @Slf4j @Component @@ -27,7 +33,8 @@ public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { private int recordTimeOut = 10000; private Date recordTime; boolean bConnected = true; - + @Autowired + DeviceAppService deviceAppService; public LetteringSocketConnectionAutoRun() { this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut); } @@ -66,8 +73,16 @@ public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { } System.out.println("收到请求参数:" + bs); //打印完成 - if (StrUtil.equals(bs.toString(), "MSG 3")) { - +// if (StrUtil.equals(bs.toString(), "MSG 3")) { +// +// } + if (StrUtil.equals(bs.toString(), "OK")) { + HaiLiangFeedingTrunkDeviceDriver haiLiangFeedingTrunkDeviceDriver; + List deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class); + if (deviceAll.get(0) instanceof HaiLiangFeedingTrunkDeviceDriver) { + haiLiangFeedingTrunkDeviceDriver = (HaiLiangFeedingTrunkDeviceDriver) deviceAll.get(0); + haiLiangFeedingTrunkDeviceDriver.setSend_letter_flag_back(true); + } } } }