From 391a6a11bab8fba9e5396c5f1cda06ed53555290 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Wed, 14 Jun 2023 20:26:48 +0800 Subject: [PATCH] =?UTF-8?q?add=20ndc=E5=8F=8D=E9=A6=88smart200=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auto/run/NDCSocketConnectionAutoRun.java | 2 +- .../run/OneNDCSocketConnectionAutoRun.java | 2 +- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 78 +++++++++++++++++++ .../HailiangOldSpecialDeviceDriver.java | 18 +++-- ...iangOldSpecialPourStationDeviceDriver.java | 2 +- .../HailiangSpecialDeviceDriver.java | 3 +- ...ailiangSpecialPourStationDeviceDriver.java | 4 +- .../wms/service/impl/AcsToWmsServiceImpl.java | 34 ++++---- .../wms/service/impl/WmsToAcsServiceImpl.java | 6 +- .../service/impl/InstructionServiceImpl.java | 2 +- 10 files changed, 119 insertions(+), 32 deletions(-) diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/NDCSocketConnectionAutoRun.java b/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/NDCSocketConnectionAutoRun.java index 352ae782..8e594e87 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/NDCSocketConnectionAutoRun.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/NDCSocketConnectionAutoRun.java @@ -69,7 +69,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { String ip = paramService.findByCode(AcsConfig.AGVURL).getValue(); int port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT).getValue()); socket = new Socket(ip, port); - byte[] bytes = new byte[1024]; + byte[] bytes = new byte[256]; dos = new DataOutputStream(socket.getOutputStream()); dis = new DataInputStream(socket.getInputStream()); int len; diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java b/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java index 882055cc..85f50117 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java @@ -68,7 +68,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { socket = new Socket(ip, port); dos = new DataOutputStream(socket.getOutputStream()); dis = new DataInputStream(socket.getInputStream()); - byte[] bytes = new byte[1024]; + byte[] bytes = new byte[256]; int count; int[] arr; StringBuffer bs; diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 01f940a6..cb43a941 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -13,6 +13,10 @@ import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver; +import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_empty_station.HailiangOldSpecialEmptyStationDeviceDriver; +import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_full_station.HailiangOldSpecialFullStationDefination; +import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_full_station.HailiangOldSpecialFullStationDeviceDriver; +import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_pour_station.HailiangOldSpecialPourStationDeviceDriver; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station.HailiangSpecialEmptyStationDeviceDriver; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station.HailiangSpecialFullStationDeviceDriver; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; @@ -99,6 +103,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic HailiangSpecialEmptyStationDeviceDriver hailiangSpecialEmptyStationDeviceDriver; //海亮专机设备满框位 HailiangSpecialFullStationDeviceDriver hailiangSpecialFullStationDeviceDriver; + //海亮smart200专机满料位 + HailiangOldSpecialFullStationDeviceDriver hailiangOldSpecialFullStationDeviceDriver; + //海亮smarrt200专机空料位 + HailiangOldSpecialEmptyStationDeviceDriver hailiangOldSpecialEmptyStationDeviceDriver; + //海亮smart200专机倒料位 + HailiangOldSpecialPourStationDeviceDriver hailiangOldSpecialPourStationDeviceDriver; //海亮专机设备倒料位 HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver; //自动缓存线 @@ -142,6 +152,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); hailiangSpecialFullStationDeviceDriver.set(phase, index, inst); } + if (device.getDeviceDriver() instanceof HailiangOldSpecialFullStationDeviceDriver) { + log.info("开始设置phase值,到达取货点1,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialFullStationDeviceDriver = (HailiangOldSpecialFullStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialFullStationDeviceDriver.set(phase, index, inst); + } if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { log.info("开始设置phase值,到达出缓存线取满框点1,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); @@ -179,6 +194,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); hailiangSpecialFullStationDeviceDriver.set(phase, index, inst); } + if (device.getDeviceDriver() instanceof HailiangOldSpecialFullStationDeviceDriver) { + log.info("开始设置phase值,取货点1取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialFullStationDeviceDriver = (HailiangOldSpecialFullStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialFullStationDeviceDriver.set(phase, index, inst); + } //入缓存线任务的起点有专机满料位 出缓存的起点是缓存线 if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { log.info("开始设置phase值,缓存线取满框点1取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); @@ -217,6 +237,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); hailiangSpecialFullStationDeviceDriver.set(phase, index, inst); } + if (device.getDeviceDriver() instanceof HailiangOldSpecialFullStationDeviceDriver) { + log.info("开始设置phase值,到达取货点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialFullStationDeviceDriver = (HailiangOldSpecialFullStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialFullStationDeviceDriver.set(phase, index, inst); + } if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { log.info("开始设置phase值,到达出缓存线取满框点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); @@ -253,6 +278,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); hailiangSpecialFullStationDeviceDriver.set(phase, index, inst); } + if (device.getDeviceDriver() instanceof HailiangOldSpecialFullStationDeviceDriver) { + log.info("开始设置phase值,取货点2取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialFullStationDeviceDriver = (HailiangOldSpecialFullStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialFullStationDeviceDriver.set(phase, index, inst); + } if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { log.info("开始设置phase值,出缓存线取满框点2取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); @@ -325,6 +355,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialPourStationDeviceDriver.set(phase, index, inst); break; } + if (device.getDeviceDriver() instanceof HailiangOldSpecialPourStationDeviceDriver) { + log.info("开始设置phase值,到达倒料点1,设备号:{}", device_code); + hailiangOldSpecialPourStationDeviceDriver = (HailiangOldSpecialPourStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialPourStationDeviceDriver.set(phase, index, inst); + break; + } if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { log.info("开始设置phase值,到达倒料点1,设备号:{}", device_code); hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); @@ -397,6 +433,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialPourStationDeviceDriver.set(phase, index, inst); break; } + if (device.getDeviceDriver() instanceof HailiangOldSpecialPourStationDeviceDriver) { + log.info("开始设置phase值,倒料点1倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialPourStationDeviceDriver = (HailiangOldSpecialPourStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialPourStationDeviceDriver.set(phase, index, inst); + break; + } if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { log.info("开始设置phase值,倒料点1倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); @@ -468,6 +510,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialPourStationDeviceDriver.set(phase, index, inst); break; } + if (device.getDeviceDriver() instanceof HailiangOldSpecialPourStationDeviceDriver) { + log.info("开始设置phase值,到达倒料点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialPourStationDeviceDriver = (HailiangOldSpecialPourStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialPourStationDeviceDriver.set(phase, index, inst); + break; + } if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { log.info("开始设置phase值,到达倒料点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); @@ -668,6 +716,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialPourStationDeviceDriver.set(phase, index, inst); break; } + if (device.getDeviceDriver() instanceof HailiangOldSpecialPourStationDeviceDriver) { + log.info("开始设置phase值,倒料点2倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialPourStationDeviceDriver = (HailiangOldSpecialPourStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialPourStationDeviceDriver.set(phase, index, inst); + break; + } if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { log.info("开始设置phase值,倒料点2倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); @@ -707,6 +761,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst); } + if (device.getDeviceDriver() instanceof HailiangOldSpecialEmptyStationDeviceDriver) { + log.info("开始设置phase值,到达还空框1,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialEmptyStationDeviceDriver = (HailiangOldSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialEmptyStationDeviceDriver.set(phase, index, inst); + } if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { log.info("开始设置phase值,缓存线出库,还空框1完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); @@ -745,6 +804,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst); } + if (device.getDeviceDriver() instanceof HailiangOldSpecialEmptyStationDeviceDriver) { + log.info("开始设置phase值,还空框1完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialEmptyStationDeviceDriver = (HailiangOldSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialEmptyStationDeviceDriver.set(phase, index, inst); + } if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { log.info("开始设置phase值,缓存线出库还空框1完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); @@ -783,6 +847,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst); } + if (device.getDeviceDriver() instanceof HailiangOldSpecialEmptyStationDeviceDriver) { + log.info("开始设置phase值,到达还空框2,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialEmptyStationDeviceDriver = (HailiangOldSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialEmptyStationDeviceDriver.set(phase, index, inst); + } if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { log.info("开始设置phase值,缓存线出库到达还空框2,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); @@ -821,6 +890,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst); } + if (device.getDeviceDriver() instanceof HailiangOldSpecialEmptyStationDeviceDriver) { + log.info("开始设置phase值,还空框2完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); + hailiangOldSpecialEmptyStationDeviceDriver = (HailiangOldSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); + hailiangOldSpecialEmptyStationDeviceDriver.set(phase, index, inst); + } if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { log.info("开始设置phase值,缓存线出库还空框2完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code()); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); @@ -853,6 +927,10 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } //1、得到重量信息 int weight = (arr[18] * 256 + arr[19]) * 10; + if (weight < 0) { + log.info("AGV上报重量小于0不反馈AGV信息,指令号:{}", ikey); + return; + } for (Instruction inst : insts) { //校验agv上报站点编号与指令起始点相同 if (ObjectUtil.isEmpty(inst)) { diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_device/HailiangOldSpecialDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_device/HailiangOldSpecialDeviceDriver.java index a0b0b825..e7a2715d 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_device/HailiangOldSpecialDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_device/HailiangOldSpecialDeviceDriver.java @@ -134,6 +134,13 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl } if (order_compel_finish != last_order_compel_finish) { + if (order_compel_finish == 1) { + Map map = new LinkedHashMap<>(); + map.put("to_confirm_finished", "1"); + map.put("to_clear", "1"); + map.put("to_order", "0"); + this.writing(map); + } logServer.deviceExecuteLog(this.device_code, "", "", "信号order_compel_finish:" + last_order_compel_finish + "->" + order_compel_finish); } if (order != last_order) { @@ -224,7 +231,7 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl } //修改工单状态为自动完成 - if (mode == 1 && finish != last_finish && finish == 1 && order > 0 && now_order_prod_num == order_prod_allnum) { + if (mode == 1 && finish != last_finish && finish == 1 && order_compel_finish != 1 && order > 0 && now_order_prod_num == order_prod_allnum) { ProduceshiftorderDto pdto = produceshiftorderService.findByCodeFromCache(String.valueOf(order)); if (pdto != null) { if (pdto.getOrder_status().equals(WorkerOrderEnum.PRODUCTING.getCode())) { @@ -310,8 +317,9 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl // if (!this.getItemProtocol().getIsonline()) { // throw new BadRequestException("设备未开机,开工失败!"); // } + this.writing("to_clear", "1"); Map map = new LinkedHashMap<>(); - map.put("to_clear", "1"); + //map.put("to_clear", "1"); map.put("to_order", dto.getOrder_code()); map.put("to_one_box_num", String.valueOf(dto.getOne_qty())); map.put("to_order_prod_num", dto.getQty().toString()); @@ -327,12 +335,12 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl Map map = new LinkedHashMap<>(); if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) { map.put("to_order_compel_finished", "1"); - map.put("to_confirm_finished", "1"); + //map.put("to_confirm_finished", "1"); } else { map.put("to_confirm_finished", "1"); + map.put("to_order", "0"); + map.put("to_clear", "1"); } - map.put("to_order", "0"); - map.put("to_clear", "1"); this.writing(map); } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pour_station/HailiangOldSpecialPourStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pour_station/HailiangOldSpecialPourStationDeviceDriver.java index 9f3f29a2..8fbfe754 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pour_station/HailiangOldSpecialPourStationDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pour_station/HailiangOldSpecialPourStationDeviceDriver.java @@ -219,7 +219,7 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice if (agvphase == 0x0D || agvphase == 0x11) { if (mode == 1 && ObjectUtil.isNotEmpty(inst)) { //下发倒料数量 - this.writing("item_to_pour_num", inst.getQuantity()); + this.writing("to_pour_num", inst.getQuantity()); inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode()); instructionService.update(inst); if (inst != null) { diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java index 06e1cad5..6d52e0ce 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java @@ -297,8 +297,9 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme // if (!this.getItemProtocol().getIsonline()) { // throw new BadRequestException("设备未开机,开工失败!"); // } + this.writing("to_clear", "1"); Map map = new LinkedHashMap<>(); - map.put("to_clear", "1"); + //map.put("to_clear", "1"); map.put("to_order", dto.getOrder_code()); map.put("to_one_box_num", String.valueOf(dto.getOne_qty())); map.put("to_order_prod_num", dto.getQty().toString()); diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java index ee150f9d..47a657f9 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java @@ -170,7 +170,7 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri message = "未联机"; //有报警 } else { - this.setIsonline(true); + //this.setIsonline(true); this.setIserror(false); message = ""; @@ -221,7 +221,7 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri if (agvphase == 0x0D || agvphase == 0x11) { //下发电气倒料数量 if (mode == 1 && ObjectUtil.isNotEmpty(inst)) { - this.writing("item_to_pour_num", inst.getQuantity()); + this.writing("to_pour_num", inst.getQuantity()); inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode()); instructionService.update(inst); if (inst != null) { diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index d1bea396..97ea8fbd 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -50,7 +50,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .header("Authorization", token) .body(JSON.toJSONString(param)) .execute(); - log.info("acs向wms请求任务成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result)); + log.info("acs向wms请求任务成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), result.body()); } catch (Exception e) { log.error("acs向wms请求任务失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage()); } @@ -64,10 +64,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public HttpResponse feedbackTaskStatusToWms(JSONArray data) { - log.info("acs开始向mes反馈任务状态,请求参数:{}", JSON.toJSONString(data)); try { MDC.put(log_file_type, log_type); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + log.info("acs开始向mes反馈任务状态,请求参数:{}", JSON.toJSONString(data)); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms"); String methods_url = addressDto.getMethods_url(); @@ -78,7 +78,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .header("Authorization", token) .body(JSON.toJSONString(data)) .execute(); - log.info("acs向mes反馈任务状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(data), JSON.toJSONString(result)); + log.info("acs向mes反馈任务状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(data), result.body()); } catch (Exception e) { log.error("acs向mes反馈任务状态失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(data), e.getMessage()); } @@ -93,10 +93,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public HttpResponse feedbackOrderStatus(JSONObject param) { - log.info("acs开始向mes反馈工单状态,请求参数:{}", JSON.toJSONString(param)); try { MDC.put(log_file_type, log_type); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + log.info("acs开始向mes反馈工单状态,请求参数:{}", JSON.toJSONString(param)); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("feedbackOrderStatus"); String methods_url = addressDto.getMethods_url(); @@ -106,7 +106,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute(); - log.info("acs向mes反馈工单状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result.body())); + log.info("acs向mes反馈工单状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), result.body()); } catch (Exception e) { log.error("acs向mes反馈工单状态失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage()); } @@ -133,7 +133,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute(); - log.info("acs向mes反馈设备状态成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, JSON.toJSONString(result)); + log.info("acs向mes反馈设备状态成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, result.body()); } catch (Exception e) { log.error("acs向mes反馈设备状态失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(param), url, e.getMessage()); } @@ -151,7 +151,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { try { MDC.put(log_file_type, log_type); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { - log.info("acs开始向mes反馈当前设备工单生产数量,请求参数:{}", JSON.toJSONString(param)); + //log.info("acs开始向mes反馈当前设备工单生产数量,请求参数:{}", JSON.toJSONString(param)); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("feedOrderRealQty"); String methods_url = addressDto.getMethods_url(); @@ -162,7 +162,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .post(url) .body(JSON.toJSONString(param)) .execute(); - log.info("acs向mes反馈当前设备工单生产数量成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result)); + //log.info("acs向mes反馈当前设备工单生产数量成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result)); } catch (Exception e) { log.error("acs向mes反馈当前设备工单生产数量失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage()); } @@ -179,7 +179,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { try { MDC.put(log_file_type, log_type); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { - log.info("acs开始向mes反馈设备数量,请求参数:{}", JSON.toJSONString(map)); + //log.info("acs开始向mes反馈设备数量,请求参数:{}", JSON.toJSONString(map)); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("feedDeviceNum"); String methods_url = addressDto.getMethods_url(); @@ -189,7 +189,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result = HttpRequest.post(url) .body(JSON.toJSONString(map)) .execute(); - log.info("acs向mes反馈设备设备数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result)); + //log.info("acs向mes反馈设备设备数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result)); } catch (Exception e) { log.error("acs向mes反馈设备数量失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage()); } @@ -206,7 +206,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { try { MDC.put(log_file_type, log_type); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { - log.info("acs开始向mes反馈储料仓重量和数量,请求参数:{}", JSON.toJSONString(map)); + //log.info("acs开始向mes反馈储料仓重量和数量,请求参数:{}", JSON.toJSONString(map)); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("feedDeviceNum2"); String methods_url = addressDto.getMethods_url(); @@ -216,7 +216,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result = HttpRequest.post(url) .body(JSON.toJSONString(map)) .execute(); - log.info("acs向mes反馈储料仓重量和数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result)); + //log.info("acs向mes反馈储料仓重量和数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result)); } catch (Exception e) { log.error("acs向mes反馈储料仓重量和数量失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage()); } @@ -243,7 +243,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result = HttpRequest.post(url) .body(JSON.toJSONString(map)) .execute(); - log.info("acs向mes申请扫码器任务成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result)); + log.info("acs向mes申请扫码器任务成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, result.body()); } catch (Exception e) { log.error("acs向mes申请扫码器任务失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage()); } @@ -260,7 +260,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { try { MDC.put(log_file_type, log_type); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { - log.info("acs开始向mes反馈缓存线条码,请求参数:{}", JSON.toJSONString(map)); + //log.info("acs开始向mes反馈缓存线条码,请求参数:{}", JSON.toJSONString(map)); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("feedCacheLineBarcodes"); String methods_url = addressDto.getMethods_url(); @@ -270,7 +270,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result = HttpRequest.post(url) .body(JSON.toJSONString(map)) .execute(); - log.info("acs向mes反馈缓存线条码成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result)); + //log.info("acs向mes反馈缓存线条码成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result)); } catch (Exception e) { log.error("acs向mes反馈缓存线条码失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage()); } @@ -287,7 +287,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { try { MDC.put(log_file_type, log_type); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { - log.info("acs开始向mes反馈缓存线任务号,请求参数:{}", JSON.toJSONString(param)); + //log.info("acs开始向mes反馈缓存线任务号,请求参数:{}", JSON.toJSONString(param)); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("feedCacheLineTask"); String methods_url = addressDto.getMethods_url(); @@ -297,7 +297,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute(); - log.info("acs向mes反馈缓存线任务号成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, JSON.toJSONString(result)); + //log.info("acs向mes反馈缓存线任务号成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, JSON.toJSONString(result)); } catch (Exception e) { log.error("acs向mes反馈缓存线任务号失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(param), url, e.getMessage()); } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index cbcbf7b8..95c011f0 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -100,7 +100,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { if (StrUtil.isEmpty(task_group_id)) { JSONObject json = new JSONObject(); json.put("task_id", task_id); - json.put("message", "任务关联编号"); + json.put("message", "任务关联编号不能为空"); errArr.add(json); continue; } @@ -210,7 +210,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { resultJson.put("status", 400); } resultJson.put("errArr", errArr); - resultJson.put("message", errArr.size() > 0 ? "存在下发未成功的任务!" : "下发成功!"); + resultJson.put("message", errArr.size() > 0 ? "存在下发未成功的任务!" + JSON.toJSONString(errArr) : "下发成功!"); resultJson.put("data", new JSONObject()); log.info("createFromWms--------------:输出参数:" + resultJson.toString()); } catch (Exception e) { @@ -711,7 +711,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { if (code.equals("to_start_checking")) { hailiangAutoCacheLineDeviceDriver.writing("to_task", "1001"); } - if (code.equals("to_check_finish")){ + if (code.equals("to_check_finish")) { hailiangAutoCacheLineDeviceDriver.writing("to_task", "0"); } } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 142b7f17..4cce4820 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -1448,7 +1448,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu // } } if (next_device != null && next_device.getDeviceDriver() instanceof RemoveDevicePhase) { - removeDevicePhase = (RemoveDevicePhase) put_device.getDeviceDriver(); + removeDevicePhase = (RemoveDevicePhase) next_device.getDeviceDriver(); removeDevicePhase.set(0, 0, null); } }