From 52a2d283bd45eb7d3f9aca77f217cfca420e880b Mon Sep 17 00:00:00 2001 From: loujf Date: Mon, 28 Nov 2022 20:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=83=A0=E6=B0=8F=E4=BB=BB=E5=8A=A1=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceServiceImpl.java | 52 +++++++++++++++++-- .../StandardInspectSiteDeviceDriver.java | 52 ------------------- .../task/service/impl/TaskServiceImpl.java | 13 +++++ 3 files changed, 61 insertions(+), 56 deletions(-) diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index e8b872e..19a6804 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -1094,10 +1094,54 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial standardEmptyPalletSiteDeviceDriver.setContainer(vehicle_code); } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - standardInspectSiteDeviceDriver.setMaterial(material_type); - standardInspectSiteDeviceDriver.setBatch(batch); - device.setMaterial_type(material_type); - device.setBatch(batch); + if (StrUtil.isNotEmpty(material_type)) { + standardInspectSiteDeviceDriver.setMaterial(material_type); + device.setMaterial_type(material_type); + } else { + standardInspectSiteDeviceDriver.setMaterial(""); + device.setMaterial_type(""); + } + if (StrUtil.isNotEmpty(quantity)) { + standardInspectSiteDeviceDriver.setQty(quantity); + device.setQuantity(quantity); + } else { + standardInspectSiteDeviceDriver.setQty(""); + device.setQuantity(""); + } + if (StrUtil.isNotEmpty(remark)) { + standardInspectSiteDeviceDriver.setRemark(remark); + device.setRemark(remark); + } else { + standardInspectSiteDeviceDriver.setRemark(""); + device.setRemark(""); + } + if (StrUtil.isNotEmpty(batch)) { + standardInspectSiteDeviceDriver.setBatch(batch); + device.setBatch(batch); + } else { + standardInspectSiteDeviceDriver.setBatch(""); + device.setBatch(""); + } + if (StrUtil.isNotEmpty(islock)) { + standardInspectSiteDeviceDriver.setIslock(Boolean.valueOf(islock)); + device.setIslock(islock); + } + WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); + JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0); + if (!ObjectUtil.isEmpty(json)) { + DeviceRunpointDto obj = (DeviceRunpointDto) JSONObject.toBean(json, DeviceRunpointDto.class); + obj.setHasgoods(hasGoodStatus); + obj.setMaterial_type(material_type); + obj.setBatch(batch); + device.setHas_goods(Integer.parseInt(hasGoodStatus)); + device.setMaterial_type(material_type); + device.setRemark(remark); + device.setQuantity(quantity); + device.setBatch(batch); + device.setIslock(islock); + JSONObject updatejson = JSONObject.fromObject(obj); + runpointwo.update(updatejson, "device_code = '" + device_code + "'"); + } } else if (device.getDeviceDriver() instanceof YkbkSpecialDeviceDriver) { ykbkSpecialDeviceDriver = (YkbkSpecialDeviceDriver) device.getDeviceDriver(); ykbkSpecialDeviceDriver.setMaterial(material_type); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java index 46b3df4..5c20f1c 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java @@ -242,59 +242,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp return; case 2: //申请任务 -// if (this.getApply_handling()) { -// String link_device_code = this.getDevice().getExtraValue().get("link_device_code").toString(); -// DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); -// Device link_device = appService.findDeviceByCode(link_device_code); -// StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver; -// if(link_device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { -// standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) link_device.getDeviceDriver(); -// if(standardInspectSiteDevicedriver.getMode() != 2){ -// log.debug("设备未待机"); -// return; -// } -// if(standardInspectSiteDevicedriver.getMove() != 0){ -// log.debug("设备不满足放货条件"); -// return; -// } -// -// //如果目标设备申请叫料 则允许生成任务 -// if(standardInspectSiteDevicedriver.getApply_material()){ -// TaskDto dto = new TaskDto(); -// String now = DateUtil.now(); -// dto.setTask_id(IdUtil.simpleUUID()); -// dto.setCreate_by(this.getDevice().getDevice_code()); -// dto.setUpdate_by(this.getDevice().getDevice_code()); -// dto.setStart_point_code(this.getDevice().getDevice_code()); -// -// String taskcode = CodeGenerateUtil.getNewCode("TASK_NO"); -// dto.setTask_code("-"+taskcode); -// dto.setTask_status("0"); -// dto.setPriority("101"); -// RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); -// String next_device_codecode = jo.getNext_device_code(); -// if(StrUtil.isEmpty(next_device_codecode)){ -// throw new RuntimeException("该设备未找到对应路由"); -// } -// dto.setNext_point_code(next_device_codecode); -// dto.setUpdate_time(now); -// dto.setCreate_time(now); -// -// WQLObject wo = WQLObject.getWQLObject("acs_task"); -// JSONObject json = JSONObject.fromObject(dto); -// wo.insert(json); -// standardInspectSiteDevicedriver.setApply_material(false); -// } -// } -// this.setApply_handling(false); -// } - if (material.length() > 0 && qty.length() > 0 && !requireSucess) { - this.execute_log.log("设备:" + devicecode + ",material:" + material + ",qty:" + qty); - - this.instruction_require(container); - - } case 5: if (!emptyrequireSucess){ //mode = 5 并且工位上无货时申请空托盘 diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index c2b7042..47bc594 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -674,6 +674,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { // throw new RuntimeException("设备:" + device_code + " 已存在该起点的任务"); // } StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; for (int j = 0; j < list.size(); j++) { RouteLineDto routeLineDto = list.get(j); next_device_code = routeLineDto.getNext_device_code(); @@ -688,6 +689,18 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } else { next_device_code = ""; } + } + if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); + if (standardInspectSiteDeviceDriver.getMode() != 0 + && standardInspectSiteDeviceDriver.getHasGoods() == 0 + && !standardInspectSiteDeviceDriver.getIslock() + && ObjectUtil.isEmpty(this.findByNextCode(next_device_code)) + && ObjectUtil.isEmpty(this.findByStartCode(device_code))) { + break; + } else { + next_device_code = ""; + } } else { next_device_code = ""; }