From ffa9ff130a39f54cf8df476a871bd19ed93e4420 Mon Sep 17 00:00:00 2001 From: loujf Date: Sun, 27 Nov 2022 11:00:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=83=A0=E6=B0=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/AgvServiceImpl.java | 23 +++++++++++++++++++ .../StandardInspectSiteDeviceDriver.java | 8 ++++--- .../modules/quartz/task/HsDeviceStatus.java | 21 +++++++++++++++++ .../nl/modules/quartz/task/HsSaveTask.java | 11 +++++++++ 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java index d8ac11d..e60864a 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java @@ -22,6 +22,7 @@ import org.nl.acs.device_driver.ndxy_special_two.NdxySpecialTwoDeviceDriver; import org.nl.acs.device_driver.special_ordinary_site.SpecialOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSiteSmartDeviceDriver; import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipulatorInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver; @@ -813,6 +814,7 @@ public class AgvServiceImpl implements AgvService { SpecialOrdinarySiteDeviceDriver specialOrdinarySiteDeviceDriver; YzjaSpecialDeviceDriver yzjaSpecialDeviceDriver; StandardManipulatorInspectSiteDeviceDriver standardManipulatorInspectSiteDeviceDriver; + StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver; //请求进入 if ("onEntry".equals(type)) { @@ -957,6 +959,27 @@ public class AgvServiceImpl implements AgvService { } } + } + if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { + standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) addressdevice.getDeviceDriver(); + //取货完成 + if ("Load".equals(action)) { + if (standardInspectSiteSmartDeviceDriver.getMode() != 0 && standardInspectSiteSmartDeviceDriver.getMove() == 0) { + inst.setExecute_device_code(processingVehicle); + inst.setExecute_status("2"); + standardInspectSiteSmartDeviceDriver.writing(2); + is_feedback = true; + } + //放货完成 + } else if ("Unload".equals(action)) { + if (standardInspectSiteSmartDeviceDriver.getMode() != 0 && standardInspectSiteSmartDeviceDriver.getMove() > 0) { + inst.setExecute_device_code(address); + inst.setExecute_status("4"); + standardInspectSiteSmartDeviceDriver.writing(3); + is_feedback = true; + } + } + } if (addressdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) addressdevice.getDeviceDriver(); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java index 917354f..46b3df4 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java @@ -98,12 +98,14 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp private int instruction_finished_time_out; int branchProtocol = 0; + + Boolean islock = false; //备注 - String remark; + String remark = ""; //数量 - String qty; + String qty = ""; //物料 - String material; + String material = ""; //批次 String batch; //当前指令 diff --git a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsDeviceStatus.java b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsDeviceStatus.java index d3ab660..8a23dde 100644 --- a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsDeviceStatus.java +++ b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsDeviceStatus.java @@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; @@ -47,6 +48,7 @@ public class HsDeviceStatus { String device_code = MapUtil.getStr(whereJson1, "device_code"); Device deviceApp = deviceAppService.findDeviceByCode(device_code); StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; if (deviceApp.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) deviceApp.getDeviceDriver(); jo.put("device_code", device_code); @@ -56,6 +58,15 @@ public class HsDeviceStatus { jo.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); jo.put("islock", standardOrdinarySiteDeviceDriver.getIslock()); } + if (deviceApp.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) deviceApp.getDeviceDriver(); + jo.put("device_code", device_code); + jo.put("quantity", standardInspectSiteDeviceDriver.getQty()); + jo.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); + jo.put("hasGood", standardInspectSiteDeviceDriver.getHasGoods()); + jo.put("remark", standardInspectSiteDeviceDriver.getRemark()); + jo.put("islock", standardInspectSiteDeviceDriver.getIslock()); + } device.add(jo); } for (int i = 0; i < array2.size(); i++) { @@ -63,6 +74,7 @@ public class HsDeviceStatus { String device_code = MapUtil.getStr(whereJson2, "device_code"); Device deviceApp = deviceAppService.findDeviceByCode(device_code); StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; if (deviceApp.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) deviceApp.getDeviceDriver(); jo.put("device_code", device_code); @@ -72,6 +84,15 @@ public class HsDeviceStatus { jo.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); jo.put("islock", standardOrdinarySiteDeviceDriver.getIslock()); } + if (deviceApp.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) deviceApp.getDeviceDriver(); + jo.put("device_code", device_code); + jo.put("quantity", standardInspectSiteDeviceDriver.getQty()); + jo.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); + jo.put("hasGood", standardInspectSiteDeviceDriver.getHasGoods()); + jo.put("remark", standardInspectSiteDeviceDriver.getRemark()); + jo.put("islock", standardInspectSiteDeviceDriver.getIslock()); + } device2.add(jo); } json.put("device", device); diff --git a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsSaveTask.java b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsSaveTask.java index f9f1f8b..4b3369b 100644 --- a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsSaveTask.java +++ b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/HsSaveTask.java @@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; @@ -44,6 +45,7 @@ public class HsSaveTask { String device_code = MapUtil.getStr(whereJson1, "device_code"); Device deviceApp = deviceAppService.findDeviceByCode(device_code); StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; if (deviceApp.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) deviceApp.getDeviceDriver(); jo.put("device_code", device_code); @@ -53,6 +55,15 @@ public class HsSaveTask { jo.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); jo.put("islock", standardOrdinarySiteDeviceDriver.getIslock()); } + if (deviceApp.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) deviceApp.getDeviceDriver(); + jo.put("device_code", device_code); + jo.put("quantity", standardInspectSiteDeviceDriver.getQty()); + jo.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); + jo.put("hasGood", standardInspectSiteDeviceDriver.getHasGoods()); + jo.put("remark", standardInspectSiteDeviceDriver.getRemark()); + jo.put("islock", standardInspectSiteDeviceDriver.getIslock()); + } device.add(jo); } json.put("device", device);