From 8762465bbabc087a37aa09630007d8706b5b81c1 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Thu, 27 Jun 2024 18:48:41 +0800 Subject: [PATCH 1/5] =?UTF-8?q?rev:=E4=BC=98=E5=8C=96=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=88=86=E5=88=87=E8=A1=8C=E6=9E=B6=E4=BB=BB=E5=8A=A1=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SlitTwoManipulatorDeviceDriver.java | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 0d6dfd394..083255ab0 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -403,41 +403,39 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl TaskDto task = null; for (int i = 0; i < getDeviceCodeList.size(); i++) { String startDeviceCode = getDeviceCodeList.get(i); - List taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode); + List taskDtos = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode); if (ObjectUtil.isNotEmpty(taskDtos)) { - //按照优先级排序 优先级相等按照创建时间排序 - taskDtos = this.sortTask(taskDtos); - TaskDto taskDto = taskDtos.get(0); - truss_type = taskDto.getTruss_type(); - //查询任务是行架任务 - if (!StrUtil.equals(taskDto.getTask_type(), "6")) { - taskDto = null; - continue; + //按照创建时间排序 + List taskDtoStream = taskDtos.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(taskDtoStream)) { + TaskDto taskDto = taskDtoStream.get(0); + this.executeReadyInst(taskDto); } - flag = this.executeReadyInst(taskDto); } else { - List taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); + List taskDtoList = taskserver.findByTrappedManipulatorReady(); if (ObjectUtil.isNotEmpty(taskDtoList)) { - //按照优先级排序 优先级相等按照创建时间排序 - taskDtoList = this.sortTask(taskDtoList); - for (int j = 0; j < taskDtoList.size(); j++) { - task = taskDtoList.get(j); - - // 6 行架任务 - if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) { - task = null; - continue; + List taskDtosReady = new ArrayList<>(); + for (TaskDto taskDto1 : taskDtoList) { + if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) { + taskDtosReady.add(taskDto1); } - if (ObjectUtil.isNotEmpty(task)) break; } + //按照优先级排序 优先级相等按照创建时间排序 + taskDtosReady = this.sortTask(taskDtosReady); + task = taskDtosReady.get(0); + } + if (!ObjectUtil.isEmpty(task)) { + break; } } } if (!ObjectUtil.isEmpty(task)) { - flag = this.executeReadyTask(task); + this.executeReadyTask(task); + } else { + notCreateInstMessage = "universal_notCreateInstMessage"; } + return true; } - return flag; } //执行已有就绪指令 From ce1d9377d5a14045769add15d4401a72e462ebd2 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Thu, 27 Jun 2024 18:50:58 +0800 Subject: [PATCH 2/5] opt --- .../slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java | 1 + 1 file changed, 1 insertion(+) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 083255ab0..a3399eeed 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -373,6 +373,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } } + if (!ObjectUtil.isEmpty(task)) { this.executeReadyTask(task); } else { From 2134dcfd33cfb6ce46cee33c873e9f19a6ce892a Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Thu, 27 Jun 2024 20:35:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?rev=20=20=E5=AF=B9=E6=8E=A5=E5=B7=A5?= =?UTF-8?q?=E4=BD=8D=E4=BF=A1=E5=8F=B7=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManipulatorAgvStationDeviceDriver.java | 55 ++++++++++++------- .../ToCommandControl.java | 31 +++++++++++ 2 files changed, 66 insertions(+), 20 deletions(-) create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java index 8cb62f565..9c3770c3d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java @@ -42,6 +42,9 @@ import java.util.Map; @RequiredArgsConstructor public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed { protected ItemProtocol itemProtocol = new ItemProtocol(this); + + protected ToCommandControl toCommandControl = new ToCommandControl(this); + @Autowired DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); @Autowired @@ -99,6 +102,10 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i return this.device; } + public ToCommandControl getToCommandControl() { + return this.toCommandControl; + } + /** * 请求成功标记 */ @@ -210,30 +217,38 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i this.setRequireSucess(false); } - public void writing(int command) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.ItemProtocol.item_to_command; - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("下发电气信号:" + itemMap) - .build(); - logDto.setLog_level(3); - luceneExecuteLogService.deviceExecuteLog(logDto); - try { - this.checkcontrol(itemMap); - } catch (Exception e) { + public void writing(int command){ +// String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() +// + "." + org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.ItemProtocol.item_to_command; +// Map itemMap = new HashMap(); +// itemMap.put(to_command, command); +// LuceneLogDto logDto = LuceneLogDto.builder() +// .device_code(device_code) +// .content("下发电气信号:" + itemMap) +// .build(); +// logDto.setLog_level(3); +// luceneExecuteLogService.deviceExecuteLog(logDto); +// try { +// this.checkcontrol(itemMap); +// } catch (Exception e) { +// e.printStackTrace(); +// try { +// this.checkcontrol(itemMap); +// } catch (Exception e1) { +// e1.printStackTrace(); +// } +// } + + try{ + this.toCommandControl.control(command); + } catch (Exception e){ e.printStackTrace(); - try { - this.checkcontrol(itemMap); - } catch (Exception e1) { - e1.printStackTrace(); - } } } - @Override + + + @Override public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); String mode = ""; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java new file mode 100644 index 000000000..92567876c --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java @@ -0,0 +1,31 @@ +package org.nl.acs.device_driver.two_conveyor.manipulator_agv_station; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import org.nl.acs.device_driver.driver.ItemValue; +import org.nl.acs.device_driver.stacker.standard_stacker.ItemProtocol; +import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver; + +import java.util.HashMap; +import java.util.Map; + +public class ToCommandControl { + + private ManipulatorAgvStationDeviceDriver driver; + + public ToCommandControl(ManipulatorAgvStationDeviceDriver driver) { + this.driver = driver; + } + + public void control(int command) throws Exception { +// ItemValue[] itemValues = new ItemValue[]{new ItemValue(this.driver.getItem(ItemProtocol.item_to_command), command)}; + Map itemMap = new HashMap(); + String to_param = this.driver.getOpcServer() + "." + this.driver.getOpcPlc() + "." + this.driver.getDevice().getDevice_code() + + ".to_command"; + Object obj = command; + itemMap.put(to_param, obj); + this.driver.checkcontrol(itemMap); + } + +} From aa53ece8abed5a972db0e8b4ae61b771b6a2a347 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Fri, 28 Jun 2024 09:08:04 +0800 Subject: [PATCH 4/5] =?UTF-8?q?rev:=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlugPullDeviceSiteDeviceDriver.java | 13 ++++++++++-- .../SlitTwoManipulatorDeviceDriver.java | 2 +- .../src/views/monitor/lucene/index.vue | 21 ++++++++----------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 5bf38710b..12598ef8e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -361,12 +361,21 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl requireSucess = true; logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse); message = "申请套管成功"; - } else { + } + if (StrUtil.equals("2", is_bushing)){ + Map map = new LinkedHashMap<>(); + map.put("to_command", 97); + this.writing(map); + requireSucess = true; + message = "不套管,送空气轴"; + logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); + } + if (StrUtil.equals("0", is_bushing)){ Map map = new LinkedHashMap<>(); map.put("to_command", 98); this.writing(map); requireSucess = true; - message = "不申请套管"; + message = "缺少纸管,人工确认"; logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); } } else { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index a3399eeed..d98b4aa21 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -373,7 +373,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } } - + if (!ObjectUtil.isEmpty(task)) { this.executeReadyTask(task); } else { diff --git a/acs2/nladmin-ui/src/views/monitor/lucene/index.vue b/acs2/nladmin-ui/src/views/monitor/lucene/index.vue index 84f14c8c8..c9c20977d 100644 --- a/acs2/nladmin-ui/src/views/monitor/lucene/index.vue +++ b/acs2/nladmin-ui/src/views/monitor/lucene/index.vue @@ -14,18 +14,12 @@ > - - + - - - - - - - - - + + + + @@ -106,5 +100,8 @@ export default { From f614e469cbd854e8f1fc9a8d77ec4ddf47b3057b Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Fri, 28 Jun 2024 10:37:15 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=E6=97=A5=E5=BF=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/agv/AgvWaitUtil.java | 110 ++++++++++-------- .../server/impl/XianGongAgvServiceImpl.java | 82 ++++++------- .../ManipulatorAgvStationDeviceDriver.java | 13 +-- .../wms/service/impl/AcsToWmsServiceImpl.java | 2 +- .../main/resources/log/NDCAgvServiceImpl.xml | 2 +- .../log/OneNDCSocketConnectionAutoRun.xml | 2 +- .../log/TwoNDCSocketConnectionAutoRun.xml | 2 +- .../main/resources/log/XgAgvDeviceDriver.xml | 2 +- .../resources/log/XianGongAgvServiceImpl.xml | 29 +++++ .../src/main/resources/logback-spring.xml | 1 + 10 files changed, 140 insertions(+), 105 deletions(-) create mode 100644 acs2/nladmin-system/nlsso-server/src/main/resources/log/XianGongAgvServiceImpl.xml diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java index b2035a536..0207bb0cd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java @@ -49,36 +49,38 @@ public class AgvWaitUtil { ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; //agv诺宝对接位安全信号交互 - if(startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver){ + if (startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(2); - if(manipulatorAgvStationDeviceDriver.getAction() == 1){ - LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code(inst.getCarno()) - .content("诺宝agv允许取货"+"点位"+startDeviceCode) - .build(); - logDto1.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto1); - JSONObject map = new JSONObject(); - map.put("status", 200); - map.put("message", "允许取货!"); - log.info("允许仙工AGV取货,设备号 - {}", startDeviceCode); - return map; - }else { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(inst.getCarno()) - .content("agv诺宝对接位行架不允许取货:" + inst.getCarno()+ "点位号"+ manipulatorAgvStationDeviceDriver.getDevice_code()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException("行架不允许取货"); + if (manipulatorAgvStationDeviceDriver.getTo_command() != 2) { + manipulatorAgvStationDeviceDriver.writing(2); + if (manipulatorAgvStationDeviceDriver.getAction() == 1) { + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("诺宝agv允许取货" + "点位" + startDeviceCode) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + JSONObject map = new JSONObject(); + map.put("status", 200); + map.put("message", "允许取货!"); + log.info("允许仙工AGV取货,设备号 - {}", startDeviceCode); + return map; + } else { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("agv诺宝对接位行架不允许取货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + throw new BadRequestException("行架不允许取货"); + } } } //agv叉车对接位安全信号交互 - if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver){ + if (startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) { boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver(); - if(boxSubvolumesConveyorDeviceDriver.getMode() == 2){ + if (boxSubvolumesConveyorDeviceDriver.getMode() == 2) { LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(inst.getCarno()) .content("叉车允许取货") @@ -90,10 +92,10 @@ public class AgvWaitUtil { map.put("message", "允许取货!"); log.info("允许仙工AGV取货,设备号 - {}", startDeviceCode); return map; - }else { + } else { LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("agv叉车对接位输送线不允许取货:" + inst.getCarno()+ "点位号"+ boxSubvolumesConveyorDeviceDriver.getDevice_code()) + .content("agv叉车对接位输送线不允许取货:" + inst.getCarno() + "点位号" + boxSubvolumesConveyorDeviceDriver.getDevice_code()) .build(); logDto1.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto1); @@ -115,19 +117,23 @@ public class AgvWaitUtil { //如果是叉车,取货完成给输送线完成信号 Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode); ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; - if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())){ - if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) { + if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { + if (startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) { BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver(); - boxSubvolumesConveyorDeviceDriver.writing(3); + if (boxSubvolumesConveyorDeviceDriver.getTo_command() != 3) { + boxSubvolumesConveyorDeviceDriver.writing(3); + } } } //诺宝agv调lms更新点位 - if(inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){ + if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { applyLmsGetOut(inst); - if(startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + if (startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(3); + if (manipulatorAgvStationDeviceDriver.getTo_command() != 3) { + manipulatorAgvStationDeviceDriver.writing(3); + } } } @@ -145,7 +151,7 @@ public class AgvWaitUtil { param.put("actionType", ActionTypeEnum.IN_FINISHING.getCode().toString()); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("诺宝取货完成:" + inst.getTask_code() + "--" + ActionTypeEnum.IN_FINISHING.getCode().toString()) + .content("诺宝取货完成请求lms:" + inst.getTask_code() + "--" + ActionTypeEnum.IN_FINISHING.getCode().toString()) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -154,7 +160,7 @@ public class AgvWaitUtil { if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("追加动诺宝作块,参数,接口返回:" + jo) + .content("诺宝取货完成请求lms,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -177,23 +183,25 @@ public class AgvWaitUtil { log.info("仙工AGV请求放货,设备号 - {}", endDeviceCode); Device endDevice = deviceAppService.findDeviceByCode(endDeviceCode); ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; - if(endDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver){ + if (endDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) endDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(4); - if(manipulatorAgvStationDeviceDriver.getAction() != 1){ - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(inst.getCarno()) - .content("agv诺宝对接位行架不允许放货:" + inst.getCarno()+ "点位号"+ manipulatorAgvStationDeviceDriver.getDevice_code()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDevice); - throw new BadRequestException("上位系统不允许取货"); + if (manipulatorAgvStationDeviceDriver.getTo_command() != 4) { + manipulatorAgvStationDeviceDriver.writing(4); + if (manipulatorAgvStationDeviceDriver.getAction() != 1) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(inst.getCarno()) + .content("agv诺宝对接位行架不允许放货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDevice); + throw new BadRequestException("上位系统不允许取货"); + } } } LuceneLogDto logDto = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("允许放货"+ "点位" + endDeviceCode) + .content("允许放货" + "点位" + endDeviceCode) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -207,12 +215,14 @@ public class AgvWaitUtil { //放货完成等待 public JSONObject waitOutPut(String endDeviceCode, Instruction inst) { - Device nextDevice = deviceAppService.findDeviceByCode(inst.getNext_device_code()); + Device nextDevice = deviceAppService.findDeviceByCode(endDeviceCode); ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; - if(inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){ - if(nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { + if (nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) nextDevice.getDeviceDriver(); - manipulatorAgvStationDeviceDriver.writing(5); + if (manipulatorAgvStationDeviceDriver.getTo_command() != 5) { + manipulatorAgvStationDeviceDriver.writing(5); + } } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index 6f23d43ca..9b5c3533d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -62,7 +62,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { @Autowired private LuceneExecuteLogService luceneExecuteLogService; @Autowired - private DeviceAppService deviceAppservice; + private DeviceAppService deviceAppservice; @Autowired @@ -379,7 +379,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("location", pointCode); jo1.put("operation", "JackLoad"); - inspectInStocckSet(ja, pointCode, jo1); + inspectInStocckSet(pointCode, jo1); + ja.add(jo1); JSONObject jo2 = new JSONObject(); jo2.put("blockId", IdUtil.simpleUUID()); jo2.put("location", pointCode + "OUTGET"); @@ -400,22 +401,24 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - private void inspectInStocckSet(JSONArray ja, String pointCode, JSONObject jo1) { + private void inspectInStocckSet( String pointCode, JSONObject jo1) { Device device = deviceAppservice.findDeviceByCode(pointCode); StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - String inspectInStocck = (String)device.getExtraValue().get("inspect_in_stocck"); - if (StrUtil.isNotEmpty( inspectInStocck) && inspectInStocck.equals("true")){ + String inspectInStocck = (String) device.getExtraValue().get("inspect_in_stocck"); + if (StrUtil.isNotEmpty(inspectInStocck) && inspectInStocck.equals("true")) { jo1.put("operationArgs", new JSONObject() {{ - put("recognize",false); + put("recognize", false); }}); - ja.add(jo1); - }else { + } else { jo1.put("operationArgs", new JSONObject() {{ put("recognize", true); }}); - ja.add(jo1); } + } else { + jo1.put("operationArgs", new JSONObject() {{ + put("recognize", true); + }}); } } @@ -752,26 +755,25 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } //一楼诺宝agv if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { - if (address.contains("GET") || address.contains("WAIT")) { - //如果是取货二次分配,取放货二次分配需要重新追加动作块 - if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { - Integer actionType = ActionTypeEnum.IN_STOCK.getCode(); - String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); - return agvWaitUtil.waitInGet(newPointCode, instructionDto); - } - return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); - } else if (address.contains("PUT") || address.contains("WAIT")) { - //如果是放货二次分配,取放货二次分配需要重新追加动作块 - if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { - Integer actionType = ActionTypeEnum.OUT_STOCK.getCode(); -// deviceCodeNow = applyXGAgvTask(task_code, actionType, instructionDto); - deviceCodeNow = "ZXQ_05"; - sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), deviceCodeNow, instructionDto); - return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); - } + if (address.contains("GET")) { + return agvWaitUtil.waitInGet(deviceCodeNow, instructionDto); + } else if (address.contains("PUT")) { return agvWaitUtil.waitInPut(deviceCodeNow, instructionDto); } + //如果是取货二次分配,取放货二次分配需要重新追加动作块 + if (AgvActionTypeEnum.IN_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { + Integer actionType = ActionTypeEnum.IN_STOCK.getCode(); + String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); + return agvWaitUtil.waitInGet(newPointCode, instructionDto); + } + //如果是放货二次分配,取放货二次分配需要重新追加动作块 + if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { + Integer actionType = ActionTypeEnum.OUT_STOCK.getCode(); + String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); +// sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), deviceCodeNow, instructionDto); + return agvWaitUtil.waitInPut(newPointCode, instructionDto); + } } //一楼叉车 if (instructionDto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { @@ -783,13 +785,13 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (address.contains("WAIT")) { String newPointCode = applyCCAgvTask(task_code, instructionDto); LuceneLogDto logDto = LuceneLogDto.builder() - .content("叉车允许放货"+"新点位:"+newPointCode) + .content("叉车允许放货" + "新点位:" + newPointCode) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); JSONObject map = new JSONObject(); map.put("status", 200); - map.put("message", "允许叉车放货!"+"点位"+newPointCode); + map.put("message", "允许叉车放货!" + "点位" + newPointCode); log.info("允许仙工AGV放货,设备号 - {}", newPointCode); return map; } @@ -824,7 +826,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { param.put("task_code", task_code); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动叉车作块,参数:" + task_code) + .content("叉车二次分配请求lms,参数:" + task_code) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -833,7 +835,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动叉车作块,参数,接口返回:" + jo) + .content("叉车二次分配请求lms,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -844,11 +846,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动叉车作块失败,返回参数:" + jo.getString("body")) + .content("叉车二次分配请求lms失败,返回参数:" + jo.getString("message")) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); - throw new BadRequestException("追加动叉车作块返回失败"); + throw new BadRequestException("叉车二次分配请求lms返回失败"); } } catch (Exception e) { e.printStackTrace(); @@ -939,7 +941,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { param.put("actionType", actionType.toString()); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动诺宝作块,参数:" + task_code + "--" + actionType) + .content("二次分配请求lms,参数:" + task_code + "--" + actionType) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -948,7 +950,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动诺宝作块,参数,接口返回:" + jo) + .content("二次分配请求lms,参数,接口返回:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -961,11 +963,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(instructionDto.getCarno()) - .content("追加动诺宝作块失败,返回参数:" + jo.getString("body")) + .content("二次分配请求lms,返回参数:" + jo.getString("body")) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); - throw new BadRequestException("追加动诺宝作块返回失败"); + throw new BadRequestException("二次分配请求lms返回失败"); } } catch (Exception e) { e.printStackTrace(); @@ -1069,7 +1071,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { .device_code("追加诺宝运单参数") .content("指令号:" + instructionCode + ",下发追加诺宝运单反馈参数:" + jo) .build(); - logDto.setLog_level(4); + logDto1.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto1); log.info("指令号{},状态{},下发追加诺宝运单序列反馈:{}", instructionCode, result.getStatus(), result.body()); @@ -1078,9 +1080,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { private Object createBlocksDataTowEnd(String instructionCode, String point, Instruction instructionDto) { JSONArray ja = new JSONArray(); - String nextDeviceCode = instructionDto.getNext_device_code(); //终点2 - sendEndDeviceOrder3(ja, nextDeviceCode, instructionCode, instructionDto); + sendEndDeviceOrder3(ja, point, instructionCode, instructionDto); return ja; } @@ -1178,7 +1179,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("location", startPoint); jo1.put("operation", "JackLoad"); - inspectInStocckSet(ja, startPoint, jo1); + inspectInStocckSet(startPoint, jo1); + ja.add(jo1); JSONObject jo2 = new JSONObject(); jo2.put("blockId", IdUtil.simpleUUID()); jo2.put("location", startPoint + "OUTGET"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java index 9c3770c3d..43c20aee4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java @@ -123,9 +123,6 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i if (mode != last_mode) { this.setRequireSucess(false); - if (mode == 2) { - this.writing(0); - } } } catch (Exception var17) { return; @@ -265,14 +262,10 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i } else if (this.getMode() == 3) { mode = LangProcess.msg("universal_operation"); } - if (this.getAction() == 1) { + if (this.getAction() == 0) { + action = LangProcess.msg("universal_actionMessage1"); + } else if (this.getAction() == 1) { action = LangProcess.msg("universal_delivery"); - } else if (this.getAction() == 2) { - action = LangProcess.msg("universal_completed"); - } else if (this.getAction() == 3) { - action = LangProcess.msg("universal_releasing"); - } else if (this.getAction() == 4) { - action = LangProcess.msg("universal_releasing_completed"); } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 9dd4ef120..36d3c397f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -641,7 +641,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String secondaryAllocationPoint(JSONObject param) { try { MDC.put(log_file_type, log_type); - log.info("applyTaskToWms-----输入参数{}", param); + log.info("secondaryAllocationPoint-----输入参数{}", param); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("secondaryAllocationPoint"); String url = wmsurl + addressDto.getMethods_url(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/NDCAgvServiceImpl.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/NDCAgvServiceImpl.xml index f13d96f5f..4ad8c2e02 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/log/NDCAgvServiceImpl.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/NDCAgvServiceImpl.xml @@ -10,7 +10,7 @@ 15 - 200MB + 50MB 2GB diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml index 8f4151a72..4d8d438ff 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml @@ -10,7 +10,7 @@ 15 - 200MB + 50MB 2GB diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml index 63517b12f..6f9b53f82 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml @@ -10,7 +10,7 @@ 15 - 200MB + 50MB 2GB diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/XgAgvDeviceDriver.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/XgAgvDeviceDriver.xml index d47c53012..885cf5920 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/log/XgAgvDeviceDriver.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/XgAgvDeviceDriver.xml @@ -10,7 +10,7 @@ 15 - 100MB + 50MB 2GB diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/XianGongAgvServiceImpl.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/XianGongAgvServiceImpl.xml new file mode 100644 index 000000000..02c3cf8f7 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/XianGongAgvServiceImpl.xml @@ -0,0 +1,29 @@ + + + + + + + + + ${LOG_HOME}/仙工agv请求/%d{yyyy-MM-dd}.%i.log + + 15 + + 50MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + + + + + + + + + diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index 158891bd8..a070661e3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -23,6 +23,7 @@ https://juejin.cn/post/6844903775631572999 +