diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index 9542896..410e388 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -236,10 +236,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (lnshPalletizingManipulatorSiteDeviceDriver.getAction() == 3 || lnshPalletizingManipulatorSiteDeviceDriver.getAction() == 1)) { inst.setExecute_status("1"); instructionService.update(inst); + lnshPalletizingManipulatorSiteDeviceDriver.writing(2); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",2); - lnshPalletizingManipulatorSiteDeviceDriver.writing(map); lnshPalletizingManipulatorSiteDeviceDriver.setMessage(""); flag = true; } else { @@ -274,10 +272,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (lnshStationDeviceDriver.getAction() == 3 || lnshStationDeviceDriver.getAction() == 1)){ inst.setExecute_status("1"); instructionService.update(inst); + lnshStationDeviceDriver.writing(2); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",2); - lnshStationDeviceDriver.writing(map); lnshStationDeviceDriver.setMessage(""); flag=true; }else{ @@ -311,10 +307,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && conveyorPressStationDeviceDriver.getMove() != 0 && (conveyorPressStationDeviceDriver.getIo_action() == 3 || conveyorPressStationDeviceDriver.getIo_action() == 1) && (conveyorPressStationDeviceDriver.getAction() == 3 || conveyorPressStationDeviceDriver.getAction() == 1)) { - data = AgvService.sendAgvOneModeInst(phase, index, 0); Map map = new LinkedHashMap<>(); map.put("to_command",2); conveyorPressStationDeviceDriver.writing(map); + data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); flag = true; } else { @@ -369,11 +365,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic ) { inst.setExecute_status("1"); instructionService.update(inst); + conveyorBarcodeDeviceDriver.writing(2); data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorBarcodeDeviceDriver.setMessage(""); - Map map = new LinkedHashMap<>(); - map.put("to_command",2); - conveyorBarcodeDeviceDriver.writing(map); flag = true; } else { String message = ""; @@ -401,10 +395,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic // && (lnshFoldDiscSiteDeviceDriver.getAction() == 3 || lnshFoldDiscSiteDeviceDriver.getAction() == 1) inst.setExecute_status("1"); instructionService.update(inst); + lnshFoldDiscSiteDeviceDriver.writing(2); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",2); - lnshFoldDiscSiteDeviceDriver.writing(map); lnshFoldDiscSiteDeviceDriver.setMessage(""); flag = true; } else { @@ -506,11 +498,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 3 || lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 2) ) { inst.setExecute_status("5"); + lnshPalletizingManipulatorSiteDeviceDriver.writing(3); instructionService.update(inst); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",3); - lnshPalletizingManipulatorSiteDeviceDriver.writing(map); lnshPalletizingManipulatorSiteDeviceDriver.setMessage(""); flag = true; } else { @@ -542,10 +532,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic ) { inst.setExecute_status("5"); instructionService.update(inst); + lnshStationDeviceDriver.writing(3); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",3); - lnshStationDeviceDriver.writing(map); lnshStationDeviceDriver.setMessage(""); flag = true; } else { @@ -577,10 +565,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic ) { inst.setExecute_status("5"); instructionService.update(inst); - data = AgvService.sendAgvOneModeInst(phase, index, 0); Map map = new LinkedHashMap<>(); map.put("to_command",3); conveyorPressStationDeviceDriver.writing(map); + data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); flag = true; } else { @@ -625,11 +613,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver(); if (conveyorBarcodeDeviceDriver.getMode() != 0) { inst.setExecute_status("5"); + conveyorBarcodeDeviceDriver.writing(3); instructionService.update(inst); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",3); - conveyorBarcodeDeviceDriver.writing(map); conveyorBarcodeDeviceDriver.setMessage(""); flag = true; } else { @@ -657,11 +643,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic // && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 3 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 2) ) { inst.setExecute_status("5"); + lnshFoldDiscSiteDeviceDriver.writing(3); instructionService.update(inst); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",3); - lnshFoldDiscSiteDeviceDriver.writing(map); lnshFoldDiscSiteDeviceDriver.setMessage(""); flag = true; } else { @@ -778,10 +762,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (lnshPalletizingManipulatorSiteDeviceDriver.getAction() == 2 || lnshPalletizingManipulatorSiteDeviceDriver.getAction() == 3)) { inst.setExecute_status("3"); instructionService.update(inst); + lnshPalletizingManipulatorSiteDeviceDriver.writing(4); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",4); - lnshPalletizingManipulatorSiteDeviceDriver.writing(map); lnshPalletizingManipulatorSiteDeviceDriver.setMessage(""); flag = true; } else { @@ -816,10 +798,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (lnshStationDeviceDriver.getAction() == 2 || lnshStationDeviceDriver.getAction() == 3)) { inst.setExecute_status("3"); instructionService.update(inst); + lnshStationDeviceDriver.writing(4); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",4); - lnshStationDeviceDriver.writing(map); lnshStationDeviceDriver.setMessage(""); flag = true; } else { @@ -854,10 +834,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (conveyorPressStationDeviceDriver.getAction() == 2 || conveyorPressStationDeviceDriver.getAction() == 3)) { inst.setExecute_status("3"); instructionService.update(inst); - data = AgvService.sendAgvOneModeInst(phase, index, 0); Map map = new LinkedHashMap<>(); map.put("to_command",4); conveyorPressStationDeviceDriver.writing(map); + data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); flag = true; } else { @@ -906,10 +886,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (conveyorBarcodeDeviceDriver.getMode() == 2&& conveyorBarcodeDeviceDriver.getMove()==0){ inst.setExecute_status("3"); instructionService.update(inst); + conveyorBarcodeDeviceDriver.writing(4); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",4); - conveyorBarcodeDeviceDriver.writing(map); conveyorBarcodeDeviceDriver.setMessage(""); flag = true; } else { @@ -939,10 +917,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic ) { inst.setExecute_status("3"); instructionService.update(inst); + lnshFoldDiscSiteDeviceDriver.writing(4); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",4); - lnshFoldDiscSiteDeviceDriver.writing(map); lnshFoldDiscSiteDeviceDriver.setMessage(""); flag = true; } else { @@ -1040,10 +1016,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 2 || lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 3)) { inst.setExecute_status("6"); instructionService.update(inst); + lnshPalletizingManipulatorSiteDeviceDriver.writing(5); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",5); - lnshPalletizingManipulatorSiteDeviceDriver.writing(map); lnshPalletizingManipulatorSiteDeviceDriver.setMessage(""); flag = true; } else { @@ -1074,10 +1048,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (lnshStationDeviceDriver.getIo_action() == 2 || lnshStationDeviceDriver.getIo_action() == 3)) { inst.setExecute_status("6"); instructionService.update(inst); + lnshStationDeviceDriver.writing(5); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",5); - lnshStationDeviceDriver.writing(map); lnshStationDeviceDriver.setMessage(""); flag = true; } else { @@ -1122,11 +1094,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic }else{ log.info("任务号为空"); } - - data = AgvService.sendAgvOneModeInst(phase, index, 0); Map map = new LinkedHashMap<>(); map.put("to_command",5); conveyorPressStationDeviceDriver.writing(map); + data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); flag = true; } else { @@ -1175,10 +1146,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if(ObjectUtil.isNotEmpty(inst.getVehicle_code())){ conveyorBarcodeDeviceDriver.writing("to_barcode",inst.getVehicle_code()); } + conveyorBarcodeDeviceDriver.writing(5); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",5); - conveyorBarcodeDeviceDriver.writing(map); TaskDto task=taskService.findByCode(inst.getTask_code()); String material=task.getDirection(); conveyorBarcodeDeviceDriver.setMessage(""); @@ -1210,10 +1179,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic ) { inst.setExecute_status("6"); instructionService.update(inst); + lnshFoldDiscSiteDeviceDriver.writing(5); data = AgvService.sendAgvOneModeInst(phase, index, 0); - Map map = new LinkedHashMap<>(); - map.put("to_command",5); - lnshFoldDiscSiteDeviceDriver.writing(map); lnshFoldDiscSiteDeviceDriver.setMessage(""); flag = true; } else { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java index 4a11dbf..7e7803d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java @@ -1214,6 +1214,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi this.writing("to_task1", dto.getInstruction_code()); this.writing("to_command1", "1"); this.writing("to_command1", "1"); + log.info("下发前工位任务起始站{}目标站{}任务号{}",start_addr,next_addr,dto.getInstruction_code()); } /** * 下发后工位任务 @@ -1236,6 +1237,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi this.writing("to_task2", dto.getInstruction_code()); this.writing("to_command2", "1"); this.writing("to_command2", "1"); + log.info("下发后工位任务起始站{}目标站{}任务号{}",start_addr,next_addr,dto.getInstruction_code()); } /** @@ -1274,6 +1276,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi this.writing("to_task2", dto.getInstruction_code()); this.writing("to_command2", "1"); this.writing("to_command2", "1"); + log.info("下发前后工位任务前起始站{}前目标站{}任务号{}后起始站{}后目标站{}",start_addr,next_addr,dto.getInstruction_code(),start_addr2,next_addr2); } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/package_site/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/package_site/ItemProtocol.java index 8596a97..57827a0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/package_site/ItemProtocol.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/package_site/ItemProtocol.java @@ -31,7 +31,7 @@ public class ItemProtocol { public static String item_barcode = "barcode"; public static String item_to_target = "to_target"; public static String item_to_task= "to_task"; - public static String item_is_message= "is_message"; + public static String item_to_message= "to_message"; Boolean isonline; private PackageSiteDeviceDriver driver; @@ -62,7 +62,7 @@ public class ItemProtocol { } public String getmessage() { - return this.getOpcStringValue(item_is_message); + return this.getOpcStringValue(item_to_message); } public int getTask() { return this.getOpcIntegerValue(item_task); } @@ -154,7 +154,7 @@ public class ItemProtocol { list.add(new ItemDto(item_to_target, "下发目标站", "DB51.B2")); list.add(new ItemDto(item_to_task, "下发任务号", "DB51.B4")); list.add(new ItemDto(item_to_is_package, "下发是否包装", "DB51.B8")); - list.add(new ItemDto(item_is_message, "下发信息反馈", "DB62.STRING10.50")); + list.add(new ItemDto(item_to_message, "下发信息反馈", "DB62.STRING10.50")); return list; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index e1a9736..2741917 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -357,13 +357,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String device_code = orderDto.getDevice_code(); String material_code = orderDto.getMaterial_code(); String qty = orderDto.getPlan_qty(); - String product_code = orderDto.getProduct_code(); + String product_code = orderDto.getBrick_code(); String AlongSide = orderDto.getA(); String BshortSide = orderDto.getB(); String Htrapezoidal = orderDto.getH(); String Wthickness = orderDto.getW(); String formula = orderDto.getFormula(); - String brick_code = orderDto.getBrick_code(); + String brick_code = orderDto.getProduct_code(); String size_error = orderDto.getSize_error(); String single_weight = orderDto.getSingle_weight(); String drawing_address = orderDto.getDrawing_address(); @@ -509,6 +509,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { errArr.add(json); continue; } + StringBuilder sb = new StringBuilder(); + sb.append("product_code~~"); + sb.append("formula"); Map map = new LinkedHashMap<>(); map.put("to_order_No", order_code); map.put("to_material", material_code); @@ -518,7 +521,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { map.put("to_Htrapezoidal", Htrapezoidal); map.put("to_Wthickness", Wthickness); map.put("to_feedback",100); - map.put("to_formula",formula); + map.put("to_formula",sb); lnshPackagePalletManipulatorDeviceDriver.writing(map); is_flag = true; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcServerServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcServerServiceImpl.java index ce719ce..9bd95b0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcServerServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/OpcServerServiceImpl.java @@ -121,7 +121,7 @@ public class OpcServerServiceImpl implements OpcServerService, ApplicationAutoIn group = server.addGroup(groupName); } catch (Exception var12) { this.clearServer(code); - ThreadUtl.sleep(5000L); + ThreadUtl.sleep(1000L); log.warn("获取opc出错重新获取", code, var12); server = OpcServerUtl.getServerWithOutException(dto.getOpc_host(), StrUtil.trim(dto.getCls_id()), dto.getUser(), dto.getPassword(), StrUtil.trim(dto.getDomain())); try { @@ -162,7 +162,7 @@ public class OpcServerServiceImpl implements OpcServerService, ApplicationAutoIn group = server.addGroup(groupName); } catch (Exception var12) { this.clearServer(code); - ThreadUtl.sleep(2000L); + ThreadUtl.sleep(1000L); log.warn("获取opc出错重新获取", code, var12); server = OpcServerUtl.getServerWithOutException(dto.getOpc_host(), StrUtil.trim(dto.getCls_id()), dto.getUser(), dto.getPassword(), StrUtil.trim(dto.getDomain())); try {