From 7364df4a2d06a054ab0555d4117d13dd875c0d01 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Mon, 15 May 2023 17:06:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20ndc=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../run/OneNDCSocketConnectionAutoRun.java | 2 +- .../run/TwoNDCSocketConnectionAutoRun.java | 20 ++++++++++--------- .../SiemensConveyorDeviceDriver.java | 1 - 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java index f006cffd4..e8672f2da 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java @@ -197,7 +197,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } else { //上报异常信息 //(不需要WCS反馈) - if (phase == 0x67 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74 || phase == 0x75) { + if (phase == 0x67 || phase == 0x70 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74 ) { device = deviceAppService.findDeviceByCode(Integer.toString(arr[18] * 256 + arr[19])); } else { device = deviceAppService.findDeviceByCode(Integer.toString(arr[20])); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index eee214ae0..6ca2e9736 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -72,16 +72,17 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } public void autoRun() throws IOException { + ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class); + InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); + AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); + NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); + DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); + DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); + DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); try { System.out.println("2楼1区域AGV系统链接开始"); - ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class); - InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); - DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); - DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); - DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); + ip = paramService.findByCode(AcsConfig.AGVURL2).getValue(); port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT2).getValue()); byte[] b = new byte[1024]; @@ -242,7 +243,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } else { //上报异常信息 //(不需要WCS反馈) - if (phase == 0x67 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74 || phase == 0x75) { + if (phase == 0x67 || phase == 0x70 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74) { device = deviceAppService.findDeviceByCode(Integer.toString(arr[18] * 256 + arr[19])); } else { device = deviceAppService.findDeviceByCode(Integer.toString(arr[20])); @@ -267,11 +268,12 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { System.out.println("TwoAgv链接异常"); log.info("TwoAgv链接异常"); log.error("agv连接出现异常:{}", e); + logServer.deviceExecuteLog("NDC2", "", "", "agv异常" + e.getMessage()); + logServer.deviceExecuteLog("NDC2", "", "", "agv异常" + e); if (ObjectUtil.isNotEmpty(s)) { s.close(); } System.out.println(e.getMessage()); - e.printStackTrace(); } finally { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index 1a8477b8b..ef44259ef 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -1023,7 +1023,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme message = "申请空盘出库成功"; requireSucess = true; } else { - requireSucess = true; message = "申请空盘出库失败," + jo.get("message").toString(); } }