From 38121f3a57abc408cea5c54f1560f426770ccc41 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Mon, 15 Aug 2022 17:10:08 +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 --- .../StandardCoveyorControlDeviceDriver.java | 42 +++++++++++++++++-- .../service/impl/InstructionServiceImpl.java | 4 +- .../nl/modules/quartz/task/AutoCleanLog.java | 2 +- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java index dc449d9..c8e9819 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java @@ -152,7 +152,6 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver @Override public void execute() throws Exception { - String message = null; try { device_code = this.getDeviceCode(); mode = this.itemProtocol.getMode(); @@ -169,7 +168,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver if (move != last_move) { this.execute_log.setResource(this.device_code, this.device_code); this.execute_log.log("设备:" + device_code + ",last_move -> move:" + last_mode + "->" + move); - if (move == 0) { + if (move == 0 && mode == 2) { thingToNothing(); } this.setRequireSucess(false); @@ -191,6 +190,12 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); if(mode == 2){ if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { +// try{ +// finish_instruction(); +// container = inst.getVehicle_code(); +// } catch (Exception e){ +// e.printStackTrace(); +// } finish_instruction(); container = inst.getVehicle_code(); } @@ -224,7 +229,6 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver } else { this.setIsonline(true); this.setIserror(false); - message = ""; Instruction instruction = null; List toInstructions; switch (mode) { @@ -244,9 +248,29 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver //申请任务 if (hasGoods > 0 && error == 0 && !StrUtil.isEmpty(container) && !requireSucess) { instruction_require(container); + } else { + if(StrUtil.isEmpty(container) ){ + message ="申请任务托盘号为空无法申请指令"; + } + if(error > 0){ + message ="申请任务error>0无法申请指令"; + } + if(requireSucess){ + message ="申请任务请求成功标记未复位无法申请指令"; + } } if (hasGoods > 0 && error == 0 && !StrUtil.isEmpty(container) && !applySucess) { instruction_apply(container); + } else { + if(StrUtil.isEmpty(container) ){ + message ="申请指令托盘号为空无法申请指令"; + } + if(error > 0){ + message ="申请指令error>0无法申请指令"; + } + if(applySucess){ + message ="申请指令请求成功标记未复位无法申请指令"; + } } break; case 3: @@ -636,6 +660,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce List byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code); if (byNextDeviceCode.size() >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "查询此终点的指令数量异常(661)"; return true; } @@ -652,6 +677,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce //如果当前关联的设备中都有货的话,就返回 if (count != 0 && count >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "当前关联的设备中都有货,异常(678)"; return true; } instructionService.create(instdto); @@ -702,6 +728,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce List byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code); if (byNextDeviceCode.size() >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "查询此终点的指令数量,异常(729)"; return true; } @@ -718,6 +745,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce //如果当前关联的设备中都有货的话,就返回 if (count != 0 && count >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "当前关联的设备中都有货的话,就返回异常(746)"; return true; } instructionService.create(instdto); @@ -758,6 +786,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce List byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code); if (byNextDeviceCode.size() >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "查询此终点的指令数量返回异常(787)"; return true; } @@ -774,6 +803,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce //如果当前关联的设备中都有货的话,就返回 if (count != 0 && count >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "当前关联的设备中都有货返回异常(804)"; return true; } instructionService.create(instdto); @@ -1018,6 +1048,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce List byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code); if (byNextDeviceCode.size() >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "查询此终点的指令数量返回异常(1051)"; return true; } @@ -1034,6 +1065,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce //如果当前关联的设备中都有货的话,就返回 if (count != 0 && count >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "当前关联的设备中都有货返回异常(1068)"; return true; } @@ -1085,6 +1117,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce List byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code); if (byNextDeviceCode.size() >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "当前关联的设备中都有货返回异常(1120)"; return true; } @@ -1101,6 +1134,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce //如果当前关联的设备中都有货的话,就返回 if (count != 0 && count >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "当前关联的设备中都有货返回异常(1137)"; return true; } instructionService.create(instdto); @@ -1142,6 +1176,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce List byNextDeviceCode = instructionService.findByNextDeviceCode(next_device_code); if (byNextDeviceCode.size() >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点的指令数量:" + byNextDeviceCode.size() + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "查询此终点的指令数量返回异常(1179)"; return true; } @@ -1158,6 +1193,7 @@ public synchronized boolean instruction_apply(String container_code) throws Exce //如果当前关联的设备中都有货的话,就返回 if (count != 0 && count >= list.size()) { logServer.log(taskcode,"当前分配的终点设备:"+ next_device_code +"","400","当前终点关联设备中,有货的设备数量:" + count + "","当前终点设备关联设备数量:"+ list.size() +"","","",this.container); + message = "当前关联的设备中都有货(1196)"; return true; } instructionService.create(instdto); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 5f0431e..ae2ff13 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -351,7 +351,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu RouteLineDto routeLineDto = shortPathsList.get(i); if (routeLineDto.getType().equals("0")) { Instruction byContainer = this.findByContainer(dto.getVehicle_code()); - if (ObjectUtil.isNotEmpty(byContainer)) { + if (ObjectUtil.isNotEmpty(byContainer) && StrUtil.isEmpty(byContainer.getCarno())) { throw new RuntimeException("已有当前载具号的输送指令"); } } @@ -1169,7 +1169,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu WQLObject wo = WQLObject.getWQLObject("acs_instruction"); // =0 则不用再次请求 - if (StrUtil.equals(obj.getRequest_again(), "0")) { + if (StrUtil.equals(obj.getRequest_again(), "0") && !StrUtil.equals(dto.getNext_device_code(),"1004")) { if (StrUtil.equals(obj.getNext_device_code(), instnextdevice)) { dto.setInstruction_status("2"); JSONObject jsonObject = JSONObject.fromObject(dto); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanLog.java b/acs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanLog.java index 3654615..569e648 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanLog.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanLog.java @@ -20,7 +20,7 @@ public class AutoCleanLog { public void run() throws Exception { System.out.println("111"); - // 0 0/1 0,1 * * ? 每天0-1点执行间隔10分钟一次 + // 0 0/10 0,1 * * ? 每天0-1点执行间隔10分钟一次 //sys_log //delete from sys_log where DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 30 day)) limit 10; WQLObject logTab = WQLObject.getWQLObject("sys_log");