From 42cd7d125855a5c0802283c076919dcba4d246b0 Mon Sep 17 00:00:00 2001 From: yanps Date: Wed, 17 Jan 2024 18:57:02 +0800 Subject: [PATCH 1/4] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E6=8F=92=E6=8B=94?= =?UTF-8?q?=E6=9C=BA=E5=8F=96=E8=B4=A7=E5=AE=8C=E6=88=90=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndoorManipulatorDeviceDriver.java | 7 ++++- ...PluggingUnpluggingMachineDeviceDriver.java | 27 +++++++++++++++++++ .../basedriver/rgv/RgvDeviceDriver.java | 20 +++++++------- acs/nladmin-ui/src/views/acs/task/index.vue | 8 +----- 4 files changed, 44 insertions(+), 18 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index e410abc8e..b338c56ca 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -397,7 +397,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple try { this.checkcontrol(itemMap); } catch (Exception e) { - throw new RuntimeException(e); + try { + Thread.sleep(1000); + this.checkcontrol(itemMap); + } catch (Exception ex) { + throw new RuntimeException(ex); + } } logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java index 95f1b9aed..e89644ebd 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java @@ -161,6 +161,11 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv pullingSucess(); } break; + case 7: + if (task1 > 0 && !requireSucess) { + deliveryCompleted(); + } + break; default: break; @@ -174,6 +179,28 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv last_to_command = to_command; } + /** + * 取货完成 + */ + private void deliveryCompleted() { + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + applyManipulatorActionRequest.setAction("1"); + applyManipulatorActionRequest.setTask_code1(String.valueOf(task1)); + ApplyManipulatorActionResponse applyManipulatorActionResponse = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求成功响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + Map map = new LinkedHashMap<>(); + map.put("to_command", 7); + this.writing(map); + requireSucess = true; + message = "缓存库放货成功"; + } else { + requireSucess = false; + logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求失败响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + message = "缓存库放货失败"; + } + } + private synchronized void pullingSucess() { List list = new ArrayList(); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java index 58985a5d7..993fa5c68 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java @@ -65,10 +65,10 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr int last_move1 = 0; Integer move2 = 0; Integer last_move2 = 0; - float qty1 = 0f; - float last_qty1 = 0f; - float qty2 = 0f; - float last_qty2 = 0f; + Float qty1 = 0f; + Float last_qty1 = 0f; + Float qty2 = 0f; + Float last_qty2 = 0f; int task = 0; int last_task = 0; @@ -117,14 +117,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr if(!move2.equals(last_move2)){ logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_move2 + "->" + move2); } - if(qty1 != last_qty1){ - logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_qty1 + "->" + qty1); + if(!qty1.equals(last_qty1)){ + logServer.deviceExecuteLog(this.device_code, "", "", "信号qty1:" + last_qty1 + "->" + qty1); } - if(qty2 != last_qty2){ - logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_qty2 + "->" + qty2); + if(!qty2.equals(last_qty2)){ + logServer.deviceExecuteLog(this.device_code, "", "", "信号qty2:" + last_qty2 + "->" + qty2); } if(task != last_task){ - logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_task + "->" + task); + logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); } @@ -162,7 +162,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr } break; case 5: - if (task > 0 && !requireSucess && (qty1 > 0 || qty2 > 0)) { + if (task > 0 && !requireSucess) { manualFeedbackQty(); } break; diff --git a/acs/nladmin-ui/src/views/acs/task/index.vue b/acs/nladmin-ui/src/views/acs/task/index.vue index e97158864..20a170eb3 100644 --- a/acs/nladmin-ui/src/views/acs/task/index.vue +++ b/acs/nladmin-ui/src/views/acs/task/index.vue @@ -599,13 +599,7 @@ export default { device_code: '', material_code: '', qty: '' - }/* , - { - device_code: '', - material_code: '', - qty: '' - } */ - ] + }] }, rules: { start_height: [ From 58417bf12c1cf3ebc079934334d48325b49e0e74 Mon Sep 17 00:00:00 2001 From: "ZHOUZ\\Noble'lift" <1014987728@qq.com> Date: Wed, 17 Jan 2024 17:09:08 +0800 Subject: [PATCH 2/4] =?UTF-8?q?rev:=E7=A9=BF=E6=8B=94=E8=BD=B4=E6=9C=BA?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java | 2 +- .../main/java/org/nl/wms/sch/tasks/PaperTrussTask.java | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 4f000e66b..ddc7fa02b 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -1318,7 +1318,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0); point1_jo.put("have_qzz", "0"); ivt_shaftivt.update(point1_jo); - } else if ("010607".equals(point_type)) { + } else if ("010607".equals(point_type) || "010603".equals(point_type)) { JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0); point1_jo.put("qzz_size", ""); point1_jo.put("qzz_generation", ""); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/PaperTrussTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/PaperTrussTask.java index 3b3cfd553..7cb5c869c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/PaperTrussTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/PaperTrussTask.java @@ -108,15 +108,6 @@ public class PaperTrussTask extends AbstractAcsTask { goal_point.put("have_qzz", "1"); ivt_shaftivt.update(goal_point); } - //空轴放货任务 - if ("010603".equals(task_type)) { - String point_code = task_jo.getString("point_code1"); - JSONObject goal_point = ivt_shaftivt.query("point_code = '" + point_code + "'").uniqueResult(0); - goal_point.put("qzz_size", ""); - goal_point.put("qzz_generation", ""); - goal_point.put("have_qzz", "0"); - ivt_shaftivt.update(goal_point); - } //空轴换货任务 if ("010604".equals(task_type)) { String point_code = task_jo.getString("point_code1"); From 54f0a10efdb24074f3ca0b1f9dd3476be9734c2c Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Wed, 17 Jan 2024 20:36:44 +0800 Subject: [PATCH 3/4] =?UTF-8?q?add:=20=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/config/application-dev.yml | 2 +- .../BoxStorageOutConveyorDeviceDriver.java | 45 ------ ...ConveyorWithScannerWeightDeviceDriver.java | 133 +++--------------- .../un_box_lable_conveyor/ItemProtocol.java | 8 +- .../UnBoxLableConveyorDeviceDriver.java | 60 ++------ .../BoxPackageManipulatorDeviceDriver.java | 57 -------- .../box_package_manipulator/ItemProtocol.java | 14 ++ .../BoxStorageManipulatorDeviceDriver.java | 34 +---- 8 files changed, 56 insertions(+), 297 deletions(-) diff --git a/acs/nladmin-system/src/main/resources/config/application-dev.yml b/acs/nladmin-system/src/main/resources/config/application-dev.yml index 7a0351aed..e0243e89f 100644 --- a/acs/nladmin-system/src/main/resources/config/application-dev.yml +++ b/acs/nladmin-system/src/main/resources/config/application-dev.yml @@ -17,7 +17,7 @@ spring: username: ${DB_USER:root} # password: ${DB_PWD:P@ssw0rd} # password: ${DB_PWD:Root.123456} - password: ${DB_PWD:123456} + password: ${DB_PWD:root} # 初始连接数 initial-size: 5 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java index a4710cc8f..fc511ca50 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java @@ -171,52 +171,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i heartbeat = this.itemProtocol.getHeartbeat(); - if (to_strap_times != last_to_strap_times) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_strap_times:" + last_to_strap_times + "->" + to_strap_times); - } - if (to_length != last_to_length) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_length:" + last_to_length + "->" + to_length); - } - if (to_weight != last_to_weight) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_weight:" + last_to_weight + "->" + to_weight); - } - if (to_height != last_to_height) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_height:" + last_to_height + "->" + to_height); - } - if (to_command != last_to_command) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command); - } - if (to_target != last_to_target) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target); - } - if (to_task != last_to_task) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task); - } - if (mode != last_mode) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (carrier_direction != last_carrier_direction) { - logServer.deviceItemValue(this.device_code, "carrier_direction", String.valueOf(carrier_direction)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction:" + last_carrier_direction + "->" + carrier_direction); - } - if (error != last_error) { - if (error != 0) { - DeviceErrorLogDto dto = new DeviceErrorLogDto(); - dto.setDevice_code(device_code); - dto.setError_code(String.valueOf(error)); - String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)); - dto.setError_info(errorInfo); - deviceErrorLogService.create(dto); - } - - - - - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } if (move != 0 && task > 0) { update_instruction_status(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index 511ff2e25..cae8d3361 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -64,6 +64,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class); + DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); + + //工作模式 int mode = 0; int last_mode = 0; @@ -267,8 +270,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv applyIn(); } - //申请任务 - if (mode == 2 && move == 0 && task == 0 && !requireSucess) { + //申请入库指令、异常位指令 + if (mode == 2 && move == 1 && task > 0 && !requireSucess) { boolean res = instruction_require(); if (res) { notCreateInstMessage = ""; @@ -400,85 +403,22 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv //判断是否存在起点相同 任务状态就绪的任务 TaskDto taskdto = taskserver.findByStartCodeAndReady(device_code); if (!ObjectUtil.isEmpty(taskdto)) { - //需要判断当前设备是否已经存在就绪的指令 如果存在就直接下发 不存在则创建 - Instruction inst = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()); - if (ObjectUtil.isNotEmpty(inst)) { - List list = new ArrayList(); - Map map2 = new HashMap(); - map2.put("code", "to_task"); - map2.put("value", inst.getInstruction_code()); - list.add(map2); - Map map3 = new HashMap(); - map3.put("code", "to_command"); - map3.put("value", "1"); - list.add(map3); - this.writing(list); - requireSucess = true; - while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() - , inst.getInstruction_code())) { - this.writing(list); - logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发信号"); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } - if (ObjectUtil.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))) { - requireSucess = false; - return false; - } - } - message = "下发电气任务号成功"; - requireSucess = true; - return true; - } + String taskid = taskdto.getTask_id(); String taskcode = taskdto.getTask_code(); String vehiclecode = taskdto.getVehicle_code(); String priority = taskdto.getPriority(); - String start_point_code = taskdto.getStart_point_code(); - String start_device_code = taskdto.getStart_device_code(); String route_plan_code = taskdto.getRoute_plan_code(); - String next_device_code = ""; - /** - * 开始平均分配 - */ - String this_coevice_code = taskserver.queryAssignedByDevice(device_code, taskdto.getNext_device_code()); - if (StrUtil.isEmpty(this_coevice_code)) { - List shortPathsList = routeLineService.getShortPathLines(start_device_code, taskdto.getNext_device_code(), route_plan_code); - RouteLineDto routeLineDto = shortPathsList.get(0); - - String path = routeLineDto.getPath(); - String type = routeLineDto.getType(); - String[] str = path.split("->"); - - List pathlist = Arrays.asList(str); - int index = 0; - for (int m = 0; m < pathlist.size(); m++) { - if (pathlist.get(m).equals(start_device_code)) { - index = m + 1; - break; - } - } - next_device_code = pathlist.get(index); - } else { - next_device_code = this_coevice_code; - } - //校验路由关系 - List shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); - if (ObjectUtils.isEmpty(shortPathsList)) { - throw new RuntimeException("路由不通!"); - } - - Device startdevice = deviceAppService.findDeviceByCode(start_device_code); - Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); - String next_point_code; - if (StrUtil.equals(deviceAppService.findDeviceTypeByCode(next_device_code), "storage")) { - next_point_code = taskdto.getTo_x() + "-" + taskdto.getTo_y() + "-" + taskdto.getTo_z(); - } else { - next_point_code = next_device_code; - } + List shortPathsList = routeLineService.getShortPathLines(taskdto.getStart_device_code(), taskdto.getNext_device_code(), route_plan_code); + RouteLineDto routeLineDto = shortPathsList.get(0); + String path = routeLineDto.getPath(); + String[] str = path.split("->"); + List pathlist = Arrays.asList(str); + Integer start = 2; + String start_point_code = pathlist.get(start); + String start_device_code = pathlist.get(start); + String next_device_code = pathlist.get(start+1); Instruction instdto = new Instruction(); instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRoute_plan_code(route_plan_code); @@ -494,7 +434,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv instdto.setStart_device_code(start_device_code); instdto.setNext_device_code(next_device_code); instdto.setStart_point_code(start_point_code); - instdto.setNext_point_code(next_point_code); + instdto.setNext_point_code(next_device_code); instdto.setPriority(priority); instdto.setInstruction_status("0"); instdto.setExecute_device_code(start_point_code); @@ -505,6 +445,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv log.error("指令创建失败!", e.getMessage()); return false; } + Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code); + //创建指令后修改任务状态 taskdto.setTask_status("1"); taskserver.update(taskdto); @@ -540,45 +482,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv return false; } } - } else { - //如果不存在则直接找对应指令 - Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code); - if (ObjectUtil.isEmpty(inst)) { - return false; - } - - Device nextdevice = deviceAppService.findDeviceByCode(inst.getNext_device_code()); - String next_addr = nextdevice.getExtraValue().get("address").toString(); - - List list = new ArrayList(); - Map map = new HashMap(); - map.put("code", "to_target"); - map.put("value", next_addr); - list.add(map); - Map map2 = new HashMap(); - map2.put("code", "to_task"); - map2.put("value", inst.getInstruction_code()); - list.add(map2); - Map map3 = new HashMap(); - map3.put("code", "to_command"); - map3.put("value", "1"); - list.add(map3); - this.writing(list); - requireSucess = true; - while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() - , inst.getInstruction_code())) { - this.writing(list); - logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号"); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } - if (ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))) { - requireSucess = false; - return false; - } - } } return true; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/ItemProtocol.java index 2daa66305..30c3e4afd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/ItemProtocol.java @@ -48,6 +48,11 @@ public class ItemProtocol { */ public static String item_task = "task"; + /** + * 干燥机模板 + */ + public static String item_desiccant = "desiccant"; + /** * 动作信号 */ @@ -76,7 +81,7 @@ public class ItemProtocol { public String getMaterialBarCode() { return this.getOpcStringValue(item_material_barcode); - } + } public int getContainer_type() { return this.getOpcIntegerValue(item_container_type); @@ -163,6 +168,7 @@ public class ItemProtocol { list.add(new ItemDto(item_error, "报警信号", "DB600.B6")); list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B7")); list.add(new ItemDto(item_task, "任务号", "DB600.D10")); + list.add(new ItemDto(item_desiccant, "干燥机模板", "DB600.D10")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java index 015d95e13..27ae88f9a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java @@ -171,47 +171,6 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl to_task = this.itemProtocol.getTo_task(); heartbeat = this.itemProtocol.getHeartbeat(); - - if (to_strap_times != last_to_strap_times) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_strap_times:" + last_to_strap_times + "->" + to_strap_times); - } - if (to_length != last_to_length) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_length:" + last_to_length + "->" + to_length); - } - if (to_weight != last_to_weight) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_weight:" + last_to_weight + "->" + to_weight); - } - if (to_height != last_to_height) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_height:" + last_to_height + "->" + to_height); - } - if (to_command != last_to_command) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command); - } - if (to_target != last_to_target) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target); - } - if (to_task != last_to_task) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task); - } - if (mode != last_mode) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - - if (carrier_direction != last_carrier_direction) { - logServer.deviceItemValue(this.device_code, "carrier_direction", String.valueOf(carrier_direction)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction:" + last_carrier_direction + "->" + carrier_direction); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } - -// if (move != 0 && task > 0) { -// -// update_instruction_status(); -// } - } catch (Exception e) { logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace())); @@ -231,11 +190,20 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl message = "有报警"; } - Instruction instruction = null; List toInstructions; //空箱出库开盖位,申请开盖 if (mode == 7 && move == 1 && task > 0) { - applyUnbox(); + //不允许开盖,完成出库任务,自动去扫码位 + if (!applyUnbox()){ + Instruction instruction = instructionService.findByCode(String.valueOf(task)); + if (ObjectUtil.isNotEmpty(instruction)) { + try { + instructionService.finish(instruction); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } } } @@ -256,12 +224,12 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl last_to_height =to_height; } - private void applyUnbox() { + private Boolean applyUnbox() { Date date = new Date(); if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return; + return false; } else { try { JSONObject param = new JSONObject(); @@ -271,11 +239,13 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl HttpResponse response = acsToWmsService.shipDeviceUpdate(param); if (response == null || response.getStatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "木箱申请开盖任务,接口返回:" + response.body()); + return true; } } catch (Exception e) { e.printStackTrace(); } } + return false; } public boolean exe_error() { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java index 3afdedfc9..682a9fd1d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java @@ -171,63 +171,6 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i to_direction = this.itemProtocol.getTo_direction(); to_last = this.itemProtocol.getTo_last(); - if (to_last != last_to_last) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_last:" + last_to_last + "->" + to_last); - } - if (to_max_no != last_to_max_no) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_max_no:" + last_to_max_no + "->" + to_max_no); - } - if (to_direction != last_to_direction) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_direction:" + last_to_direction + "->" + to_direction); - } - if (to_seq != last_to_seq) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_seq:" + last_to_seq + "->" + to_seq); - } - if (to_onset != last_to_onset) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_onset + "->" + to_onset); - } - if (to_command != last_to_command) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command); - } - if (to_target != last_to_target) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target); - } - if (to_task != last_to_task) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task); - } - if (mode != last_mode) { - requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); - } - if (action != last_action) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } - if (walk_y != last_walk_y) { - logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + last_walk_y + "->" + walk_y); - } - if (task != last_task) { - logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); - } - if (x_position != last_x_position) { - logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(x_position)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position:" + last_x_position + "->" + x_position); - } - if (y_position != last_y_position) { - logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(y_position)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position:" + last_y_position + "->" + y_position); - } // 更新指令状态 if (mode == 3 && task > 0) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java index 5375b4d25..554b039a2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java @@ -48,6 +48,18 @@ public class ItemProtocol { */ public static String item_y_position = "y_position"; + + /** + * 木箱数量 + */ + public static String item_number = "number"; + + /** + * 木箱位置 + */ + public static String item_position = "position"; + + /** * 下发命令 */ @@ -207,6 +219,8 @@ public class ItemProtocol { list.add(new ItemDto(item_task, "任务号", "DB1.D6")); list.add(new ItemDto(item_x_position, "x坐标", "DB1.REAL10")); list.add(new ItemDto(item_y_position, "y坐标", "DB1.REAL14")); + list.add(new ItemDto(item_position, "木箱位置", "DB1.REAL16")); + list.add(new ItemDto(item_number, "木箱数量", "DB1.REAL18")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java index f8da6162e..b07a8953d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java @@ -152,39 +152,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i to_task = this.itemProtocol.getTo_task(); to_layer = this.itemProtocol.getTo_layer(); to_barcode = this.itemProtocol.getTo_barcode(); - if (mode != last_mode) { - requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); - } - if (action != last_action) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } - if (task != last_task) { - logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); - } - if (to_command != last_to_command) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command); - } - if (to_target != last_to_target) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target); - } - if (to_onset != last_to_onset) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_target + "->" + to_target); - } - if (to_task != last_to_task) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task); - } + // 更新指令状态 From a2c03da1c85a1662426e9e1a1641c99c6e8fb258 Mon Sep 17 00:00:00 2001 From: "ZHOUZ\\Noble'lift" <1014987728@qq.com> Date: Thu, 18 Jan 2024 15:54:44 +0800 Subject: [PATCH 4/4] =?UTF-8?q?rev:=E6=B0=94=E6=B6=A8=E8=BD=B4=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index ddc7fa02b..a05e692fc 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -1,5 +1,6 @@ package org.nl.wms.ext.acs.service.impl; +import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.NumberUtil; @@ -1290,7 +1291,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { JSONObject fhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '7' AND product_area = '" + product_area + "'").uniqueResult(0); jo.put("point_code2", fhd_jo.getString("point_code")); jo.put("product_area", product_area); - jo.put("vehicle_code", "qzz"); + jo.put("vehicle_code", DateUtil.format(DateUtil.date(),"yyyyMMdd")+"qzz"); jo.put("truss_type", "8"); JSONObject request_param = new JSONObject(); request_param.put("have_size", cbz_size);