From 161399d435935e295ae1062a41419a484048f6cb Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Thu, 23 Mar 2023 17:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../run/OneNDCSocketConnectionAutoRun.java | 4 +- .../agv/ndcone/AgvNdcOneDeviceDriver.java | 39 ++++++++++++++----- .../src/main/resources/config/application.yml | 2 +- 3 files changed, 33 insertions(+), 12 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 e1fa800..097664c 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 @@ -163,10 +163,10 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (!ObjectUtil.isEmpty(inst)) { instructionService.finish(inst.getInstruction_id()); } else { - log.warn("指令号:{},未反馈wms任务完成,因为agv上报指令号查询指令为空!"); + log.warn("指令号:{},未反馈wms任务完成,因为agv上报指令号查询指令为空!",inst.getInstruction_code()); } data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); - log.info("指令号:{},已反馈agv任务完成!"); + log.info("指令号:{},已反馈agv任务完成!",inst.getInstruction_code()); } //请求删除任务 //(需要WCS反馈) 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 6eb9276..f6c57af 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 @@ -3,6 +3,7 @@ package org.nl.acs.device_driver.basedriver.agv.ndcone; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.Data; @@ -186,8 +187,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic req.add(map); HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { - data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); - log.info("指令号:{},acs请求wms取货申请成功,wms允许agv申请取货,已反馈agv允许取货", inst.getInstruction_code()); + String respBody = httpResponse.body(); + if (respBody.length() <= 3) { + data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); + log.info("指令号:{},acs请求wms取货申请成功,wms允许agv申请取货,已反馈agv允许取货", inst.getInstruction_code()); + } else { + log.warn("指令号:{},acs请求wms取货申请失败,wms反馈失败,未反馈agv允许取货,原因:{}", inst.getInstruction_code(), respBody); + } } else { log.warn("指令号:{},acs请求wms取货申请失败,连接被拒绝,未反馈agv允许取货", inst.getInstruction_code()); } @@ -244,8 +250,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic req.add(map); HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { - data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); - log.info("指令号:{},acs反馈wms取货完成成功,wms允许agv取货完成,已反馈agv取货完成", inst.getInstruction_code()); + String respBody = httpResponse.body(); + if (respBody.length() <= 3) { + data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); + log.info("指令号:{},acs反馈wms取货完成成功,wms允许agv取货完成,已反馈agv取货完成", inst.getInstruction_code()); + } else { + log.warn("指令号:{},acs反馈wms取货完成失败,wms反馈失败,未反馈agv允许取货,原因:{}", inst.getInstruction_code(), respBody); + } } else { log.warn("指令号:{},acs反馈wms取货完成失败,连接被拒绝,未反馈agv取货完成", inst.getInstruction_code()); } @@ -298,8 +309,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic req.add(map); HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { - data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); - log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code()); + String respBody = httpResponse.body(); + if (respBody.length() <= 3) { + data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); + log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code()); + } else { + log.warn("指令号:{},acs反馈wms放货申请失败,wms不允许放货,未反馈agv允许放货,原因:{}", inst.getInstruction_code(), respBody); + } } else { log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code()); } @@ -352,10 +368,15 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic req.add(map); HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { - data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); - log.info("指令号:{},acs请求wms放货完成成功", inst.getInstruction_code()); + String respBody = httpResponse.body(); + if (respBody.length() <= 3) { + data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); + log.info("指令号:{},acs请求wms放货完成成功", inst.getInstruction_code()); + } else { + log.warn("指令号:{},acs反馈wms放货完成失败,wms反馈失败,未反馈agv允许放货,原因:{}", inst.getInstruction_code(), respBody); + } } else { - log.warn("指令号:{},acs请求wms放货完成失败", inst.getInstruction_code()); + log.warn("指令号:{},acs请求wms放货完成失败,原因:{}", inst.getInstruction_code(), JSON.toJSONString(httpResponse)); } } else { data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); diff --git a/acs/nladmin-system/src/main/resources/config/application.yml b/acs/nladmin-system/src/main/resources/config/application.yml index f943602..cfc52fe 100644 --- a/acs/nladmin-system/src/main/resources/config/application.yml +++ b/acs/nladmin-system/src/main/resources/config/application.yml @@ -2,7 +2,7 @@ spring: freemarker: check-template-location: false profiles: - active: dev + active: prod jackson: time-zone: GMT+8 data: