From 095e3d20471e0d741622e33aacbac0e750441105 Mon Sep 17 00:00:00 2001 From: pangshenghao Date: Thu, 6 Jul 2023 16:12:18 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=202.?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=9F=A5=E8=AF=A2inst=E5=B9=B6=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=B7=B2=E5=8F=96=E6=B6=88=E6=88=96=E5=B7=B2=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E7=9A=84=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auto/run/OneNDCSocketConnectionAutoRun.java | 14 +++++++++++--- .../ext/wms/service/impl/WmsToAcsServiceImpl.java | 8 ++++++-- 2 files changed, 17 insertions(+), 5 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 149aa78..cad902d 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 @@ -134,9 +134,17 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } if (ikey != 0) { inst = instructionService.findByCodeFromCache(String.valueOf(ikey)); -// if (ObjectUtil.isEmpty(inst)) { -// inst = instructionService.findByCode(String.valueOf(ikey)); -// } + if (ObjectUtil.isEmpty(inst)) { + inst = instructionService.findByCode(String.valueOf(ikey)); + if(inst!=null) { + log.info(inst.toString()); + //如果任務已完成或已取消則置為空 + if (!"0".equals(inst.getInstruction_status()) && + !"1".equals(inst.getInstruction_status())) { + inst = null; + } + } + } } if (!ObjectUtil.isEmpty(link_inst)) { link_flag = true; 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 2f2b003..1d36e4f 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 @@ -70,6 +70,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { @Override public CancelTaskResponse cancelFromWms(List reqs) throws Exception { + log.info("cancelFromWms--------------:输入参数:" + reqs); ParamService paramService = SpringContextHolder.getBean(ParamService.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); CancelTaskResponse response = new CancelTaskResponse(); @@ -84,7 +85,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { } TaskDto taskDto = taskService.findByCodeFromCache(task_code); String cancelTaskCheck = paramService.findByCode(AcsConfig.CANCELTASKCHECK).getValue(); - + if(taskDto==null){ + log.info("任务已完成或取消"); + }else { // if (StrUtil.equals(cancelTaskCheck, "1")) { // taskService.cancelNoSendWms(taskDto.getTask_id()); // } else if (StrUtil.equals(cancelTaskCheck, "0")) { @@ -92,10 +95,11 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { if (inst != null) { instructionService.cancel(inst.getInstruction_id()); } - taskService.cancelNoSendWms(taskDto.getTask_id()); + taskService.cancelNoSendWms(taskDto.getTask_id()); // } else { // throw new RuntimeException("指令正在执行中,操作失败!"); // } + } }