From 16fdd7d128d7a314789c270ec5baaec08e7865cf Mon Sep 17 00:00:00 2001 From: "ZHOUZ\\Noble'lift" <1014987728@qq.com> Date: Sat, 6 Aug 2022 17:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E5=A4=9A=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/AgvServiceImpl.java | 97 +-- .../org/nl/acs/common/AgvNdcOneDevice.java | 33 - .../org/nl/acs/common/AgvNdcTwoDevice.java | 32 - .../HailiangCleaningMachineStorageDevice.java | 25 - .../common/HailiangEngravingCacheDevice.java | 25 - .../HailiangEngravingMachineDevice.java | 24 - .../common/HailiangPackerStationDevice.java | 39 - .../nl/acs/common/HailiangSpecialDevice.java | 37 - .../common/HailiangSpecialEmptyDevice.java | 23 - .../acs/common/HailiangSpecialFullDevice.java | 21 - .../acs/common/HailiangSpecialPickDevice.java | 21 - .../acs/common/HailiangSpecialPourDevice.java | 25 - .../nl/acs/common/HailiangxjplcDevice.java | 50 -- .../device/device_driver/DriverTypeEnum.java | 52 +- .../service/impl/DeviceServiceImpl.java | 46 - .../agv/ndcone/AgvNdcOneDefination.java | 49 -- .../agv/ndcone/AgvNdcOneDeviceDriver.java | 477 ----------- .../agv/ndctwo/AgvNdcTwoDefination.java | 49 -- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 738 ---------------- .../HailiangAutoCacheLineDefination.java | 62 -- .../HailiangAutoCacheLineDeviceDriver.java | 512 ------------ .../ItemProtocol.java | 682 --------------- ...HailiangCleaningFeedingLineDefination.java | 62 -- .../HailiangCleaningFeedingLineDriver.java | 386 --------- .../ItemProtocol.java | 167 ---- .../HailiangCleaningMachineDefination.java | 62 -- .../HailiangCleaningMachineDeviceDriver.java | 426 ---------- .../ItemProtocol.java | 171 ---- ...eaningMachineStorageStationDefination.java | 62 -- ...ningMachineStorageStationDeviceDriver.java | 416 --------- .../ItemProtocol.java | 120 --- .../HailiangEngravingCacheDefination.java | 61 -- .../HailiangEngravingCacheDeviceDriver.java | 424 ---------- .../ItemProtocol.java | 73 -- .../HailiangEngravingMachineDefination.java | 61 -- .../HailiangEngravingMachineDeviceDriver.java | 787 ------------------ .../ItemProtocol.java | 228 ----- .../HailiangPackerStationDefination.java | 61 -- .../HailiangPackerStationDeviceDriver.java | 715 ---------------- .../hailiang_packer_station/ItemProtocol.java | 171 ---- .../HailiangSmartplcTestDeviceDriver.java | 303 ------- .../hailiang_smart_plc_test/ItemProtocol.java | 248 ------ .../HailiangSpecialDeviceDefination.java | 62 -- .../HailiangSpecialDeviceDriver.java | 564 ------------- .../hailiang_special_device/ItemProtocol.java | 263 ------ ...HailiangSpecialEmptyStationDefination.java | 62 -- ...iliangSpecialEmptyStationDeviceDriver.java | 426 ---------- .../ItemProtocol.java | 109 --- .../HailiangSpecialFullStationDefination.java | 62 -- ...ailiangSpecialFullStationDeviceDriver.java | 675 --------------- .../ItemProtocol.java | 110 --- .../HailiangSpecialPickStationDefination.java | 62 -- ...ailiangSpecialPickStationDeviceDriver.java | 406 --------- .../ItemProtocol.java | 97 --- .../HailiangSpecialPourStationDefination.java | 62 -- ...ailiangSpecialPourStationDeviceDriver.java | 515 ------------ .../ItemProtocol.java | 109 --- ...HailiangHailiangxjplcTestDeviceDriver.java | 300 ------- .../HailiangxjplcTestDefination.java | 61 -- .../hailiang_xj_plc_test/ItemProtocol.java | 248 ------ .../HailiangSmartplcTestDefination.java | 2 +- .../HailiangSmartplcTestDeviceDriver.java | 102 +++ .../hailiang_smart_plc_test/ItemProtocol.java | 105 +++ .../lamp_three_color/ItemProtocol.java | 72 -- .../LampThreecolorDefination.java | 71 -- .../LampThreecolorDeviceDriver.java | 155 ---- .../ManipulatorInspectSiteNDCDefination.java | 49 -- ...ManipulatorInspectSiteNDCDeviceDriver.java | 25 - .../standard_autodoor/ItemProtocol.java | 72 -- .../StandardAutodoorDefination.java | 71 -- .../StandardAutodoorDeviceDriver.java | 163 ---- .../StandardOrdinarySiteDeviceDriver.java | 17 - .../traffic_light/ItemProtocol.java | 72 -- .../traffic_light/TrafficLightDefination.java | 71 -- .../TrafficLightDeviceDriver.java | 152 ---- .../HaiLiangCoatingDefination.java | 71 -- .../HaiLiangCoatingDeviceDriver.java | 155 ---- .../hailiang_coating/ItemProtocol.java | 72 -- .../HaiLiangLabelingDefination.java | 70 -- .../HaiLiangLabelingDeviceDriver.java | 87 -- .../hailiang_labeling/ItemProtocol.java | 66 -- .../HaiLiangLetteringDefination.java | 50 -- .../HaiLiangLetteringDeviceDriver.java | 121 --- .../HaiLiangPackingDefination.java | 71 -- .../HaiLiangPackingDeviceDriver.java | 155 ---- .../hailiang_packing/ItemProtocol.java | 72 -- .../acs/ext/wms/rest/WmsToAcsController.java | 14 - .../acs/ext/wms/service/WmsToAcsService.java | 14 - .../wms/service/impl/WmsToAcsServiceImpl.java | 175 +--- .../service/impl/InstructionServiceImpl.java | 156 +--- .../rest/ProduceshiftorderController.java | 95 --- .../service/ProduceshiftorderService.java | 110 --- .../service/dto/ProduceshiftorderDto.java | 66 -- .../impl/ProduceshiftorderServiceImpl.java | 368 -------- .../org/nl/acs/order/service/wql/order.xls | Bin 163840 -> 0 bytes .../service/impl/StageActorServiceImpl.java | 29 +- .../quartz/task/AutoCreateAGVTwoInst.java | 6 - .../run/LetteringSocketConnectionAutoRun.java | 3 + .../auto/run/NDCSocketConnectionAutoRun.java | 25 +- .../run/OneNDCSocketConnectionAutoRun.java | 29 +- wcs/qd/src/api/acs/order/produceshiftorder.js | 42 - wcs/qd/src/views/acs/device/config.vue | 51 +- wcs/qd/src/views/acs/order/index.vue | 215 ----- 103 files changed, 306 insertions(+), 15597 deletions(-) delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/AgvNdcOneDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/AgvNdcTwoDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangCleaningMachineStorageDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangEngravingCacheDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangEngravingMachineDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangPackerStationDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialEmptyDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialFullDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialPickDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialPourDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangxjplcDevice.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/HailiangCleaningMachineDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/HailiangCleaningMachineDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/HailiangSmartplcTestDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/HailiangHailiangxjplcTestDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/HailiangxjplcTestDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/ItemProtocol.java rename wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/{hailiang_one => }/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java (94%) create mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDeviceDriver.java create mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/manipulator_inspect_site_NDC/ManipulatorInspectSiteNDCDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/manipulator_inspect_site_NDC/ManipulatorInspectSiteNDCDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/TrafficLightDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/TrafficLightDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/HaiLiangPackingDefination.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/HaiLiangPackingDeviceDriver.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/ItemProtocol.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderDto.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java delete mode 100644 wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls delete mode 100644 wcs/qd/src/api/acs/order/produceshiftorder.js delete mode 100644 wcs/qd/src/views/acs/order/index.vue diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java index 107d062..bd2582b 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java @@ -14,7 +14,6 @@ import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.impl.DeviceServiceImpl; -import org.nl.acs.device_driver.basedriver.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver; @@ -25,7 +24,6 @@ import org.nl.acs.log.service.LogServer; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; -import org.nl.acs.opc.DeviceType; import org.nl.acs.task.service.TaskService; import org.nl.exception.BadRequestException; import org.nl.start.auto.run.NDCSocketConnectionAutoRun; @@ -996,108 +994,17 @@ public class AgvServiceImpl implements AgvService { @Override public String requestOpenOrCloseDoor(String device, String param) { - log.info("AGV请求开关门参数,设备:{},参数:{}", device, param); - int type = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.BUSINESSTYPE)); - switch (type) { - case 4: - acsToWmsService.applyOpenOrCloseDoor(device, param); - break; - default: - StandardAutodoorDeviceDriver autodoor; - Device doordevice = deviceAppService.findDeviceByCode(device); - if (ObjectUtil.isEmpty(doordevice)) { - throw new BadRequestException("未找到对应设备"); - } - if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); - if (StrUtil.equals("open", param)) { - autodoor.OpenOrClose("1"); - log.info("下发开门请求"); - - } else if (StrUtil.equals("close", param)) { - autodoor.OpenOrClose("2"); - log.info("下发关门请求"); - } - } - break; - - } return null; } @Override public String queryDoorStatus(String device) { - log.info("AGV查询自动门状态,参数:{}", device); - int type = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.BUSINESSTYPE)); - switch (type) { - case 4: - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASOTHERSYSTEM).toString(), "1")) { - String result = acsToWmsService.queryDoorsStatus().body(); - JSONArray ja = JSONArray.parseArray(result); - log.info("AGV查询自动门状态,反馈:{}", ja.toString()); - return ja.toString(); - } - return null; - default: - if (StrUtil.equals("doors", device)) { - List list = deviceAppService.findDevice(DeviceType.autodoor); - JSONArray ja = new JSONArray(); - for (int i = 0; i < list.size(); i++) { - Device doordevice = deviceAppService.findDeviceByCode(list.get(i).getDevice_code()); - if (ObjectUtil.isEmpty(doordevice)) { - throw new BadRequestException("未找到对应设备"); - } - String mes = null; - StandardAutodoorDeviceDriver autodoor; - if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); - mes = autodoor.getStatus(); - } - JSONObject jo = JSONObject.parseObject(mes); - ja.add(jo); - } - log.info("AGV查询自动门状态,反馈:{}", ja.toString()); - return ja.toString(); - - } else { - Device doordevice = deviceAppService.findDeviceByCode(device); - if (ObjectUtil.isEmpty(doordevice)) { - throw new BadRequestException("未找到对应设备"); - } - String mes = null; - StandardAutodoorDeviceDriver autodoor; - if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); - mes = autodoor.getStatus(); - } - JSONObject jo = JSONObject.parseObject(mes); - log.info("AGV查询自动门状态,反馈:{}", jo.toString()); - return jo.toString(); - } - } + return null; } @Override public String queryAllDoorStatus() { - log.info("AGV查询全部自动门状态"); - List list = deviceAppService.findDevice(DeviceType.autodoor); - JSONArray ja = new JSONArray(); - for (int i = 0; i < list.size(); i++) { - Device doordevice = deviceAppService.findDeviceByCode(list.get(i).getDevice_code()); - if (ObjectUtil.isEmpty(doordevice)) { - throw new BadRequestException("未找到对应设备"); - } - String mes = null; - StandardAutodoorDeviceDriver autodoor; - if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); - mes = autodoor.getStatus(); - } - JSONObject jo = JSONObject.parseObject(mes); - ja.add(jo); - } - log.info("AGV查询全部自动门状态,反馈:{}", ja.toString()); - return ja.toString(); + return null; } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/AgvNdcOneDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/AgvNdcOneDevice.java deleted file mode 100644 index 0a11a7a..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/AgvNdcOneDevice.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.service.StorageCellService; -import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver; -import org.nl.acs.device_driver.basedriver.agv.utils.IAgv; -import org.nl.acs.device_driver.basedriver.agv.utils.OneAgvPhase; -import org.nl.acs.opc.Device; -import org.nl.acs.stage.service.utils.StageActorUtil; -import org.nl.utils.SpringContextHolder; -import org.springframework.stereotype.Service; - -/** - * @author geng by - * 单工agv - */ -@Service("agv_ndc_one") -@RequiredArgsConstructor -@Slf4j -public class AgvNdcOneDevice extends AbstractDriverService { - private final StorageCellService storageCellService; - @Override - public JSONObject getDeviceInfo(Device device) { - AgvNdcOneDeviceDriver agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver(); - IAgv oneAgv = SpringContextHolder.getBean(OneAgvPhase.class); - JSONObject jo = new JSONObject(); - jo.put("address", StageActorUtil.getAddress(storageCellService.findByAddress(agvNdcOneDeviceDriver.getAgvaddr_copy() + ""))); - jo.put("phaseName", oneAgv.getPhaseName(agvNdcOneDeviceDriver.getPhase())); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/AgvNdcTwoDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/AgvNdcTwoDevice.java deleted file mode 100644 index 7127e11..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/AgvNdcTwoDevice.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.service.StorageCellService; -import org.nl.acs.device_driver.basedriver.agv.ndctwo.AgvNdcTwoDeviceDriver; -import org.nl.acs.device_driver.basedriver.agv.utils.IAgv; -import org.nl.acs.device_driver.basedriver.agv.utils.TwoAgvPhase; -import org.nl.acs.opc.Device; -import org.nl.acs.stage.service.utils.StageActorUtil; -import org.nl.utils.SpringContextHolder; -import org.springframework.stereotype.Service; -/** - * @author geng by - * 双工agv - */ -@Service("agv_ndc_two") -@RequiredArgsConstructor -@Slf4j -public class AgvNdcTwoDevice extends AbstractDriverService { - private final StorageCellService storageCellService; - @Override - public JSONObject getDeviceInfo(Device device) { - AgvNdcTwoDeviceDriver agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver(); - IAgv twoAgv = SpringContextHolder.getBean(TwoAgvPhase.class); - JSONObject jo = new JSONObject(); - jo.put("address", StageActorUtil.getAddress(storageCellService.findByAddress(agvNdcTwoDeviceDriver.getAgvaddr_copy() + ""))); - jo.put("phaseName",twoAgv.getPhaseName(agvNdcTwoDeviceDriver.getPhase())); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangCleaningMachineStorageDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangCleaningMachineStorageDevice.java deleted file mode 100644 index c20ec6b..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangCleaningMachineStorageDevice.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver; -import org.nl.acs.opc.Device; -import org.springframework.stereotype.Service; - -/** - * @author geng by - * 清洗机 - */ -@Service("hailiang_cleaning_machine_storage_station") -public class HailiangCleaningMachineStorageDevice extends AbstractDriverService { - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangCleaningMachineStorageStationDeviceDriver hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangCleaningMachineStorageStationDeviceDriver, 0); - jo.put("isError", hailiangCleaningMachineStorageStationDeviceDriver.getIserror()); - jo.put("error", hailiangCleaningMachineStorageStationDeviceDriver.getError()); - jo.put("weight", hailiangCleaningMachineStorageStationDeviceDriver.getSilo_weight()); - jo.put("qty", hailiangCleaningMachineStorageStationDeviceDriver.getFull_number()); - jo.put("material", hailiangCleaningMachineStorageStationDeviceDriver.getMaterial()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangEngravingCacheDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangEngravingCacheDevice.java deleted file mode 100644 index def9e66..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangEngravingCacheDevice.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache.HailiangEngravingCacheDeviceDriver; -import org.nl.acs.opc.Device; -import org.nl.acs.stage.service.utils.StageActorUtil; -import org.springframework.stereotype.Service; -/** - * @author geng by - * 刻字缓存位 - */ -@Service("hailiang_engraving_cache") -public class HailiangEngravingCacheDevice extends AbstractDriverService { - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangEngravingCacheDeviceDriver hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangEngravingCacheDeviceDriver); - jo.put("move", StageActorUtil.getCacheMove(hailiangEngravingCacheDeviceDriver.getMove())); - jo.put("is_click", true); - jo.put("device_type",device.getDevice_type()); - jo.put("driver_type",device.getDeviceDriverDefination().getDriverCode()); - jo.put("material_type",device.getMaterial_type()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangEngravingMachineDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangEngravingMachineDevice.java deleted file mode 100644 index bae8ec7..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangEngravingMachineDevice.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver; -import org.nl.acs.opc.Device; -import org.nl.acs.stage.service.utils.StageActorUtil; -import org.springframework.stereotype.Service; -/** - * @author geng by - * 刻字机 - */ -@Service("hailiang_engraving_machine") -public class HailiangEngravingMachineDevice extends AbstractDriverService { - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangEngravingMachineDeviceDriver); - jo.put("empty_req",StageActorUtil.getIsOrNo(hailiangEngravingMachineDeviceDriver.getEmpty_req())); - jo.put("full_req", StageActorUtil.getIsOrNo(hailiangEngravingMachineDeviceDriver.getFull_req())); - jo.put("error", hailiangEngravingMachineDeviceDriver.getError()); - jo.put("material_type", device.getMaterial_type()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangPackerStationDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangPackerStationDevice.java deleted file mode 100644 index adcf708..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangPackerStationDevice.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; -import org.nl.acs.opc.Device; -import org.nl.acs.stage.service.utils.StageActorUtil; -import org.springframework.stereotype.Service; -/** - * @author geng by - * 包装机 - */ -@Service("hailiang_packer_station") -public class HailiangPackerStationDevice extends AbstractDriverService { - HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver; - @Override - public JSONObject getDeviceInfo(Device device) { - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangPackerStationDeviceDriver); - jo.put("material_type",device.getMaterial_type()); - jo.put("lack_req", StageActorUtil.getIsOrNo(hailiangPackerStationDeviceDriver.getLack_req())); - jo.put("empty_req", StageActorUtil.getIsOrNo(hailiangPackerStationDeviceDriver.getReq_task_empty())); - jo.put("is_click", true); - jo.put("device_type",device.getDevice_type()); - Boolean requireSucess = hailiangPackerStationDeviceDriver.getRequireSucess(); - jo.put("requestSucess",StageActorUtil.getRequestSucess(requireSucess)); - jo.put("requireSucess",StageActorUtil.getRequireSucess(requireSucess)); - Boolean fullrequireSucess = hailiangPackerStationDeviceDriver.getFullrequireSucess(); - jo.put("fullrequestSucess",StageActorUtil.getRequestSucess(fullrequireSucess)); - jo.put("fullrequireSucess",StageActorUtil.getRequireSucess(fullrequireSucess)); - jo.put("driver_type",device.getDeviceDriverDefination().getDriverCode()); - return jo; - } - - @Override - public Integer getDbValue(Device device,String dbName){ - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - return super.getDbValue(hailiangPackerStationDeviceDriver,dbName); - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialDevice.java deleted file mode 100644 index 616c13c..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialDevice.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device.HailiangSpecialDeviceDriver; -import org.nl.acs.opc.Device; -import org.springframework.stereotype.Service; - -import java.util.Map; -/** - * @author geng by - * 专机 - */ -@Service("hailiang_special_device") -public class HailiangSpecialDevice extends AbstractDriverService{ - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangSpecialDeviceDriver,0); - jo.put("isError", hailiangSpecialDeviceDriver.getIserror()); - jo.put("error", hailiangSpecialDeviceDriver.getError()); - jo.put("empty_is_lack", hailiangSpecialDeviceDriver.getEmpty_is_lack()); - jo.put("empty_is_finish", hailiangSpecialDeviceDriver.getEmpty_is_finish()); - jo.put("full_ready_req_agv", hailiangSpecialDeviceDriver.getFull_ready_req_agv()); - jo.put("full_out", hailiangSpecialDeviceDriver.getFull_out()); - jo.put("finish", hailiangSpecialDeviceDriver.getFinish()); - jo.put("order_compel_finish", hailiangSpecialDeviceDriver.getOrder_compel_finish()); - jo.put("now_order_prod_num", hailiangSpecialDeviceDriver.getNow_order_prod_num()); - jo.put("now_one_prod_num", hailiangSpecialDeviceDriver.getNow_one_box_num()); - jo.put("task", hailiangSpecialDeviceDriver.getTask()); - jo.put("full_number", hailiangSpecialDeviceDriver.getFull_number()); - jo.put("storage_stock_num", hailiangSpecialDeviceDriver.getStorage_stock_num()); - jo.put("line_stock_num", hailiangSpecialDeviceDriver.getLine_stock_num()); - jo.put("order_prod_allnum", hailiangSpecialDeviceDriver.getOrder_prod_allnum()); - jo.put("order", hailiangSpecialDeviceDriver.getOrder()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialEmptyDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialEmptyDevice.java deleted file mode 100644 index 3ad6b47..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialEmptyDevice.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station.HailiangSpecialEmptyStationDeviceDriver; -import org.nl.acs.opc.Device; -import org.nl.acs.stage.service.utils.StageActorUtil; -import org.springframework.stereotype.Service; -/** - * @author geng by - * 空料口 - */ -@Service("hailiang_special_empty_station") -public class HailiangSpecialEmptyDevice extends AbstractDriverService { - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangSpecialEmptyStationDeviceDriver hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangSpecialEmptyStationDeviceDriver,0); - jo.put("move", StageActorUtil.getMove(hailiangSpecialEmptyStationDeviceDriver.getMove())); - jo.put("hasGoods", StageActorUtil.getHasGoods(hailiangSpecialEmptyStationDeviceDriver.getMove(),0)); - jo.put("isError", hailiangSpecialEmptyStationDeviceDriver.getIserror()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialFullDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialFullDevice.java deleted file mode 100644 index 592ce2d..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialFullDevice.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station.HailiangSpecialFullStationDeviceDriver; -import org.nl.acs.opc.Device; -import org.nl.acs.stage.service.utils.StageActorUtil; -import org.springframework.stereotype.Service; -/** - * @author geng by - * 满料口 - */ -@Service("hailiang_special_full_station") -public class HailiangSpecialFullDevice extends AbstractDriverService { - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangSpecialFullStationDeviceDriver hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangSpecialFullStationDeviceDriver); - jo.put("isError", hailiangSpecialFullStationDeviceDriver.getIserror()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialPickDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialPickDevice.java deleted file mode 100644 index 08211b4..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialPickDevice.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pick_station.HailiangSpecialPickStationDeviceDriver; -import org.nl.acs.opc.Device; -import org.springframework.stereotype.Service; -/** - * @author geng by - * 接料口 - */ -@Service("hailiang_special_pick_station") -public class HailiangSpecialPickDevice extends AbstractDriverService { - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangSpecialPickStationDeviceDriver hailiangSpecialPickStationDeviceDriver = (HailiangSpecialPickStationDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangSpecialPickStationDeviceDriver, 0); - jo.put("isError", hailiangSpecialPickStationDeviceDriver.getIserror()); - jo.put("full_number", hailiangSpecialPickStationDeviceDriver.getFull_number()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialPourDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialPourDevice.java deleted file mode 100644 index 2697c14..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangSpecialPourDevice.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.opc.Device; -import org.springframework.stereotype.Service; - -/** - * @author geng by - * 倒料 - */ -@Service("hailiang_special_pour_station") -public class HailiangSpecialPourDevice extends AbstractDriverService { - - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangSpecialPourStationDeviceDriver,0); - jo.put("isError", hailiangSpecialPourStationDeviceDriver.getIserror()); - jo.put("full_number", hailiangSpecialPourStationDeviceDriver.getFull_number()); - jo.put("storage_stock_num", hailiangSpecialPourStationDeviceDriver.getStorage_stock_num()); - jo.put("line_stock_num", hailiangSpecialPourStationDeviceDriver.getLine_stock_num()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangxjplcDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangxjplcDevice.java deleted file mode 100644 index 542b232..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangxjplcDevice.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.nl.acs.common; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_xj_plc_test.HailiangHailiangxjplcTestDeviceDriver; -import org.nl.acs.opc.Device; -import org.springframework.stereotype.Service; - -/** - * @author geng by - * 海亮-海亮迅捷plc测试 - */ -@Service("hailiang_xj_plc_test") -public class HailiangxjplcDevice extends AbstractDriverService { - @Override - public JSONObject getDeviceInfo(Device device) { - HailiangHailiangxjplcTestDeviceDriver hailiangHailiangxjplcTestDeviceDriver = (HailiangHailiangxjplcTestDeviceDriver) device.getDeviceDriver(); - JSONObject jo = super.getCommonDeviceInfo(hailiangHailiangxjplcTestDeviceDriver,0); - jo.put("heartbeat",hailiangHailiangxjplcTestDeviceDriver.getHeartbeat()); - jo.put("error",hailiangHailiangxjplcTestDeviceDriver.getError()); - jo.put("error_num",hailiangHailiangxjplcTestDeviceDriver.getError_num()); - jo.put("open_time",hailiangHailiangxjplcTestDeviceDriver.getOpen_time()); - jo.put("close_time",hailiangHailiangxjplcTestDeviceDriver.getClose_time()); - jo.put("ready_time",hailiangHailiangxjplcTestDeviceDriver.getReady_time()); - jo.put("running_time",hailiangHailiangxjplcTestDeviceDriver.getRunning_time()); - jo.put("error_time",hailiangHailiangxjplcTestDeviceDriver.getError_time()); - jo.put("voltage",hailiangHailiangxjplcTestDeviceDriver.getVoltage()); - jo.put("temperature",hailiangHailiangxjplcTestDeviceDriver.getTemperature()); - jo.put("current",hailiangHailiangxjplcTestDeviceDriver.getCurrent()); - jo.put("material",hailiangHailiangxjplcTestDeviceDriver.getMaterial()); - jo.put("lack_material",hailiangHailiangxjplcTestDeviceDriver.getLack_material()); - jo.put("full_material",hailiangHailiangxjplcTestDeviceDriver.getFull_material()); - jo.put("storage_qty",hailiangHailiangxjplcTestDeviceDriver.getStorage_qty()); - jo.put("feeding_qty",hailiangHailiangxjplcTestDeviceDriver.getFeeding_qty()); - jo.put("blanking_qty",hailiangHailiangxjplcTestDeviceDriver.getBlanking_qty()); - jo.put("qualified_qty",hailiangHailiangxjplcTestDeviceDriver.getQualified_qty()); - jo.put("unqualified_qty",hailiangHailiangxjplcTestDeviceDriver.getUnqualified_qty()); - jo.put("finish",hailiangHailiangxjplcTestDeviceDriver.getFinish()); - jo.put("task",hailiangHailiangxjplcTestDeviceDriver.getTask()); - jo.put("noload_electricity_consumption",hailiangHailiangxjplcTestDeviceDriver.getNoload_electricity_consumption()); - jo.put("prod_electricity_consumption",hailiangHailiangxjplcTestDeviceDriver.getProd_electricity_consumption()); - jo.put("gas_consumption",hailiangHailiangxjplcTestDeviceDriver.getGas_consumption()); - jo.put("water_consumption",hailiangHailiangxjplcTestDeviceDriver.getWater_consumption()); - jo.put("oil_level",hailiangHailiangxjplcTestDeviceDriver.getOil_level()); - jo.put("pause",hailiangHailiangxjplcTestDeviceDriver.getPause()); - jo.put("is_click",true); - jo.put("driver_type","hailiang_xj_plc_test"); - jo.put("monthly_electricity_consumption",hailiangHailiangxjplcTestDeviceDriver.getMonthly_electricity_consumption()); - return jo; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java index 81925b2..2db1f62 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java @@ -13,57 +13,17 @@ public enum DriverTypeEnum { INSPECT_SITE(2, "standard_inspect_site", "检测站点", "conveyor"), - AUTODOOR(3, "standard_autodoor", "标准版-自动门", "autodoor"), + STORAGE(3, "standard_storage", "标准版-货架", "storage"), - LAMP_THREE_COLOR(4, "lamp_three_color", "标准版-三色灯", "三色灯"), + SCANNER(4, "standard_scanner", "标准版-扫码器", "scanner"), - STORAGE(5, "standard_storage", "标准版-货架", "storage"), + INSPECT_CONVEYOR_CONTROL_WITH_SCANNER(5, "standard_conveyor_control_with_scanner", "标准版-输送机-控制点-关联扫码", "conveyor"), - SCANNER(6, "standard_scanner", "标准版-扫码器", "scanner"), + INSPECT_CONVEYOR_CONTROL(6, "standard_conveyor_control", "标准版-输送机-控制点", "conveyor"), - INSPECT_CONVEYOR_CONTROL_WITH_SCANNER(7, "standard_conveyor_control_with_scanner", "标准版-输送机-控制点-关联扫码", "conveyor"), + INSPECT_CONVEYOR_MONITOR(7, "standard_conveyor_monitor", "标准版-输送机-监控点", "conveyor"), - INSPECT_CONVEYOR_CONTROL(8, "standard_conveyor_control", "标准版-输送机-控制点", "conveyor"), - - INSPECT_CONVEYOR_MONITOR(9, "standard_conveyor_monitor", "标准版-输送机-监控点", "conveyor"), - - HAILIANG_PACKING(10, "hailiang_packing", "海亮包装项目-包装机", "conveyor"), - - HAILIANG_LABELING(11, "hailiang_labeling", "海亮包装项目-贴标机", "conveyor"), - - HAILIANG_COATING(12, "hailiang_coating", "海亮包装项目-裹膜机", "conveyor"), - - HAILIANG_SPECIAL_EMPTY_STATION(13, "hailiang_special_empty_station", "海亮专机空料点", "conveyor"), - - HAILIANG_SPECIAL_PICK_STATION(14, "hailiang_special_pick_station", "海亮专机接料点", "conveyor"), - - HAILIANG_SPECIAL_FULL_STATION(15, "hailiang_special_full_station", "海亮专机满料点", "conveyor"), - - HAILIANG_SPECIAL_POUR_STATION(16, "hailiang_special_pour_station", "海亮专机倒料点", "conveyor"), - - HAILIANG_SPECIAL_DEVICE(17, "hailiang_special_device", "海亮专机设备", "conveyor"), - - HAILIANG_AUTO_CACHE_LINE(18, "hailiang_auto_cache_line", "海亮自动缓存线", "conveyor"), - - HAILIANG_ENGRAVING_MACHINE(19, "hailiang_engraving_machine", "海亮-激光刻字工位", "conveyor"), - - HAILIANG_CLEANING_MACHINE_STORAGE_STATION(20, "hailiang_cleaning_machine_storage_station", "海亮-清洗机储料仓", "conveyor"), - - HAILIANG_CLEANING_MACHINE(21, "hailiang_cleaning_machine", "海亮-清洗机", "conveyor"), - - HAILIANG_CLEANING_FEEDING_LINE(22, "hailiang_cleaning_feeding_line", "海亮-清洗上料线体", "conveyor"), - - AGV_NDC_ONE(23, "agv_ndc_one", "NDC单工位AGV", "agv"), - - AGV_NDC_TWO(24, "agv_ndc_two", "NDC双工位AGV", "agv"), - - HAILIANG_ENGRAVING_CACHE(25, "hailiang_engraving_cache", "海亮-刻字缓存位", "conveyor"), - - HAILIANG_PACKER_STATION(26, "hailiang_packer_station", "海亮-包装机工位", "conveyor"), - - HAILIANG_XJ_PLC_TEST(27, "hailiang_xj_plc_test", "海亮-信捷PLC", "conveyor"), - - HAILIANG_SMART_PLC_TEST(28, "hailiang_smart_plc_test", "海亮-西门子SMART200PLC", "conveyor"); + HAILIANG_SMART_PLC_TEST(8, "hailiang_smart_plc_test", "永裕共挤线-西门子SMART200PLC", "conveyor"); diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 7940286..54aa8e5 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -21,8 +21,6 @@ import org.nl.acs.device.service.*; import org.nl.acs.device.service.dto.*; import org.nl.acs.device_driver.DeviceDriverDefination; import org.nl.acs.device_driver.ScannerDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache.HailiangEngravingCacheDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; @@ -868,9 +866,6 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; //检测站点 StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; - //刻字缓存位 - HailiangEngravingCacheDeviceDriver hailiangEngravingCacheDeviceDriver; - HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver; if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); if (!StrUtil.isEmpty(hasGoodStatus)) { @@ -929,47 +924,6 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial device.setMaterial_type(material_type); device.setBatch(batch); } - - else if (device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) device.getDeviceDriver(); - WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); - JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0); - if (!ObjectUtil.isEmpty(json)) { - DeviceRunpointDto obj = json.toJavaObject(DeviceRunpointDto.class); - obj.setHasgoods(hasGoodStatus); - obj.setMaterial_type(material_type); - obj.setBatch(batch); - obj.setIslock(islock); - hailiangEngravingCacheDeviceDriver.setMaterial(material_type); - if (hailiangEngravingCacheDeviceDriver.getMove() != Integer.parseInt(hasGoodStatus)){ - hailiangEngravingCacheDeviceDriver.writing("to_cache_write",hasGoodStatus); - } - hailiangEngravingCacheDeviceDriver.setHasGoods(Integer.parseInt(hasGoodStatus)); - device.setHas_goods(Integer.parseInt(hasGoodStatus)); - device.setMaterial_type(material_type); - hailiangEngravingCacheDeviceDriver.setMaterial(material_type); - JSONObject updatejson = (JSONObject) JSONObject.toJSON(obj); - runpointwo.update(updatejson, "device_code = '" + device_code + "'"); - } - } - else if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) { - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - if(StrUtil.isNotEmpty(requireSucess)) { - if (requireSucess.equals("0")){ - hailiangPackerStationDeviceDriver.setRequireSucess(false); - } else { - hailiangPackerStationDeviceDriver.setRequireSucess(true); - } - } - if(StrUtil.isNotEmpty(fullrequireSucess)) { - if (fullrequireSucess.equals("0")){ - hailiangPackerStationDeviceDriver.setFullrequireSucess(false); - } else { - hailiangPackerStationDeviceDriver.setFullrequireSucess(true); - } - } - } - } @Override diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefination.java deleted file mode 100644 index ccb93c9..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefination.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.nl.acs.device_driver.basedriver.agv.ndcone; - -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * NDC单工位AGV - */ -@Service -public class AgvNdcOneDefination implements DeviceDriverDefination { - @Override - public String getDriverCode() { - return "agv_ndc_one"; - } - - @Override - public String getDriverName() { - return "NDC单工位AGV"; - } - - @Override - public String getDriverDescription() { - return "NDC单工位AGV"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new AgvNdcOneDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return AgvNdcOneDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.agv); - return types; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java deleted file mode 100644 index e3a1128..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ /dev/null @@ -1,477 +0,0 @@ -package org.nl.acs.device_driver.basedriver.agv.ndcone; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.config.server.impl.AcsConfigServiceImpl; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache.HailiangEngravingCacheDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station.HailiangSpecialEmptyStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station.HailiangSpecialFullStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pick_station.HailiangSpecialPickStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.instruction.service.impl.InstructionServiceImpl; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.start.auto.run.NDCSocketConnectionAutoRun; -import org.nl.start.auto.run.OneNDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * NDC单工位AGV - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements DeviceDriver { - - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigServiceImpl.class); - InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - org.nl.acs.agv.server.AgvService AgvService = SpringContextHolder.getBean(AgvService.class); - DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); - DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - int agvaddr = 0; - int agvaddr_copy = 0; - int weight = 0; - String device_code = ""; - int phase = 0; - - int x = 0; //x坐标 - int y = 0; //y坐标 - int angle = 0; //角度 - int electric_qty = 0; //电量 - int status = 0; //三色灯状态 - int error = 0; //车辆故障 - - int last_x = 0; - int last_y = 0; - int last_angle = 0; - int last_electric_qty = 0; - int last_status = 0; - int last_error = 0; - public synchronized void processSocket(int[] arr) throws Exception { - device_code = this.getDeviceCode(); - byte[] data = null; - phase = arr[16] * 256 + arr[17]; - // agv任务号 - int index = arr[12] * 256 + arr[13]; - //任务号 - int ikey = arr[26] * 256 + arr[27]; - //站点号 - agvaddr = arr[18] * 256 + arr[19]; - //车号 - int carno = arr[20]; - Instruction link_inst = null; - List insts = null; - boolean link_flag = false; - Device agv_device = null; - if (carno != 0) { - agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno)); - } - if (ikey != 0) { - insts = instructionService.findByLinkNum(String.valueOf(ikey)); - } - if (!ObjectUtil.isEmpty(link_inst)) { - link_flag = true; - } - logServer.deviceLogToacs(this.device_code,"","","接收AGV上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno); - - Device device = null; - String old_device_code = null; - String emptyNum = null; - String device_code = null; - - if(phase==0x67) { - //故障信息 - if(arr[18]*256+arr[19]==0){ - - } - data = AgvService.sendAgvOneModeInst(phase, index, 0); - } - //刻字缓存位 - HailiangEngravingCacheDeviceDriver hailiangEngravingCacheDeviceDriver; - //刻字机工位 - HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver; - //包装机工位 - HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver; - //普通站点 - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - //货架 - StandardStorageDeviceDriver standardStorageDeviceDriver; - - //开始任务/上报订单号 - if (phase == 0x02) { - for (Instruction inst : insts) { - inst.setCarno(String.valueOf(carno)); - instructionService.update(inst); - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //请求取货 - } else if (phase == 0x03) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - logServer.deviceLogToacs(this.device_code,"","","agv地址参数有误,phase:" + phase ); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - if (agvaddr != 0) { - old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - if (StrUtil.contains(old_device_code, "-")) { - String[] point = old_device_code.split("-"); - device_code = point[0]; - } else if (StrUtil.contains(old_device_code, ".")) { - String[] point = old_device_code.split("\\."); - device_code = point[0]; - emptyNum = point[1]; - } else { - device_code = old_device_code; - } - } - - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - logServer.deviceLogToacs(this.device_code,"","",agvaddr+"对应设备号为空"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - logServer.deviceLogToacs(this.device_code,"","","未找到关联编号对应的指令"+ikey); - break; - } - - if (StrUtil.equals(inst.getStart_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) { - hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver(); - hailiangEngravingMachineDeviceDriver.setAgvphase(phase); - hailiangEngravingMachineDeviceDriver.setIndex(index); - hailiangEngravingMachineDeviceDriver.setInst(inst); - } - - if (device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) device.getDeviceDriver(); - hailiangEngravingCacheDeviceDriver.setAgvphase(phase); - hailiangEngravingCacheDeviceDriver.setIndex(index); - hailiangEngravingCacheDeviceDriver.setInst(inst); - } - - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - standardOrdinarySiteDeviceDriver.setIndex(index); - standardOrdinarySiteDeviceDriver.setInst(inst); - } - - if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) { - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - hailiangPackerStationDeviceDriver.setAgvphase(phase); - hailiangPackerStationDeviceDriver.setIndex(index); - hailiangPackerStationDeviceDriver.setInst(inst); - } - - if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { - data = AgvService.sendAgvOneModeInst(phase, index, 0); - } - } - } - - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - } else if (phase == 0x65) {//param,重量待定 - //1、得到重量信息 - int weight = (arr[18] * 256 + arr[19]) * 10; - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - // 4010 待处理 - if (StrUtil.equals(inst.getStart_device_code(), device_code)) { - inst.setWeight(String.valueOf(weight)); - } - } - data = AgvService.sendAgvOneModeInst(phase, index, 0); - - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //取货完毕/取满框完毕1/点对点取货完毕 - } else if (phase == 0x64) {//param,agv货位id待定 - //1、根据货位id找到对应三工位设备,赋给agv属性地址对应的满料位设备 - agvaddr = arr[18] * 256 + arr[19]; - agvaddr_copy = agvaddr; - data = AgvService.sendAgvOneModeInst(phase, index, 0); - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //取货完毕 - } else if (phase == 0x05) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - logServer.deviceLogToacs(this.device_code,"","","agv地址参数有误,phase:" + phase ); - return; - } - if (agvaddr != 0) { - old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - if (StrUtil.contains(old_device_code, "-")) { - String[] point = old_device_code.split("-"); - device_code = point[0]; - } else if (StrUtil.contains(old_device_code, ".")) { - String[] point = old_device_code.split("\\."); - device_code = point[0]; - emptyNum = point[1]; - } else { - device_code = old_device_code; - } - } - device = deviceAppService.findDeviceByCode(device_code); - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - logServer.deviceLogToacs(this.device_code,"","","对应设备号为空"+device_code); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - logServer.deviceLogToacs(this.device_code,"","","未找到关联编号对应的指令"+ikey); - break; - } - - if (StrUtil.equals(inst.getStart_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) { - hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver(); - hailiangEngravingMachineDeviceDriver.setAgvphase(phase); - hailiangEngravingMachineDeviceDriver.setIndex(index); - hailiangEngravingMachineDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) device.getDeviceDriver(); - hailiangEngravingCacheDeviceDriver.setAgvphase(phase); - hailiangEngravingCacheDeviceDriver.setIndex(index); - hailiangEngravingCacheDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - standardOrdinarySiteDeviceDriver.setIndex(index); - standardOrdinarySiteDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) { - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - hailiangPackerStationDeviceDriver.setAgvphase(phase); - hailiangPackerStationDeviceDriver.setIndex(index); - hailiangPackerStationDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { - standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver(); - data = AgvService.sendAgvOneModeInst(phase, index, 0); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //请求放货 - } else if (phase == 0x07) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - logServer.deviceLogToacs(this.device_code,"","","agv地址参数有误,phase:" + phase ); - return; - } - if (agvaddr != 0) { - old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - if (StrUtil.contains(old_device_code, "-")) { - String[] point = old_device_code.split("-"); - device_code = point[0]; - } else if (StrUtil.contains(old_device_code, ".")) { - String[] point = old_device_code.split("\\."); - device_code = point[0]; - emptyNum = point[1]; - } else { - device_code = old_device_code; - } - } - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getNext_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) { - hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver(); - hailiangEngravingMachineDeviceDriver.setAgvphase(phase); - hailiangEngravingMachineDeviceDriver.setIndex(index); - hailiangEngravingMachineDeviceDriver.setInst(inst); - } - - if (device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) device.getDeviceDriver(); - hailiangEngravingCacheDeviceDriver.setAgvphase(phase); - hailiangEngravingCacheDeviceDriver.setIndex(index); - hailiangEngravingCacheDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - standardOrdinarySiteDeviceDriver.setIndex(index); - standardOrdinarySiteDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) { - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - hailiangPackerStationDeviceDriver.setAgvphase(phase); - hailiangPackerStationDeviceDriver.setIndex(index); - hailiangPackerStationDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { - standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver(); - data = AgvService.sendAgvOneModeInst(phase, index, 0); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //放货完成 - } else if (phase == 0x09) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - logServer.deviceLogToacs(this.device_code,"","","agv地址参数有误,phase:" + phase ); - return; - } - if (agvaddr != 0) { - old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - if (StrUtil.contains(old_device_code, "-")) { - String[] point = old_device_code.split("-"); - device_code = point[0]; - } else if (StrUtil.contains(old_device_code, ".")) { - String[] point = old_device_code.split("\\."); - device_code = point[0]; - emptyNum = point[1]; - } else { - device_code = old_device_code; - } - } - - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getNext_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) { - hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver(); - hailiangEngravingMachineDeviceDriver.setAgvphase(phase); - hailiangEngravingMachineDeviceDriver.setIndex(index); - hailiangEngravingMachineDeviceDriver.setInst(inst); - } - - if (device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) device.getDeviceDriver(); - hailiangEngravingCacheDeviceDriver.setAgvphase(phase); - hailiangEngravingCacheDeviceDriver.setIndex(index); - hailiangEngravingCacheDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) { - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - hailiangPackerStationDeviceDriver.setAgvphase(phase); - hailiangPackerStationDeviceDriver.setIndex(index); - hailiangPackerStationDeviceDriver.setInst(inst); - } - - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - standardOrdinarySiteDeviceDriver.setIndex(index); - standardOrdinarySiteDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { - standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver(); - data = AgvService.sendAgvOneModeInst(phase, index, 0); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - } else if (phase == 0x71){ - x = ikey; - if (x != last_x){ - logServer.deviceLog(this.device_code, "x", String.valueOf(x)); - } - } else if (phase == 0x72){ - y = ikey; - if (y != last_y){ - logServer.deviceLog(this.device_code, "y", String.valueOf(y)); - } - } else if (phase == 0x73){ - angle = last_angle; - if (angle != last_angle){ - logServer.deviceLog(this.device_code, "angle", String.valueOf(angle)); - } - } else if (phase == 0x74){ - electric_qty = ikey; - if (electric_qty != last_electric_qty){ - logServer.deviceLog(this.device_code, "electric_qty", String.valueOf(electric_qty)); - } - } else if (phase == 0x75){ - status = ikey; - if (status != last_status){ - logServer.deviceLog(this.device_code, "status", String.valueOf(status)); - } - } else if (phase == 0x76){ - error = ikey; - if (error != last_error){ - logServer.deviceLog(this.device_code, "error", String.valueOf(error)); - } - } - if (!ObjectUtil.isEmpty(data)) { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - OneNDCSocketConnectionAutoRun.write(data); - } - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefination.java deleted file mode 100644 index c67d99d..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefination.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.nl.acs.device_driver.basedriver.agv.ndctwo; - -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * NDC双工位AGV - */ -@Service -public class AgvNdcTwoDefination implements DeviceDriverDefination { - @Override - public String getDriverCode() { - return "agv_ndc_two"; - } - - @Override - public String getDriverName() { - return "NDC双工位AGV"; - } - - @Override - public String getDriverDescription() { - return "NDC双工位AGV"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new AgvNdcTwoDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return AgvNdcTwoDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.agv); - return types; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java deleted file mode 100644 index c0123e8..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ /dev/null @@ -1,738 +0,0 @@ -package org.nl.acs.device_driver.basedriver.agv.ndctwo; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.config.server.impl.AcsConfigServiceImpl; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station.HailiangSpecialEmptyStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station.HailiangSpecialFullStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pick_station.HailiangSpecialPickStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.instruction.service.impl.InstructionServiceImpl; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.start.auto.run.AutoRunService; -import org.nl.start.auto.run.NDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 双工位诺宝AGV - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements DeviceDriver { - - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigServiceImpl.class); - InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - AgvService AgvService = SpringContextHolder.getBean(AgvService.class); - DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); - DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - int agvaddr = 0; - int agvaddr_copy = 0; - int weight = 0; - String device_code = ""; - int phase = 0; - - int x = 0; //x坐标 - int y = 0; //y坐标 - int angle = 0; //角度 - int electric_qty = 0; //电量 - int status = 0; //三色灯状态 - int error = 0; //车辆故障 - - int last_x = 0; - int last_y = 0; - int last_angle = 0; - int last_electric_qty = 0; - int last_status = 0; - int last_error = 0; - public synchronized void processSocket(int[] arr) throws Exception { - device_code = this.getDeviceCode(); - logServer.deviceLogToacs(this.device_code,"","","接收AGV上报信息:" + arr); - - byte[] data = null; - phase = arr[16] * 256 + arr[17]; - // agv任务号 - int index = arr[12] * 256 + arr[13]; - //任务号 - int ikey = arr[26] * 256 + arr[27]; - //站点号 - agvaddr = arr[18] * 256 + arr[19]; - //车号 - int carno = arr[20]; - Instruction link_inst = null; - List insts = null; - boolean link_flag = false; - Device agv_device = null; - if (carno != 0) { - agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno)); - } - if (ikey != 0) { - insts = instructionService.findByLinkNum(String.valueOf(ikey)); - } - if (!ObjectUtil.isEmpty(link_inst)) { - link_flag = true; - } - log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno); - logServer.deviceLogToacs(this.device_code,"","","接收AGV上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno); - - Device device = null; - String old_device_code = null; - String emptyNum = null; - String device_code = null; - - if(phase==0x67) { - //故障信息 - if(arr[18]*256+arr[19]==0){ - - } - return; - } - - //海亮专机设备空框位 - HailiangSpecialEmptyStationDeviceDriver hailiangSpecialEmptyStationDeviceDriver; - //海亮专机设备满框位 - HailiangSpecialFullStationDeviceDriver hailiangSpecialFullStationDeviceDriver; - //海亮专机设备接框位 - HailiangSpecialPickStationDeviceDriver hailiangSpecialPickStationDeviceDriver; - //海亮专机设备倒料位 - HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver; - //自动缓存线 - HailiangAutoCacheLineDeviceDriver hailiangAutoCacheLineDeviceDriver; - //清洗倒料 - HailiangCleaningMachineStorageStationDeviceDriver hailiangCleaningMachineStorageStationDeviceDriver; - - //开始任务/上报订单号 - if (phase == 0x02) { - for (Instruction inst : insts) { - inst.setCarno(String.valueOf(carno)); - instructionService.update(inst); - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //到达取货点1 - } else if (phase == 0x03) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getStart_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialFullStationDeviceDriver) { - hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialFullStationDeviceDriver.setAgvphase(phase); - hailiangSpecialFullStationDeviceDriver.setIndex(index); - hailiangSpecialFullStationDeviceDriver.setInst(inst); - } - } - } - - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - } else if (phase == 0x65) {//param,重量待定 - //1、得到重量信息 - int weight = (arr[18] * 256 + arr[19]) * 10; - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - // 4010 待处理 - if (StrUtil.equals(inst.getStart_device_code(), device_code)) { - inst.setWeight(String.valueOf(weight)); - } - } - data = AgvService.sendAgvTwoModeInst(phase, index, 0); - - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //取货完毕/取满框完毕1/点对点取货完毕 - } else if (phase == 0x64) {//param,agv货位id待定 - //1、根据货位id找到对应三工位设备,赋给agv属性地址对应的满料位设备 - agvaddr = arr[18] * 256 + arr[19]; - agvaddr_copy = agvaddr; - data = AgvService.sendAgvTwoModeInst(phase, index, 0); - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //取货点1取货完毕 - } else if (phase == 0x05) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - - if (StrUtil.equals(inst.getStart_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialFullStationDeviceDriver) { - hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialFullStationDeviceDriver.setAgvphase(phase); - hailiangSpecialFullStationDeviceDriver.setIndex(index); - hailiangSpecialFullStationDeviceDriver.setInst(inst); - } - } - - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //到达取货点2 - } else if (phase == 0x07) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getStart_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialFullStationDeviceDriver) { - hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialFullStationDeviceDriver.setAgvphase(phase); - hailiangSpecialFullStationDeviceDriver.setIndex(index); - hailiangSpecialFullStationDeviceDriver.setInst(inst); - } - } - - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //取货点2取货完毕 - } else if (phase == 0x09) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getStart_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialFullStationDeviceDriver) { - hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialFullStationDeviceDriver.setAgvphase(phase); - hailiangSpecialFullStationDeviceDriver.setIndex(index); - hailiangSpecialFullStationDeviceDriver.setInst(inst); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //自动缓存线--到达送满框1 - } else if (phase == 0x0A) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - - - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - - //到达倒料点1 - } else if (phase == 0x0B) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - - if (StrUtil.equals(inst.getPut_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) { - hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialPourStationDeviceDriver.setAgvphase(phase); - hailiangSpecialPourStationDeviceDriver.setIndex(index); - hailiangSpecialPourStationDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { - hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); - hailiangCleaningMachineStorageStationDeviceDriver.setAgvphase(phase); - hailiangCleaningMachineStorageStationDeviceDriver.setIndex(index); - hailiangCleaningMachineStorageStationDeviceDriver.setInst(inst); - } - } - - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //自动缓存线--送满框完毕1 - } else if (phase == 0x0C) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getPut_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialEmptyStationDeviceDriver) { - hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); - if (hailiangSpecialEmptyStationDeviceDriver.getMove() == 0 - && hailiangSpecialEmptyStationDeviceDriver.getError() == 0 && - hailiangSpecialEmptyStationDeviceDriver.getAllready() == 1) { - inst.setExecute_status("4"); - instructionService.update(inst); - data = AgvService.sendAgvTwoModeInst(phase, index, 0); - } else { - log.info("AGV请求放货设备{}条件不满足,无法反馈", device_code); - } - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //倒料点1倒料完毕 - } else if (phase == 0x0D) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - - if (StrUtil.equals(inst.getPut_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) { - hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialPourStationDeviceDriver.setAgvphase(phase); - hailiangSpecialPourStationDeviceDriver.setIndex(index); - hailiangSpecialPourStationDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { - hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); - hailiangCleaningMachineStorageStationDeviceDriver.setAgvphase(phase); - hailiangCleaningMachineStorageStationDeviceDriver.setIndex(index); - hailiangCleaningMachineStorageStationDeviceDriver.setInst(inst); - } - - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //自动缓存线--到达取空框1 - } else if (phase == 0x0E) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //到达倒料点2 - } else if (phase == 0x0F) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - - if (StrUtil.equals(inst.getPut_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) { - hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialPourStationDeviceDriver.setAgvphase(phase); - hailiangSpecialPourStationDeviceDriver.setIndex(index); - hailiangSpecialPourStationDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { - hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); - hailiangCleaningMachineStorageStationDeviceDriver.setAgvphase(phase); - hailiangCleaningMachineStorageStationDeviceDriver.setIndex(index); - hailiangCleaningMachineStorageStationDeviceDriver.setInst(inst); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //倒料点2倒料完毕 - } else if (phase == 0x11) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getPut_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) { - hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialPourStationDeviceDriver.setAgvphase(phase); - hailiangSpecialPourStationDeviceDriver.setIndex(index); - hailiangSpecialPourStationDeviceDriver.setInst(inst); - } - if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { - hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver(); - hailiangCleaningMachineStorageStationDeviceDriver.setAgvphase(phase); - hailiangCleaningMachineStorageStationDeviceDriver.setIndex(index); - hailiangCleaningMachineStorageStationDeviceDriver.setInst(inst); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //到达送箱点1 - } else if (phase == 0x13) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getNext_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialEmptyStationDeviceDriver) { - hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialEmptyStationDeviceDriver.setAgvphase(phase); - hailiangSpecialEmptyStationDeviceDriver.setIndex(index); - hailiangSpecialEmptyStationDeviceDriver.setInst(inst); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //送箱点1送箱完毕 - } else if (phase == 0x15) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getNext_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialEmptyStationDeviceDriver) { - hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialEmptyStationDeviceDriver.setAgvphase(phase); - hailiangSpecialEmptyStationDeviceDriver.setIndex(index); - hailiangSpecialEmptyStationDeviceDriver.setInst(inst); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //到达送箱点2 - } else if (phase == 0x17) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - if (StrUtil.equals(inst.getNext_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialEmptyStationDeviceDriver) { - hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialEmptyStationDeviceDriver.setAgvphase(phase); - hailiangSpecialEmptyStationDeviceDriver.setIndex(index); - hailiangSpecialEmptyStationDeviceDriver.setInst(inst); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //送箱完毕/送空框完毕2 - } else if (phase == 0x19) { - if (agvaddr == 0) { - agvaddr = agvaddr_copy; - } - if (agvaddr < 1) { - log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr); - return; - } - device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - device = deviceAppService.findDeviceByCode(device_code); - - if (ObjectUtil.isEmpty(device_code)) { - log.info(agvaddr + "对应设备号为空!"); - return; - } - for (Instruction inst : insts) { - //校验agv上报站点编号与指令起始点相同 - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到关联编号{}对应的指令", ikey); - break; - } - - if (StrUtil.equals(inst.getNext_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof HailiangSpecialEmptyStationDeviceDriver) { - hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver(); - hailiangSpecialEmptyStationDeviceDriver.setAgvphase(phase); - hailiangSpecialEmptyStationDeviceDriver.setIndex(index); - hailiangSpecialEmptyStationDeviceDriver.setInst(inst); - } - } - } - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - //自动缓存线--到达送满框1 - } else if (phase == 0x0A) { - - //到达倒料点1 - } else if (phase == 0x0B) { - - ///自动缓存线--送满框完毕1 - } else if (phase == 0x0C) { - - //倒料完毕 - } else if (phase == 0x0D) { - - //自动缓存线--到达取空框1 - } else if (phase == 0x0E) { - - //到达倒料点2 - } else if (phase == 0x0F) { - - //自动缓存线--取空框完毕1 - } else if (phase == 0x10) { - - //自动缓存线--到达送满框2 - } else if (phase == 0x21) { - - //自动缓存线--送满框完毕2 - } else if (phase == 0x23) { - - //自动缓存线--到达取空框2 - } else if (phase == 0x25) { - - //自动缓存线--取空框完毕2 - } else if (phase == 0x27) { - - //请求删除任务 - } else if (phase == 0x30) { - - data = AgvService.sendAgvTwoModeInst(143, index, 0); - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data); - - } else if (phase == 0x71){ - x = ikey; - if (x != last_x){ - logServer.deviceLog(this.device_code, "x", String.valueOf(x)); - } - } else if (phase == 0x72){ - y = ikey; - if (y != last_y){ - logServer.deviceLog(this.device_code, "y", String.valueOf(y)); - } - } else if (phase == 0x73){ - angle = last_angle; - if (angle != last_angle){ - logServer.deviceLog(this.device_code, "angle", String.valueOf(angle)); - } - } else if (phase == 0x74){ - electric_qty = ikey; - if (electric_qty != last_electric_qty){ - logServer.deviceLog(this.device_code, "electric_qty", String.valueOf(electric_qty)); - } - } else if (phase == 0x75){ - status = ikey; - if (status != last_status){ - logServer.deviceLog(this.device_code, "status", String.valueOf(status)); - } - } else if (phase == 0x76){ - error = ikey; - if (error != last_error){ - logServer.deviceLog(this.device_code, "error", String.valueOf(error)); - } - } - - if (!ObjectUtil.isEmpty(data)) { - NDCSocketConnectionAutoRun.write(data); - } - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDefination.java deleted file mode 100644 index eda087b..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮专自动缓存线 - */ -@Service -public class HailiangAutoCacheLineDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_auto_cache_line"; - } - - @Override - public String getDriverName() { - return "海亮-自动缓存线"; - } - - @Override - public String getDriverDescription() { - return "海亮-自动缓存线"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangAutoCacheLineDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangAutoCacheLineDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java deleted file mode 100644 index b92345d..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java +++ /dev/null @@ -1,512 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line; - -import cn.hutool.core.util.StrUtil; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮自动缓存线 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - TaskService taskserver = SpringContextHolder.getBean(TaskService.class); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - - int mode = 0; - int error = 0; - int move = 0; - int task = 0; - - //开始条码匹配 - int matching_barcode = 0; - //准备位就绪 - int prepare_ready = 0; - //对接位入箱就绪 - int in_ready = 0; - //对接位入箱完成 - int in_finish = 0; - //对接位出箱就绪 - int out_ready = 0; - //任务完成 - int task_finish = 0; - //盘点中 - int checking = 0; - //盘点完成 - int check_finish =0; - //盘点强制完成 - int check_compel_finish =0; - //匹配条码失败 - int matching_barcode_fail =0; - //专机暂停 - int pause = 0; - //提升机条码目的层 - int hoist_target_layer =0; - //任务类型 - int task_type =0; - - int material_spec1,material_spec2,material_spec3,material_spec4,material_spec5,material_spec6,material_spec7, - material_spec8,material_spec9,material_spec10; - - //准备位条码 - int prepare_barcode =0; - //对接位条码 - int docking_barcode =0; - //提升机条码 - int hoist_barcode =0; - - int one_floor_barcode1,one_floor_barcode2,one_floor_barcode3,one_floor_barcode4,one_floor_barcode5,one_floor_barcode6, - one_floor_barcode7,one_floor_barcode8,one_floor_barcode9,one_floor_barcode10; - - int two_floor_barcode1,two_floor_barcode2,two_floor_barcode3,two_floor_barcode4,two_floor_barcode5,two_floor_barcode6, - two_floor_barcode7,two_floor_barcode8,two_floor_barcode9,two_floor_barcode10; - - int three_floor_barcode1,three_floor_barcode2,three_floor_barcode3,three_floor_barcode4,three_floor_barcode5, - three_floor_barcode6,three_floor_barcode7,three_floor_barcode8,three_floor_barcode9,three_floor_barcode10; - - - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int last_task_finish = 0; - int last_task = 0; - //开始条码匹配 - int last_matching_barcode = 0; - //准备位就绪 - int last_prepare_ready = 0; - //对接位入箱就绪 - int last_in_ready = 0; - //对接位入箱完成 - int last_in_finish = 0; - //对接位出箱就绪 - int last_out_ready = 0; - //盘点中 - int last_checking = 0; - //盘点完成 - int last_check_finish =0; - //盘点强制完成 - int last_check_compel_finish =0; - //匹配条码失败 - int last_matching_barcode_fail =0; - //专机暂停 - int last_pause = 0; - //提升机条码目的层 - int last_hoist_target_layer =0; - //任务类型 - int last_task_type =0; - - - int hasGoods = 0; - Boolean isonline = false; - Boolean iserror = false; - Boolean task_finish_flag = false; - String material_spec = null; - String last_material_spec = null; - - boolean requireSucess = false; - - int one_barcode1,one_barcode2,one_barcode3,one_barcode4,one_barcode5,one_barcode6,one_barcode7,one_barcode8, - one_barcode9,one_barcode10; - int two_barcode1,two_barcode2,two_barcode3,two_barcode4,two_barcode5,two_barcode6,two_barcode7,two_barcode8, - two_barcode9,two_barcode10; - int three_barcode1,three_barcode2,three_barcode3,three_barcode4,three_barcode5,three_barcode6,three_barcode7, - three_barcode8,three_barcode9,three_barcode10; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - String device_code; - //agv 执行动作 - int agv_phase =0 ; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - error = this.itemProtocol.getError(); - mode = this.itemProtocol.getMode(); - hasGoods = this.itemProtocol.getItem_move(); - task = this.itemProtocol.getTask(); - matching_barcode = this.itemProtocol.getItem_matching_barcode(); - prepare_ready = this.itemProtocol.getItem_prepare_ready(); - in_ready = this.itemProtocol.getItem_in_ready(); - in_finish = this.itemProtocol.getItem_in_finish(); - out_ready = this.itemProtocol.getItem_out_ready(); - task_finish = this.itemProtocol.getItem_task_finish(); - checking = this.itemProtocol.getItem_checking(); - check_finish = this.itemProtocol.getItem_check_finish(); - check_compel_finish = this.itemProtocol.getItem_check_compel_finish(); - matching_barcode_fail = this.itemProtocol.getItem_matching_barcode_fail(); - pause = this.itemProtocol.getItem_pause(); - hoist_target_layer = this.itemProtocol.getItem_hoist_target_layer(); - task_type = this.itemProtocol.getItem_task_type(); - material_spec1 = this.itemProtocol.getItem_material_spec1(); - material_spec2 = this.itemProtocol.getItem_material_spec2(); - material_spec3 = this.itemProtocol.getItem_material_spec3(); - material_spec4 = this.itemProtocol.getItem_material_spec4(); - material_spec5 = this.itemProtocol.getItem_material_spec5(); - material_spec6 = this.itemProtocol.getItem_material_spec6(); - material_spec7 = this.itemProtocol.getItem_material_spec7(); - material_spec8 = this.itemProtocol.getItem_material_spec8(); - material_spec9 = this.itemProtocol.getItem_material_spec9(); - material_spec10 = this.itemProtocol.getItem_material_spec10(); - prepare_barcode = this.itemProtocol.getItem_prepare_barcode(); - docking_barcode = this.itemProtocol.getItem_docking_barcode(); - hoist_barcode = this.itemProtocol.getItem_hoist_barcode(); - one_floor_barcode1 = this.itemProtocol.getItem_one_floor_barcode1(); - one_floor_barcode2 = this.itemProtocol.getItem_one_floor_barcode2(); - one_floor_barcode3 = this.itemProtocol.getItem_one_floor_barcode3(); - one_floor_barcode4 = this.itemProtocol.getItem_one_floor_barcode4(); - one_floor_barcode5 = this.itemProtocol.getItem_one_floor_barcode5(); - one_floor_barcode6 = this.itemProtocol.getItem_one_floor_barcode6(); - one_floor_barcode7 = this.itemProtocol.getItem_one_floor_barcode7(); - one_floor_barcode8 = this.itemProtocol.getItem_one_floor_barcode8(); - one_floor_barcode9 = this.itemProtocol.getItem_one_floor_barcode9(); - one_floor_barcode10 = this.itemProtocol.getItem_one_floor_barcode10(); - two_floor_barcode1 = this.itemProtocol.getItem_two_floor_barcode1(); - two_floor_barcode2 = this.itemProtocol.getItem_two_floor_barcode2(); - two_floor_barcode3 = this.itemProtocol.getItem_two_floor_barcode3(); - two_floor_barcode4 = this.itemProtocol.getItem_two_floor_barcode4(); - two_floor_barcode5 = this.itemProtocol.getItem_two_floor_barcode5(); - two_floor_barcode6 = this.itemProtocol.getItem_two_floor_barcode6(); - two_floor_barcode7 = this.itemProtocol.getItem_two_floor_barcode7(); - two_floor_barcode8 = this.itemProtocol.getItem_two_floor_barcode8(); - two_floor_barcode9 = this.itemProtocol.getItem_two_floor_barcode9(); - two_floor_barcode10 = this.itemProtocol.getItem_two_floor_barcode10(); - three_floor_barcode1 = this.itemProtocol.getItem_three_floor_barcode1(); - three_floor_barcode2 = this.itemProtocol.getItem_three_floor_barcode2(); - three_floor_barcode3 = this.itemProtocol.getItem_three_floor_barcode3(); - three_floor_barcode4 = this.itemProtocol.getItem_three_floor_barcode4(); - three_floor_barcode5 = this.itemProtocol.getItem_three_floor_barcode5(); - three_floor_barcode6 = this.itemProtocol.getItem_three_floor_barcode6(); - three_floor_barcode7 = this.itemProtocol.getItem_three_floor_barcode7(); - three_floor_barcode8 = this.itemProtocol.getItem_three_floor_barcode8(); - three_floor_barcode9 = this.itemProtocol.getItem_three_floor_barcode9(); - three_floor_barcode10 = this.itemProtocol.getItem_three_floor_barcode10(); - - material_spec = stringToascii(material_spec1)+stringToascii(material_spec2)+stringToascii(material_spec3) - +stringToascii(material_spec4)+stringToascii(material_spec5)+stringToascii(material_spec6)+ - stringToascii(material_spec7)+stringToascii(material_spec8)+stringToascii(material_spec9)+ - stringToascii(material_spec10); - - if(StrUtil.equals(material_spec,last_material_spec)){ - logServer.deviceLog(this.device_code,"material_spec" ,String.valueOf(material_spec)); - logServer.deviceLogToacs(this.device_code,"","","信号material_spec:" + last_material_spec + "->" + material_spec); - } - - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess); - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - if (move == 0) { - thingToNothing(); - } - logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); - logServer.deviceLogToacs(this.device_code,"","","信号move:" + last_move + "->" + move); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - if(task_finish != last_task_finish){ - if(task_finish == 1){ - writing("item_to_task_finish","1"); - } - logServer.deviceLog(this.device_code,"task_finish" ,String.valueOf(task_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号task_finish:" + last_task_finish + "->" + task_finish); - } - - - if (task != last_task) { - logServer.deviceLog(this.device_code,"task" ,String.valueOf(task)); - logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task); - } - if (matching_barcode != last_matching_barcode) { - logServer.deviceLog(this.device_code,"matching_barcode" ,String.valueOf(matching_barcode)); - logServer.deviceLogToacs(this.device_code,"","","信号matching_barcode:" + last_matching_barcode + "->" + matching_barcode); - } - if (prepare_ready != last_prepare_ready) { - logServer.deviceLog(this.device_code,"prepare_ready" ,String.valueOf(prepare_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号prepare_ready:" + last_prepare_ready + "->" + prepare_ready); - } - if (in_ready != last_in_ready) { - logServer.deviceLog(this.device_code,"in_ready" ,String.valueOf(in_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号in_ready:" + last_in_ready + "->" + in_ready); - } - if (in_finish != last_in_finish) { - logServer.deviceLog(this.device_code,"in_finish" ,String.valueOf(in_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号in_finish:" + last_in_finish + "->" + in_finish); - } - if (out_ready != last_out_ready) { - logServer.deviceLog(this.device_code,"out_ready" ,String.valueOf(out_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号out_ready:" + last_out_ready + "->" + out_ready); - } - if (checking != last_checking) { - logServer.deviceLog(this.device_code,"checking" ,String.valueOf(checking)); - logServer.deviceLogToacs(this.device_code,"","","信号checking:" + last_checking + "->" + checking); - } - if (check_finish != last_check_finish) { - logServer.deviceLog(this.device_code,"check_finish" ,String.valueOf(check_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号check_finish:" + last_check_finish + "->" + check_finish); - } - if (check_compel_finish != last_check_compel_finish) { - logServer.deviceLog(this.device_code,"check_compel_finish" ,String.valueOf(check_compel_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号check_compel_finish:" + last_check_compel_finish + "->" + check_compel_finish); - } - if (matching_barcode_fail != last_matching_barcode_fail) { - logServer.deviceLog(this.device_code,"matching_barcode_fail" ,String.valueOf(matching_barcode_fail)); - logServer.deviceLogToacs(this.device_code,"","","信号matching_barcode_fail:" + last_matching_barcode_fail + "->" + matching_barcode_fail); - } - if (pause != last_pause) { - logServer.deviceLog(this.device_code,"pause" ,String.valueOf(pause)); - logServer.deviceLogToacs(this.device_code,"","","信号pause:" + last_pause + "->" + pause); - } - if (hoist_target_layer != last_hoist_target_layer) { - logServer.deviceLog(this.device_code,"hoist_target_layer" ,String.valueOf(hoist_target_layer)); - logServer.deviceLogToacs(this.device_code,"","","信号hoist_target_layer:" + last_hoist_target_layer + "->" + hoist_target_layer); - } - if (task_type != last_task_type) { - logServer.deviceLog(this.device_code,"task_type" ,String.valueOf(task_type)); - logServer.deviceLogToacs(this.device_code,"","","信号task_type:" + last_task_type + "->" + task_type); - } - - - - if( prepare_ready == 1 && move ==0 && in_ready ==0 && in_finish ==0 && ( agv_phase==0x0A || agv_phase==0x21) ){ - -// if(this.准备位条码==this.条码异常值) -// { -// debug(d.getID()+" 准备位条码异常"); -// return; -// } - writing("item_to_agv_put_ready","1"); - - } - - - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - message = "信号量同步异常"; - //未联机 - } else if (mode == 0) { - message = "未联机"; - //有报警 - } else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - } - - - - - - last_mode = mode; - last_error = error; - last_move = move; - last_task = task; - last_task_finish = task_finish; - last_material_spec = material_spec; - last_matching_barcode = matching_barcode; - last_prepare_ready = prepare_ready; - last_in_ready = in_ready; - last_in_finish = in_finish; - last_out_ready = out_ready; - last_checking = checking; - last_check_finish =check_finish; - last_check_compel_finish =check_compel_finish; - last_matching_barcode_fail =matching_barcode_fail; - last_pause = pause; - last_hoist_target_layer =hoist_target_layer; - last_task_type =task_type; - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - } - - public void writing(int command) {} - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - - } - - - public String stringToascii(int num) - { - String str=""; - switch (num) - { - case 48: str="0";break; - case 49: str="1";break; - case 50: str="2";break; - case 51: str="3";break; - case 52: str="4";break; - case 53: str="5";break; - case 54: str="6";break; - case 55: str="7";break; - case 56: str="8";break; - case 57: str="9";break; - case 65: str="A";break; - case 66: str="B";break; - case 67: str="C";break; - case 68: str="D";break; - case 69: str="E";break; - case 70: str="F";break; - case 71: str="G";break; - case 72: str="H";break; - case 73: str="I";break; - case 74: str="J";break; - case 75: str="K";break; - case 76: str="L";break; - case 77: str="M";break; - case 78: str="N";break; - case 79: str="O";break; - case 80: str="P";break; - case 81: str="Q";break; - case 82: str="R";break; - case 83: str="S";break; - case 84: str="T";break; - case 85: str="U";break; - case 86: str="V";break; - case 87: str="W";break; - case 88: str="X";break; - case 89: str="Y";break; - case 90: str="Z";break; - case 97: str="a";break; - case 98: str="b";break; - case 99: str="c";break; - case 100: str="d";break; - case 101: str="e";break; - case 102: str="f";break; - case 103: str="g";break; - case 104: str="h";break; - case 105: str="i";break; - case 106: str="j";break; - case 107: str="k";break; - case 108: str="l";break; - case 109: str="m";break; - case 110: str="n";break; - case 111: str="o";break; - case 112: str="p";break; - case 113: str="q";break; - case 114: str="r";break; - case 115: str="s";break; - case 116: str="t";break; - case 117: str="u";break; - case 118: str="v";break; - case 119: str="w";break; - case 120: str="x";break; - case 121: str="y";break; - case 122: str="z";break; - - case 40: str="(";break; - case 41: str=")";break; - case 43: str="+";break; - case 45: str="-";break; - case 47: str="/";break; - case 91: str="[";break; - case 93: str="]";break; - case 95: str="_";break; - default: str="*"; - } - return str; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/ItemProtocol.java deleted file mode 100644 index dd951b7..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/ItemProtocol.java +++ /dev/null @@ -1,682 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_error = "error"; - //开始条码匹配 - public static String item_matching_barcode = "matching_barcode"; - //对接位有货 - public static String item_move = "move"; - //准备位就绪 - public static String item_prepare_ready = "prepare_ready"; - //对接位入箱就绪 - public static String item_in_ready = "in_ready"; - //对接位入箱完成 - public static String item_in_finish = "in_finish"; - //对接位出箱就绪 - public static String item_out_ready = "out_ready"; - //任务完成 - public static String item_task_finish = "task_finish"; - //盘点中 - public static String item_checking = "checking"; - //盘点完成 - public static String item_check_finish = "check_finish"; - //盘点强制完成 - public static String item_check_compel_finish = "check_compel_finish"; - //匹配条码失败 - public static String item_matching_barcode_fail = "matching_barcode_fail"; - //专机暂停 - public static String item_pause = "pause"; - //提升机条码目的层 - public static String item_hoist_target_layer = "hoist_target_layer"; - //任务类型 - public static String item_task_type = "task_type"; - //物料规格 - public static String item_material_spec1= "material_spec1"; - - public static String item_material_spec2= "material_spec2"; - - public static String item_material_spec3= "material_spec3"; - - public static String item_material_spec4= "material_spec4"; - - public static String item_material_spec5= "material_spec5"; - - public static String item_material_spec6= "material_spec6"; - - public static String item_material_spec7= "material_spec7"; - - public static String item_material_spec8= "material_spec8"; - - public static String item_material_spec9= "material_spec9"; - - public static String item_material_spec10= "material_spec10"; - //准备位条码 - public static String item_prepare_barcode = "prepare_barcode"; - //对接位条码 - public static String item_docking_barcode = "docking_barcode"; - //任务号 - public static String item_task = "task"; - //提升机条码 - public static String item_hoist_barcode = "hoist_barcode"; - - - //一层条码 - public static String item_one_floor_barcode1 = "one_floor_barcode1"; - - public static String item_one_floor_barcode2 = "one_floor_barcode2"; - - public static String item_one_floor_barcode3 = "one_floor_barcode3"; - - public static String item_one_floor_barcode4 = "one_floor_barcode4"; - - public static String item_one_floor_barcode5 = "one_floor_barcode5"; - - public static String item_one_floor_barcode6 = "one_floor_barcode6"; - - public static String item_one_floor_barcode7 = "one_floor_barcode7"; - - public static String item_one_floor_barcode8 = "one_floor_barcode8"; - - public static String item_one_floor_barcode9 = "one_floor_barcode9"; - - public static String item_one_floor_barcode10 = "one_floor_barcode10"; - //二层条码 - public static String item_two_floor_barcode1 = "two_floor_barcode1"; - - public static String item_two_floor_barcode2 = "two_floor_barcode2"; - - public static String item_two_floor_barcode3 = "two_floor_barcode3"; - - public static String item_two_floor_barcode4 = "two_floor_barcode4"; - - public static String item_two_floor_barcode5 = "two_floor_barcode5"; - - public static String item_two_floor_barcode6 = "two_floor_barcode6"; - - public static String item_two_floor_barcode7 = "two_floor_barcode7"; - - public static String item_two_floor_barcode8 = "two_floor_barcode8"; - - public static String item_two_floor_barcode9 = "two_floor_barcode9"; - - public static String item_two_floor_barcode10 = "two_floor_barcode10"; - //三层条码 - public static String item_three_floor_barcode1 = "three_floor_barcode1"; - - public static String item_three_floor_barcode2 = "three_floor_barcode2"; - - public static String item_three_floor_barcode3 = "three_floor_barcode3"; - - public static String item_three_floor_barcode4 = "three_floor_barcode4"; - - public static String item_three_floor_barcode5 = "three_floor_barcode5"; - - public static String item_three_floor_barcode6 = "three_floor_barcode6"; - - public static String item_three_floor_barcode7 = "three_floor_barcode7"; - - public static String item_three_floor_barcode8 = "three_floor_barcode8"; - - public static String item_three_floor_barcode9 = "three_floor_barcode9"; - - public static String item_three_floor_barcode10 = "three_floor_barcode10"; - - //设备开关 - public static String item_to_open = "to_open"; - //开始匹配条码 - public static String item_to_open_check_barcode = "to_open_check_barcode"; - //任务类型 - public static String item_to_task_type = "to_task_type"; - //放货就绪 - public static String item_to_agv_put_ready = "to_agv_put_ready"; - //放货完成 - public static String item_to_agv_put_finish = "to_agv_put_finish"; - //准备位到对接位 - public static String item_to_prepare_docking = "to_prepare_docking"; - //取货就绪 - public static String item_to_agv_get_ready = "to_agv_get_ready"; - //放货完成 - public static String item_to_agv_get_finish = "to_agv_get_finish"; - //任务完成 - public static String item_to_task_finish = "to_task_finish"; - //专机暂停 - public static String item_to_pause = "to_pause"; - //优先层 - public static String item_to_priority_layer = "to_priority_layer"; - //开始盘点 - public static String item_to_start_checking = "to_start_checking"; - //盘点完成清零 - public static String item_to_check_finish = "to_check_finish"; - //暂停出箱匹配 - public static String item_to_pause_out_check = "to_pause_out_check"; - - //物料规格 - public static String item_to_material_spec1= "to_material_spec1"; - - public static String item_to_material_spec2= "to_material_spec2"; - - public static String item_to_material_spec3= "to_material_spec3"; - - public static String item_to_material_spec4= "to_material_spec4"; - - public static String item_to_material_spec5= "to_material_spec5"; - - public static String item_to_material_spec6= "to_material_spec6"; - - public static String item_to_material_spec7= "to_material_spec7"; - - public static String item_to_material_spec8= "to_material_spec8"; - - public static String item_to_material_spec9= "to_material_spec9"; - - public static String item_to_material_spec10= "to_material_spec10"; - - public static String item_to_material_spec11= "to_material_spec11"; - - public static String item_to_material_spec12= "to_material_spec12"; - - public static String item_to_material_spec13= "to_material_spec13"; - - public static String item_to_material_spec14= "to_material_spec14"; - - public static String item_to_material_spec15= "to_material_spec15"; - - public static String item_to_material_spec16= "to_material_spec16"; - - public static String item_to_material_spec17= "to_material_spec17"; - - public static String item_to_material_spec18= "to_material_spec18"; - - public static String item_to_material_spec19= "to_material_spec19"; - - public static String item_to_material_spec20= "to_material_spec20"; - - //准备位条码准备 - public static String item_to_prepare_barcode_write = "to_prepare_barcode_write"; - //对接位条码准备 - public static String item_to_docking_barcode_write = "to_docking_barcode_write"; - //任务号 - public static String item_to_task = "to_task"; - //条码 - public static String item_to_barcode1 = "to_barcode1"; - - public static String item_to_barcode2 = "to_barcode2"; - - public static String item_to_barcode3 = "to_barcode3"; - - public static String item_to_barcode4 = "to_barcode4"; - - public static String item_to_barcode5 = "to_barcode5"; - - public static String item_to_barcode6 = "to_barcode6"; - - public static String item_to_barcode7 = "to_barcode7"; - - public static String item_to_barcode8 = "to_barcode8"; - - public static String item_to_barcode9 = "to_barcode9"; - - public static String item_to_barcode10 = "to_barcode10"; - - public static String item_to_barcode11 = "to_barcode11"; - - public static String item_to_barcode12 = "to_barcode12"; - - public static String item_to_barcode13 = "to_barcode13"; - - public static String item_to_barcode14 = "to_barcode14"; - - public static String item_to_barcode15 = "to_barcode15"; - - public static String item_to_barcode16 = "to_barcode16"; - - public static String item_to_barcode17 = "to_barcode17"; - - public static String item_to_barcode18 = "to_barcode18"; - - public static String item_to_barcode19 = "to_barcode19"; - - public static String item_to_barcode20 = "to_barcode20"; - - public static String item_to_barcode21 = "to_barcode21"; - - public static String item_to_barcode22 = "to_barcode22"; - - public static String item_to_barcode23 = "to_barcode23"; - - public static String item_to_barcode24 = "to_barcode24"; - - public static String item_to_barcode25 = "to_barcode25"; - - public static String item_to_barcode26 = "to_barcode26"; - - public static String item_to_barcode27 = "to_barcode27"; - - public static String item_to_barcode28 = "to_barcode28"; - - public static String item_to_barcode29 = "to_barcode29"; - - public static String item_to_barcode30 = "to_barcode30"; - - - - private HailiangAutoCacheLineDeviceDriver driver; - - public ItemProtocol(HailiangAutoCacheLineDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getTask() { - return this.getOpcIntegerValue(item_task); - } - - public int getItem_matching_barcode() { - return this.getOpcIntegerValue(item_matching_barcode); - } - - public int getItem_move() { - return this.getOpcIntegerValue(item_move); - } - - public int getItem_prepare_ready() { - return this.getOpcIntegerValue(item_prepare_ready); - } - - public int getItem_in_ready() { - return this.getOpcIntegerValue(item_in_ready); - } - - public int getItem_in_finish() { - return this.getOpcIntegerValue(item_in_finish); - } - - public int getItem_out_ready() { - return this.getOpcIntegerValue(item_out_ready); - } - - public int getItem_task_finish() { - return this.getOpcIntegerValue(item_task_finish); - } - - public int getItem_checking() { - return this.getOpcIntegerValue(item_checking); - } - - public int getItem_check_finish() { - return this.getOpcIntegerValue(item_check_finish); - } - - public int getItem_check_compel_finish() { - return this.getOpcIntegerValue(item_check_compel_finish); - } - - public int getItem_matching_barcode_fail() { - return this.getOpcIntegerValue(item_matching_barcode_fail); - } - - public int getItem_pause() { - return this.getOpcIntegerValue(item_pause); - } - - public int getItem_hoist_target_layer() { - return this.getOpcIntegerValue(item_hoist_target_layer); - } - - public int getItem_task_type() { - return this.getOpcIntegerValue(item_task_type); - } - - public int getItem_material_spec1() { - return this.getOpcIntegerValue(item_material_spec1); - } - - public int getItem_material_spec2() { - return this.getOpcIntegerValue(item_material_spec2); - } - - public int getItem_material_spec3() { - return this.getOpcIntegerValue(item_material_spec3); - } - - public int getItem_material_spec4() { - return this.getOpcIntegerValue(item_material_spec4); - } - - public int getItem_material_spec5() { - return this.getOpcIntegerValue(item_material_spec5); - } - - public int getItem_material_spec6() { - return this.getOpcIntegerValue(item_material_spec6); - } - - public int getItem_material_spec7() { - return this.getOpcIntegerValue(item_material_spec7); - } - - public int getItem_material_spec8() { - return this.getOpcIntegerValue(item_material_spec8); - } - - public int getItem_material_spec9() { - return this.getOpcIntegerValue(item_material_spec9); - } - - public int getItem_material_spec10() { - return this.getOpcIntegerValue(item_material_spec10); - } - - public int getItem_prepare_barcode() { - return this.getOpcIntegerValue(item_prepare_barcode); - } - - public int getItem_docking_barcode() { - return this.getOpcIntegerValue(item_docking_barcode); - } - - public int getItem_task() { - return this.getOpcIntegerValue(item_task); - } - - public int getItem_hoist_barcode() { - return this.getOpcIntegerValue(item_hoist_barcode); - } - - public int getItem_one_floor_barcode1() { - return this.getOpcIntegerValue(item_one_floor_barcode1); - } - - public int getItem_one_floor_barcode2() { - return this.getOpcIntegerValue(item_one_floor_barcode2); - } - - public int getItem_one_floor_barcode3() { - return this.getOpcIntegerValue(item_one_floor_barcode3); - } - - public int getItem_one_floor_barcode4() { - return this.getOpcIntegerValue(item_one_floor_barcode4); - } - - public int getItem_one_floor_barcode5() { - return this.getOpcIntegerValue(item_one_floor_barcode5); - } - - public int getItem_one_floor_barcode6() { - return this.getOpcIntegerValue(item_one_floor_barcode6); - } - - public int getItem_one_floor_barcode7() { - return this.getOpcIntegerValue(item_one_floor_barcode7); - } - - public int getItem_one_floor_barcode8() { - return this.getOpcIntegerValue(item_one_floor_barcode8); - } - - public int getItem_one_floor_barcode9() { - return this.getOpcIntegerValue(item_one_floor_barcode9); - } - - public int getItem_one_floor_barcode10() { - return this.getOpcIntegerValue(item_one_floor_barcode10); - } - - public int getItem_two_floor_barcode1() { - return this.getOpcIntegerValue(item_two_floor_barcode1); - } - - public int getItem_two_floor_barcode2() { - return this.getOpcIntegerValue(item_two_floor_barcode2); - } - - public int getItem_two_floor_barcode3() { - return this.getOpcIntegerValue(item_two_floor_barcode3); - } - - public int getItem_two_floor_barcode4() { - return this.getOpcIntegerValue(item_two_floor_barcode4); - } - - public int getItem_two_floor_barcode5() { - return this.getOpcIntegerValue(item_two_floor_barcode5); - } - - public int getItem_two_floor_barcode6() { - return this.getOpcIntegerValue(item_two_floor_barcode6); - } - - public int getItem_two_floor_barcode7() { - return this.getOpcIntegerValue(item_two_floor_barcode7); - } - - public int getItem_two_floor_barcode8() { - return this.getOpcIntegerValue(item_two_floor_barcode8); - } - - public int getItem_two_floor_barcode9() { - return this.getOpcIntegerValue(item_two_floor_barcode9); - } - - public int getItem_two_floor_barcode10() { - return this.getOpcIntegerValue(item_two_floor_barcode10); - } - - public int getItem_three_floor_barcode1() { - return this.getOpcIntegerValue(item_three_floor_barcode1); - } - - public int getItem_three_floor_barcode2() { - return this.getOpcIntegerValue(item_three_floor_barcode2); - } - - public int getItem_three_floor_barcode3() { - return this.getOpcIntegerValue(item_three_floor_barcode3); - } - - public int getItem_three_floor_barcode4() { - return this.getOpcIntegerValue(item_three_floor_barcode4); - } - - public int getItem_three_floor_barcode5() { - return this.getOpcIntegerValue(item_three_floor_barcode5); - } - - public int getItem_three_floor_barcode6() { - return this.getOpcIntegerValue(item_three_floor_barcode6); - } - - public int getItem_three_floor_barcode7() { - return this.getOpcIntegerValue(item_three_floor_barcode7); - } - - public int getItem_three_floor_barcode8() { - return this.getOpcIntegerValue(item_three_floor_barcode8); - } - - public int getItem_three_floor_barcode9() { - return this.getOpcIntegerValue(item_three_floor_barcode9); - } - - public int getItem_three_floor_barcode10() { - return this.getOpcIntegerValue(item_three_floor_barcode10); - } - - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_mode, "手自动状态", "DB1.B0.0", Boolean.valueOf(true))); - list.add(new ItemDto(item_matching_barcode, "开始条码匹配", "DB1.B1.0")); - list.add(new ItemDto(item_move, "对接位有货", "DB1.B1.2")); - list.add(new ItemDto(item_prepare_ready, "准备位就绪", "DB1.B1.3")); - list.add(new ItemDto(item_in_ready, "对接位入箱就绪", "DB1.B1.4")); - list.add(new ItemDto(item_in_finish, "对接位入箱完成", "DB1.B1.5")); - list.add(new ItemDto(item_out_ready, "对接位出箱就绪", "DB1.B1.6")); - list.add(new ItemDto(item_task_finish, "任务完成", "DB1.B2.0")); - list.add(new ItemDto(item_checking, "盘点中", "DB1.B2.1")); - list.add(new ItemDto(item_check_finish, "盘点完成", "DB1.B2.2")); - list.add(new ItemDto(item_check_compel_finish, "盘点强制完成", "DB1.B2.3")); - list.add(new ItemDto(item_matching_barcode_fail, "匹配条码失败", "DB1.B2.4")); - list.add(new ItemDto(item_pause, "暂停", "DB1.B2.5")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W4")); - list.add(new ItemDto(item_hoist_target_layer, "提升机条码目的层", "DB1.W6")); - list.add(new ItemDto(item_task_type, "任务类型", "DB1.W8")); - list.add(new ItemDto(item_material_spec1, "物料规格1", "DB1.W10")); - list.add(new ItemDto(item_material_spec2, "物料规格2", "DB1.W12")); - list.add(new ItemDto(item_material_spec3, "物料规格3", "DB1.W14")); - list.add(new ItemDto(item_material_spec4, "物料规格4", "DB1.W16")); - list.add(new ItemDto(item_material_spec5, "物料规格5", "DB1.W18")); - list.add(new ItemDto(item_material_spec6, "物料规格6", "DB1.W20")); - list.add(new ItemDto(item_material_spec7, "物料规格7", "DB1.W22")); - list.add(new ItemDto(item_material_spec8, "物料规格8", "DB1.W24")); - list.add(new ItemDto(item_material_spec9, "物料规格9", "DB1.W26")); - list.add(new ItemDto(item_material_spec10, "物料规格10", "DB1.W28")); - list.add(new ItemDto(item_prepare_barcode, "准备位条码", "DB1.D84")); - list.add(new ItemDto(item_docking_barcode, "对接位条码", "DB1.D88")); - list.add(new ItemDto(item_task, "任务号", "DB1.D92")); - list.add(new ItemDto(item_hoist_barcode, "提升机条码", "DB1.D96")); - list.add(new ItemDto(item_one_floor_barcode1, "一层条码1", "DB1.D124")); - list.add(new ItemDto(item_one_floor_barcode2, "一层条码2", "DB1.D128")); - list.add(new ItemDto(item_one_floor_barcode3, "一层条码3", "DB1.D132")); - list.add(new ItemDto(item_one_floor_barcode4, "一层条码4", "DB1.D136")); - list.add(new ItemDto(item_one_floor_barcode5, "一层条码5", "DB1.D140")); - list.add(new ItemDto(item_one_floor_barcode6, "一层条码6", "DB1.D144")); - list.add(new ItemDto(item_one_floor_barcode7, "一层条码7", "DB1.D148")); - list.add(new ItemDto(item_one_floor_barcode8, "一层条码8", "DB1.D152")); - list.add(new ItemDto(item_one_floor_barcode9, "一层条码9", "DB1.D156")); - list.add(new ItemDto(item_one_floor_barcode10, "一层条码10", "DB1.D160")); - list.add(new ItemDto(item_two_floor_barcode1, "二层条码1", "DB1.D164")); - list.add(new ItemDto(item_two_floor_barcode2, "二层条码2", "DB1.D168")); - list.add(new ItemDto(item_two_floor_barcode3, "二层条码3", "DB1.D172")); - list.add(new ItemDto(item_two_floor_barcode4, "二层条码4", "DB1.D176")); - list.add(new ItemDto(item_two_floor_barcode5, "二层条码5", "DB1.D180")); - list.add(new ItemDto(item_two_floor_barcode6, "二层条码6", "DB1.D184")); - list.add(new ItemDto(item_two_floor_barcode7, "二层条码7", "DB1.D188")); - list.add(new ItemDto(item_two_floor_barcode8, "二层条码8", "DB1.D192")); - list.add(new ItemDto(item_two_floor_barcode9, "二层条码9", "DB1.D196")); - list.add(new ItemDto(item_two_floor_barcode10, "二层条码10", "DB1.D200")); - list.add(new ItemDto(item_three_floor_barcode1, "三层条码1", "DB1.D204")); - list.add(new ItemDto(item_three_floor_barcode2, "三层条码2", "DB1.D208")); - list.add(new ItemDto(item_three_floor_barcode3, "三层条码3", "DB1.D212")); - list.add(new ItemDto(item_three_floor_barcode4, "三层条码4", "DB1.D216")); - list.add(new ItemDto(item_three_floor_barcode5, "三层条码5", "DB1.D220")); - list.add(new ItemDto(item_three_floor_barcode6, "三层条码6", "DB1.D224")); - list.add(new ItemDto(item_three_floor_barcode7, "三层条码7", "DB1.D228")); - list.add(new ItemDto(item_three_floor_barcode8, "三层条码8", "DB1.D232")); - list.add(new ItemDto(item_three_floor_barcode9, "三层条码9", "DB1.D236")); - list.add(new ItemDto(item_three_floor_barcode10, "三层条码10", "DB1.D240")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_open, "设备开关", "DB1.W4")); - list.add(new ItemDto(item_to_open_check_barcode, "开始匹配条码", "DB1.W6")); - list.add(new ItemDto(item_to_task_type, "任务类型", "DB1.W8")); - list.add(new ItemDto(item_to_agv_put_ready, "放货就绪", "DB1.W10")); - list.add(new ItemDto(item_to_agv_put_finish, "放货完成", "DB1.W12")); - list.add(new ItemDto(item_to_prepare_docking, "准备位到对接位", "DB1.W14")); - list.add(new ItemDto(item_to_agv_get_ready, "取货就绪", "DB1.W16")); - list.add(new ItemDto(item_to_agv_get_finish, "取货完成", "DB1.W18")); - list.add(new ItemDto(item_to_task_finish, "任务完成", "DB1.W20")); - list.add(new ItemDto(item_to_pause, "专机暂停", "DB1.W22")); - list.add(new ItemDto(item_to_priority_layer, "优先层", "DB1.W24")); - list.add(new ItemDto(item_to_start_checking, "开始盘点", "DB1.W28")); - list.add(new ItemDto(item_to_check_finish, "盘点完成清零", "DB1.W30")); - list.add(new ItemDto(item_to_pause_out_check, "暂停出箱匹配", "DB1.W34")); - list.add(new ItemDto(item_to_material_spec1, "物料规格1", "DB1.W40")); - list.add(new ItemDto(item_to_material_spec2, "物料规格2", "DB1.W42")); - list.add(new ItemDto(item_to_material_spec3, "物料规格3", "DB1.W44")); - list.add(new ItemDto(item_to_material_spec4, "物料规格4", "DB1.W46")); - list.add(new ItemDto(item_to_material_spec5, "物料规格5", "DB1.W48")); - list.add(new ItemDto(item_to_material_spec6, "物料规格6", "DB1.W50")); - list.add(new ItemDto(item_to_material_spec7, "物料规格7", "DB1.W52")); - list.add(new ItemDto(item_to_material_spec8, "物料规格8", "DB1.W54")); - list.add(new ItemDto(item_to_material_spec9, "物料规格9", "DB1.W56")); - list.add(new ItemDto(item_to_material_spec10, "物料规格10", "DB1.W58")); - list.add(new ItemDto(item_to_material_spec11, "物料规格11", "DB1.W60")); - list.add(new ItemDto(item_to_material_spec12, "物料规格12", "DB1.W62")); - list.add(new ItemDto(item_to_material_spec13, "物料规格13", "DB1.W64")); - list.add(new ItemDto(item_to_material_spec14, "物料规格14", "DB1.W66")); - list.add(new ItemDto(item_to_material_spec15, "物料规格15", "DB1.W68")); - list.add(new ItemDto(item_to_material_spec16, "物料规格16", "DB1.W70")); - list.add(new ItemDto(item_to_material_spec17, "物料规格17", "DB1.W72")); - list.add(new ItemDto(item_to_material_spec18, "物料规格18", "DB1.W74")); - list.add(new ItemDto(item_to_material_spec19, "物料规格19", "DB1.W76")); - list.add(new ItemDto(item_to_material_spec20, "物料规格20", "DB1.W78")); - list.add(new ItemDto(item_to_prepare_barcode_write, "准备位条码准备", "DB1.D84")); - list.add(new ItemDto(item_to_docking_barcode_write, "对接位条码准备", "DB1.D88")); - list.add(new ItemDto(item_to_task, "任务号", "DB1.D92")); - list.add(new ItemDto(item_to_barcode1, "条码1", "DB1.D96")); - list.add(new ItemDto(item_to_barcode2, "条码2", "DB1.D100")); - list.add(new ItemDto(item_to_barcode3, "条码3", "DB1.D104")); - list.add(new ItemDto(item_to_barcode4, "条码4", "DB1.D108")); - list.add(new ItemDto(item_to_barcode5, "条码5", "DB1.D112")); - list.add(new ItemDto(item_to_barcode6, "条码6", "DB1.D116")); - list.add(new ItemDto(item_to_barcode7, "条码7", "DB1.D120")); - list.add(new ItemDto(item_to_barcode8, "条码8", "DB1.D124")); - list.add(new ItemDto(item_to_barcode9, "条码9", "DB1.D128")); - list.add(new ItemDto(item_to_barcode10, "条码10", "DB1.D132")); - list.add(new ItemDto(item_to_barcode11, "条码11", "DB1.D136")); - list.add(new ItemDto(item_to_barcode12, "条码12", "DB1.D140")); - list.add(new ItemDto(item_to_barcode13, "条码13", "DB1.D144")); - list.add(new ItemDto(item_to_barcode14, "条码14", "DB1.D148")); - list.add(new ItemDto(item_to_barcode15, "条码15", "DB1.D152")); - list.add(new ItemDto(item_to_barcode16, "条码16", "DB1.D156")); - list.add(new ItemDto(item_to_barcode17, "条码17", "DB1.D160")); - list.add(new ItemDto(item_to_barcode18, "条码18", "DB1.D164")); - list.add(new ItemDto(item_to_barcode19, "条码19", "DB1.D168")); - list.add(new ItemDto(item_to_barcode20, "条码20", "DB1.D172")); - list.add(new ItemDto(item_to_barcode21, "条码21", "DB1.D176")); - list.add(new ItemDto(item_to_barcode22, "条码22", "DB1.D180")); - list.add(new ItemDto(item_to_barcode23, "条码23", "DB1.D184")); - list.add(new ItemDto(item_to_barcode24, "条码24", "DB1.D188")); - list.add(new ItemDto(item_to_barcode25, "条码25", "DB1.D192")); - list.add(new ItemDto(item_to_barcode26, "条码26", "DB1.D196")); - list.add(new ItemDto(item_to_barcode27, "条码27", "DB1.D200")); - list.add(new ItemDto(item_to_barcode28, "条码28", "DB1.D204")); - list.add(new ItemDto(item_to_barcode29, "条码29", "DB1.D208")); - list.add(new ItemDto(item_to_barcode30, "条码30", "DB1.D212")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDefination.java deleted file mode 100644 index c2ebf12..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_feeding_line; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮-清洗上料线体 - */ -@Service -public class HailiangCleaningFeedingLineDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_cleaning_feeding_line"; - } - - @Override - public String getDriverName() { - return "海亮-清洗上料线体"; - } - - @Override - public String getDriverDescription() { - return "海亮-清洗上料线体"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangCleaningFeedingLineDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangCleaningFeedingLineDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDriver.java deleted file mode 100644 index 4afbdf3..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDriver.java +++ /dev/null @@ -1,386 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_feeding_line; - -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * 海亮-清洗上料线体 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); - @Autowired - TaskService taskserver = SpringContextHolder.getBean(TaskService.class); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int mode = 0; //线体状态 - int is_open = 0; //是否启动 开机状态 - int in_ready = 0; //入料就绪 - int all_ready = 0; //所有设备就绪 - int task_finish = 0; //任务完成 - int allowed_in = 0; //清洗机允许上料 - int error = 0; //报警信号 - int in_pcsn = 0; //上料批次号 - //出入库模式 - int operation_type = 0; - int last_mode = 0; //线体状态 - int last_is_open = 0; //是否启动 开机状态 - int last_in_ready = 0; //入料就绪 - int last_all_ready = 0; //所有设备就绪 - int last_task_finish = 0; //任务完成 - int last_allowed_in = 0; //清洗机允许上料 - int last_error = 0; //报警信号 - int last_in_pcsn = 0; //上料批次号 - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - mode = this.itemProtocol.getItem_mode(); - is_open = this.itemProtocol.getItem_is_open(); - in_ready = this.itemProtocol.getItem_in_ready(); - all_ready = this.itemProtocol.getItem_all_ready(); - task_finish = this.itemProtocol.getItem_task_finish(); - allowed_in = this.itemProtocol.getItem_allowed_in(); - error = this.itemProtocol.getItem_error(); - in_pcsn = this.itemProtocol.getItem_in_pcsn(); - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess); - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (is_open != last_is_open) { - logServer.deviceLog(this.device_code,"is_open" ,String.valueOf(is_open)); - logServer.deviceLogToacs(this.device_code,"","","信号is_open:" + last_is_open + "->" + is_open); - } - if (in_ready != last_in_ready) { - logServer.deviceLog(this.device_code,"in_ready" ,String.valueOf(in_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号in_ready:" + last_in_ready + "->" + in_ready); - } - if (all_ready != last_all_ready) { - logServer.deviceLog(this.device_code,"all_ready" ,String.valueOf(all_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号all_ready:" + last_all_ready + "->" + all_ready); - } - if (task_finish != last_task_finish) { - logServer.deviceLog(this.device_code,"task_finish" ,String.valueOf(task_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号task_finish:" + last_task_finish + "->" + task_finish); - } - if (allowed_in != last_allowed_in) { - logServer.deviceLog(this.device_code,"allowed_in" ,String.valueOf(allowed_in)); - logServer.deviceLogToacs(this.device_code,"","","信号allowed_in:" + last_allowed_in + "->" + allowed_in); - } - if (in_pcsn != last_in_pcsn) { - logServer.deviceLog(this.device_code,"in_pcsn" ,String.valueOf(in_pcsn)); - logServer.deviceLogToacs(this.device_code,"","","信号in_pcsn:" + last_in_pcsn + "->" + in_pcsn); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - - - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 - } else if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - } else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - - if(!requireSucess){ - /* if ( mode == 1 && move != 0 && task > 0) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务"); - apply_task(); - }*/ - } - - - - } - last_mode = mode; //线体状态 - last_is_open = is_open; //是否启动 开机状态 - last_in_ready = in_ready; //入料就绪 - last_all_ready = all_ready; //所有设备就绪 - last_task_finish = task_finish; //任务完成 - last_allowed_in = allowed_in; //清洗机允许上料 - last_error = error; //报警信号 - last_in_pcsn = in_pcsn; //上料批次号 - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - logServer.deviceLogToacs(this.device_code,"","","光电信号切换,刷新请求标记:"+this.requireSucess); - - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } - -/* public synchronized boolean apply_task() throws Exception { - Boolean flag = false; - //通过路由找到所有的目标设备 - //找到当前设备生产的物料,并且判断下个工序生产的物料相同 - //判断是否已经有前往这个工位的任务 - List list = routeLineService.getShortPathLinesByCode(this.device_code,"normal"); - ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(this.device_code); - //查找当前工单对应的物料编号 - String cpbh = order.getMaterial_code(); - HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver; - //遍历路由,找到对应所有的物料进行匹配 - for(int i=0;i getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_mode, "线体状态", "DB1.X0.0")); - list.add(new ItemDto(item_is_open, "开机状态", "DB1.X0.1")); - list.add(new ItemDto(item_in_ready, "入料就绪", "DB1.X0.7")); - list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.X1.0")); - list.add(new ItemDto(item_task_finish, "任务完成", "DB1.X1.1")); - list.add(new ItemDto(item_allowed_in, "清洗机允许上料", "DB1.X1.2")); - list.add(new ItemDto(item_error, "报警信号", "DB1.w4")); - list.add(new ItemDto(item_in_pcsn, "上料批次号", "DB1.D156")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_open, "设备开关", "DB2.W4")); - list.add(new ItemDto(item_to_compel_finished, "强制完成", "DB2.W6")); - list.add(new ItemDto(item_to_dis_weight, "称重禁用", "DB2.W8")); - list.add(new ItemDto(item_to_in_confirm_req, "上料请求确认", "DB2.W40")); - list.add(new ItemDto(item_to_in_confirm_finish, "上料命令确认完毕", "DB2.W72")); - list.add(new ItemDto(item_to_confirm_finished, "确认完成", "DB2.W74")); - list.add(new ItemDto(item_to_pcsn, "批次号", "DB2.D84")); - list.add(new ItemDto(item_to_all_num, "上料总数量", "DB2.D232")); - list.add(new ItemDto(item_to_all_weight, "上料总重量", "DB2.D232")); - list.add(new ItemDto(item_to_del_task, "任务删除", "DB2.D232")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/HailiangCleaningMachineDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/HailiangCleaningMachineDefination.java deleted file mode 100644 index d570db5..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/HailiangCleaningMachineDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮清洗机 - */ -@Service -public class HailiangCleaningMachineDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_cleaning_machine"; - } - - @Override - public String getDriverName() { - return "海亮-清洗机"; - } - - @Override - public String getDriverDescription() { - return "海亮-清洗机"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangCleaningMachineDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangCleaningMachineDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/HailiangCleaningMachineDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/HailiangCleaningMachineDeviceDriver.java deleted file mode 100644 index c5b2763..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine/HailiangCleaningMachineDeviceDriver.java +++ /dev/null @@ -1,426 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮清洗机 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangCleaningMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); - @Autowired - TaskService taskserver = SpringContextHolder.getBean(TaskService.class); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int running = 0; //是否运行 - int prepare = 0; //是否准备 - int ready = 0; //是否就绪 - int order_finish = 0; //订单完成 - int error = 0; //报警信号 - int open_ready_time = 0; //开机准备时间(S) - int device_running_time = 0; //设备运转时间(S) - int await_time = 0; //待机时间(S) - int order = 0; //工单号 - int order_real_time = 0; //订单实时 - int is_start = 0; //是否开始 - int pause = 0; //是否暂停 - //出入库模式 - int operation_type = 0; - int last_running = 0; //是否运行 - int last_prepare = 0; //是否准备 - int last_ready = 0; //是否就绪 - int last_order_finish = 0; //订单完成 - int last_error = 0; //报警信号 - int last_open_ready_time = 0; //开机准备时间(S) - int last_device_running_time = 0; //设备运转时间(S) - int last_await_time = 0; //待机时间(S) - int last_order = 0; //工单号 - int last_order_real_time = 0; //订单实时 - int last_is_start = 0; //是否开始 - int last_pause = 0; //是否暂停 - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - running = this.itemProtocol.getItem_running(); - prepare = this.itemProtocol.getItem_prepare(); - ready = this.itemProtocol.getItem_ready(); - order_finish = this.itemProtocol.getItem_order_finish(); - error = this.itemProtocol.getItem_error(); - open_ready_time = this.itemProtocol.getItem_open_ready_time(); - device_running_time = this.itemProtocol.getItem_device_running_time(); - await_time = this.itemProtocol.getItem_await_time(); - order = this.itemProtocol.getItem_order(); - order_real_time = this.itemProtocol.getItem_order_real_time(); - is_start = this.itemProtocol.getItem_is_start(); - pause = this.itemProtocol.getItem_pause(); - if (running != last_running) { - logServer.deviceLog(this.device_code,"running" ,String.valueOf(running)); - logServer.deviceLogToacs(this.device_code,"","","信号running:" + last_running + "->" + running); - } - if (prepare != last_prepare) { - logServer.deviceLog(this.device_code,"prepare" ,String.valueOf(prepare)); - logServer.deviceLogToacs(this.device_code,"","","信号prepare:" + last_prepare + "->" + prepare); - } - if (ready != last_ready) { - logServer.deviceLog(this.device_code,"ready" ,String.valueOf(ready)); - logServer.deviceLogToacs(this.device_code,"","","信号ready:" + last_ready + "->" + ready); - } - if (order_finish != last_order_finish) { - logServer.deviceLog(this.device_code,"order_finish" ,String.valueOf(order_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号order_finish:" + last_order_finish + "->" + order_finish); - } - if (open_ready_time != last_open_ready_time) { - logServer.deviceLog(this.device_code,"open_ready_time" ,String.valueOf(open_ready_time)); - logServer.deviceLogToacs(this.device_code,"","","信号open_ready_time:" + last_open_ready_time + "->" + open_ready_time); - } - if (device_running_time != last_device_running_time) { - logServer.deviceLog(this.device_code,"device_running_time" ,String.valueOf(device_running_time)); - logServer.deviceLogToacs(this.device_code,"","","信号device_running_time:" + last_device_running_time + "->" + device_running_time); - } - if (await_time != last_await_time) { - logServer.deviceLog(this.device_code,"await_time" ,String.valueOf(await_time)); - logServer.deviceLogToacs(this.device_code,"","","信号await_time:" + last_await_time + "->" + await_time); - } - if (order != last_order) { - logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); - logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); - } - if (order_real_time != last_order_real_time) { - logServer.deviceLog(this.device_code,"order_real_time" ,String.valueOf(order_real_time)); - logServer.deviceLogToacs(this.device_code,"","","信号order_real_time:" + last_order_real_time + "->" + order_real_time); - } - if (is_start != last_is_start) { - logServer.deviceLog(this.device_code,"is_start" ,String.valueOf(is_start)); - logServer.deviceLogToacs(this.device_code,"","","信号is_start:" + last_is_start + "->" + is_start); - } - if (pause != last_pause) { - logServer.deviceLog(this.device_code,"pause" ,String.valueOf(pause)); - logServer.deviceLogToacs(this.device_code,"","","信号pause:" + last_pause + "->" + pause); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - - - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 - }/* else if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - }*/ else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - - if(!requireSucess){ - /* if ( mode == 1 && move != 0 && task > 0) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务"); - apply_task(); - }*/ - } - - - - } - last_running = running; //是否运行 - last_prepare = prepare; //是否准备 - last_ready = ready; //是否就绪 - last_order_finish = order_finish; //订单完成 - last_error = error; //报警信号 - last_open_ready_time = open_ready_time; //开机准备时间(S) - last_device_running_time = device_running_time; //设备运转时间(S) - last_await_time = await_time; //待机时间(S) - last_order = order; //工单号 - last_order_real_time = order_real_time; //订单实时 - last_is_start = is_start; //是否开始 - last_pause = pause; //是否暂停 - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - logServer.deviceLogToacs(this.device_code,"","","光电信号切换,刷新请求标记:"+this.requireSucess); - - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } - -/* public synchronized boolean apply_task() throws Exception { - Boolean flag = false; - //通过路由找到所有的目标设备 - //找到当前设备生产的物料,并且判断下个工序生产的物料相同 - //判断是否已经有前往这个工位的任务 - List list = routeLineService.getShortPathLinesByCode(this.device_code,"normal"); - ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(this.device_code); - //查找当前工单对应的物料编号 - String cpbh = order.getMaterial_code(); - HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver; - //遍历路由,找到对应所有的物料进行匹配 - for(int i=0;i getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_running, "是否运行", "DB1.X0.3")); - list.add(new ItemDto(item_prepare, "是否准备", "DB1.X0.5")); - list.add(new ItemDto(item_ready, "是否就绪", "DB1.X0.6")); - list.add(new ItemDto(item_order_finish, "订单完成", "DB1.X1.3")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W68")); - list.add(new ItemDto(item_open_ready_time, "开机准备时间(S)", "DB1.D144")); - list.add(new ItemDto(item_device_running_time, "设备运转时间(S)", "DB1.D148")); - list.add(new ItemDto(item_await_time, "待机时间(S)", "DB1.D152")); - list.add(new ItemDto(item_order, "工单号", "DB1.D160")); - list.add(new ItemDto(item_order_real_time, "订单实时", "DB1.D284")); - list.add(new ItemDto(item_is_start, "是否开始", "DB1.D288")); - list.add(new ItemDto(item_pause, "是否暂停", "DB1.D292")); - return list; - } - - //订单生产总量 - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_open, "设备开关", "DB2.W76")); - list.add(new ItemDto(item_to_clear, "产量清零", "DB2.W78")); - list.add(new ItemDto(item_to_confirm_finished, "订单确认完成", "DB2.W80")); - list.add(new ItemDto(item_to_order, "工单号", "DB2.D160")); - list.add(new ItemDto(item_to_order_prod_num, "订单生产总量", "DB2.D224")); - list.add(new ItemDto(item_to_start_end, "开始结束", "DB2.D228")); - list.add(new ItemDto(item_to_pause, "暂停恢复", "DB2.D232")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDefination.java deleted file mode 100644 index 24dadef..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮清洗机储料仓 - */ -@Service -public class HailiangCleaningMachineStorageStationDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_cleaning_machine_storage_station"; - } - - @Override - public String getDriverName() { - return "海亮-清洗机储料仓"; - } - - @Override - public String getDriverDescription() { - return "海亮-清洗机储料仓"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangCleaningMachineStorageStationDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangCleaningMachineStorageStationDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java deleted file mode 100644 index 55bf62d..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java +++ /dev/null @@ -1,416 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.run.NDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮清洗机储料仓 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); - @Autowired - TaskService taskserver = SpringContextHolder.getBean(TaskService.class); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int mode =0; - int running = 0; //是否运行 - int is_open = 0; //是否启动 - int error = 0; //报警信号 - int silo_weight = 0; //储料仓重量 - int full_number = 0; //储料仓总数量 - int silo_material_no = 0; //储料仓物物料号 - //出入库模式 - int operation_type = 0; - int last_running = 0; //是否运行 - int last_is_open = 0; //是否启动 - int last_error = 0; //报警信号 - int last_silo_weight = 0; //储料仓重量 - int last_full_number = 0; //储料仓总数量 - int last_silo_material_no = 0; //储料仓物物料号 - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - - int agvphase=0; - int index =0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - mode = this.itemProtocol.getMode(); - error = this.itemProtocol.getItem_error(); - running = this.itemProtocol.getItem_running(); - is_open = this.itemProtocol.getItem_is_open(); - silo_weight = this.itemProtocol.getItem_silo_weight(); - full_number = this.itemProtocol.getItem_full_number(); - silo_material_no = this.itemProtocol.getItem_silo_material_no(); - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - if (running != last_running) { - logServer.deviceLog(this.device_code,"running" ,String.valueOf(running)); - logServer.deviceLogToacs(this.device_code,"","","信号running:" + last_running + "->" + running); - } - if (is_open != last_is_open) { - logServer.deviceLog(this.device_code,"is_open" ,String.valueOf(is_open)); - logServer.deviceLogToacs(this.device_code,"","","信号is_open:" + last_is_open + "->" + is_open); - } - if (silo_weight != last_silo_weight) { - logServer.deviceLog(this.device_code,"silo_weight" ,String.valueOf(silo_weight)); - logServer.deviceLogToacs(this.device_code,"","","信号silo_weight:" + last_silo_weight + "->" + silo_weight); - } - if (full_number != last_full_number) { - logServer.deviceLog(this.device_code,"full_number" ,String.valueOf(full_number)); - logServer.deviceLogToacs(this.device_code,"","","信号full_number:" + last_full_number + "->" + full_number); - } - if (silo_material_no != last_silo_material_no) { - logServer.deviceLog(this.device_code,"silo_material_no" ,String.valueOf(silo_material_no)); - logServer.deviceLogToacs(this.device_code,"","","信号silo_material_no:" + last_silo_material_no + "->" + silo_material_no); - } - - } catch (Exception var17) { - return; - } - -// if (!this.itemProtocol.getIsonline()) { -// this.setIsonline(false); -// this.setIserror(true); - message = "信号量同步异常"; - //未联机 -// } else if (mode == 0) { -// this.setIsonline(false); -// this.setIserror(true); -// message = "未联机"; - //有报警 -// } - if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - - if(!requireSucess){ - /* if ( mode == 1 && move != 0 && task > 0) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务"); - apply_task(); - }*/ - } - - if(agvphase == 0x0B || agvphase == 0x0F ) - { - if(error == 0 && ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("3"); - instructionService.update(inst); - writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); - NDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - }else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因error:"+error+",inst"+inst); - - } - } - - if(agvphase == 0x0D || agvphase == 0x11){ - if(error == 0 && ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("4"); - instructionService.update(inst); - byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); - NDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - }else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因error:"+error+",inst"+inst); - - } - } - - } - last_running = running; - last_is_open = is_open; //是否启动 - last_error = error; //报警信号 - last_silo_weight = silo_weight; //储料仓重量 - last_full_number = full_number; //储料仓总数量 - last_silo_material_no = silo_material_no; //储料仓物物料号 - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - logServer.deviceLogToacs(this.device_code,"","","光电信号切换,刷新请求标记:"+this.requireSucess); - - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } - - public synchronized boolean apply_task() throws Exception { - Boolean flag = false; - //通过路由找到所有的目标设备 - //找到当前设备生产的物料,并且判断下个工序生产的物料相同 - //判断是否已经有前往这个工位的任务 - List list = routeLineService.getShortPathLinesByCode(this.device_code,"normal"); - ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(this.device_code); - //查找当前工单对应的物料编号 - String cpbh = order.getMaterial_code(); - HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver; - //遍历路由,找到对应所有的物料进行匹配 - for(int i=0;i getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_mode, "模式", "DB1.W36")); - list.add(new ItemDto(item_running, "是否运行", "DB1.B2.0")); - list.add(new ItemDto(item_is_open, "是否启动", "DB1.B1.0")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W38")); - list.add(new ItemDto(item_silo_weight, "储料仓重量", "DB1.D84")); - list.add(new ItemDto(item_full_number, "储料仓总数量", "DB1.D164")); - list.add(new ItemDto(item_silo_material_no, "储料仓物料号", "DB1.D224")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_open_weight, "储料仓开始称重", "DB2.W10")); - list.add(new ItemDto(item_to_feeding, "储料仓上料", "DB2.W42")); - list.add(new ItemDto(item_to_material_no, "储料仓料号", "DB2.D92")); - list.add(new ItemDto(item_to_dumping_num, "储料仓倒料数量", "DB2.D164")); - list.add(new ItemDto(item_to_peel, "储料仓去皮", "DB2.W364")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDefination.java deleted file mode 100644 index 9b28f7a..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDefination.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮刻字缓存位 - */ -@Service -public class HailiangEngravingCacheDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_engraving_cache"; - } - - @Override - public String getDriverName() { - return "海亮-刻字缓存位"; - } - - @Override - public String getDriverDescription() { - return "海亮-刻字缓存位"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangEngravingCacheDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangEngravingCacheDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java deleted file mode 100644 index 64c9734..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java +++ /dev/null @@ -1,424 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.run.OneNDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮刻字缓存位 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - - String container; - - int move = 0;//光电信号 - int mode = 0;//模式 - //出入库模式 - int operation_type = 0; - int last_move = 0;//光电信号 - int last_mode = 0;//光电信号 - - - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - int agvphase = 0; - int index = 0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - move = this.itemProtocol.getItem_move();//光电信号 - mode = this.itemProtocol.getItem_mode();//模式 - if (mode != last_mode) { - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - if (move == 1) { - thingToNothing(); - } - this.setRequireSucess(false); - logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); - logServer.deviceLogToacs(this.device_code,"","","信号move(取反):" + last_move + "->" + move); - } - - - /* if (mode == 2 && move != 0 && task > 0) { - - }*/ - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 - } /*else if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - } */ else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - if(agvphase == 0x03) - { - if(ObjectUtil.isNotEmpty(inst) && move != 0){ - inst.setExecute_status("1"); - instructionService.update(inst); - //writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "move=" +move + ",等待反馈,inst:"+inst); - - } - } - - if(agvphase == 0x05){ - if(ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("2"); - instructionService.update(inst); - writing("to_cache_write", "0"); - this.setMaterial(""); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); - - } - } - - if(agvphase == 0x07){ - if(ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("5"); - instructionService.update(inst); - //writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); - } - } - - if(agvphase == 0x09){ - if(ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("6"); - instructionService.update(inst); - // TODO 指令中根据起始点位驱动类型判断空满 - String start_device_code = inst.getStart_device_code(); - log.warn("起点设备为:{}",start_device_code); - String next_device_code = inst.getNext_device_code(); - log.warn("终点设备为:{}",next_device_code); - Device start_device = deviceAppservice.findDeviceByCode(start_device_code); - Device next_device = deviceAppservice.findDeviceByCode(next_device_code); - if (start_device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){ - writing("to_cache_write", "2"); - this.setMaterial(inst.getMaterial()); - next_device.setMaterial_type(inst.getMaterial()); - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置刻字机,缓存位解锁成功"); - } - if (start_device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){ - writing("to_cache_write", "1"); - this.setMaterial(""); - next_device.setMaterial_type(""); - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置包装机,缓存位解锁成功"); - } - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); - - } - } - } - last_move = move ;//光电信号 - last_mode = mode ;//光电信号 - } - - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - this.setRequireSucess(false); - this.setApplySucess(false); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - } - - public void writing(int type, int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - logServer.deviceLogToacs(this.device_code,"","","下发信号:" + key + ",value:"+value); - ReadUtil.write(itemMap, server); - } - - public boolean instruction_apply() throws Exception { - return false; - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("1"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - - public void apply_OutEmpty() { - - } - - public synchronized boolean apply_InEmpty() throws Exception { - return false; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/ItemProtocol.java deleted file mode 100644 index 6b7c1a4..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/ItemProtocol.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_move = "move";//光电信号 - public static String item_mode = "mode";//模式 - - // - public static String item_to_cache_write = "to_cache_write"; - - - - private HailiangEngravingCacheDeviceDriver driver; - - public ItemProtocol(HailiangEngravingCacheDeviceDriver driver) { - this.driver = driver; - } - - - public int getItem_heartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - public int getItem_move() { - return this.getOpcIntegerValue(item_move); - } - public int getItem_mode() { - return this.getOpcIntegerValue(item_mode); - } - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_move, "光电信号", "DB1.W22")); - list.add(new ItemDto(item_mode, "模式", "DB1.B0.6")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_cache_write, "刻字缓存写", "DB2.W22")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDefination.java deleted file mode 100644 index a8f4088..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDefination.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮刻字机工位 - */ -@Service -public class HailiangEngravingMachineDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_engraving_machine"; - } - - @Override - public String getDriverName() { - return "海亮-刻字机工位"; - } - - @Override - public String getDriverDescription() { - return "海亮-刻字机工位"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangEngravingMachineDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangEngravingMachineDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java deleted file mode 100644 index b7b6b67..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java +++ /dev/null @@ -1,787 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache.HailiangEngravingCacheDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.exception.BadRequestException; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.run.OneNDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.unit.DataUnit; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮刻字机工位 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - String container; - - int status = 0;//线体状态 - int is_open = 0;//线体开机状态 - int is_running = 0;//刻字机运行状态 - int empty_req = 0;//空箱请求 - int move = 0;//有货 - int full_req = 0;//满箱请求 - int full_finish = 0;//满箱完成 - int order_finish = 0;//订单完成 - int engraving_prepare = 0;//刻字机准备 - int engraving_ready = 0;//刻字机就绪 - int line_ready = 0;//线体就绪 - int mode = 0;//模式 所有设备就绪 - int error = 0; //报警信号 - int order_now = 0; //订单实时 - int one_now = 0; //每框实时 - int task = 0; //任务号 - int port_full_num = 0; //出料口满框数量 - int lettering_silo_number = 0; //刻字机储料仓数量 - int open_ready_time = 0; //开机准备时间(S) - int device_running_time = 0; //设备运转时间(S) - int await_time = 0; //待机时间(S) - int order = 0; //工单号 - - //出入库模式 - int operation_type = 0; - int last_status = 0;//线体状态 - int last_is_open = 0;//线体开机状态 - int last_is_running = 0;//刻字机运行状态 - int last_empty_req = 0;//空箱请求 - int last_move = 0;//有货 - int last_full_req = 0;//满箱请求 - int last_full_finish = 0;//满箱完成 - int last_order_finish = 0;//订单完成 - int last_engraving_prepare = 0;//刻字机准备 - int last_engraving_ready = 0;//刻字机就绪 - int last_line_ready = 0;//线体就绪 - int last_mode = 0;//模式 所有设备就绪 - int last_error = 0; //报警信号 - int last_order_now = 0; //订单实时 - int last_one_now = 0; //每框实时 - int last_task = 0; //任务号 - int last_port_full_num = 0; //出料口满框数量 - int last_lettering_silo_number = 0; //刻字机储料仓数量 - int last_open_ready_time = 0; //开机准备时间(S) - int last_device_running_time = 0; //设备运转时间(S) - int last_await_time = 0; //待机时间(S) - int last_order = 0; //工单号 - - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - int agvphase = 0; - int index = 0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - mode = this.itemProtocol.getItem_mode();//模式 所有设备就绪 - status = this.itemProtocol.getItem_status();//线体状态 - is_open = this.itemProtocol.getItem_is_open();//线体开机状态 - is_running = this.itemProtocol.getItem_is_running();//刻字机运行状态 - empty_req = this.itemProtocol.getItem_empty_req();//空箱请求 - move = this.itemProtocol.getItem_move();//有货 - full_req = this.itemProtocol.getItem_full_req();//满箱请求 - full_finish = this.itemProtocol.getItem_full_finish();//满箱完成 - order_finish = this.itemProtocol.getItem_order_finish();//订单完成 - engraving_prepare = this.itemProtocol.getItem_engraving_prepare();//刻字机准备 - engraving_ready = this.itemProtocol.getItem_engraving_ready();//刻字机就绪 - line_ready = this.itemProtocol.getItem_line_ready();//线体就绪 - error = this.itemProtocol.getItem_error(); //报警信号 - order_now = this.itemProtocol.getItem_order_now(); //订单实时 - one_now = this.itemProtocol.getItem_one_now(); //每框实时 - task = this.itemProtocol.getItem_task(); //任务号 - port_full_num = this.itemProtocol.getItem_port_full_num(); //出料口满框数量 - lettering_silo_number = this.itemProtocol.getItem_lettering_silo_number(); //刻字机储料仓数量 - open_ready_time = this.itemProtocol.getItem_open_ready_time(); //开机准备时间(S) - device_running_time = this.itemProtocol.getItem_device_running_time(); //设备运转时间(S) - await_time = this.itemProtocol.getItem_await_time(); //待机时间(S) - order = this.itemProtocol.getItem_order(); //工单号 - if (mode != last_mode) { - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - thingToNothing(); - this.setRequireSucess(false); - logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); - logServer.deviceLogToacs(this.device_code,"","","信号move(取反):" + last_move + "->" + move); - } - if (status != last_status) { - logServer.deviceLog(this.device_code,"status" ,String.valueOf(status)); - logServer.deviceLogToacs(this.device_code,"","","信号status:" + last_status + "->" + status); - } - if (is_open != last_is_open) { - logServer.deviceLog(this.device_code,"is_open" ,String.valueOf(is_open)); - logServer.deviceLogToacs(this.device_code,"","","信号is_open:" + last_is_open + "->" + is_open); - } - if (is_running != last_is_running) { - logServer.deviceLog(this.device_code,"is_running" ,String.valueOf(is_running)); - logServer.deviceLogToacs(this.device_code,"","","信号is_running:" + last_is_running + "->" + is_running); - } - if (empty_req != last_empty_req) { - logServer.deviceLog(this.device_code,"empty_req" ,String.valueOf(empty_req)); - logServer.deviceLogToacs(this.device_code,"","","信号empty_req:" + last_empty_req + "->" + empty_req); - } - if (full_req != last_full_req) { - logServer.deviceLog(this.device_code,"full_req" ,String.valueOf(full_req)); - logServer.deviceLogToacs(this.device_code,"","","信号full_req:" + last_full_req + "->" + full_req); - } - if (full_finish != last_full_finish) { - logServer.deviceLog(this.device_code,"full_finish" ,String.valueOf(full_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号full_finish:" + last_full_finish + "->" + full_finish); - } - if (order_finish != last_order_finish) { - logServer.deviceLog(this.device_code,"order_finish" ,String.valueOf(order_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号order_finish:" + last_order_finish + "->" + order_finish); - } - if (engraving_prepare != last_engraving_prepare) { - logServer.deviceLog(this.device_code,"engraving_prepare" ,String.valueOf(engraving_prepare)); - logServer.deviceLogToacs(this.device_code,"","","信号engraving_prepare:" + last_engraving_prepare + "->" + engraving_prepare); - } - if (engraving_ready != last_engraving_ready) { - logServer.deviceLog(this.device_code,"engraving_ready" ,String.valueOf(engraving_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号engraving_ready:" + last_engraving_ready + "->" + engraving_ready); - } - if (line_ready != last_line_ready) { - logServer.deviceLog(this.device_code,"line_ready" ,String.valueOf(line_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号line_ready:" + last_line_ready + "->" + line_ready); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - if (order_now != last_order_now) { - logServer.deviceLog(this.device_code,"order_now" ,String.valueOf(order_now)); - logServer.deviceLogToacs(this.device_code,"","","信号order_now:" + last_order_now + "->" + order_now); - } - if (one_now != last_one_now) { - logServer.deviceLog(this.device_code,"one_now" ,String.valueOf(one_now)); - logServer.deviceLogToacs(this.device_code,"","","信号one_now:" + last_one_now + "->" + one_now); - } - if (task != last_task) { - logServer.deviceLog(this.device_code,"task" ,String.valueOf(task)); - logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task); - } - if (port_full_num != last_port_full_num) { - logServer.deviceLog(this.device_code,"port_full_num" ,String.valueOf(port_full_num)); - logServer.deviceLogToacs(this.device_code,"","","信号port_full_num:" + last_port_full_num + "->" + port_full_num); - } - if (lettering_silo_number != last_lettering_silo_number) { - logServer.deviceLog(this.device_code,"lettering_silo_number" ,String.valueOf(lettering_silo_number)); - logServer.deviceLogToacs(this.device_code,"","","信号lettering_silo_number:" + last_lettering_silo_number + "->" + lettering_silo_number); - } - if (open_ready_time != last_open_ready_time) { - logServer.deviceLog(this.device_code,"open_ready_time" ,String.valueOf(open_ready_time)); - } - if (device_running_time != last_device_running_time) { - logServer.deviceLog(this.device_code,"device_running_time" ,String.valueOf(device_running_time)); - } - if (await_time != last_await_time) { - logServer.deviceLog(this.device_code,"await_time" ,String.valueOf(await_time)); - } - if (order != last_order) { - logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); - logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); - } - - /* if (mode == 2 && move != 0 && task > 0) { - - }*/ - } catch (Exception var17) { - return; - } - -// if (!this.itemProtocol.getIsonline()) { -// this.setIsonline(false); -// this.setIserror(true); -// message = "信号量同步异常"; -// //未联机 -// } else if (mode == 0) { -// this.setIsonline(false); -// this.setIserror(true); -// message = "未联机"; -// //有报警 -// } else - if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - - if ( mode == 1 && order_finish == 1 && order > 0){ - ProduceshiftorderDto dto = new ProduceshiftorderDto(); - dto.setOrder_code(order + ""); - dto.setOrder_status("2"); - ProduceshiftorderDto deviceInfo = produceshiftorderService.findOrderByDeviceCode(this.device_code); - if(deviceInfo != null){ - if (StrUtil.isNotEmpty(deviceInfo.getExt_order_id())) { - String ext_order_id = deviceInfo.getExt_order_id(); - JSONObject param = new JSONObject(); - param.put("ext_order_id",ext_order_id); - acsToWmsService.feedbackOrderStatus(param); - logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单的外部标识:"+ext_order_id); - }else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单的没有外部标识"); - } - }else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单信息为空"); - } - produceshiftorderService.updateByOrderCode(dto); - this.writing("to_confirm_finished","1"); - this.writing("to_clear","1"); - this.writing("to_pause","1"); - logServer.deviceLogToacs(this.device_code,"","",device_code+":,任务确认完成,电器信号写入成功"); - }else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move + ",order_finish>"+ order_finish +",last_order_finish>"+last_order_finish); - } - - if(!requireSucess){ -// if ( move == 1 && mode == 1 && order > 0 && full_number>0 ) { - - if ( move == 1 && mode == 1 && full_req == 1 ) { -// if ( full_req == 1 ) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务"); - - apply_task(); - } else { - logServer.deviceLogToacs(this.device_code,"","","不满足下发满框请求任务条件,mode:"+mode+"move:"+move+"full_req:"+full_req); - - } - - if (move == 0 && mode == 1 && empty_req == 1){ -// if (empty_req == 1) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请空箱请求任务"); - apply_empty_task(); - }else { - logServer.deviceLogToacs(this.device_code,"","","不满足下发空框请求任务条件,mode:"+mode+"move:"+move+"empty_req:"+empty_req); - - } - - }else { - logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess); - } - - if(agvphase == 0x03) - { - if(ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("1"); - instructionService.update(inst); - //writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); - - } - } - - if(agvphase == 0x05){ - if(ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("2"); - instructionService.update(inst); - writing("to_cache_write", "0"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); - - } - } - - if(agvphase == 0x07){ - if(ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("5"); - instructionService.update(inst); - //writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); - } - } - - if(agvphase == 0x09){ - if(ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("6"); - instructionService.update(inst); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); - - } - } - - - } - last_status = status;//线体状态 - last_is_open = is_open;//线体开机状态 - last_is_running = is_running;//刻字机运行状态 - last_empty_req = empty_req;//空箱请求 - last_move = move;//有货 - last_full_req = full_req;//满箱请求 - last_full_finish = full_finish;//满箱完成 - last_order_finish = order_finish;//订单完成 - last_engraving_prepare = engraving_prepare;//刻字机准备 - last_engraving_ready = engraving_ready;//刻字机就绪 - last_line_ready = line_ready;//线体就绪 - last_mode = mode;//模式 所有设备就绪 - last_error = error; //报警信号 - last_order_now = order_now; //订单实时 - last_one_now = one_now; //每框实时 - last_task = task; //任务号 - last_port_full_num = port_full_num; //出料口满框数量 - last_lettering_silo_number = lettering_silo_number; //刻字机储料仓数量 - last_open_ready_time = open_ready_time; //开机准备时间(S) - last_device_running_time = device_running_time; //设备运转时间(S) - last_await_time = await_time; //待机时间(S) - last_order = order; //工单号 - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - this.setRequireSucess(false); - this.setApplySucess(false); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - public synchronized boolean apply_empty_task() throws Exception { - Date date = new Date(); - if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - Boolean flag = false; - List list = routeLineService.getPathLinesByCode(this.device_code, "normal"); - if (ObjectUtil.isEmpty(list)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":未找到对应路由"); - throw new BadRequestException(this.device_code + ":未找到对应路由"); - } - HailiangEngravingCacheDeviceDriver hailiangEngravingCacheDeviceDriver; - for (int i = 0; i < list.size(); i++) { - RouteLineDto dto = list.get(i); - String start_device_code = dto.getDevice_code(); - Device route_link_device = deviceAppservice.findDeviceByCode(start_device_code); - if (route_link_device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) route_link_device.getDeviceDriver(); - if (hailiangEngravingCacheDeviceDriver.getMove() != 1){ - continue; - } - int num = taskserver.querySameOriginTask(start_device_code); - if(num != 0){ - continue; - } - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - //onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_type("7"); - onedto.setTask_status("0"); - onedto.setPriority("1"); - onedto.setStart_device_code(start_device_code); - onedto.setStart_point_code(start_device_code); - onedto.setNext_device_code(this.getDevice().getDevice_code()); - onedto.setNext_point_code(this.getDevice().getDevice_code()); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - - try { - taskserver.create(onedto); - flag = true; - break; - } catch (Exception e) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务成功"); - } - } - //生成任务成功 - if (flag) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功"); - requireSucess = true; - } else { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":条件不满足未找到起点设备"); - } - } - return true; - } - - public synchronized boolean apply_task() throws Exception { - WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); - - Date date = new Date(); - if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - Boolean flag = false; - List list = routeLineService.getShortPathLinesByCode(this.device_code, "normal"); - if (ObjectUtil.isEmpty(list)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":未找到对应路由"); - throw new BadRequestException(this.device_code + ":未找到对应路由"); - } - String link_device = this.getDevice().getExtraValue().get("link_device_code").toString(); - ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(link_device); - if (ObjectUtil.isEmpty(order)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单"); - throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单"); - } - if (order.getIs_needmove().equals("0")){ - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "工单,不需要agv搬运"); - return false; - } - //查找当前工单对应的物料编号 - String cpbh = order.getMaterial_code(); - - HailiangEngravingCacheDeviceDriver hailiangEngravingCacheDeviceDriver; - for (int i = 0; i < list.size(); i++) { - RouteLineDto dto = list.get(i); - String next_device_code = dto.getNext_device_code(); - Device route_link_device = deviceAppservice.findDeviceByCode(next_device_code); - - if (route_link_device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) route_link_device.getDeviceDriver(); - if (hailiangEngravingCacheDeviceDriver.getMove() != 0){ - continue; - } - int num = taskserver.querySameDestinationTask(next_device_code); - if(num != 0){ - continue; - } - //判断缓存位是否锁定 - JSONObject jsonObject = runpointwo.query("device_code = '" + next_device_code + "' and islock = '1'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonObject)){ - continue; - } - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - //onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_type("6"); - onedto.setTask_status("0"); - onedto.setPriority("1"); - onedto.setMaterial(cpbh); - // TODO 任务中物料数量要不要赋值 - onedto.setQuantity(order.getQty() + ""); - onedto.setStart_device_code(this.getDevice().getDevice_code()); - onedto.setStart_point_code(this.getDevice().getDevice_code()); - onedto.setNext_device_code(next_device_code); - onedto.setNext_point_code(next_device_code); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - try { - taskserver.create(onedto); - //任务创建成功 锁定 - JSONObject map = new JSONObject(); - map.put("islock","1"); - map.put("update_by","auto"); - map.put("update_time", DateUtil.now()); - runpointwo.update(map,"device_code = '" + next_device_code + "'"); - flag = true; - break; - } catch (Exception e) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务成功"); - } - } - //生成任务成功 - if (flag) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":刻字机满料请求任务生成成功"); - requireSucess = true; - } else { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":条件不满足未找到起点设备"); - } - } - return true; - } - - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - } - - public void writing(int type, int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - logServer.deviceLogToacs(this.device_code,"","","下发信号:" + key + ",value:"+value); - ReadUtil.write(itemMap, server); - } - - public boolean instruction_apply() throws Exception { - return false; - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - - public void apply_OutEmpty() { - - } - - public synchronized boolean apply_InEmpty() throws Exception { - return false; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/ItemProtocol.java deleted file mode 100644 index d39ad32..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/ItemProtocol.java +++ /dev/null @@ -1,228 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_status = "status";//线体状态 - public static String item_is_open = "is_open";//线体开机状态 - public static String item_is_running = "is_running";//刻字机运行状态 - public static String item_empty_req = "empty_req";//空箱请求 - public static String item_move = "move";//有货 - public static String item_full_req = "full_req";//满箱请求 - public static String item_full_finish = "full_finish";//满箱完成 - public static String item_order_finish = "order_finish";//订单完成 - public static String item_engraving_prepare = "engraving_prepare";//刻字机准备 - public static String item_engraving_ready = "engraving_ready";//刻字机就绪 - public static String item_line_ready = "line_ready";//线体就绪 - public static String item_mode = "mode";//模式 所有设备就绪 - public static String item_error = "error"; //报警信号 - public static String item_order_now = "order_now"; //订单实时 - public static String item_one_now = "one_now"; //每框实时 - public static String item_task = "task"; //任务号 - public static String item_port_full_num = "port_full_num"; //出料口满框数量 - public static String item_lettering_silo_number = "lettering_silo_number"; //刻字机储料仓数量 - public static String item_open_ready_time = "open_ready_time"; //开机准备时间(S) - public static String item_device_running_time = "device_running_time"; //设备运转时间(S) - public static String item_await_time = "await_time"; //待机时间(S) - public static String item_order = "order"; //工单号 - - //开机 - public static String item_to_open = "to_open"; - //AGV放空箱完成 - public static String item_to_agv_empty_finish = "to_agv_empty_finish"; - //刻字信息 - public static String item_to_engraving_info = "to_engraving_info"; - //产量清零 - public static String item_to_clear = "to_clear"; - //确认完成(订单完成状态置零) - public static String item_to_confirm_finished = "to_confirm_finished"; - //暂停 - public static String item_to_pause = "to_pause"; - //工单强制完成 - public static String item_to_order_compel_finished = "to_order_compel_finished"; - //订单生产总量 - public static String item_to_order_prod_num = "to_order_prod_num"; - //每框接料数量 - public static String item_to_one_box_num = "to_one_box_num"; - //任务号 - public static String item_to_task = "to_task"; - //刻字机倒料数量 - public static String item_to_dumping_num = "to_to_dumping_num"; - //工单号 - public static String item_to_order = "to_order"; - - - private HailiangEngravingMachineDeviceDriver driver; - - public ItemProtocol(HailiangEngravingMachineDeviceDriver driver) { - this.driver = driver; - } - - - public int getItem_heartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getItem_status() { - return this.getOpcIntegerValue(item_status); - } - - public int getItem_is_open() { - return this.getOpcIntegerValue(item_is_open); - } - - public int getItem_is_running() { - return this.getOpcIntegerValue(item_is_running); - } - - public int getItem_empty_req() { - return this.getOpcIntegerValue(item_empty_req); - } - - public int getItem_move() { - return this.getOpcIntegerValue(item_move); - } - - public int getItem_full_req() { - return this.getOpcIntegerValue(item_full_req); - } - - public int getItem_full_finish() { - return this.getOpcIntegerValue(item_full_finish); - } - - public int getItem_order_finish() { - return this.getOpcIntegerValue(item_order_finish); - } - - public int getItem_engraving_prepare() { - return this.getOpcIntegerValue(item_engraving_prepare); - } - - public int getItem_engraving_ready() { - return this.getOpcIntegerValue(item_engraving_ready); - } - - public int getItem_line_ready() { - return this.getOpcIntegerValue(item_line_ready); - } - - public int getItem_mode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getItem_error() { - return this.getOpcIntegerValue(item_error); - } - - public int getItem_order_now() { - return this.getOpcIntegerValue(item_order_now); - } - - public int getItem_one_now() { - return this.getOpcIntegerValue(item_one_now); - } - - public int getItem_task() { - return this.getOpcIntegerValue(item_task); - } - - public int getItem_port_full_num() { - return this.getOpcIntegerValue(item_port_full_num); - } - - public int getItem_lettering_silo_number() { - return this.getOpcIntegerValue(item_lettering_silo_number); - } - - public int getItem_open_ready_time() { - return this.getOpcIntegerValue(item_open_ready_time); - } - - public int getItem_device_running_time() { - return this.getOpcIntegerValue(item_device_running_time); - } - - public int getItem_await_time() { - return this.getOpcIntegerValue(item_await_time); - } - - public int getItem_order() { - return this.getOpcIntegerValue(item_order); - } - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_status, "线体状态", "DB1.B0.0")); - list.add(new ItemDto(item_is_open, "线体开机状态", "DB1.B0.1")); - list.add(new ItemDto(item_is_running, "刻字机运行状态", "DB1.B0.3")); - list.add(new ItemDto(item_empty_req, "空箱请求", "DB1.B0.5")); - list.add(new ItemDto(item_move, "光电信号", "DB1.B0.7")); - list.add(new ItemDto(item_full_req, "满箱请求", "DB1.B1.0")); - list.add(new ItemDto(item_full_finish, "满箱完成", "DB1.B1.1")); - list.add(new ItemDto(item_order_finish, "订单完成", "DB1.B1.2")); - list.add(new ItemDto(item_engraving_prepare, "刻字机准备", "DB1.B1.3")); - list.add(new ItemDto(item_engraving_ready, "刻字机就绪", "DB1.B1.4")); - list.add(new ItemDto(item_line_ready, "线体就绪", "DB1.B1.5")); - list.add(new ItemDto(item_mode, "模式", "DB1.B1.6")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W4")); - list.add(new ItemDto(item_order_now, "订单实时", "DB1.D84")); - list.add(new ItemDto(item_one_now, "每框实时", "DB1.D88")); - list.add(new ItemDto(item_task, "任务号", "DB1.D92")); - list.add(new ItemDto(item_port_full_num, "出料口满框数量", "DB1.D96")); - list.add(new ItemDto(item_lettering_silo_number, "刻字机储料仓数量", "DB1.D100")); - list.add(new ItemDto(item_open_ready_time, "开机准备时间", "DB1.D108")); - list.add(new ItemDto(item_device_running_time, "设备运转时间", "DB1.D112")); - list.add(new ItemDto(item_await_time, "待机时间", "DB1.D116")); - list.add(new ItemDto(item_order, "工单号", "DB1.D160")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_open, "设备开关", "DB2.W4", Boolean.valueOf(true))); - list.add(new ItemDto(item_to_agv_empty_finish, "AGV放空箱完成", "DB2.W8")); - list.add(new ItemDto(item_to_engraving_info, "刻字信息", "DB2.W10")); - list.add(new ItemDto(item_to_clear, "当前产量清零", "DB2.W12")); - list.add(new ItemDto(item_to_confirm_finished, "确认完成", "DB2.W14")); - list.add(new ItemDto(item_to_pause, "暂停", "DB2.W16")); - list.add(new ItemDto(item_to_order_compel_finished, "工单强制完成", "DB2.W82")); - list.add(new ItemDto(item_to_order_prod_num, "订单生产总量", "DB2.D84")); - list.add(new ItemDto(item_to_one_box_num, "每箱接料数量", "DB2.D88")); - list.add(new ItemDto(item_to_task, "任务号", "DB2.D92")); - list.add(new ItemDto(item_to_dumping_num, "刻字机倒料数量", "DB2.D100")); - list.add(new ItemDto(item_to_order, "工单号", "DB2.D160")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDefination.java deleted file mode 100644 index b72ab03..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDefination.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮包装机工位 - */ -@Service -public class HailiangPackerStationDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_packer_station"; - } - - @Override - public String getDriverName() { - return "海亮-包装机工位"; - } - - @Override - public String getDriverDescription() { - return "海亮-包装机工位"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangPackerStationDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangPackerStationDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java deleted file mode 100644 index 828d663..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java +++ /dev/null @@ -1,715 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache.HailiangEngravingCacheDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.exception.BadRequestException; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.run.OneNDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮包装机工位 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - - String container; - - int packer_ready = 0;//包装机就绪 - int mode = 0;//模式 所有设备就绪 - int move = 0;//有货 - int order_finish = 0;//订单完成 - int lack_req = 0;//缺料请求 - int hopper_already = 0;//料斗已就位 - int req_task_empty = 0;//请求取空料斗 - int hopper_removed = 0;//料斗已取走 - int error = 0; //报警信号 - int order_now = 0; //订单实时 - int open_ready_time = 0; //开机准备时间(S) - int device_running_time = 0; //设备运转时间(S) - int await_time = 0; //待机时间(S) - int order = 0; //工单号 - //出入库模式 - int operation_type = 0; - int last_packer_ready = 0;//包装机就绪 - int last_mode = 0;//模式 所有设备就绪 - int last_move = 0;//有货 - int last_order_finish = 0;//订单完成 - int last_lack_req = 0;//缺料请求 - int last_hopper_already = 0;//料斗已就位 - int last_req_task_empty = 0;//请求取空料斗 - int last_hopper_removed = 0;//料斗已取走 - int last_error = 0; //报警信号 - int last_order_now = 0; //订单实时 - int last_open_ready_time = 0; //开机准备时间(S) - int last_device_running_time = 0; //设备运转时间(S) - int last_await_time = 0; //待机时间(S) - int last_order = 0; //工单号 - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - Boolean fullrequireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - String device_code; - - int agvphase = 0; - int index = 0; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - packer_ready = this.itemProtocol.getItem_packer_ready();//包装机就绪 - lack_req = this.itemProtocol.getItem_lack_req();//缺料请求 - hopper_already = this.itemProtocol.getItem_hopper_already();//料斗已就位 - req_task_empty = this.itemProtocol.getItem_req_task_empty();//请求取空料斗 - hopper_removed = this.itemProtocol.getItem_hopper_removed();//料斗已取走 - mode = this.itemProtocol.getItem_mode();//模式 所有设备就绪 - move = this.itemProtocol.getItem_move();//有货 - order_finish = this.itemProtocol.getItem_order_finish();//订单完成 - error = this.itemProtocol.getItem_error(); //报警信号 - order_now = this.itemProtocol.getItem_order_now(); //订单实时 - open_ready_time = this.itemProtocol.getItem_open_ready_time(); //开机准备时间(S) - device_running_time = this.itemProtocol.getItem_device_running_time(); //设备运转时间(S) - await_time = this.itemProtocol.getItem_await_time(); //待机时间(S) - order = this.itemProtocol.getItem_order(); //工单号 - if (mode != last_mode) { - logServer.deviceLog(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - logServer.deviceLog(this.device_code, "move", String.valueOf(move)); - logServer.deviceLogToacs(this.device_code, "", "", "信号move(取反):" + last_move + "->" + move); - } - if (packer_ready != last_packer_ready) { - logServer.deviceLog(this.device_code, "packer_ready", String.valueOf(packer_ready)); - logServer.deviceLogToacs(this.device_code, "", "", "信号packer_ready:" + last_packer_ready + "->" + packer_ready); - } - if (lack_req != last_lack_req) { - if (lack_req == 0) { - this.setRequireSucess(false); - } - logServer.deviceLog(this.device_code, "lack_req", String.valueOf(lack_req)); - logServer.deviceLogToacs(this.device_code, "", "", "信号lack_req:" + last_lack_req + "->" + lack_req); - } - if (hopper_already != last_hopper_already) { - logServer.deviceLog(this.device_code, "hopper_already", String.valueOf(hopper_already)); - logServer.deviceLogToacs(this.device_code, "", "", "信号hopper_already:" + last_hopper_already + "->" + hopper_already); - } - if (req_task_empty != last_req_task_empty) { - if (req_task_empty == 0) { - this.setFullrequireSucess(false); - } - logServer.deviceLog(this.device_code, "req_task_empty", String.valueOf(req_task_empty)); - logServer.deviceLogToacs(this.device_code, "", "", "信号req_task_empty:" + last_req_task_empty + "->" + req_task_empty); - } - if (hopper_removed != last_hopper_removed) { - logServer.deviceLog(this.device_code, "hopper_removed", String.valueOf(hopper_removed)); - logServer.deviceLogToacs(this.device_code, "", "", "信号hopper_removed:" + last_hopper_removed + "->" + hopper_removed); - } - - if (order_finish != last_order_finish) { - logServer.deviceLog(this.device_code, "order_finish", String.valueOf(order_finish)); - logServer.deviceLogToacs(this.device_code, "", "", "信号order_finish:" + last_order_finish + "->" + order_finish); - } - - if (error != last_error) { - logServer.deviceLog(this.device_code, "error", String.valueOf(error)); - logServer.deviceLogToacs(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } - if (order_now != last_order_now) { - logServer.deviceLog(this.device_code, "order_now", String.valueOf(order_now)); - logServer.deviceLogToacs(this.device_code, "", "", "信号order_now:" + last_order_now + "->" + order_now); - } - -/* if (open_ready_time != last_open_ready_time) { - logServer.deviceLog(this.device_code, "open_ready_time", String.valueOf(open_ready_time)); - logServer.deviceLogToacs(this.device_code, "", "", "信号open_ready_time:" + last_open_ready_time + "->" + open_ready_time); - }*/ -/* if (device_running_time != last_device_running_time) { - logServer.deviceLog(this.device_code, "device_running_time", String.valueOf(device_running_time)); - logServer.deviceLogToacs(this.device_code, "", "", "信号device_running_time:" + last_device_running_time + "->" + device_running_time); - }*/ - if (await_time != last_await_time) { - logServer.deviceLog(this.device_code, "await_time", String.valueOf(await_time)); - logServer.deviceLogToacs(this.device_code, "", "", "信号await_time:" + last_await_time + "->" + await_time); - } - if (order != last_order) { - logServer.deviceLog(this.device_code, "order", String.valueOf(order)); - logServer.deviceLogToacs(this.device_code, "", "", "信号order:" + last_order + "->" + order); - } - - /* if (mode == 2 && move != 0 && task > 0) { - - }*/ - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 -// } else if (mode == 0) { -// this.setIsonline(false); -// this.setIserror(true); -// message = "未联机"; -// //有报警 -// } else if (error != 0) { -// this.setIsonline(false); -// this.setIserror(true); -// message = "有报警"; -// //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - if (mode == 1 && order_finish != last_order_finish && order_finish == 1 && order > 0) { - ProduceshiftorderDto dto = new ProduceshiftorderDto(); - dto.setOrder_code(order + ""); - dto.setOrder_status("2"); - ProduceshiftorderDto deviceInfo = produceshiftorderService.findOrderByDeviceCode(this.device_code); - if (deviceInfo != null) { - if (StrUtil.isNotEmpty(deviceInfo.getExt_order_id())) { - String ext_order_id = deviceInfo.getExt_order_id(); - JSONObject param = new JSONObject(); - param.put("ext_order_id", ext_order_id); - acsToWmsService.feedbackOrderStatus(param); - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,对应的工单的外部标识:" + ext_order_id); - } else { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,对应的工单的没有外部标识"); - } - } else { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,对应的工单信息为空"); - } - produceshiftorderService.updateByOrderCode(dto); - this.writing("to_confirm_finished", "1"); - this.writing("to_clear", "1"); - this.writing("to_pause", "1"); - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,任务确认完成,电器信号写入成功"); - } - - if (ObjectUtil.isEmpty(inst)) { - if (!requireSucess) { - if (mode == 1 && lack_req == 1 && move == 0) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",mode:" + mode + ",requireSucess:" + requireSucess + "开始申请缺料请求任务"); - apply_task(); - } - } - if (!fullrequireSucess){ - if (mode == 1 && req_task_empty == 1 && move == 1) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",mode:" + mode + ",fullrequireSucess:" + fullrequireSucess + "开始申请请求取走空料斗任务"); - apply_take_empty_task(); - } - } - } - - - if (agvphase == 0x03) { - //&& lack_req =1 缺料请求 先不判断 - /*if( move == 1 && error == 0 && ObjectUtil.isNotEmpty(inst)){*/ - inst.setExecute_status("1"); - instructionService.update(inst); - //writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); - /* } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); - - }*/ - } - - if (agvphase == 0x05) { - if (move == 0 && error == 0 && ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("2"); - instructionService.update(inst); - //writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - writing("to_agv_take_finish", "1"); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,原因move:" + move + ",error:" + error + ",inst" + inst); - } - } - - if (agvphase == 0x07) { - if (move == 0 && error == 0 && ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("5"); - instructionService.update(inst); - //writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,原因move:" + move + ",error:" + error + ",inst" + inst); - - } - } - - if (agvphase == 0x09) { - if (move == 1 && error == 0 && ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("6"); - instructionService.update(inst); - writing("to_agv_release_finish", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - String next_device_code = inst.getNext_device_code(); - Device next_device = deviceAppservice.findDeviceByCode(next_device_code); - next_device.setMaterial_type(inst.getMaterial()); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,move:" + move + ",error:" + error + ",inst:" + inst); - - } - } - } - last_packer_ready = packer_ready;//包装机就绪 - last_lack_req = lack_req;//缺料请求 - last_hopper_already = hopper_already;//料斗已就位 - last_req_task_empty = req_task_empty;//请求取空料斗 - last_hopper_removed = hopper_removed;//料斗已取走 - last_move = move;//有货 - last_order_finish = order_finish;//订单完成 - last_mode = mode;//模式 所有设备就绪 - last_error = error; //报警信号 - last_order_now = order_now; //订单实时 - last_open_ready_time = open_ready_time; //开机准备时间(S) - last_device_running_time = device_running_time; //设备运转时间(S) - last_await_time = await_time; //待机时间(S) - last_order = order; //工单号 - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - public synchronized boolean apply_take_empty_task() throws Exception { - WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); - - Date date = new Date(); - if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - Boolean flag = false; - List list = routeLineService.getShortPathLinesByCode(this.device_code, "normal"); - if (ObjectUtil.isEmpty(list)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":未找到对应路由"); - throw new BadRequestException(this.device_code + ":未找到对应路由"); - } - String link_device = this.getDevice().getExtraValue().get("link_device_code").toString(); - ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(link_device); - if (ObjectUtil.isEmpty(order)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单"); - throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单"); - } - HailiangEngravingCacheDeviceDriver hailiangEngravingCacheDeviceDriver; - for (int i = 0; i < list.size(); i++) { - RouteLineDto dto = list.get(i); - String next_device_code = dto.getNext_device_code(); - Device route_link_device = deviceAppservice.findDeviceByCode(next_device_code); - if (route_link_device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) route_link_device.getDeviceDriver(); - if (hailiangEngravingCacheDeviceDriver.getMove() != 0) { - continue; - } - //querySameDestinationTask 查询是否有相同终点的任务 - int num = taskserver.querySameDestinationTask(next_device_code); - int numE = taskserver.querySameOriginTask(this.getDevice_code()); - if (num != 0 || numE != 0) { - continue; - } - //判断缓存位是否锁定 - JSONObject jsonObject = runpointwo.query("device_code = '" + next_device_code + "' and islock = '1'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonObject)) { - logServer.deviceLogToacs(this.device_code, "", "", "对应路由设备," + next_device_code + "已锁定"); - continue; - } - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - //onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_type("7"); - onedto.setTask_status("0"); - onedto.setPriority("1"); - onedto.setStart_device_code(this.getDevice().getDevice_code()); - onedto.setStart_point_code(this.getDevice().getDevice_code()); - onedto.setNext_device_code(next_device_code); - onedto.setNext_point_code(next_device_code); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - try { - taskserver.create(onedto); - //任务创建成功 锁定 - JSONObject map = new JSONObject(); - map.put("islock", "1"); - map.put("update_by", "auto"); - map.put("update_time", DateUtil.now()); - runpointwo.update(map, "device_code = '" + next_device_code + "'"); - flag = true; - break; - } catch (Exception e) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - } - } - //生成任务成功 - if (flag) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":取走空料斗任务创建成功"); - fullrequireSucess = true; - } else { - //如果都没有则调用mes接口申请入缓存线 - //生成任务 - //前往缓存线 - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线"); - } - } - return true; - } - - public synchronized boolean apply_task() throws Exception { - Date date = new Date(); - if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - Boolean flag = false; - List list = routeLineService.getPathLinesByCode(this.device_code, "normal"); - if (ObjectUtil.isEmpty(list)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":未找到对应路由"); - throw new BadRequestException(this.device_code + ":未找到对应路由"); - } - String link_device = this.getDevice().getExtraValue().get("link_device_code").toString(); - ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(link_device); - if (ObjectUtil.isEmpty(order)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单"); - throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单"); - } - - if (StrUtil.isNotEmpty(order.getIs_needmove()) && order.getIs_needmove().equals("0")) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "工单,不需要agv搬运"); - return false; - } - //查找当前工单对应的物料编号 - String cpbh = order.getMaterial_code(); - - HailiangEngravingCacheDeviceDriver hailiangEngravingCacheDeviceDriver; - for (int i = 0; i < list.size(); i++) { - RouteLineDto dto = list.get(i); - String start_device_code = dto.getDevice_code(); - Device route_link_device = deviceAppservice.findDeviceByCode(start_device_code); - if (route_link_device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { - hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) route_link_device.getDeviceDriver(); - if (hailiangEngravingCacheDeviceDriver.getMove() == 0 || hailiangEngravingCacheDeviceDriver.getMove() == 1) { - continue; - } - //querySameOriginTask 查询是否有相同起点的任务 - int num = taskserver.querySameOriginTask(start_device_code); - int numN = taskserver.querySameDestinationTask(this.getDevice_code()); - if (num != 0 || numN != 0) { - continue; - } - String material = route_link_device.getMaterial_type(); - if (StrUtil.isEmpty(material)) { - logServer.deviceLogToacs(this.device_code, "", "", hailiangEngravingCacheDeviceDriver.getDevice_code() + ":缓存位物料为空"); - continue; - } - if (material.equals(cpbh)) { - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - //onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_type("7"); - onedto.setTask_status("0"); - onedto.setPriority("1"); - // TODO 任务中物料数量要不要赋值 - onedto.setQuantity(order.getQty() + ""); - onedto.setStart_device_code(start_device_code); - onedto.setStart_point_code(start_device_code); - onedto.setNext_device_code(this.getDevice().getDevice_code()); - onedto.setNext_point_code(this.getDevice().getDevice_code()); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - try { - taskserver.create(onedto); - flag = true; - break; - } catch (Exception e) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - } - } - } - - //生成任务成功 - if (flag) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":缺料请求任务生成成功"); - requireSucess = true; - } else { - //如果都没有则调用mes接口申请入缓存线 - //生成任务 - //前往缓存线 - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线"); - } - } - return true; - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - } - - public void writing(int type, int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - logServer.deviceLogToacs(this.device_code, "", "", "下发信号:" + key + ",value:" + value); - ReadUtil.write(itemMap, server); - } - - public boolean instruction_apply() throws Exception { - return false; - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("1"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - - public void apply_OutEmpty() { - - } - - public synchronized boolean apply_InEmpty() throws Exception { - return false; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/ItemProtocol.java deleted file mode 100644 index 8107c58..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/ItemProtocol.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_packer_ready = "packer_ready";//包装机就绪 - public static String item_mode = "mode";//模式 所有设备就绪 - public static String item_move = "move";//有货 - public static String item_order_finish = "order_finish";//订单完成 - public static String item_lack_req = "lack_req";//缺料请求 - public static String item_hopper_already = "hopper_already";//料斗已就位 - public static String item_req_task_empty = "req_task_empty";//请求取空料斗 - public static String item_hopper_removed = "hopper_removed";//料斗已取走 - public static String item_error = "error"; //报警信号 - public static String item_order_now = "order_now"; //订单实时 - public static String item_open_ready_time = "open_ready_time"; //开机准备时间(S) - public static String item_device_running_time = "device_running_time"; //设备运转时间(S) - public static String item_await_time = "await_time"; //待机时间(S) - public static String item_order = "order"; //工单号 - - //开机 - public static String item_to_open = "to_open"; - //AGV放货完成 - public static String item_to_agv_release_finish = "to_agv_release_finish"; - //AGV取货完成 - public static String item_to_agv_take_finish = "to_agv_take_finish"; - //产量清零 - public static String item_to_clear = "to_clear"; - //确认完成(订单完成状态置零) - public static String item_to_confirm_finished = "to_confirm_finished"; - //工单强制完成 - public static String item_to_order_compel_finished = "to_order_compel_finished"; - //订单生产总量 - public static String item_to_order_prod_num = "to_order_prod_num"; - //工单号 - public static String item_to_order = "to_order"; - - - private HailiangPackerStationDeviceDriver driver; - - public ItemProtocol(HailiangPackerStationDeviceDriver driver) { - this.driver = driver; - } - - - public int getItem_heartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getItem_move() { - return this.getOpcIntegerValue(item_move); - } - - - public int getItem_order_finish() { - return this.getOpcIntegerValue(item_order_finish); - } - - - public int getItem_mode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getItem_error() { - return this.getOpcIntegerValue(item_error); - } - - public int getItem_order_now() { - return this.getOpcIntegerValue(item_order_now); - } - - - public int getItem_open_ready_time() { - return this.getOpcIntegerValue(item_open_ready_time); - } - - public int getItem_device_running_time() { - return this.getOpcIntegerValue(item_device_running_time); - } - - public int getItem_await_time() { - return this.getOpcIntegerValue(item_await_time); - } - - public int getItem_order() { - return this.getOpcIntegerValue(item_order); - } - - public int getItem_packer_ready() { - return this.getOpcIntegerValue(item_packer_ready); - } - - public int getItem_lack_req() { - return this.getOpcIntegerValue(item_lack_req); - } - - public int getItem_hopper_already() { - return this.getOpcIntegerValue(item_hopper_already); - } - - public int getItem_req_task_empty() { - return this.getOpcIntegerValue(item_req_task_empty); - } - - public int getItem_hopper_removed() { - return this.getOpcIntegerValue(item_hopper_removed); - } - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_packer_ready, "包装机就绪", "DB1.B0.5")); - list.add(new ItemDto(item_mode, "模式", "DB1.B0.6")); - list.add(new ItemDto(item_move, "光电信号", "DB1.B1.0")); - list.add(new ItemDto(item_order_finish, "订单完成", "DB1.B1.5")); - list.add(new ItemDto(item_lack_req, "缺料请求", "DB1.B2.0")); - list.add(new ItemDto(item_hopper_already, "料斗已到位", "DB1.B2.1")); - list.add(new ItemDto(item_req_task_empty, "请求取空料斗", "DB1.B2.6")); - list.add(new ItemDto(item_hopper_removed, "料斗已取走", "DB1.B2.7")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W4")); - list.add(new ItemDto(item_order_now, "订单实时", "DB1.D84")); - list.add(new ItemDto(item_open_ready_time, "开机准备时间", "DB1.D108")); - list.add(new ItemDto(item_device_running_time, "设备运转时间", "DB1.D112")); - list.add(new ItemDto(item_await_time, "待机时间", "DB1.D116")); - list.add(new ItemDto(item_order, "工单号", "DB1.D160")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_open, "设备开关", "DB2.W4", Boolean.valueOf(true))); - list.add(new ItemDto(item_to_agv_release_finish, "AGV放货完成", "DB2.W6")); - list.add(new ItemDto(item_to_agv_take_finish, "AGV取货完成", "DB2.W8")); - list.add(new ItemDto(item_to_clear, "当前产量清零", "DB2.W12")); - list.add(new ItemDto(item_to_confirm_finished, "确认完成", "DB2.W14")); - list.add(new ItemDto(item_to_order_compel_finished, "工单强制完成", "DB2.W82")); - list.add(new ItemDto(item_to_order_prod_num, "订单生产总量", "DB2.D84")); - list.add(new ItemDto(item_to_order, "工单号", "DB2.D160")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/HailiangSmartplcTestDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/HailiangSmartplcTestDeviceDriver.java deleted file mode 100644 index 2a8ed64..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/HailiangSmartplcTestDeviceDriver.java +++ /dev/null @@ -1,303 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_smart_plc_test; - -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * 海亮清洗机储料仓 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); - @Autowired - TaskService taskserver = SpringContextHolder.getBean(TaskService.class); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int heartbeat = 0; - int mode =0; - int error =0; - int error_num =0; - int open_time =0; - int close_time =0; - int ready_time =0; - int running_time =0; - int error_time =0; - int voltage =0; - int temperature =0; - int current =0; - int material =0; - int lack_material =0; - int full_material =0; - int storage_qty =0; - int feeding_qty =0; - int blanking_qty =0; - int qualified_qty =0; - int unqualified_qty =0; - int finish =0; - int task =0; - int noload_electricity_consumption =0; - int prod_electricity_consumption =0; - int gas_consumption =0; - int water_consumption =0; - int oil_level =0; - int monthly_electricity_consumption =0; - int pause =0; - - - int last_mode =0; - int last_error =0; - int last_error_num =0; - int last_open_time =0; - int last_close_time =0; - int last_ready_time =0; - int last_running_time =0; - int last_error_time =0; - int last_voltage =0; - int last_temperature =0; - int last_current =0; - int last_material =0; - int last_lack_material =0; - int last_full_material =0; - int last_storage_qty =0; - int last_feeding_qty =0; - int last_blanking_qty =0; - int last_qualified_qty =0; - int last_unqualified_qty =0; - int last_finish =0; - int last_task =0; - int last_noload_electricity_consumption =0; - int last_prod_electricity_consumption =0; - int last_gas_consumption =0; - int last_water_consumption =0; - int last_oil_level =0; - int last_monthly_electricity_consumption =0; - int last_pause =0; - - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - - int agvphase=0; - int index =0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - device_code = this.getDeviceCode(); - heartbeat = this.itemProtocol.getItem_heartbeat(); - mode = this.itemProtocol.getItem_mode(); - error = this.itemProtocol.getItem_error(); - error_num = this.itemProtocol.getItem_error_num(); - open_time = this.itemProtocol.getItem_open_time(); - close_time = this.itemProtocol.getItem_close_time(); - ready_time = this.itemProtocol.getItem_ready_time(); - running_time = this.itemProtocol.getItem_running_time(); - error_time = this.itemProtocol.getItem_error_time(); - voltage = this.itemProtocol.getItem_voltage(); - temperature = this.itemProtocol.getItem_temperature(); - current = this.itemProtocol.getItem_current(); - material = this.itemProtocol.getItem_material(); - lack_material = this.itemProtocol.getItem_lack_material(); - full_material = this.itemProtocol.getItem_full_material(); - storage_qty = this.itemProtocol.getItem_storage_qty(); - feeding_qty = this.itemProtocol.getItem_feeding_qty(); - blanking_qty = this.itemProtocol.getItem_blanking_qty(); - qualified_qty = this.itemProtocol.getItem_qualified_qty(); - unqualified_qty = this.itemProtocol.getItem_unqualified_qty(); - finish = this.itemProtocol.getItem_finish(); - task = this.itemProtocol.getItem_task(); - noload_electricity_consumption = this.itemProtocol.getItem_noload_electricity_consumption(); - prod_electricity_consumption = this.itemProtocol.getItem_prod_electricity_consumption(); - gas_consumption = this.itemProtocol.getItem_gas_consumption(); - water_consumption = this.itemProtocol.getItem_water_consumption(); - oil_level = this.itemProtocol.getItem_oil_level(); - monthly_electricity_consumption = this.itemProtocol.getItem_monthly_electricity_consumption(); - pause = this.itemProtocol.getItem_pause(); - - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess); - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - - if (finish != last_finish) { - logServer.deviceLog(this.device_code,"finish" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号finish:" + last_finish + "->" + finish); - if(finish == 1){ - ProduceshiftorderDto deviceInfo = produceshiftorderService.findOrderByDeviceCode(this.device_code); - deviceInfo.setOrder_status("2"); - produceshiftorderService.updateByOrderCode(deviceInfo); - } - } - last_finish = finish; - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - logServer.deviceLogToacs(this.device_code,"","","光电信号切换,刷新请求标记:"+this.requireSucess); - - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/ItemProtocol.java deleted file mode 100644 index ecc8e3d..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/ItemProtocol.java +++ /dev/null @@ -1,248 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_smart_plc_test; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_error = "error"; - public static String item_error_num = "error_num"; - public static String item_open_time = "open_time"; - public static String item_close_time = "close_time"; // - public static String item_ready_time = "ready_time"; // - public static String item_running_time = "running_time"; - public static String item_error_time = "error_time"; - public static String item_voltage = "voltage"; - public static String item_temperature = "temperature"; - public static String item_current = "current"; - public static String item_material = "material"; - public static String item_lack_material = "lack_material"; - public static String item_full_material = "full_material"; - public static String item_storage_qty = "storage_qty"; - public static String item_feeding_qty = "feeding_qty"; - public static String item_blanking_qty = "blanking_qty"; - public static String item_qualified_qty = "qualified_qty"; - public static String item_unqualified_qty = "unqualified_qty"; - public static String item_finish = "finish"; - public static String item_task = "task"; - public static String item_noload_electricity_consumption = "noload_electricity_consumption"; - public static String item_prod_electricity_consumption = "prod_electricity_consumption"; - public static String item_gas_consumption = "gas_consumption"; - public static String item_water_consumption = "water_consumption"; - public static String item_oil_level = "oil_level"; - public static String item_monthly_electricity_consumption = "monthly_electricity_consumption"; - public static String item_pause = "pause"; - - - - public static String item_to_heartbeat = "to_heartbeat";// - public static String item_to_command = "to_command";// - public static String item_to_feeding = "to_feeding";// - public static String item_to_task = "to_task";// - public static String item_to_pause= "to_pause";// - public static String item_to_clear = "to_clear";// - public static String item_to_finish = "to_finish";// - public static String item_to_open = "to_open";// - public static String item_to_close = "to_close";// - public static String item_to_material = "to_material";// - public static String item_to_qty = "to_qty";// - - - private HailiangSmartplcTestDeviceDriver driver; - - public ItemProtocol(HailiangSmartplcTestDeviceDriver driver) { - this.driver = driver; - } - - public int getItem_heartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getItem_mode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getItem_error() { - return this.getOpcIntegerValue(item_error); - } - - public int getItem_error_num() { - return this.getOpcIntegerValue(item_error_num); - } - - public int getItem_open_time() { - return this.getOpcIntegerValue(item_open_time); - } - - public int getItem_close_time() { - return this.getOpcIntegerValue(item_close_time); - } - - public int getItem_ready_time() { - return this.getOpcIntegerValue(item_ready_time); - } - - public int getItem_running_time() { - return this.getOpcIntegerValue(item_running_time); - } - - public int getItem_error_time() { - return this.getOpcIntegerValue(item_error_time); - } - - public int getItem_voltage() { - return this.getOpcIntegerValue(item_voltage); - } - - public int getItem_temperature() { - return this.getOpcIntegerValue(item_temperature); - } - - public int getItem_current() { - return this.getOpcIntegerValue(item_current); - } - - public int getItem_material() { - return this.getOpcIntegerValue(item_material); - } - - public int getItem_lack_material() { - return this.getOpcIntegerValue(item_lack_material); - } - - public int getItem_full_material() { - return this.getOpcIntegerValue(item_full_material); - } - - public int getItem_storage_qty() { - return this.getOpcIntegerValue(item_storage_qty); - } - - public int getItem_feeding_qty() { - return this.getOpcIntegerValue(item_feeding_qty); - } - - public int getItem_blanking_qty() { - return this.getOpcIntegerValue(item_blanking_qty); - } - - public int getItem_qualified_qty() { - return this.getOpcIntegerValue(item_qualified_qty); - } - - public int getItem_unqualified_qty() { - return this.getOpcIntegerValue(item_unqualified_qty); - } - - public int getItem_finish() { - return this.getOpcIntegerValue(item_finish); - } - - public int getItem_task() { - return this.getOpcIntegerValue(item_task); - } - - public int getItem_noload_electricity_consumption() { - return this.getOpcIntegerValue(item_noload_electricity_consumption); - } - - public int getItem_prod_electricity_consumption() { - return this.getOpcIntegerValue(item_prod_electricity_consumption); - } - - public int getItem_gas_consumption() { - return this.getOpcIntegerValue(item_gas_consumption); - } - - public int getItem_water_consumption() { - return this.getOpcIntegerValue(item_water_consumption); - } - - public int getItem_oil_level() { - return this.getOpcIntegerValue(item_oil_level); - } - - public int getItem_monthly_electricity_consumption() { - return this.getOpcIntegerValue(item_monthly_electricity_consumption); - } - - public int getItem_pause() { - return this.getOpcIntegerValue(item_pause); - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "VW0")); - list.add(new ItemDto(item_mode, "模式", "VW2")); - list.add(new ItemDto(item_error, "故障", "VW4")); - list.add(new ItemDto(item_error_num, "故障次数", "VD6")); - list.add(new ItemDto(item_open_time, "开机时间", "VD8")); - list.add(new ItemDto(item_close_time, "关机时间", "VD12")); - list.add(new ItemDto(item_ready_time, "待机时间", "VD16")); - list.add(new ItemDto(item_running_time, "生产时间", "VD20")); - list.add(new ItemDto(item_error_time, "故障时间", "VD24")); - list.add(new ItemDto(item_temperature, "温度", "VD28")); - list.add(new ItemDto(item_voltage, "电压", "VD32")); - list.add(new ItemDto(item_current, "电流", "VD36")); - list.add(new ItemDto(item_material, "当前生产产品编号", "VD40")); - list.add(new ItemDto(item_lack_material, "生产缺料信号", "VD44")); - list.add(new ItemDto(item_full_material, "生产满料信号", "VD48")); - list.add(new ItemDto(item_storage_qty, "储料斗数量", "VD52")); - list.add(new ItemDto(item_feeding_qty, "上料数量", "VD56")); - list.add(new ItemDto(item_blanking_qty, "下料数量", "VD60")); - list.add(new ItemDto(item_qualified_qty, "当前生产合格品数量", "VD64")); - list.add(new ItemDto(item_unqualified_qty, "当前生产不合格数量", "VD68")); - list.add(new ItemDto(item_finish, "生产完成", "VD72")); - list.add(new ItemDto(item_task, "任务号", "VD76")); - list.add(new ItemDto(item_noload_electricity_consumption, "空载电能耗(未生产时)", "VD80")); - list.add(new ItemDto(item_prod_electricity_consumption, "生产电能耗", "VD84")); - list.add(new ItemDto(item_gas_consumption, "气压能耗", "VD88")); - list.add(new ItemDto(item_water_consumption, "水流量能耗", "VD92")); - list.add(new ItemDto(item_oil_level, "当前液压油位", "VD96")); - list.add(new ItemDto(item_monthly_electricity_consumption, "本月总电能耗", "VD100")); - list.add(new ItemDto(item_pause, "设备暂停", "VD104")); - - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_heartbeat, "心跳", "VW200")); - list.add(new ItemDto(item_to_command, "下发命令", "VW202")); - list.add(new ItemDto(item_to_feeding, "下发命令", "VW204")); - list.add(new ItemDto(item_to_task, "任务号", "VW208")); - list.add(new ItemDto(item_to_pause, "生产暂停", "VW212")); - list.add(new ItemDto(item_to_clear, "当前产量清零", "VW216")); - list.add(new ItemDto(item_to_finish, "强制完成", "VW220")); - list.add(new ItemDto(item_to_open, "设备开机", "VW224")); - list.add(new ItemDto(item_to_close, "设备关机", "VW228")); - list.add(new ItemDto(item_to_material, "当前任务生产物料", "VW232")); - list.add(new ItemDto(item_to_qty, "当前任务生产数量", "VW236")); - return list; - } - - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDefination.java deleted file mode 100644 index 5817df3..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮专机设备 - */ -@Service -public class HailiangSpecialDeviceDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_special_device"; - } - - @Override - public String getDriverName() { - return "海亮-专机设备"; - } - - @Override - public String getDriverDescription() { - return "海亮-专机设备"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangSpecialDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangSpecialDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java deleted file mode 100644 index 0efa50a..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java +++ /dev/null @@ -1,564 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpResponse; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮专机设备 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int mode = 0; - int error = 0; - /* int move = 0;*/ - int task = 0; - int is_open = 0; - int running = 0; - int finish = 0; - int all_ready = 0; - int order_compel_finish = 0; - int order = 0; - int now_order_prod_num = 0; - int full_number = 0; - int now_one_box_num = 0; - int storage_stock_num = 0; - int line_stock_num = 0; - int open_ready_time = 0; - int device_running_time = 0; - int await_time = 0; - int order_prod_allnum = 0; - int empty_is_lack = 0; //空箱位缺箱 - int device_is_running = 0; //专机运行状态 - int empty_is_finish = 0; //空位完成 - int full_ready_req_agv = 0; //满箱位就绪,请求AGV - int full_out = 0; //满箱已运出满箱位 - int device_prepare = 0; //专机准备中 - int device_ready = 0; //专机就绪 - int line_ready = 0; //线体就绪 - int device_online = 0; //专机联机 - //出入库模式 - int operation_type = 0; - int last_mode = 0; - int last_error = 0; -/* int last_move = 0;*/ - int last_task = 0; - int last_is_open = 0; - int last_running = 0; - int last_finish = 0; - int last_all_ready = 0; - int last_order_compel_finish = 0; - int last_order = 0; - int last_now_order_prod_num = 0; - int last_full_number = 0; - int last_now_one_box_num = 0; - int last_storage_stock_num = 0; - int last_line_stock_num = 0; - int last_open_ready_time = 0; - int last_device_running_time = 0; - int last_await_time = 0; - int last_order_prod_allnum = 0; - int last_empty_is_lack = 0; //空箱位缺箱 - int last_device_is_running = 0; //专机运行状态 - int last_empty_is_finish = 0; //空位完成 - int last_full_ready_req_agv = 0; //满箱位就绪,请求AGV - int last_full_out = 0; //满箱已运出满箱位 - int last_device_prepare = 0; //专机准备中 - int last_device_ready = 0; //专机就绪 - int last_line_ready = 0; //线体就绪 - int last_device_online = 0; //专机联机 - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - error = this.itemProtocol.getError(); - task = this.itemProtocol.getTask(); - is_open = this.itemProtocol.getIsOpen(); - running = this.itemProtocol.getRunning(); - all_ready = this.itemProtocol.getAllReady(); - order = this.itemProtocol.getOrder(); - mode = this.itemProtocol.getItem_mode(); - finish = this.itemProtocol.getItem_finish(); - order_compel_finish = this.itemProtocol.getItem_order_compel_finish(); - now_order_prod_num = this.itemProtocol.getItem_now_order_prod_num(); - full_number = this.itemProtocol.getItem_full_number(); - now_one_box_num = this.itemProtocol.getItem_now_one_box_num(); - storage_stock_num = this.itemProtocol.getItem_storage_stock_num(); - line_stock_num = this.itemProtocol.getItem_line_stock_num(); - open_ready_time = this.itemProtocol.getItem_open_ready_time(); - device_running_time = this.itemProtocol.getItem_device_running_time(); - await_time = this.itemProtocol.getItem_await_time(); - order_prod_allnum = this.itemProtocol.getItem_order_prod_allnum(); - empty_is_lack = this.itemProtocol.getItem_empty_is_lack(); - device_is_running = this.itemProtocol.getItem_device_is_running(); - empty_is_finish = this.itemProtocol.getItem_empty_is_finish(); - full_ready_req_agv = this.itemProtocol.getItem_full_ready_req_agv(); - full_out = this.itemProtocol.getItem_full_out(); - device_prepare = this.itemProtocol.getItem_device_prepare(); - device_ready = this.itemProtocol.getItem_device_ready(); - line_ready = this.itemProtocol.getItem_line_ready(); - - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess); - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (empty_is_lack != last_empty_is_lack) { - logServer.deviceLog(this.device_code,"empty_is_lack" ,String.valueOf(empty_is_lack)); - logServer.deviceLogToacs(this.device_code,"","","信号empty_is_lack:" + last_empty_is_lack + "->" + empty_is_lack); - } - if (device_is_running != last_device_is_running) { - logServer.deviceLog(this.device_code,"device_is_running" ,String.valueOf(device_is_running)); - logServer.deviceLogToacs(this.device_code,"","","信号device_is_running:" + last_device_is_running + "->" + device_is_running); - } - if (empty_is_finish != last_empty_is_finish) { - logServer.deviceLog(this.device_code,"empty_is_finish" ,String.valueOf(empty_is_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号empty_is_finish:" + last_empty_is_finish + "->" + empty_is_finish); - } - if (full_ready_req_agv != last_full_ready_req_agv) { - logServer.deviceLog(this.device_code,"full_ready_req_agv" ,String.valueOf(full_ready_req_agv)); - logServer.deviceLogToacs(this.device_code,"","","信号full_ready_req_agv:" + last_full_ready_req_agv + "->" + full_ready_req_agv); - } - if (full_out != last_full_out) { - logServer.deviceLog(this.device_code,"full_out" ,String.valueOf(full_out)); - logServer.deviceLogToacs(this.device_code,"","","信号full_out:" + last_full_out + "->" + full_out); - } - if (device_prepare != last_device_prepare) { - logServer.deviceLog(this.device_code,"device_prepare" ,String.valueOf(device_prepare)); - logServer.deviceLogToacs(this.device_code,"","","信号device_prepare:" + last_device_prepare + "->" + device_prepare); - } - if (device_ready != last_device_ready) { - logServer.deviceLog(this.device_code,"device_ready" ,String.valueOf(device_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号device_ready:" + last_device_ready + "->" + device_ready); - } - if (line_ready != last_line_ready) { - logServer.deviceLog(this.device_code,"line_ready" ,String.valueOf(line_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号line_ready:" + last_line_ready + "->" + line_ready); - } - if (device_online != last_device_online) { - logServer.deviceLog(this.device_code,"device_online" ,String.valueOf(device_online)); - logServer.deviceLogToacs(this.device_code,"","","信号device_online:" + last_device_online + "->" + device_online); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - if (task != last_task) { - logServer.deviceLog(this.device_code,"task" ,String.valueOf(task)); - logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task); - } - - if (is_open != last_is_open) { - logServer.deviceLog(this.device_code,"is_open" ,String.valueOf(is_open)); - logServer.deviceLogToacs(this.device_code,"","","信号is_open:" + last_is_open + "->" + is_open); - } - if (running != last_running) { - logServer.deviceLog(this.device_code,"running" ,String.valueOf(running)); - logServer.deviceLogToacs(this.device_code,"","","信号running:" + last_running + "->" + running); - } - if (finish != last_finish) { - logServer.deviceLog(this.device_code,"finish" ,String.valueOf(finish)); - logServer.deviceLogToacs(this.device_code,"","","信号finish:" + last_finish + "->" + finish); - } - if (all_ready != last_all_ready) { - logServer.deviceLog(this.device_code,"all_ready" ,String.valueOf(all_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号all_ready:" + last_all_ready + "->" + all_ready); - } - if (order_compel_finish != last_order_compel_finish) { - logServer.deviceLog(this.device_code,"order_compel_finish" ,String.valueOf(order_compel_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号order_compel_finish:" + last_order_compel_finish + "->" + order_compel_finish); - } - if (order != last_order) { - logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); - logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); - } - if (now_order_prod_num != last_now_order_prod_num) { - logServer.deviceLog(this.device_code,"now_order_prod_num" ,String.valueOf(now_order_prod_num)); - logServer.deviceLogToacs(this.device_code,"","","信号now_order_prod_num:" + last_now_order_prod_num + "->" + now_order_prod_num); - } - if (full_number != last_full_number) { - logServer.deviceLog(this.device_code,"full_number" ,String.valueOf(full_number)); - logServer.deviceLogToacs(this.device_code,"","","信号full_number:" + last_full_number + "->" + full_number); - } - if (now_one_box_num != last_now_one_box_num) { - logServer.deviceLog(this.device_code,"now_one_box_num" ,String.valueOf(now_one_box_num)); - logServer.deviceLogToacs(this.device_code,"","","信号now_one_box_num:" + last_now_one_box_num + "->" + now_one_box_num); - } - if (storage_stock_num != last_storage_stock_num) { - logServer.deviceLog(this.device_code,"storage_stock_num" ,String.valueOf(storage_stock_num)); - logServer.deviceLogToacs(this.device_code,"","","信号storage_stock_num:" + last_storage_stock_num + "->" + storage_stock_num); - } - if (line_stock_num != last_line_stock_num) { - logServer.deviceLog(this.device_code,"line_stock_num" ,String.valueOf(line_stock_num)); - logServer.deviceLogToacs(this.device_code,"","","信号line_stock_num:" + last_line_stock_num + "->" + line_stock_num); - } - if (open_ready_time != last_open_ready_time) { - logServer.deviceLog(this.device_code,"open_ready_time" ,String.valueOf(task)); - logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task); - } - if (device_running_time != last_device_running_time) { - logServer.deviceLog(this.device_code,"device_running_time" ,String.valueOf(device_running_time)); - logServer.deviceLogToacs(this.device_code,"","","信号device_running_time:" + last_device_running_time + "->" + device_running_time); - } - if (await_time != last_await_time) { - logServer.deviceLog(this.device_code,"await_time" ,String.valueOf(await_time)); - logServer.deviceLogToacs(this.device_code,"","","信号await_time:" + last_await_time + "->" + await_time); - } - if (order_prod_allnum != last_order_prod_allnum) { - logServer.deviceLog(this.device_code,"order_prod_allnum" ,String.valueOf(order_prod_allnum)); - logServer.deviceLogToacs(this.device_code,"","","信号order_prod_allnum:" + last_order_prod_allnum + "->" + order_prod_allnum); - } - -/* if (mode == 2 && move != 0 && task > 0) { - - }*/ - } catch (Exception var17) { - return; - } - if(1 != 1){ -// if (!this.itemProtocol.getIsonline()) { -// this.setIsonline(false); -// this.setIserror(true); - message = "信号量同步异常"; - //未联机 -// } else if (mode == 0) { -// this.setIsonline(false); -// this.setIserror(true); -// message = "未联机"; - //有报警 -// } else if (error != 0) { -// this.setIsonline(false); -// this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - if ( mode == 1 && finish != last_finish && finish == 1 && order > 0){ - ProduceshiftorderDto dto = new ProduceshiftorderDto(); - dto.setOrder_code(order + ""); - dto.setOrder_status("2"); - ProduceshiftorderDto deviceInfo = produceshiftorderService.findOrderByDeviceCode(this.device_code); - if(deviceInfo != null){ - if (StrUtil.isNotEmpty(deviceInfo.getExt_order_id())) { - String ext_order_id = deviceInfo.getExt_order_id(); - JSONObject param = new JSONObject(); - param.put("ext_order_id",ext_order_id); - acsToWmsService.feedbackOrderStatus(param); - logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单的外部标识:"+ext_order_id); - }else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单的没有外部标识"); - } - }else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单信息为空"); - } - produceshiftorderService.updateByOrderCode(dto); - this.writing("to_confirm_finished","1"); - this.writing("to_clear","1"); - this.writing("to_pause","1"); - } else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,order_finish>"+ finish +",last_finish>"+last_finish); - } - } - last_mode = mode; - last_error = error; - /* last_move = move;*/ - last_task = task; - last_is_open = is_open; - last_running = running ; - last_finish = finish; - last_all_ready = all_ready; - last_order_compel_finish = order_compel_finish; - last_order = order; - last_now_order_prod_num = now_order_prod_num; - last_full_number = full_number; - last_now_one_box_num = now_one_box_num; - last_storage_stock_num = storage_stock_num; - last_line_stock_num = line_stock_num; - last_open_ready_time = open_ready_time; - last_device_running_time = device_running_time; - last_await_time = await_time; - last_order_prod_allnum = order_prod_allnum; - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - - } - - public void writing(String param, String value) { - String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + param; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_param, Integer.parseInt(value)); - ReadUtil.write(itemMap, server); - logServer.deviceLogToacs(this.device_code,"","","下发信号:" + param + ":" + value); - } - - - - - public boolean instruction_apply() throws Exception { - return false; - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - - public void apply_OutEmpty() { - - } - - public synchronized boolean apply_InEmpty() throws Exception { - return false; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/ItemProtocol.java deleted file mode 100644 index aae58eb..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/ItemProtocol.java +++ /dev/null @@ -1,263 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; //心跳 - public static String item_mode = "mode"; //模式 - public static String item_is_open = "is_open";// 线体是否启动 - public static String item_running = "running"; //是否运行 - public static String item_finish = "finish";// 订单完成 - public static String item_all_ready = "all_ready"; //所有设备就绪 - public static String item_order_compel_finish = "order_compel_finish"; // 订单强制完成 - public static String item_order = "order"; //订单号 - public static String item_error = "error"; //报警信号 - public static String item_task = "task"; //任务号 - public static String item_now_order_prod_num = "now_order_prod_num"; //当前生产总量 - public static String item_full_number = "full_number"; //出料口满框数量 - public static String item_now_one_box_num = "now_one_prod_num"; //每框数量 - public static String item_storage_stock_num = "storage_stock_num"; //储料仓库存数量 - public static String item_line_stock_num = "line_stock_num"; //线体库存数量 - public static String item_open_ready_time = "open_ready_time";//开机准备时间(S) - public static String item_device_running_time = "device_running_time";//设备运行时间(S) - public static String item_await_time = "await_time";//待机时间(S) - public static String item_order_prod_allnum = "order_prod_allnum";//订单生产总量 - - public static String item_empty_is_lack = "empty_is_lack"; //空箱位缺箱 - public static String item_device_is_running = "device_is_running"; //专机运行状态 - public static String item_empty_is_finish = "empty_is_finish"; //空位完成 - public static String item_full_ready_req_agv = "full_ready_req_agv"; //满箱位就绪,请求AGV - public static String item_full_out = "full_out"; //满箱已运出满箱位 - public static String item_device_prepare = "device_prepare"; //专机准备中 - public static String item_device_ready = "device_prepare"; //专机就绪 - public static String item_line_ready = "line_ready"; //线体就绪 - - - //开机 - public static String item_to_open = "to_open"; - //产量清零 - public static String item_to_clear = "to_clear"; - //确认完成(订单完成状态置零) - public static String item_to_confirm_finished = "to_confirm_finished"; - //暂停 - public static String item_to_pause = "to_pause"; - //工单强制完成 - public static String item_to_order_compel_finished = "to_order_compel_finished"; - //订单生产总量 - public static String item_to_order_prod_num = "to_order_prod_num"; - //每框接料数量 - public static String item_to_one_box_num = "to_one_box_num"; - //倒料数量 - public static String item_to_out_num = "to_out_num"; - //工单号 - public static String item_to_order = "to_order"; - //agvAGV空位就绪 - public static String item_to_empty_ready = "to_empty_ready"; - //agvAGV满位就绪 - public static String item_to_full_ready = "to_full_ready"; - //agvAGV取货完成 - public static String item_to_pick_finish = "to_pick_finish"; - //任务号 - public static String item_to_task = "to_task"; - - private HailiangSpecialDeviceDriver driver; - - public ItemProtocol(HailiangSpecialDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getIsOpen() { - return this.getOpcIntegerValue(item_is_open); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getRunning() { return this.getOpcIntegerValue(item_running);} - - public int getAllReady() { return this.getOpcIntegerValue(item_all_ready);} - - public int getOrder() { return this.getOpcIntegerValue(item_order);} - - public int getTask() { - return this.getOpcIntegerValue(item_task); - } - - public int getItem_mode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getItem_finish() { - return this.getOpcIntegerValue(item_finish); - } - - public int getItem_order_compel_finish() { - return this.getOpcIntegerValue(item_order_compel_finish); - } - - public int getItem_now_order_prod_num() { - return this.getOpcIntegerValue(item_now_order_prod_num); - } - - public int getItem_full_number() { - return this.getOpcIntegerValue(item_full_number); - } - - public int getItem_now_one_box_num() { - return this.getOpcIntegerValue(item_now_one_box_num); - } - - public int getItem_storage_stock_num() { - return this.getOpcIntegerValue(item_storage_stock_num); - } - - public int getItem_line_stock_num() { - return this.getOpcIntegerValue(item_line_stock_num); - } - - public int getItem_open_ready_time() { - return this.getOpcIntegerValue(item_open_ready_time); - } - - public int getItem_device_running_time() { - return this.getOpcIntegerValue(item_device_running_time); - } - - public int getItem_await_time() { - return this.getOpcIntegerValue(item_await_time); - } - - public int getItem_order_prod_allnum() { - return this.getOpcIntegerValue(item_order_prod_allnum); - } - - public int getItem_empty_is_lack() { - return this.getOpcIntegerValue(item_empty_is_lack); - } - - public int getItem_device_is_running() { - return this.getOpcIntegerValue(item_device_is_running); - } - - public int getItem_empty_is_finish() { - return this.getOpcIntegerValue(item_empty_is_finish); - } - - public int getItem_full_ready_req_agv() { - return this.getOpcIntegerValue(item_full_ready_req_agv); - } - - public int getItem_full_out() { - return this.getOpcIntegerValue(item_full_out); - } - - public int getItem_device_prepare() { - return this.getOpcIntegerValue(item_device_prepare); - } - - public int getItem_device_ready() { - return this.getOpcIntegerValue(item_device_ready); - } - - public int getItem_line_ready() { - return this.getOpcIntegerValue(item_line_ready); - } - - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static String getField_desc(String item){ - String field_desc = ""; - List readlist = getReadableItemDtos(); - List writelist = getWriteableItemDtos(); - for(int i=0;i getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_mode, "手自动状态", "DB1.B1.7", Boolean.valueOf(true))); - list.add(new ItemDto(item_is_open, "线体是否启动", "DB1.B0.1")); - list.add(new ItemDto(item_running, "是否运行", "DB1.B0.6")); - list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B1.6")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W4")); - list.add(new ItemDto(item_order_compel_finish, "订单强制完成", "DB1.B2.0")); - list.add(new ItemDto(item_now_order_prod_num, "当前生产总量", "DB1.D84")); - list.add(new ItemDto(item_now_one_box_num, "每框箱数量", "DB1.D99")); - list.add(new ItemDto(item_full_number, "出料口满框数量", "DB1.D96")); - list.add(new ItemDto(item_storage_stock_num, "储料仓库存数量", "DB1.D100")); - list.add(new ItemDto(item_line_stock_num, "线体库存数量", "DB1.D104")); - list.add(new ItemDto(item_open_ready_time, "开机准备时间(S)", "DB1.D108")); - list.add(new ItemDto(item_device_running_time, "设备运行时间(S)", "DB1.D112")); - list.add(new ItemDto(item_await_time, "待机时间(S)", "DB1.D116")); - list.add(new ItemDto(item_order_prod_allnum, "订单生产总量", "DB1.D120")); - list.add(new ItemDto(item_task, "任务号", "DB1.D22")); - list.add(new ItemDto(item_empty_is_lack, "空箱位缺箱", "DB1.B0.5")); - list.add(new ItemDto(item_device_is_running, "专机运行状态", "DB1.B0.3")); - list.add(new ItemDto(item_empty_is_finish, "空位完成", "DB1.B0.7")); - list.add(new ItemDto(item_full_ready_req_agv, "满箱位就绪,请求AGV", "DB1.B1.0")); - list.add(new ItemDto(item_full_out, "满箱已运出满箱位", "DB1.B1.1")); - list.add(new ItemDto(item_device_prepare, "专机准备中", "DB1.B1.3")); - list.add(new ItemDto(item_device_ready, "专机就绪", "DB1.B1.4")); - list.add(new ItemDto(item_line_ready, "线体就绪", "DB1.B1.5")); - list.add(new ItemDto(item_order, "工单号", "DB1.D160")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_open, "设备开关", "DB2.W4", Boolean.valueOf(true))); - list.add(new ItemDto(item_to_clear, "当前产量清零", "DB2.W12")); - list.add(new ItemDto(item_to_confirm_finished, "确认完成", "DB2.W14")); - list.add(new ItemDto(item_to_pause, "暂停", "DB2.W16")); - list.add(new ItemDto(item_to_order_compel_finished, "工单强制完成", "DB2.W82")); - list.add(new ItemDto(item_to_order_prod_num, "订单生产总量", "DB2.D84")); - list.add(new ItemDto(item_to_one_box_num, "每箱接料数量", "DB2.D88")); - list.add(new ItemDto(item_to_out_num, "倒料数量", "DB2.D96")); - list.add(new ItemDto(item_to_order, "工单号", "DB2.D160")); - list.add(new ItemDto(item_to_empty_ready, "AGV空位就绪", "DB2.W6")); - list.add(new ItemDto(item_to_full_ready, "AGV满位就绪", "DB2.W8")); - list.add(new ItemDto(item_to_pick_finish, "AGV取货完成", "DB2.W10")); - list.add(new ItemDto(item_to_task, "任务号", "DB2.D92")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDefination.java deleted file mode 100644 index 848d15f..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮专机设备空框位 - */ -@Service -public class HailiangSpecialEmptyStationDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_special_empty_station"; - } - - @Override - public String getDriverName() { - return "海亮-专机设备空框位"; - } - - @Override - public String getDriverDescription() { - return "海亮-专机设备空框位"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangSpecialEmptyStationDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangSpecialEmptyStationDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java deleted file mode 100644 index 88c5de3..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java +++ /dev/null @@ -1,426 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.run.NDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮专机设备空框位 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - - String container; - - int agvphase = 0; - int index = 0; - String device_code; - - int mode = 0; - int status = 0; - int move = 0; - int finish = 0; - int allready = 0; - int order = 0; - int error = 0; - int task = 0; - int running = 0; - //出入库模式 - int operation_type = 0; - int last_mode = 0; - int last_status = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - int last_all_ready = 0; - int last_order = 0; - int last_finish = 0; - int last_running = 0; - - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - error = this.itemProtocol.getError(); - move = this.itemProtocol.getMove(); - status = this.itemProtocol.getStatus(); - task = this.itemProtocol.getTask(); - allready = this.itemProtocol.getAllReady(); - mode = this.itemProtocol.getMode(); - finish = this.itemProtocol.getFinish(); - order = this.itemProtocol.getOrder(); - hasGoods = this.itemProtocol.getMove(); - running = this.itemProtocol.getRunning(); - if (mode != last_mode) { - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - if (move == 1) { - thingToNothing(); - } - this.setRequireSucess(false); - logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); - logServer.deviceLogToacs(this.device_code,"","","信号move(取反):" + last_move + "->" + move); - } - if (status != last_status) { - logServer.deviceLog(this.device_code,"status" ,String.valueOf(status)); - logServer.deviceLogToacs(this.device_code,"","","信号status:" + last_status + "->" + status); - } - if (task != last_task) { - logServer.deviceLog(this.device_code,"task" ,String.valueOf(task)); - logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task); - } - if (running != last_running) { - logServer.deviceLog(this.device_code,"running" ,String.valueOf(running)); - logServer.deviceLogToacs(this.device_code,"","","信号running:" + last_running + "->" + running); - } - if (allready != last_all_ready) { - logServer.deviceLog(this.device_code,"allready" ,String.valueOf(allready)); - logServer.deviceLogToacs(this.device_code,"","","信号all_ready:" + last_all_ready + "->" + allready); - } - if (finish != last_finish) { - logServer.deviceLog(this.device_code,"finish" ,String.valueOf(finish)); - logServer.deviceLogToacs(this.device_code,"","","信号finish:" + last_finish + "->" + finish); - } - if (order != last_order) { - logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); - logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - - if (mode == 2 && move != 0 && task > 0) { - - } - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 - } else if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - } else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - //请求放空箱 - if(agvphase == 0x13 || agvphase == 0x17 ) - { - if(error == 0 && move== 1 && ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("5"); - instructionService.update(inst); - writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); - NDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - }else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); - } - } - //放空箱完成 - if(agvphase == 0x15 || agvphase == 0x19){ - if(error == 0 && move== 1 && ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("6"); - instructionService.update(inst); - byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); - NDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - }else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); - } - } - } - last_mode = mode; - last_status = status; - last_error = error; - last_move = move; - last_task = task; - last_all_ready = allready; - last_finish = finish; - last_order = order; - last_running = running; - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - this.setRequireSucess(false); - this.setApplySucess(false); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - } - - public void writing(int type, int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } - - public boolean instruction_apply() throws Exception { - return false; - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - - public void apply_OutEmpty() { - - } - - public synchronized boolean apply_InEmpty() throws Exception { - return false; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/ItemProtocol.java deleted file mode 100644 index 2095478..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/ItemProtocol.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_move = "move"; - public static String item_running = "running"; - public static String item_status = "status"; - public static String item_finish = "finish"; - public static String item_all_ready = "all_ready"; - public static String item_order = "order"; - public static String item_error = "error"; - public static String item_task = "task"; - - public static String item_to_agv_ready = "to_agv_ready"; - - public static String item_to_agv_finish = "to_agv_finish"; - - private HailiangSpecialEmptyStationDeviceDriver driver; - - public ItemProtocol(HailiangSpecialEmptyStationDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getMove() { - return this.getOpcIntegerValue(item_move); - } - - public int getRunning() { - return this.getOpcIntegerValue(item_running); - } - - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getFinish() { return this.getOpcIntegerValue(item_finish);} - - public int getAllReady() { return this.getOpcIntegerValue(item_all_ready);} - - public int getOrder() { return this.getOpcIntegerValue(item_order);} - - public int getTask() { - return this.getOpcIntegerValue(item_task); - } - public int getStatus() { - return this.getOpcIntegerValue(item_status); - } - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_mode, "是否启动", "DB1.B0.1")); - list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true))); - list.add(new ItemDto(item_move, "光电开关信号(取反)", "DB1.B0.5")); - list.add(new ItemDto(item_running, "空位运行", "DB1.B0.6")); - list.add(new ItemDto(item_finish, "是否完成", "DB1.B0.7")); - list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B1.6")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W4")); - list.add(new ItemDto(item_task, "任务号", "DB1.D22")); - list.add(new ItemDto(item_order, "工单号", "DB1.D160")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_agv_ready, "AGV就绪", "DB2.W6", Boolean.valueOf(true))); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDefination.java deleted file mode 100644 index 4503023..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮专机设备满框位 - */ -@Service -public class HailiangSpecialFullStationDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_special_full_station"; - } - - @Override - public String getDriverName() { - return "海亮-专机设备满框位"; - } - - @Override - public String getDriverDescription() { - return "海亮-专机设备满框位"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangSpecialFullStationDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangSpecialFullStationDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java deleted file mode 100644 index 0f177bb..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java +++ /dev/null @@ -1,675 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpResponse; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_feeding_line.HailiangCleaningFeedingLineDefination; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.exception.BadRequestException; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.run.NDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮专机设备满框位 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); - @Autowired - TaskService taskserver = SpringContextHolder.getBean(TaskService.class); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int mode = 0; - int move = 0; - int status = 0; - int finish = 0; - int allready = 0; - int order = 0; - int error = 0; - int task = 0; - int full_number = 0; - //出入库模式 - int operation_type = 0; - int last_mode = 0; - int last_status = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - int last_all_ready = 0; - int last_order = 0; - int last_finish = 0; - int last_full_number = 0; - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - int agvphase = 0; - int index = 0; - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - error = this.itemProtocol.getError(); - move = this.itemProtocol.getMove(); - task = this.itemProtocol.getTask(); - allready = this.itemProtocol.getAllReady(); - mode = this.itemProtocol.getMode(); - finish = this.itemProtocol.getFinish(); - order = this.itemProtocol.getOrder(); - hasGoods = this.itemProtocol.getMove(); - full_number = this.itemProtocol.getFull_number(); - - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess); - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - if (move == 0) { - thingToNothing(); - } - logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); - logServer.deviceLogToacs(this.device_code,"","","信号move:" + last_move + "->" + move); - } - if (status != last_status) { - logServer.deviceLog(this.device_code,"status" ,String.valueOf(status)); - logServer.deviceLogToacs(this.device_code,"","","信号status:" + last_status + "->" + status); - } - if (full_number != last_full_number) { - logServer.deviceLog(this.device_code,"full_number" ,String.valueOf(full_number)); - logServer.deviceLogToacs(this.device_code,"","","信号full_number:" + last_full_number + "->" + full_number); - } - if (task != last_task) { - logServer.deviceLog(this.device_code,"task" ,String.valueOf(task)); - logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task); - } - if (allready != last_all_ready) { - logServer.deviceLog(this.device_code,"allready" ,String.valueOf(allready)); - logServer.deviceLogToacs(this.device_code,"","","信号all_ready:" + last_all_ready + "->" + allready); - } - if (finish != last_finish) { - logServer.deviceLog(this.device_code,"finish" ,String.valueOf(finish)); - logServer.deviceLogToacs(this.device_code,"","","信号finish:" + last_finish + "->" + finish); - } - if (order != last_order) { - logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); - logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - - } catch (Exception var17) { - return; - } - -// if (!this.itemProtocol.getIsonline()) { -// this.setIsonline(false); -// this.setIserror(true); -// message = "信号量同步异常"; -// //未联机 -// } else - if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 -// } else if (error != 0) { -// this.setIsonline(false); -// this.setIserror(true); -// message = "有报警"; -// //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - - if(!requireSucess){ -// if ( move == 1 && mode == 1 && order > 0 && full_number>0 ) { - - if ( move == 1 && mode == 1 ) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务"); - apply_task(); - } else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "申请任务失败,不符合条件"); - } - } else { - logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess); - - } - - if(agvphase == 0x03 || agvphase == 0x07 ) - { - if(move ==1 && error == 0 && allready ==1 && full_number>0 && ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("1"); - instructionService.update(inst); - writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); - NDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst+",allready:"+allready+",full_number:"+full_number); - - - } - } - - if(agvphase == 0x05 || agvphase == 0x09){ - if(move ==0 && error == 0 && allready ==1 && full_number>0 && ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("2"); - instructionService.update(inst); - writing("to_agv_finish", "1"); - byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); - NDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); - - } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst+",allready:"+allready+",full_number:"+full_number); - - - } - } - - } - last_mode = mode; - last_status = status; - last_error = error; - last_move = move; - last_task = task; - last_all_ready = allready; - last_finish = finish; - last_order = order; - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - logServer.deviceLogToacs(this.device_code,"","","光电信号切换,刷新请求标记:"+this.requireSucess); - - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } - - public synchronized boolean apply_task() throws Exception { - Date date = new Date(); - if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - Boolean flag = false; - //通过路由找到所有的目标设备 - //找到当前设备生产的物料,并且判断下个工序生产的物料相同 - //判断是否已经有前往这个工位的任务 - List list = routeLineService.getShortPathLinesByCode(this.device_code, "normal"); - if (ObjectUtil.isEmpty(list)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":未找到对应路由"); - throw new BadRequestException(this.device_code + ":未找到对应路由"); - } - //link_device tw 满料位设备关联的设备tw - String link_device = this.getDevice().getExtraValue().get("link_device_code").toString(); - //empty_device 满料位对应的空料位 - String empty_device = this.getDevice().getExtraValue().get("empty_device_code").toString(); - //通过满料位设备关联的设备tw查找订单 - ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(link_device); - if (ObjectUtil.isEmpty(order)) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单"); - throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单"); - } - //判断是否需要agv搬运 - if (order.getIs_needmove().equals("0")){ - requireSucess = true; - logServer.deviceLogToacs(this.device_code,"","","不需要agv搬运,工单号:"+order.getOrder_code()); - return true; - } - //查找当前工单对应的物料编号 - String cpbh = order.getMaterial_code(); - HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver; - HailiangCleaningMachineStorageStationDeviceDriver hailiangCleaningMachineStorageStationDeviceDriver; - HailiangAutoCacheLineDeviceDriver hailiangAutoCacheLineDeviceDriver; - String clear_storage_device =null; - //遍历路由,找到对应所有的物料进行匹配 - for (int i = 0; i < list.size(); i++) { - RouteLineDto dto = list.get(i); - //找到路由对应工位 清洗机设备编号 - String route_device_code = dto.getNext_device_code(); - Device route_link_device = deviceAppservice.findDeviceByCode(route_device_code); - //找到路由工位对应设备 - String route_link_device_code = (String)route_link_device.getExtraValue().get("link_device_code"); - if(StrUtil.isEmpty(route_link_device_code)){ - continue; - } - //找到路由工位对应设备对应的工单 - ProduceshiftorderDto route_order = produceshiftorderService.findOrderByDeviceCode(route_link_device_code); - //找到对应设备工单 - if (ObjectUtil.isNotEmpty(route_order)) { - //找到生产产品一样的设备 - if (StrUtil.equals(route_order.getMaterial_code(), cpbh)) { - //所有到这个倒料位上任务的总数量 - int allnum = taskserver.queryAllTaskMaterialQty(route_link_device_code); - //查询此工位是否需要补料 - //获取此工位允许的最大上料数量 - int max_num = Integer.parseInt(route_link_device.getExtraValue().get("max_num").toString()); - //判断设备是专机倒料位 - if (route_link_device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) { - hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) route_link_device.getDeviceDriver(); - if (hailiangSpecialPourStationDeviceDriver.getMode() != 1) { - continue; - } - //获取储料仓库存数量 - int stock_num = hailiangSpecialPourStationDeviceDriver.getStorage_stock_num(); - //此款数量+储料仓库存数量 < 下工序允许最大数量 则通过 - if (allnum + full_number + stock_num < max_num) { - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_status("0"); - onedto.setPriority("101"); - onedto.setAgv_system_type("1"); - onedto.setTask_type("1"); - onedto.setStart_device_code(this.getDevice().getDevice_code()); - onedto.setStart_point_code(this.getDevice().getDevice_code()); - onedto.setPut_device_code(route_device_code); - onedto.setPut_point_code(route_device_code); - onedto.setNext_point_code(empty_device); - onedto.setNext_device_code(empty_device); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - - try { - taskserver.create(onedto); - flag = true; - break; - } catch (Exception e) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务成功"); - } else { - //打印日志 - continue; - } - } - - } - else if (route_link_device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver){ - JSONObject json = new JSONObject(); - json.put("device_code",device_code); - json.put("type","1"); - HttpResponse httpResponse = acsToWmsService.applyInCacheLineTask(json); - JSONObject jsonObject = JSONObject.parseObject(httpResponse.body()); - String ext_task_id = jsonObject.getString("ext_task_id"); - String task_code = jsonObject.getString("task_code"); - String start_device_code = jsonObject.getString("start_device_code"); - String put_device_code = jsonObject.getString("put_device_code"); - String next_device_code = jsonObject.getString("next_device_code"); - String task_type = jsonObject.getString("task_type"); - String barcodeArr = jsonObject.getString("barcodeArr"); - String[] barcodeArrs = barcodeArr.split("\\,"); - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - onedto.setExt_task_id(ext_task_id); - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_status("0"); - onedto.setPriority("101"); - onedto.setAgv_system_type("1"); - onedto.setTask_type(task_type); - onedto.setTask_id(IdUtil.simpleUUID()); - onedto.setTask_code(task_code); - onedto.setStart_device_code(start_device_code); - onedto.setStart_point_code(start_device_code); - onedto.setPut_device_code(put_device_code); - onedto.setPut_point_code(put_device_code); - onedto.setNext_point_code(next_device_code); - onedto.setNext_device_code(next_device_code); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - try { - taskserver.create(onedto); - flag = true; - } catch (Exception e) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - } - } else { - //清洗倒料位是没有工单的 - if (route_link_device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { - //优先判断是否有相同的物料 - //优先找相同的物料的倒料位,然后判断最大重量是否可放,如果都没有则找个空的位置 - //需要在这个驱动中设置允许最大重量,如果当前重量超过了,则不能倒料 - hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) route_link_device.getDeviceDriver(); - String material = route_link_device.getMaterial(); - int maxWeight = Integer.parseInt(route_link_device.getExtraValue().get("max_weight").toString()); - //此处需要考虑已有任务的情况 - if (StrUtil.equals(material,cpbh) && hailiangCleaningMachineStorageStationDeviceDriver.getSilo_weight() < maxWeight ){ - clear_storage_device = route_link_device.getDevice_code(); - //直接生成任务 - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_status("0"); - onedto.setAgv_system_type("1"); - onedto.setTask_type("1"); - onedto.setPriority("101"); - onedto.setStart_device_code(this.getDevice().getDevice_code()); - onedto.setStart_point_code(this.getDevice().getDevice_code()); - onedto.setPut_device_code(route_device_code); - onedto.setPut_point_code(route_device_code); - onedto.setNext_point_code(empty_device); - onedto.setNext_device_code(empty_device); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - - try { - taskserver.create(onedto); - route_link_device.setMaterial(cpbh); - hailiangCleaningMachineStorageStationDeviceDriver.setMaterial(cpbh); - flag = true; - break; - } catch (Exception e) { - route_link_device.setMaterial(""); - hailiangCleaningMachineStorageStationDeviceDriver.setMaterial(""); - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务成功"); - break; - } - } - } - } - - if(StrUtil.isEmpty(clear_storage_device)){ - //表示没有该物料工位 直接寻找空位倒料 - for (int i = 0; i < list.size(); i++) { - RouteLineDto dto = list.get(i); - //找到路由对应工位 - String route_device_code = dto.getNext_device_code(); - Device route_link_device = deviceAppservice.findDeviceByCode(route_device_code); - if (route_link_device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { - hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) route_link_device.getDeviceDriver(); - //寻找空位倒料 - String material = route_link_device.getMaterial(); - if (StrUtil.isEmpty(material)){ - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_status("0"); - onedto.setPriority("101"); - onedto.setAgv_system_type("1"); - onedto.setTask_type("1"); - onedto.setStart_device_code(this.getDevice().getDevice_code()); - onedto.setStart_point_code(this.getDevice().getDevice_code()); - onedto.setPut_device_code(route_device_code); - onedto.setPut_point_code(route_device_code); - onedto.setNext_point_code(empty_device); - onedto.setNext_device_code(empty_device); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - try { - taskserver.create(onedto); - //将当前工单物料赋给对应的清洗路由工位 - route_link_device.setMaterial(cpbh); - hailiangCleaningMachineStorageStationDeviceDriver.setMaterial(cpbh); - flag = true; - break; - } catch (Exception e) { - route_link_device.setMaterial(""); - hailiangCleaningMachineStorageStationDeviceDriver.setMaterial(""); - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - break; - } - } - } - } - - //生成任务成功 - if (flag) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功"); - requireSucess = true; - } else { - //如果都没有则调用mes接口申请入缓存线 - //生成任务 - //前往缓存线 - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线"); - } - } - return true; - } - - public synchronized boolean applyInCacheLineTask() throws Exception { - Boolean flag = false; - - //生成任务成功 - if (flag) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功"); - requireSucess = true; - } else { - //如果都没有则调用mes接口申请入缓存线 - //生成任务 - //前往缓存线 - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线"); - } - - return true; - } - - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/ItemProtocol.java deleted file mode 100644 index 68d6694..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/ItemProtocol.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_move = "move"; - public static String item_status = "status"; - public static String item_finish = "finish"; - public static String item_all_ready = "all_ready"; - public static String item_order = "order"; - public static String item_error = "error"; - public static String item_task = "task"; - public static String item_full_number = "full_number"; - - public static String item_to_agv_ready = "to_agv_ready"; - - public static String item_to_agv_finish = "to_agv_finish"; - - private HailiangSpecialFullStationDeviceDriver driver; - - public ItemProtocol(HailiangSpecialFullStationDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMove() { - return this.getOpcIntegerValue(item_move); - } - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - public int getStatus() { - return this.getOpcIntegerValue(item_status); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getFinish() { return this.getOpcIntegerValue(item_finish);} - - public int getAllReady() { return this.getOpcIntegerValue(item_all_ready);} - - public int getOrder() { return this.getOpcIntegerValue(item_order);} - - public int getTask() { - return this.getOpcIntegerValue(item_task); - } - - public int getFull_number() { - return this.getOpcIntegerValue(item_full_number); - } - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - //System.out.println(driver.getDevice_code()+":" + protocol+"数据同步异常"); - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_mode, "是否启动", "DB1.B0.1")); - list.add(new ItemDto(item_move, "光电开关信号", "DB1.B1.0")); - list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true))); - list.add(new ItemDto(item_finish, "是否完成", "DB1.B0.7")); - list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B1.6")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W4")); - list.add(new ItemDto(item_task, "任务号", "DB1.D22")); - list.add(new ItemDto(item_order, "工单号", "DB1.D160")); - list.add(new ItemDto(item_full_number, "出料口满框数量", "DB1.D96")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_agv_ready, "AGV就绪", "DB2.W8", Boolean.valueOf(true))); - list.add(new ItemDto(item_to_agv_finish, "AGV完成", "DB2.W10", Boolean.valueOf(true))); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDefination.java deleted file mode 100644 index bc2464c..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pick_station; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮专机设备接框位 - */ -@Service -public class HailiangSpecialPickStationDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_special_pick_station"; - } - - @Override - public String getDriverName() { - return "海亮-专机设备接框位"; - } - - @Override - public String getDriverDescription() { - return "海亮-专机设备接框位"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangSpecialPickStationDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangSpecialPickStationDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDeviceDriver.java deleted file mode 100644 index e300a5c..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDeviceDriver.java +++ /dev/null @@ -1,406 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pick_station; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮专机设备接框位 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int mode = 0; - int status = 0; - int error = 0; - int task = 0; - int finish = 0; - int order = 0; - int full_number = 0; - //出入库模式 - int operation_type = 0; - int last_mode = 0; - int last_status = 0; - int last_error = 0; - int last_task = 0; - int last_finish = 0; - int last_order = 0; - int last_full_number = 0; - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - error = this.itemProtocol.getError(); - task = this.itemProtocol.getTask(); - mode = this.itemProtocol.getMode(); - status = this.itemProtocol.getStatus(); - order = this.itemProtocol.getOrder(); - finish = this.itemProtocol.getFinish(); - full_number = this.itemProtocol.getFull_number(); - - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess); - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (status != last_status) { - logServer.deviceLog(this.device_code,"status" ,String.valueOf(status)); - logServer.deviceLogToacs(this.device_code,"","","信号status:" + last_status + "->" + status); - } - if (task != last_task) { - logServer.deviceLog(this.device_code,"task" ,String.valueOf(task)); - logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task); - } - if (full_number != last_full_number) { - logServer.deviceLog(this.device_code,"full_number" ,String.valueOf(full_number)); - logServer.deviceLogToacs(this.device_code,"","","信号full_number:" + last_full_number + "->" + full_number); - } - if (finish != last_finish) { - logServer.deviceLog(this.device_code,"finish" ,String.valueOf(finish)); - logServer.deviceLogToacs(this.device_code,"","","信号finish:" + last_finish + "->" + finish); - } - if (order != last_order) { - logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); - logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - -/* if (mode == 2 && move != 0 && task > 0) { - - }*/ - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 - } else if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - } else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - switch (mode) { - case 1: - log.debug("设备运转模式:等待工作"); - break; - case 2: - //申请任务 - - break; - case 3: - - break; - case 4: - //叫料 - - break; - case 5: - //申请空盘 - /* if (move == 0 && !requireSucess) { - apply_OutEmpty(); - }*/ - break; - case 6: - //申请入库 - /* if (move != 0 && !applySucess) { - instruction_apply(); - } - if (move != 0 && !requireSucess) { - apply_InEmpty(); - }*/ - break; - } - - - } - last_mode = mode; - last_status = status; - last_error = error; - last_task = task; - last_full_number = full_number; - last_finish = finish; - last_order = order; - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) {} - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } - - public boolean instruction_apply() throws Exception { - return false; - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - - public void apply_OutEmpty() { - - } - - public synchronized boolean apply_InEmpty() throws Exception { - return false; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/ItemProtocol.java deleted file mode 100644 index 305c9f4..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/ItemProtocol.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pick_station; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_finish = "finish"; - public static String item_order = "order"; - public static String item_error = "error"; - public static String item_full_number = "full_number"; - public static String item_task = "task"; - public static String item_status = "status"; - - public static String item_to_agv_ready = "to_agv_ready"; - - public static String item_to_agv_finish = "to_agv_finish"; - - - private HailiangSpecialPickStationDeviceDriver driver; - - public ItemProtocol(HailiangSpecialPickStationDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - public int getStatus() { - return this.getOpcIntegerValue(item_status); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getFinish() { return this.getOpcIntegerValue(item_finish);} - - public int getOrder() { return this.getOpcIntegerValue(item_order);} - - public int getFull_number() { return this.getOpcIntegerValue(item_full_number);} - - public int getTask() { - return this.getOpcIntegerValue(item_task); - } - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_mode, "是否启动", "DB1.B0.1")); - list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true))); - list.add(new ItemDto(item_finish, "是否完成", "DB1.B0.7")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W4")); - list.add(new ItemDto(item_task, "任务号", "DB1.D22")); - list.add(new ItemDto(item_full_number, "出料口满框数量", "DB1.D96")); - list.add(new ItemDto(item_order, "工单号", "DB1.D160")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDefination.java deleted file mode 100644 index fa86a6f..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDefination.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮专机设备倒料位 - */ -@Service -public class HailiangSpecialPourStationDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_special_pour_station"; - } - - @Override - public String getDriverName() { - return "海亮-专机设备倒料位"; - } - - @Override - public String getDriverDescription() { - return "海亮-专机设备倒料位"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangSpecialPourStationDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangSpecialPourStationDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java deleted file mode 100644 index 37ade75..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java +++ /dev/null @@ -1,515 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpResponse; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.run.NDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮专机设备倒料位 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - - - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - private Date instruction_require_time = new Date(); - private int instruction_require_time_out = 3000; - int mode = 0; - int error = 0; - int task = 0; - int status = 0; - int running = 0; - int finish = 0; - int all_ready = 0; - int storage_stock_num = 0; - int line_stock_num = 0; - int order = 0; - int full_number = 0; - //出入库模式 - int operation_type = 0; - int last_mode = 0; - int last_error = 0; - int last_task = 0; - int last_status = 0; - int last_running = 0; - int last_finish = 0; - int last_all_ready = 0; - int last_storage_stock_num = 0; - int last_line_stock_num = 0; - int last_order = 0; - int last_full_number = 0; - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - private Date instruction_apply_time = new Date(); - int agvphase=0; - int index =0; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - String device_code; - - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - mode = this.itemProtocol.getMode(); - error = this.itemProtocol.getError(); - task = this.itemProtocol.getTask(); - status = this.itemProtocol.getStatus(); - running = this.itemProtocol.getRunning(); - finish = this.itemProtocol.getFinish(); - all_ready = this.itemProtocol.getAllReady(); - storage_stock_num = this.itemProtocol.getStorage_stock_num(); - line_stock_num = this.itemProtocol.getLine_stock_num(); - order = this.itemProtocol.getOrder(); - full_number = this.itemProtocol.getFull_number(); - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess); - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (task != last_task) { - logServer.deviceLog(this.device_code,"task" ,String.valueOf(task)); - logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task); - } - if (full_number != last_full_number) { - logServer.deviceLog(this.device_code,"full_number" ,String.valueOf(full_number)); - logServer.deviceLogToacs(this.device_code,"","","信号full_number:" + last_full_number + "->" + full_number); - } - if (finish != last_finish) { - logServer.deviceLog(this.device_code,"finish" ,String.valueOf(finish)); - logServer.deviceLogToacs(this.device_code,"","","信号finish:" + last_finish + "->" + finish); - } - if (order != last_order) { - logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); - logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - if (status != last_status) { - logServer.deviceLog(this.device_code,"status" ,String.valueOf(status)); - logServer.deviceLogToacs(this.device_code,"","","信号status:" + last_status + "->" + status); - } - if (storage_stock_num != last_storage_stock_num) { - logServer.deviceLog(this.device_code,"storage_stock_num" ,String.valueOf(storage_stock_num)); - logServer.deviceLogToacs(this.device_code,"","","信号storage_stock_num:" + last_storage_stock_num + "->" + storage_stock_num); - } - if (all_ready != last_all_ready) { - logServer.deviceLog(this.device_code,"all_ready" ,String.valueOf(all_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号all_ready:" + last_all_ready + "->" + all_ready); - } - if (line_stock_num != last_line_stock_num) { - logServer.deviceLog(this.device_code,"line_stock_num" ,String.valueOf(line_stock_num)); - logServer.deviceLogToacs(this.device_code,"","","信号line_stock_num:" + last_line_stock_num + "->" + line_stock_num); - } - if (running != last_running) { - logServer.deviceLog(this.device_code,"running" ,String.valueOf(running)); - logServer.deviceLogToacs(this.device_code,"","","信号running:" + last_running + "->" + running); - } - - - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 - } else if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - } else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - if(!requireSucess){ - if ( mode == 1) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":requireSucess:" + requireSucess + "开始申请任务"); - applyOutCacheLineTask(); - } else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":requireSucess:" + requireSucess + "申请任务失败,不符合条件"); - } - } else { - logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess); - - } - - if(agvphase == 0x0B || agvphase == 0x0F ) - { - if(error == 0 && ObjectUtil.isNotEmpty(inst)){ - inst.setExecute_status("3"); - instructionService.update(inst); - writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); - NDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - }else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因error:"+error+",inst"+inst); - - } - } - - if(agvphase == 0x0D || agvphase == 0x11){ - if(error == 0 && ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("4"); - instructionService.update(inst); - writing("item_to_pour_num", inst.getQuantity()); - byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); - agvphase = 0; - index = 0; - }else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因error:"+error+",inst"+inst); - } - } - - } - last_mode = mode; - last_error = error; - last_task = task; - last_status = status; - last_running = running; - last_finish = finish; - last_all_ready = all_ready; - last_storage_stock_num = storage_stock_num; - last_line_stock_num = line_stock_num; - last_order = order; - last_full_number = full_number; - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - public synchronized boolean applyOutCacheLineTask() throws Exception { - Date date = new Date(); - if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - Boolean flag = false; - Device device = deviceAppservice.findDeviceByCode(device_code); - Integer min_num = Integer.parseInt(device.getExtraValue().get("min_num")+""); - if (storage_stock_num < min_num ){ - JSONObject json = new JSONObject(); - json.put("device_code",device_code); - json.put("type","2"); - HttpResponse httpResponse = acsToWmsService.applyOutCacheLineTask(json); - String body = httpResponse.body(); - JSONObject jsonObject = JSONObject.parseObject(body); - String ext_task_id = jsonObject.getString("ext_task_id"); - String task_code = jsonObject.getString("task_code"); - String start_device_code = jsonObject.getString("start_device_code"); - String put_device_code = jsonObject.getString("put_device_code"); - String next_device_code = jsonObject.getString("next_device_code"); - String task_type = jsonObject.getString("task_type"); - TaskDto onedto = new TaskDto(); - String now = DateUtil.now(); - onedto.setTask_id(IdUtil.simpleUUID()); - onedto.setQuantity(String.valueOf(full_number)); - onedto.setCreate_by(this.getDevice().getDevice_code()); - onedto.setUpdate_by(this.getDevice().getDevice_code()); - onedto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - onedto.setTask_code("-" + taskcode); - onedto.setTask_status("0"); - onedto.setPriority("101"); - onedto.setAgv_system_type("1"); - onedto.setTask_type(task_type); - onedto.setExt_task_id(ext_task_id); - onedto.setTask_id(IdUtil.simpleUUID()); - onedto.setTask_code(task_code); - onedto.setStart_device_code(start_device_code); - onedto.setStart_point_code(start_device_code); - onedto.setPut_device_code(put_device_code); - onedto.setPut_point_code(put_device_code); - onedto.setNext_point_code(next_device_code); - onedto.setNext_device_code(next_device_code); - onedto.setUpdate_time(now); - onedto.setCreate_time(now); - try { - taskserver.create(onedto); - flag = true; - } catch (Exception e) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); - } - } - //生成任务成功 - if (flag) { - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功"); - requireSucess = true; - } else { - //如果都没有则调用mes接口申请入缓存线 - //生成任务 - //前往缓存线 - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线"); - } - } - - return true; - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) {} - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - } - - public void writing(int type, int command) { - - - } - - public boolean instruction_apply() throws Exception { - return false; - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - - public void apply_OutEmpty() { - - } - - public synchronized boolean apply_InEmpty() throws Exception { - return false; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/ItemProtocol.java deleted file mode 100644 index e2fa98a..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/ItemProtocol.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_status = "status"; - public static String item_running = "running"; - public static String item_finish = "finish"; - public static String item_all_ready = "all_ready"; - public static String item_storage_stock_num = "storage_stock_num"; - public static String item_line_stock_num = "line_stock_num"; - public static String item_order = "order"; - public static String item_error = "error"; - public static String item_full_number = "full_number"; - public static String item_task = "task"; - - public static String item_to_pour_num = "to_item_pour_num"; - - private HailiangSpecialPourStationDeviceDriver driver; - - public ItemProtocol(HailiangSpecialPourStationDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getStatus() { - return this.getOpcIntegerValue(item_status); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getRunning() { return this.getOpcIntegerValue(item_running);} - - public int getFinish() { return this.getOpcIntegerValue(item_finish);} - - public int getAllReady() { return this.getOpcIntegerValue(item_all_ready);} - - public int getOrder() { return this.getOpcIntegerValue(item_order);} - - public int getFull_number() { return this.getOpcIntegerValue(item_full_number);} - public int getLine_stock_num() { return this.getOpcIntegerValue(item_line_stock_num);} - public int getStorage_stock_num() { return this.getOpcIntegerValue(item_storage_stock_num);} - - public int getTask() { - return this.getOpcIntegerValue(item_task); - } - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82")); - list.add(new ItemDto(item_mode, "是否启动", "DB1.B0.1")); - list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true))); - list.add(new ItemDto(item_running, "是否运行", "DB1.B0.6")); - list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B1.6")); - list.add(new ItemDto(item_error, "报警信号", "DB1.W4")); - list.add(new ItemDto(item_full_number, "出料口满框数量", "DB1.D96")); - list.add(new ItemDto(item_storage_stock_num, "储料仓库存数量", "DB1.D100")); - list.add(new ItemDto(item_line_stock_num, "线体库存数量", "DB1.D104")); - list.add(new ItemDto(item_task, "任务号", "DB1.D22")); - list.add(new ItemDto(item_order, "工单号", "DB1.D160")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_pour_num, "倒料数量", "DB1.D96")); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/HailiangHailiangxjplcTestDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/HailiangHailiangxjplcTestDeviceDriver.java deleted file mode 100644 index a1463ea..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/HailiangHailiangxjplcTestDeviceDriver.java +++ /dev/null @@ -1,300 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_xj_plc_test; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.run.NDCSocketConnectionAutoRun; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 海亮清洗机储料仓 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HailiangHailiangxjplcTestDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); - @Autowired - TaskService taskserver = SpringContextHolder.getBean(TaskService.class); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - @Autowired - LogServer logServer = SpringContextHolder.getBean(LogServer.class); - @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - @Autowired - AgvService agvService = SpringContextHolder.getBean(AgvService.class); - - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int heartbeat = 0; - int mode =0; - int error =0; - int error_num =0; - int open_time =0; - int close_time =0; - int ready_time =0; - int running_time =0; - int error_time =0; - int voltage =0; - int temperature =0; - int current =0; - int material =0; - int lack_material =0; - int full_material =0; - int storage_qty =0; - int feeding_qty =0; - int blanking_qty =0; - int qualified_qty =0; - int unqualified_qty =0; - int finish =0; - int task =0; - int noload_electricity_consumption =0; - int prod_electricity_consumption =0; - int gas_consumption =0; - int water_consumption =0; - int oil_level =0; - int monthly_electricity_consumption =0; - int pause =0; - - - int last_mode =0; - int last_error =0; - int last_error_num =0; - int last_open_time =0; - int last_close_time =0; - int last_ready_time =0; - int last_running_time =0; - int last_error_time =0; - int last_voltage =0; - int last_temperature =0; - int last_current =0; - int last_material =0; - int last_lack_material =0; - int last_full_material =0; - int last_storage_qty =0; - int last_feeding_qty =0; - int last_blanking_qty =0; - int last_qualified_qty =0; - int last_unqualified_qty =0; - int last_finish =0; - int last_task =0; - int last_noload_electricity_consumption =0; - int last_prod_electricity_consumption =0; - int last_gas_consumption =0; - int last_water_consumption =0; - int last_oil_level =0; - int last_monthly_electricity_consumption =0; - int last_pause =0; - - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - - int agvphase=0; - int index =0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - device_code = this.getDeviceCode(); - heartbeat = this.itemProtocol.getItem_heartbeat(); - mode = this.itemProtocol.getItem_mode(); - error = this.itemProtocol.getItem_error(); - error_num = this.itemProtocol.getItem_error_num(); - open_time = this.itemProtocol.getItem_open_time(); - close_time = this.itemProtocol.getItem_close_time(); - ready_time = this.itemProtocol.getItem_ready_time(); - running_time = this.itemProtocol.getItem_running_time(); - error_time = this.itemProtocol.getItem_error_time(); - voltage = this.itemProtocol.getItem_voltage(); - temperature = this.itemProtocol.getItem_temperature(); - current = this.itemProtocol.getItem_current(); - material = this.itemProtocol.getItem_material(); - lack_material = this.itemProtocol.getItem_lack_material(); - full_material = this.itemProtocol.getItem_full_material(); - storage_qty = this.itemProtocol.getItem_storage_qty(); - feeding_qty = this.itemProtocol.getItem_feeding_qty(); - blanking_qty = this.itemProtocol.getItem_blanking_qty(); - qualified_qty = this.itemProtocol.getItem_qualified_qty(); - unqualified_qty = this.itemProtocol.getItem_unqualified_qty(); - finish = this.itemProtocol.getItem_finish(); - task = this.itemProtocol.getItem_task(); - noload_electricity_consumption = this.itemProtocol.getItem_noload_electricity_consumption(); - prod_electricity_consumption = this.itemProtocol.getItem_prod_electricity_consumption(); - gas_consumption = this.itemProtocol.getItem_gas_consumption(); - water_consumption = this.itemProtocol.getItem_water_consumption(); - oil_level = this.itemProtocol.getItem_oil_level(); - monthly_electricity_consumption = this.itemProtocol.getItem_monthly_electricity_consumption(); - pause = this.itemProtocol.getItem_pause(); - - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess); - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); - } - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - logServer.deviceLogToacs(this.device_code,"","","光电信号切换,刷新请求标记:"+this.requireSucess); - - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - - } - - public void writing(String key, String value) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + key; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, value); - ReadUtil.write(itemMap, server); - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/HailiangxjplcTestDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/HailiangxjplcTestDefination.java deleted file mode 100644 index 6a7411a..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/HailiangxjplcTestDefination.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_xj_plc_test; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮迅捷plc测试 - */ -@Service -public class HailiangxjplcTestDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_xj_plc_test"; - } - - @Override - public String getDriverName() { - return "海亮-海亮迅捷plc测试"; - } - - @Override - public String getDriverDescription() { - return "海亮-海亮迅捷plc测试"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HailiangHailiangxjplcTestDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HailiangHailiangxjplcTestDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return ItemProtocol.getReadableItemDtos(); - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/ItemProtocol.java deleted file mode 100644 index 0dfa78b..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_xj_plc_test/ItemProtocol.java +++ /dev/null @@ -1,248 +0,0 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_xj_plc_test; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_error = "error"; - public static String item_error_num = "error_num"; - public static String item_open_time = "open_time"; - public static String item_close_time = "close_time"; // - public static String item_ready_time = "ready_time"; // - public static String item_running_time = "running_time"; - public static String item_error_time = "error_time"; - public static String item_voltage = "voltage"; - public static String item_temperature = "temperature"; - public static String item_current = "current"; - public static String item_material = "material"; - public static String item_lack_material = "lack_material"; - public static String item_full_material = "full_material"; - public static String item_storage_qty = "storage_qty"; - public static String item_feeding_qty = "feeding_qty"; - public static String item_blanking_qty = "blanking_qty"; - public static String item_qualified_qty = "qualified_qty"; - public static String item_unqualified_qty = "unqualified_qty"; - public static String item_finish = "finish"; - public static String item_task = "task"; - public static String item_noload_electricity_consumption = "noload_electricity_consumption"; - public static String item_prod_electricity_consumption = "prod_electricity_consumption"; - public static String item_gas_consumption = "gas_consumption"; - public static String item_water_consumption = "water_consumption"; - public static String item_oil_level = "oil_level"; - public static String item_monthly_electricity_consumption = "monthly_electricity_consumption"; - public static String item_pause = "pause"; - - - - public static String item_to_heartbeat = "to_heartbeat";// - public static String item_to_command = "to_command";// - public static String item_to_feeding = "to_feeding";// - public static String item_to_task = "to_task";// - public static String item_to_pause= "to_pause";// - public static String item_to_clear = "to_clear";// - public static String item_to_finish = "to_finish";// - public static String item_to_open = "to_open";// - public static String item_to_close = "to_close";// - public static String item_to_material = "to_material";// - public static String item_to_qty = "to_qty";// - - - private HailiangHailiangxjplcTestDeviceDriver driver; - - public ItemProtocol(HailiangHailiangxjplcTestDeviceDriver driver) { - this.driver = driver; - } - - public int getItem_heartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getItem_mode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getItem_error() { - return this.getOpcIntegerValue(item_error); - } - - public int getItem_error_num() { - return this.getOpcIntegerValue(item_error_num); - } - - public int getItem_open_time() { - return this.getOpcIntegerValue(item_open_time); - } - - public int getItem_close_time() { - return this.getOpcIntegerValue(item_close_time); - } - - public int getItem_ready_time() { - return this.getOpcIntegerValue(item_ready_time); - } - - public int getItem_running_time() { - return this.getOpcIntegerValue(item_running_time); - } - - public int getItem_error_time() { - return this.getOpcIntegerValue(item_error_time); - } - - public int getItem_voltage() { - return this.getOpcIntegerValue(item_voltage); - } - - public int getItem_temperature() { - return this.getOpcIntegerValue(item_temperature); - } - - public int getItem_current() { - return this.getOpcIntegerValue(item_current); - } - - public int getItem_material() { - return this.getOpcIntegerValue(item_material); - } - - public int getItem_lack_material() { - return this.getOpcIntegerValue(item_lack_material); - } - - public int getItem_full_material() { - return this.getOpcIntegerValue(item_full_material); - } - - public int getItem_storage_qty() { - return this.getOpcIntegerValue(item_storage_qty); - } - - public int getItem_feeding_qty() { - return this.getOpcIntegerValue(item_feeding_qty); - } - - public int getItem_blanking_qty() { - return this.getOpcIntegerValue(item_blanking_qty); - } - - public int getItem_qualified_qty() { - return this.getOpcIntegerValue(item_qualified_qty); - } - - public int getItem_unqualified_qty() { - return this.getOpcIntegerValue(item_unqualified_qty); - } - - public int getItem_finish() { - return this.getOpcIntegerValue(item_mode); - } - - public int getItem_task() { - return this.getOpcIntegerValue(item_task); - } - - public int getItem_noload_electricity_consumption() { - return this.getOpcIntegerValue(item_noload_electricity_consumption); - } - - public int getItem_prod_electricity_consumption() { - return this.getOpcIntegerValue(item_prod_electricity_consumption); - } - - public int getItem_gas_consumption() { - return this.getOpcIntegerValue(item_gas_consumption); - } - - public int getItem_water_consumption() { - return this.getOpcIntegerValue(item_water_consumption); - } - - public int getItem_oil_level() { - return this.getOpcIntegerValue(item_oil_level); - } - - public int getItem_monthly_electricity_consumption() { - return this.getOpcIntegerValue(item_monthly_electricity_consumption); - } - - public int getItem_pause() { - return this.getOpcIntegerValue(item_pause); - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "45203")); - list.add(new ItemDto(item_mode, "模式", "45205")); - list.add(new ItemDto(item_error, "故障", "45207")); - list.add(new ItemDto(item_error_num, "故障次数", "45209")); - list.add(new ItemDto(item_open_time, "开机时间", "45213")); - list.add(new ItemDto(item_close_time, "关机时间", "45217")); - list.add(new ItemDto(item_ready_time, "待机时间", "45221")); - list.add(new ItemDto(item_running_time, "生产时间", "45225")); - list.add(new ItemDto(item_error_time, "故障时间", "45229")); - list.add(new ItemDto(item_temperature, "温度", "45233")); - list.add(new ItemDto(item_voltage, "电压", "45237")); - list.add(new ItemDto(item_current, "电流", "45241")); - list.add(new ItemDto(item_material, "当前生产产品编号", "45245")); - list.add(new ItemDto(item_lack_material, "生产缺料信号", "45249")); - list.add(new ItemDto(item_full_material, "生产满料信号", "45253")); - list.add(new ItemDto(item_storage_qty, "储料斗数量", "45257")); - list.add(new ItemDto(item_feeding_qty, "上料数量", "45261")); - list.add(new ItemDto(item_blanking_qty, "下料数量", "45265")); - list.add(new ItemDto(item_qualified_qty, "当前生产合格品数量", "45269")); - list.add(new ItemDto(item_unqualified_qty, "当前生产不合格数量", "45273")); - list.add(new ItemDto(item_finish, "生产完成", "45277")); - list.add(new ItemDto(item_task, "任务号", "45281")); - list.add(new ItemDto(item_noload_electricity_consumption, "空载电能耗(未生产时)", "45285")); - list.add(new ItemDto(item_prod_electricity_consumption, "生产电能耗", "45289")); - list.add(new ItemDto(item_gas_consumption, "气压能耗", "45293")); - list.add(new ItemDto(item_water_consumption, "水流量能耗", "452967")); - list.add(new ItemDto(item_oil_level, "当前液压油位", "45301")); - list.add(new ItemDto(item_monthly_electricity_consumption, "本月总电能耗", "45305")); - list.add(new ItemDto(item_pause, "设备暂停", "45309")); - - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_heartbeat, "心跳", "45703")); - list.add(new ItemDto(item_to_command, "下发命令", "45705")); - list.add(new ItemDto(item_to_feeding, "下发命令", "45707")); - list.add(new ItemDto(item_to_task, "任务号", "45711")); - list.add(new ItemDto(item_to_pause, "生产暂停", "45715")); - list.add(new ItemDto(item_to_clear, "当前产量清零", "45719")); - list.add(new ItemDto(item_to_finish, "强制完成", "45723")); - list.add(new ItemDto(item_to_open, "设备开机", "45727")); - list.add(new ItemDto(item_to_close, "设备关机", "45731")); - list.add(new ItemDto(item_to_material, "当前任务生产物料", "45735")); - list.add(new ItemDto(item_to_qty, "当前任务生产数量", "45739")); - return list; - } - - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java similarity index 94% rename from wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java rename to wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java index 73e03b4..64017e2 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java @@ -1,4 +1,4 @@ -package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_smart_plc_test; +package org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDeviceDriver.java new file mode 100644 index 0000000..c5a1dbf --- /dev/null +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDeviceDriver.java @@ -0,0 +1,102 @@ +package org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test; + +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.agv.server.AgvService; +import org.nl.acs.config.server.AcsConfigService; +import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; +import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; +import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.acs.log.service.LogServer; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.route.service.RouteLineService; +import org.nl.acs.task.service.TaskService; +import org.nl.utils.SpringContextHolder; +import org.openscada.opc.lib.da.Server; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 海亮清洗机储料仓 + */ +@Slf4j +@Data +@RequiredArgsConstructor +public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { + protected ItemProtocol itemProtocol = new ItemProtocol(this); + @Autowired + DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); + @Autowired + InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); + @Autowired + DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); + @Autowired + TaskService taskserver = SpringContextHolder.getBean(TaskService.class); + @Autowired + RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); + @Autowired + AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); + @Autowired + AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); + @Autowired + LogServer logServer = SpringContextHolder.getBean(LogServer.class); + @Autowired + AgvService agvService = SpringContextHolder.getBean(AgvService.class); + + int heartbeat = 0; + int mode = 0; + int move = 0; + int action = 0; + int error = 0; + int number = 0; + int container_type = 0; + int task = 0; + + String device_code; + + @Override + public Device getDevice() { + return this.device; + } + + + @Override + public void execute() { + device_code = this.getDeviceCode(); + heartbeat = this.itemProtocol.getItem_heartbeat(); + mode = this.itemProtocol.getItem_mode(); + move = this.itemProtocol.getItem_mode(); + action = this.itemProtocol.getItem_action(); + error = this.itemProtocol.getItem_error(); + number = this.itemProtocol.getItem_number(); + container_type = this.itemProtocol.getItem_container_type(); + task = this.itemProtocol.getItem_task(); + + } + + public void writing(int command) { + + } + + public void writing(String key, String value) { + String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + key; + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + itemMap.put(to_command, value); + ReadUtil.write(itemMap, server); + } +} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/ItemProtocol.java new file mode 100644 index 0000000..4c9da20 --- /dev/null +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/ItemProtocol.java @@ -0,0 +1,105 @@ +package org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test; + +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; + +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Data +public class ItemProtocol { + + public static String item_heartbeat = "heartbeat"; + public static String item_mode = "mode"; + public static String item_move = "move"; + public static String item_action = "action"; + public static String item_error = "error"; + public static String item_number = "number"; + public static String item_container_type = "container_type"; + public static String item_task = "task"; + + + public static String item_to_target = "to_target";// + public static String item_to_command = "to_command";// + public static String item_to_task = "to_task";// + + + private HailiangSmartplcTestDeviceDriver driver; + + public ItemProtocol(HailiangSmartplcTestDeviceDriver driver) { + this.driver = driver; + } + + public int getItem_heartbeat() { + return this.getOpcIntegerValue(item_heartbeat); + } + + public int getItem_mode() { + return this.getOpcIntegerValue(item_mode); + } + + public int getItem_move() { + return this.getOpcIntegerValue(item_move); + } + + public int getItem_action() { + return this.getOpcIntegerValue(item_action); + } + + public int getItem_error() { + return this.getOpcIntegerValue(item_action); + } + + public int getItem_number() { + return this.getOpcIntegerValue(item_number); + } + + public int getItem_container_type() { + return this.getOpcIntegerValue(item_container_type); + } + + public int getItem_task() { + return this.getOpcIntegerValue(item_task); + } + + Boolean isonline; + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + if (value == null) { + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_heartbeat, "心跳", "VW0")); + list.add(new ItemDto(item_mode, "模式", "VW2")); + list.add(new ItemDto(item_move, "光电信号", "VW4")); + list.add(new ItemDto(item_action, "取放信号", "VW6")); + list.add(new ItemDto(item_error, "故障", "VW8")); + list.add(new ItemDto(item_number, "数量", "VW10")); + list.add(new ItemDto(item_container_type, "托盘类型", "VW12")); + list.add(new ItemDto(item_task, "任务号", "VD14")); + + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_to_command, "下发命令", "VW102")); + list.add(new ItemDto(item_to_target , "下发目标站", "VW104")); + list.add(new ItemDto(item_to_task, "任务号", "VD108")); + return list; + } + + +} + diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/ItemProtocol.java deleted file mode 100644 index 1320960..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/ItemProtocol.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.nl.acs.device_driver.basedriver.lamp_three_color; - -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -public class ItemProtocol { - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_action = "action"; - public static String item_error = "error"; - public static String item_to_command = "to_command"; - - - private LampThreecolorDeviceDriver driver; - - public ItemProtocol(LampThreecolorDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getAction() { - return this.getOpcIntegerValue(item_action); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getToCommand() { - return this.getOpcIntegerValue(item_to_command); - } - - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - //log.error("读取错误!"); - } else { - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB51.B0")); - list.add(new ItemDto(item_mode, "工作状态", "DB51.B1", Boolean.valueOf(true))); - list.add(new ItemDto(item_action, "动作信号", "DB51.B2")); - list.add(new ItemDto(item_error, "报警信号", "DB51.B4")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "DB52.W2", Boolean.valueOf(true))); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDefination.java deleted file mode 100644 index 57f583c..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDefination.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.nl.acs.device_driver.basedriver.lamp_three_color; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 自动门驱动定义 - */ -@Service -public class LampThreecolorDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "lamp_three_color"; - } - - @Override - public String getDriverName() { - return "标准版-三色灯"; - } - - @Override - public String getDriverDescription() { - return "标准版-三色灯"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new LampThreecolorDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return LampThreecolorDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return getReadableItemDtos2(); - } - - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", true)); - list.add(new ItemDto(ItemProtocol.item_action, "动作信号", "DB600.B2")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B4")); - return list; - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDeviceDriver.java deleted file mode 100644 index ab5b311..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDeviceDriver.java +++ /dev/null @@ -1,155 +0,0 @@ -package org.nl.acs.device_driver.basedriver.lamp_three_color; - -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.opc.Device; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * 检测站点驱动 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - String devicecode; - int mode = 0; - int action = 0; - int error = 0; - int move = 0; - int task = 0; - int last_action = 0; - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - protected boolean hasGoods = false; - boolean isFold = false; - private String assemble_check_tag; - private Boolean sampleMode0; - private Boolean sampleMode3; - private Integer sampleError; - private Boolean sampleOnline; - protected String displayMessage = null; - public int display_message_time_out = 30000; - public Date display_message_time; - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - - private int instruction_require_time_out; - boolean requireSucess = false; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() { - String message = null; - - String device_code = this.getDevice().getDevice_code(); - mode = this.itemProtocol.getMode(); - action = this.itemProtocol.getAction(); - error = this.itemProtocol.getError(); - if (mode != last_mode) { - } - if (action != last_action) { - } - if (error != last_error) { - } - last_action = action; - last_mode = mode; - last_error = error; - //message = StringFormatUtl.format("设备报警:{}", new Object[]{}); - -// String manual_create_task = this.getDevice().getExtraValue().get("manual_create_task").toString(); - - - } - - public synchronized String getStatus() { - JSONObject jo = new JSONObject(); - - if (action == 1) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "OPEN"); - - } else if (action == 2) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "CLOSE"); - - } else { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "ERROR"); - } - return jo.toString(); - } - - - 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.basedriver.standard_inspect_site.ItemProtocol.item_to_command; - - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - ReadUtil.write(itemMap, server); - log.info("下发PLC信号:{},{}", to_command, command); - System.out.println("设备:" + devicecode + ",下发PLC信号:" + to_command + ",value:" + command); - } - - public synchronized void OpenOrClose(String type) { - - writing(Integer.parseInt(type)); - - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/manipulator_inspect_site_NDC/ManipulatorInspectSiteNDCDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/manipulator_inspect_site_NDC/ManipulatorInspectSiteNDCDefination.java deleted file mode 100644 index 568a69e..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/manipulator_inspect_site_NDC/ManipulatorInspectSiteNDCDefination.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.nl.acs.device_driver.basedriver.manipulator_inspect_site_NDC; - -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * 区域管制设备交互站点-NDC - */ -@Service -public class ManipulatorInspectSiteNDCDefination implements DeviceDriverDefination { - @Override - public String getDriverCode() { - return "manipulator_inspect_site_NDC"; - } - - @Override - public String getDriverName() { - return "区域管制站点-NDC"; - } - - @Override - public String getDriverDescription() { - return "区域管制站点-NDC"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new ManipulatorInspectSiteNDCDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return ManipulatorInspectSiteNDCDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/manipulator_inspect_site_NDC/ManipulatorInspectSiteNDCDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/manipulator_inspect_site_NDC/ManipulatorInspectSiteNDCDeviceDriver.java deleted file mode 100644 index 8e6d4a3..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/manipulator_inspect_site_NDC/ManipulatorInspectSiteNDCDeviceDriver.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.nl.acs.device_driver.basedriver.manipulator_inspect_site_NDC; - -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; - - -/** - * 区域管制设备交互站点-NDC - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class ManipulatorInspectSiteNDCDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - String relevance_device_code; - - @Override - public void execute() { - } -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/ItemProtocol.java deleted file mode 100644 index 6303cd7..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/ItemProtocol.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.nl.acs.device_driver.basedriver.standard_autodoor; - -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -public class ItemProtocol { - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_action = "action"; - public static String item_error = "error"; - public static String item_to_command = "to_command"; - - - private StandardAutodoorDeviceDriver driver; - - public ItemProtocol(StandardAutodoorDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getAction() { - return this.getOpcIntegerValue(item_action); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getToCommand() { - return this.getOpcIntegerValue(item_to_command); - } - - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - log.error("读取错误!"); - } else { - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB51.B0")); - list.add(new ItemDto(item_mode, "工作状态", "DB51.B1", Boolean.valueOf(true))); - list.add(new ItemDto(item_action, "动作信号", "DB51.B2")); - list.add(new ItemDto(item_error, "报警信号", "DB51.B4")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "DB52.W2", Boolean.valueOf(true))); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDefination.java deleted file mode 100644 index 0025bda..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDefination.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.nl.acs.device_driver.basedriver.standard_autodoor; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 自动门驱动定义 - */ -@Service -public class StandardAutodoorDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "standard_autodoor"; - } - - @Override - public String getDriverName() { - return "标准版-自动门"; - } - - @Override - public String getDriverDescription() { - return "标准版-自动门"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new StandardAutodoorDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return StandardAutodoorDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return getReadableItemDtos2(); - } - - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", true)); - list.add(new ItemDto(ItemProtocol.item_action, "动作信号", "DB600.B2")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B4")); - return list; - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java deleted file mode 100644 index 0cd742a..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java +++ /dev/null @@ -1,163 +0,0 @@ -package org.nl.acs.device_driver.basedriver.standard_autodoor; - -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.opc.Device; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * 自动门驱动 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - String devicecode; - int mode = 0; - int action = 0; - int error = 0; - Boolean iserror = false; - - int move = 0; - int task = 0; - int last_action = 0; - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - protected boolean hasGoods = false; - boolean isFold = false; - private String assemble_check_tag; - private Boolean sampleMode0; - private Boolean sampleMode3; - private Integer sampleError; - private Boolean sampleOnline; - protected String displayMessage = null; - public int display_message_time_out = 30000; - public Date display_message_time; - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - - private int instruction_require_time_out; - boolean requireSucess = false; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() { - String message = null; - - String device_code = this.getDevice().getDevice_code(); - mode = this.itemProtocol.getMode(); - action = this.itemProtocol.getAction(); - error = this.itemProtocol.getError(); - if (mode != last_mode) { - } - if (action != last_action) { - } - if (error != last_error) { - //this.execute_log.setContainer(""); - } - last_action = action; - last_mode = mode; - last_error = error; - //message = StringFormatUtl.format("设备报警:{}", new Object[]{}); - -// String manual_create_task = this.getDevice().getExtraValue().get("manual_create_task").toString(); - - } - - public synchronized String getStatus() { - JSONObject jo = new JSONObject(); - - if (action == 1) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "OPEN"); - - } else if (action == 2) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "CLOSE"); - - } else { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "ERROR"); - } - return jo.toString(); - } - - - public void writeing(int command) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - ReadUtil.write(itemMap, server); - log.info("下发PLC信号:{},{}", to_command, command); - System.out.println("设备:" + devicecode + ",下发PLC信号:" + to_command + ",value:" + command); - - } - - public synchronized void OpenOrClose(String type) { - - //开门 - if ("1".equals(type)) { - writeing(1); - } else { - writeing(2); - } - - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index 5d4c9ec..5d1497e 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -1,11 +1,6 @@ package org.nl.acs.device_driver.basedriver.standard_ordinary_site; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -16,28 +11,18 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.LogServer; -import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.DeviceAppServiceImpl; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.order.service.ProduceshiftorderService; import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; import org.nl.start.auto.run.OneNDCSocketConnectionAutoRun; import org.nl.utils.SpringContextHolder; -import org.nl.wql.core.bean.WQLObject; import org.springframework.beans.factory.annotation.Autowired; -import java.math.BigDecimal; import java.util.Date; @@ -67,8 +52,6 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple @Autowired LogServer logServer = SpringContextHolder.getBean(LogServer.class); @Autowired - ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class); - @Autowired AgvService agvService = SpringContextHolder.getBean(AgvService.class); Integer hasGoods = 0; diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/ItemProtocol.java deleted file mode 100644 index 500fbd3..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/ItemProtocol.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.nl.acs.device_driver.basedriver.traffic_light; - -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -public class ItemProtocol { - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_action = "action"; - public static String item_error = "error"; - public static String item_to_command = "to_command"; - - - private TrafficLightDeviceDriver driver; - - public ItemProtocol(TrafficLightDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getAction() { - return this.getOpcIntegerValue(item_action); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getToCommand() { - return this.getOpcIntegerValue(item_to_command); - } - - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - //log.error("读取错误!"); - } else { - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "D00000")); - list.add(new ItemDto(item_mode, "工作状态", "D00010", Boolean.valueOf(true))); - list.add(new ItemDto(item_action, "动作信号", "D00012")); - list.add(new ItemDto(item_error, "报警信号", "D00014")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "D00016", Boolean.valueOf(true))); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/TrafficLightDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/TrafficLightDefination.java deleted file mode 100644 index 4d03f82..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/TrafficLightDefination.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.nl.acs.device_driver.basedriver.traffic_light; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 标准版-交通灯-欧姆龙plc - */ -@Service -public class TrafficLightDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "traffic_light"; - } - - @Override - public String getDriverName() { - return "标准版-交通灯-欧姆龙plc"; - } - - @Override - public String getDriverDescription() { - return "标准版-交通灯-欧姆龙plc"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new TrafficLightDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return TrafficLightDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return getReadableItemDtos2(); - } - - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "D00000")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "D00010", true)); - list.add(new ItemDto(ItemProtocol.item_action, "动作信号", "D00012")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "D00014")); - return list; - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/TrafficLightDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/TrafficLightDeviceDriver.java deleted file mode 100644 index 161d101..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/traffic_light/TrafficLightDeviceDriver.java +++ /dev/null @@ -1,152 +0,0 @@ -package org.nl.acs.device_driver.basedriver.traffic_light; - -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.opc.Device; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * 标准版-交通灯-欧姆龙plc - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class TrafficLightDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - String devicecode; - int mode = 0; - int action = 0; - int error = 0; - int move = 0; - int task = 0; - int last_action = 0; - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - protected boolean hasGoods = false; - boolean isFold = false; - private String assemble_check_tag; - private Boolean sampleMode0; - private Boolean sampleMode3; - private Integer sampleError; - private Boolean sampleOnline; - protected String displayMessage = null; - public int display_message_time_out = 30000; - public Date display_message_time; - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - - private int instruction_require_time_out; - boolean requireSucess = false; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() { - String message = null; - - String device_code = this.getDevice().getDevice_code(); - mode = this.itemProtocol.getMode(); - action = this.itemProtocol.getAction(); - error = this.itemProtocol.getError(); - if (mode != last_mode) { - } - if (action != last_action) { - } - if (error != last_error) { - } - last_action = action; - last_mode = mode; - last_error = error; - - - } - - public synchronized String getStatus() { - JSONObject jo = new JSONObject(); - - if (action == 1) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "OPEN"); - - } else if (action == 2) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "CLOSE"); - - } else { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "ERROR"); - } - return jo.toString(); - } - - - public void writing(int command) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - ReadUtil.write(itemMap, server); - log.info("下发PLC信号:{},{}", to_command, command); - System.out.println("设备:" + devicecode + ",下发PLC信号:" + to_command + ",value:" + command); - } - - public synchronized void OpenOrClose(String type) { - - writing(Integer.parseInt(type)); - - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDefination.java deleted file mode 100644 index bd12db8..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDefination.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_coating; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮裹膜机 - */ -@Service -public class HaiLiangCoatingDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "lamp_three_color"; - } - - @Override - public String getDriverName() { - return "标准版-三色灯"; - } - - @Override - public String getDriverDescription() { - return "标准版-三色灯"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HaiLiangCoatingDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HaiLiangCoatingDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return getReadableItemDtos2(); - } - - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", true)); - list.add(new ItemDto(ItemProtocol.item_action, "动作信号", "DB600.B2")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B4")); - return list; - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java deleted file mode 100644 index e723f3d..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java +++ /dev/null @@ -1,155 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_coating; - -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.opc.Device; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * 海亮-裹膜机驱动 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - String devicecode; - int mode = 0; - int action = 0; - int error = 0; - int move = 0; - int task = 0; - int last_action = 0; - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - protected boolean hasGoods = false; - boolean isFold = false; - private String assemble_check_tag; - private Boolean sampleMode0; - private Boolean sampleMode3; - private Integer sampleError; - private Boolean sampleOnline; - protected String displayMessage = null; - public int display_message_time_out = 30000; - public Date display_message_time; - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - - private int instruction_require_time_out; - boolean requireSucess = false; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() { - String message = null; - - String device_code = this.getDevice().getDevice_code(); - mode = this.itemProtocol.getMode(); - action = this.itemProtocol.getAction(); - error = this.itemProtocol.getError(); - if (mode != last_mode) { - } - if (action != last_action) { - } - if (error != last_error) { - } - last_action = action; - last_mode = mode; - last_error = error; - //message = StringFormatUtl.format("设备报警:{}", new Object[]{}); - -// String manual_create_task = this.getDevice().getExtraValue().get("manual_create_task").toString(); - - - } - - public synchronized String getStatus() { - JSONObject jo = new JSONObject(); - - if (action == 1) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "OPEN"); - - } else if (action == 2) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "CLOSE"); - - } else { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "ERROR"); - } - return jo.toString(); - } - - - 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.basedriver.standard_inspect_site.ItemProtocol.item_to_command; - - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - ReadUtil.write(itemMap, server); - //log.info("下发PLC信号:{},{}", to_command, command); - System.out.println("设备:" + devicecode + ",下发PLC信号:" + to_command + ",value:" + command); - } - - public synchronized void OpenOrClose(String type) { - - writing(Integer.parseInt(type)); - - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/ItemProtocol.java deleted file mode 100644 index cce09b0..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/ItemProtocol.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_coating; - -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -public class ItemProtocol { - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_action = "action"; - public static String item_error = "error"; - public static String item_to_command = "to_command"; - - - private HaiLiangCoatingDeviceDriver driver; - - public ItemProtocol(HaiLiangCoatingDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getAction() { - return this.getOpcIntegerValue(item_action); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getToCommand() { - return this.getOpcIntegerValue(item_to_command); - } - - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - //log.error("读取错误!"); - } else { - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB51.B0")); - list.add(new ItemDto(item_mode, "工作状态", "DB51.B1", Boolean.valueOf(true))); - list.add(new ItemDto(item_action, "动作信号", "DB51.B2")); - list.add(new ItemDto(item_error, "报警信号", "DB51.B4")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "DB52.W2", Boolean.valueOf(true))); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDefination.java deleted file mode 100644 index 971bf41..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDefination.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_labeling; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮贴标机驱动 - */ -@Service -public class HaiLiangLabelingDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_labeling"; - } - - @Override - public String getDriverName() { - return "海亮-贴标机"; - } - - @Override - public String getDriverDescription() { - return "海亮-贴标机"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HaiLiangLabelingDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HaiLiangLabelingDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return getReadableItemDtos2(); - } - - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "V100.1", true)); - list.add(new ItemDto(ItemProtocol.item_action, "动作信号", "V100.0")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "VB101")); - return list; - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java deleted file mode 100644 index 1c9547f..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_labeling; - -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.opc.Device; -import org.openscada.opc.lib.da.Server; - -import java.util.HashMap; -import java.util.Map; - -/** - * 海亮贴标机驱动 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - - String devicecode; - int mode = 0; - int action = 0; - int error = 0; - int move = 0; - int last_action = 0; - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int branchProtocol = 0; - - @Override - public Device getDevice() { - return this.device; - } - - @Override - public void execute() { - String message = null; - - String device_code = this.getDevice().getDevice_code(); - mode = this.itemProtocol.getMode(); - action = this.itemProtocol.getAction(); - error = this.itemProtocol.getError(); - if (mode != last_mode) { - } - if (action != last_action) { - } - if (error != last_error) { - } - // 打印就绪 - if (mode == 1 && error == 0) { - - } - - //打印完成 - if (action == 1) { - - } - last_action = action; - last_mode = mode; - last_error = error; - - } - - 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.basedriver.standard_inspect_site.ItemProtocol.item_to_command; - - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - ReadUtil.write(itemMap, server); - log.info("下发PLC信号:{},{}", to_command, command); - System.out.println("设备:" + devicecode + ",下发PLC信号:" + to_command + ",value:" + command); - } - - public synchronized void OpenOrClose(String type) { - writing(Integer.parseInt(type)); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/ItemProtocol.java deleted file mode 100644 index 455eb8a..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/ItemProtocol.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_labeling; - -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -public class ItemProtocol { - public static String item_mode = "mode"; - public static String item_action = "action"; - public static String item_error = "error"; - public static String item_to_command = "to_command"; - - - private HaiLiangLabelingDeviceDriver driver; - - public ItemProtocol(HaiLiangLabelingDeviceDriver driver) { - this.driver = driver; - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getAction() { - return this.getOpcIntegerValue(item_action); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getToCommand() { - return this.getOpcIntegerValue(item_to_command); - } - - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - //log.error("读取错误!"); - } else { - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_mode, "工作状态", "V100.1", Boolean.valueOf(true))); - list.add(new ItemDto(item_action, "动作信号", "V100.0")); - list.add(new ItemDto(item_error, "报警信号", "VB101")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "V102.0", Boolean.valueOf(true))); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDefination.java deleted file mode 100644 index 6214d2f..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDefination.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_lettering; - -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * 海亮刻字机驱动 - */ -@Service -public class HaiLiangLetteringDefination implements DeviceDriverDefination { - @Override - public String getDriverCode() { - return "hailiang_lettering"; - } - - @Override - public String getDriverName() { - return "海亮-激光刻字机"; - } - - @Override - public String getDriverDescription() { - return "海亮-激光刻字机"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HaiLiangLetteringDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HaiLiangLetteringDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java deleted file mode 100644 index ce0c6c2..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_lettering; - -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.nl.utils.SpringContextHolder; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; - - -/** - * - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HaiLiangLetteringDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - - Integer hasGoods = 0; - int error = 0; - Boolean iserror = false; - Boolean islock = false; - - int branchProtocol = 0; - int last_branchProtocol = 0; - //是否需要输入物料 - String input_material = "0"; - //备注 - String remark = ""; - //数量 - String qty = ""; - //是否在线 - Boolean is_online = true; - //批次 - String batch = ""; - //物料 - String material = ""; - //目标点位 - String purpose = ""; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - boolean requireSucess = false; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - // 1取货完成 2放货完成 3进入区域 4离开区域 - private int flag; - - //人工确认信号 默认0 agv到达后请求置1 等人工确认后变为2 反馈agv后继续为0 - private int manua_confirm = 0; - - String devicecode; - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - - private int instruction_require_time_out; - - String message; - - // 1就绪 2下发刻字 3 刻字完成 - int status; - - int mode = 2; - - int move; - - int action; - - int ioaction; - - @Override - public void execute() { - hasGoods = this.getDevice().getHas_goods(); - material = this.getDevice().getMaterial_type(); - batch = this.getDevice().getBatch(); - devicecode = this.getDeviceCode(); - if (branchProtocol != last_branchProtocol) { - requireSucess = false; - } - switch (branchProtocol) { - case 1: - break; - //呼叫请求 - case 2: - - break; - //响应生成任务 - case 3: - - break; - } - } - - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/HaiLiangPackingDefination.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/HaiLiangPackingDefination.java deleted file mode 100644 index a48b487..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/HaiLiangPackingDefination.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_packing; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 包装机驱动 - */ -@Service -public class HaiLiangPackingDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "lamp_three_color"; - } - - @Override - public String getDriverName() { - return "标准版-三色灯"; - } - - @Override - public String getDriverDescription() { - return "标准版-三色灯"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new HaiLiangPackingDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return HaiLiangPackingDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return getReadableItemDtos2(); - } - - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", true)); - list.add(new ItemDto(ItemProtocol.item_action, "动作信号", "DB600.B2")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B4")); - return list; - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/HaiLiangPackingDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/HaiLiangPackingDeviceDriver.java deleted file mode 100644 index 7760e52..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/HaiLiangPackingDeviceDriver.java +++ /dev/null @@ -1,155 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_packing; - -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.opc.Device; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.nl.utils.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * 海亮-包装机驱动 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class HaiLiangPackingDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - String devicecode; - int mode = 0; - int action = 0; - int error = 0; - int move = 0; - int task = 0; - int last_action = 0; - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - protected boolean hasGoods = false; - boolean isFold = false; - private String assemble_check_tag; - private Boolean sampleMode0; - private Boolean sampleMode3; - private Integer sampleError; - private Boolean sampleOnline; - protected String displayMessage = null; - public int display_message_time_out = 30000; - public Date display_message_time; - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - - private int instruction_require_time_out; - boolean requireSucess = false; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() { - String message = null; - - String device_code = this.getDevice().getDevice_code(); - mode = this.itemProtocol.getMode(); - action = this.itemProtocol.getAction(); - error = this.itemProtocol.getError(); - if (mode != last_mode) { - } - if (action != last_action) { - } - if (error != last_error) { - } - last_action = action; - last_mode = mode; - last_error = error; - //message = StringFormatUtl.format("设备报警:{}", new Object[]{}); - -// String manual_create_task = this.getDevice().getExtraValue().get("manual_create_task").toString(); - - - } - - public synchronized String getStatus() { - JSONObject jo = new JSONObject(); - - if (action == 1) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "OPEN"); - - } else if (action == 2) { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "CLOSE"); - - } else { - jo.put("name", this.getDevice().getDevice_code()); - jo.put("status", "ERROR"); - } - return jo.toString(); - } - - - 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.basedriver.standard_inspect_site.ItemProtocol.item_to_command; - - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - ReadUtil.write(itemMap, server); - log.info("下发PLC信号:{},{}", to_command, command); - System.out.println("设备:" + devicecode + ",下发PLC信号:" + to_command + ",value:" + command); - } - - public synchronized void OpenOrClose(String type) { - - writing(Integer.parseInt(type)); - - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/ItemProtocol.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/ItemProtocol.java deleted file mode 100644 index e904060..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_packing/ItemProtocol.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.nl.acs.device_driver.hailiang.hailiang_packing; - -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -public class ItemProtocol { - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_action = "action"; - public static String item_error = "error"; - public static String item_to_command = "to_command"; - - - private HaiLiangPackingDeviceDriver driver; - - public ItemProtocol(HaiLiangPackingDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getAction() { - return this.getOpcIntegerValue(item_action); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getToCommand() { - return this.getOpcIntegerValue(item_to_command); - } - - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - //log.error("读取错误!"); - } else { - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB51.B0")); - list.add(new ItemDto(item_mode, "工作状态", "DB51.B1", Boolean.valueOf(true))); - list.add(new ItemDto(item_action, "动作信号", "DB51.B2")); - list.add(new ItemDto(item_error, "报警信号", "DB51.B4")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "DB52.W2", Boolean.valueOf(true))); - return list; - } - -} - diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index d45d192..9376c62 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -70,20 +70,6 @@ public class WmsToAcsController { return new ResponseEntity<>(wmstoacsService.queryDevice(whereJson), HttpStatus.OK); } - @PostMapping("/order") - @Log("wms下发acs工单") - @ApiOperation("wms下发acs工单") - public ResponseEntity actionOrder(@RequestBody String whereJson){ - return new ResponseEntity<>(wmstoacsService.actionOrder(whereJson), HttpStatus.OK); - } - - @PostMapping("/orderStatusUpdate") - @Log("工单状态变更") - @ApiOperation("工单状态变更") - public ResponseEntity orderStatusUpdate(@RequestBody String whereJson){ - return new ResponseEntity<>(wmstoacsService.orderStatusUpdate(whereJson), HttpStatus.OK); - } - @PostMapping("/queryDeviceDBValue") @Log("查询设备DB值") @ApiOperation("查询设备DB值") diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java index 4c001b2..f9e6347 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java @@ -55,20 +55,6 @@ public interface WmsToAcsService { */ Map queryDevice(String jsonObject) throws Exception; - /** - * wms下发工单 - * @param whereJson - * @return - */ - Map actionOrder(String whereJson); - - /** - * 工单状态变更 - * @param whereJson - * @return - */ - Map orderStatusUpdate(String whereJson); - /** * 查询设备DB值 * @param whereJson diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 1b4236e..f6b6d4a 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -1,6 +1,5 @@ package org.nl.acs.ext.wms.service.impl; -import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; @@ -11,10 +10,6 @@ import org.nl.acs.common.IDriverService; import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device.HailiangSpecialDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; @@ -27,22 +22,16 @@ import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceExtraManageDto; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; -import org.nl.exception.BadRequestException; import org.nl.exception.WDKException; -import org.nl.modules.system.util.CodeUtil; import org.nl.utils.SpringContextHolder; import org.nl.wql.core.bean.WQLObject; import org.springframework.context.ApplicationContext; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -58,7 +47,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { private final DeviceService deviceService; private final DeviceAppService deviceAppService; private final RouteLineService routeLineService; - private final ProduceshiftorderService produceshiftorderService; @Override public Map createFromWms(String param) { @@ -155,7 +143,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { if (!StrUtil.isEmpty(task_uuid)) { jo.put("ext_task_id", task_uuid); } - + TaskDto task_dto = jo.toJavaObject(TaskDto.class); try { taskService.create(task_dto); @@ -310,8 +298,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { StandardCoveyorControlWithPlcScannerDeviceDriver standardCoveyorControlWithPlcScannerDeviceDriver; //扫码器 StandardScannerDeviceDriver standardScannerDeviceDriver; - //自动门 - StandardAutodoorDeviceDriver standardAutodoorDeviceDriver; if (datas.size() == 0) { List list = deviceService.findCacheDevice(); @@ -335,14 +321,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("requestSucess", standardCoveyorControlDeviceDriver.getRequireSucess()); jo.put("applySucess", standardCoveyorControlDeviceDriver.getApplySucess()); jo.put("message", standardCoveyorControlDeviceDriver.getMessage()); - } else if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardAutodoorDeviceDriver.getMode()); - jo.put("action", standardAutodoorDeviceDriver.getAction()); - jo.put("isOnline", true); - jo.put("error", standardAutodoorDeviceDriver.getError()); - jo.put("isError", standardAutodoorDeviceDriver.getIserror()); } else if (device.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) { standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver(); jo.put("device_code", device.getDevice_code()); @@ -460,14 +438,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("requestSucess", standardCoveyorControlDeviceDriver.getRequireSucess()); jo.put("applySucess", standardCoveyorControlDeviceDriver.getApplySucess()); jo.put("message", standardCoveyorControlDeviceDriver.getMessage()); - } else if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardAutodoorDeviceDriver.getMode()); - jo.put("action", standardAutodoorDeviceDriver.getAction()); - jo.put("isOnline", true); - jo.put("error", standardAutodoorDeviceDriver.getError()); - jo.put("isError", standardAutodoorDeviceDriver.getIserror()); } else if (device.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) { standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver(); jo.put("device_code", device.getDevice_code()); @@ -572,148 +542,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { return resultJson; } - @Override - @Transactional(rollbackFor = Exception.class) - public Map actionOrder(String whereJson) { - JSONArray datas = JSONArray.parseArray(whereJson); - log.info("actionOrder--------------:输入参数" + datas.toString()); - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - for (int i = 0; i < datas.size(); i++) { - JSONObject param = datas.getJSONObject(i); - String ext_order_id = param.getString("ext_order_id"); - if (StrUtil.isEmpty(ext_order_id)) { - throw new BadRequestException("外部标识不能为空"); - } - String order_code = param.getString("order_code"); - if (StrUtil.isEmpty(order_code)) { - order_code = CodeUtil.getNewCode("ORDER_NO"); - } else { - JSONObject jsonObject = wo.query("is_deleted = '0' and order_code = '" + order_code + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonObject)) { - throw new BadRequestException("工单编码不能重复"); - } - } - String qty = param.getString("qty"); - if (StrUtil.isEmpty(qty)) { - throw new BadRequestException("生产数量不能为空"); - } - String material_uuid = param.getString("material_uuid"); - if (StrUtil.isEmpty(material_uuid)) { - throw new BadRequestException("物料标识不能为空"); - } - String material_code = param.getString("material_code"); - if (StrUtil.isEmpty(material_code)) { - throw new BadRequestException("物料编码不能为空"); - } - String material_name = param.getString("material_name"); - if (StrUtil.isEmpty(material_name)) { - throw new BadRequestException("物料名称不能为空"); - } - String material_spec = param.getString("material_spec"); - String device_code = param.getString("device_code"); - if (StrUtil.isEmpty(device_code)) { - throw new BadRequestException("设备编码不能为空"); - } - String is_needmove = param.getString("is_needmove"); - ProduceshiftorderDto dto = new ProduceshiftorderDto(); - dto.setExt_order_id(ext_order_id); - dto.setOrder_code(order_code); - dto.setQty(BigDecimal.valueOf(Long.parseLong(qty))); - dto.setMaterial_uuid(material_uuid); - dto.setMaterial_code(material_code); - dto.setMaterial_name(material_name); - dto.setMaterial_spec(material_spec); - dto.setDevice_code(device_code); - dto.setIs_needmove(is_needmove); - dto.setCreate_by("mes"); - dto.setUpdate_by("mes"); - produceshiftorderService.create(dto); - } - JSONObject resultJson = new JSONObject(); - resultJson.put("status", HttpStatus.OK); - resultJson.put("message", "操作成功"); - log.info("actionOrder--------------:输出参数" + resultJson.toString()); - return resultJson; - } - - @Override - public Map orderStatusUpdate(String whereJson) { - JSONArray datas = JSONArray.parseArray(whereJson); - log.info("orderStatusUpdate--------------:输入参数" + datas.toString()); - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - for (int i = 0; i < datas.size(); i++) { - JSONObject jsonObject = datas.getJSONObject(i); - String ext_order_id = jsonObject.getString("ext_order_id"); - String type = jsonObject.getString("type"); - JSONObject json = wo.query("ext_order_id = '" + ext_order_id + "'").uniqueResult(0); - ProduceshiftorderDto obj = JSONObject.toJavaObject(json, ProduceshiftorderDto.class); - Device device = deviceAppService.findDeviceByCode(obj.getDevice_code()); - HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver; - HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver; - HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver; - if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver){ - hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver(); - //暂停 - if (type.equals("1")){ - hailiangSpecialDeviceDriver.writing("to_pause","1"); - } - //恢复 - if (type.equals("2")){ - hailiangSpecialDeviceDriver.writing("to_pause","0"); - } - //强制完成 - if (type.equals("3")){ - hailiangSpecialDeviceDriver.writing("to_order_compel_finished","0"); - obj.setOrder_status("3"); - obj.setUpdate_by("mes"); - obj.setUpdate_time(DateUtil.now()); - produceshiftorderService.update(obj); - } - } - if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){ - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - //强制完成 - if (type.equals("3")){ - hailiangPackerStationDeviceDriver.writing("to_order_compel_finished","1"); - obj.setOrder_status("3"); - obj.setOrder_status("3"); - obj.setUpdate_by("mes"); - produceshiftorderService.update(obj); - } - } - if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){ - hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver(); - //暂停 - if (type.equals("1")){ - hailiangEngravingMachineDeviceDriver.writing("to_pause","1"); - } - //恢复 - if (type.equals("2")){ - hailiangEngravingMachineDeviceDriver.writing("to_pause","0"); - } - //强制完成 - if (type.equals("3")){ - hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished","0"); - obj.setOrder_status("3"); - obj.setUpdate_by("mes"); - obj.setUpdate_time(DateUtil.now()); - produceshiftorderService.update(obj); - } - } - } - JSONObject resultJson = new JSONObject(); - resultJson.put("status", HttpStatus.OK); - resultJson.put("message", "操作成功"); - log.info("orderStatusUpdate--------------:输出参数" + resultJson.toString()); - return resultJson; - } @Override public Map queryDeviceDBValue(String whereJson) { JSONArray datas = JSONArray.parseArray(whereJson); log.info("orderStatusUpdate--------------:输入参数" + datas.toString()); JSONObject map = new JSONObject(); - if (datas.size() > 0){ + if (datas.size() > 0) { for (int i = 0; i < datas.size(); i++) { JSONObject jsonObject = datas.getJSONObject(i); String device_code = jsonObject.getString("device_code"); @@ -724,14 +559,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { DeviceExtraManageDto deviceExtraManageDto = extra.get(j); String deviceCode = deviceExtraManageDto.getDevice_code(); String extra_name = deviceExtraManageDto.getExtra_name(); - if (deviceCode.equals(device_code) && extra_name.equals(dbName)){ + if (deviceCode.equals(device_code) && extra_name.equals(dbName)) { String extra_code = deviceExtraManageDto.getExtra_code(); String[] split = extra_code.split("\\."); extra_code = split[split.length - 1]; - extra_code = extra_code.substring(0,1).toUpperCase()+extra_code.substring(1); + extra_code = extra_code.substring(0, 1).toUpperCase() + extra_code.substring(1); IDriverService driverService = applicationContext.getBean(device.getDeviceDriverDefination().getDriverCode(), IDriverService.class); Integer dbValue = driverService.getDbValue(device, extra_code); - map.put(dbName,dbValue); + map.put(dbName, dbValue); break; } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 370a92a..6caf817 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -17,15 +17,11 @@ import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.impl.DeviceServiceImpl; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver; -import org.nl.acs.device_driver.basedriver.traffic_light.TrafficLightDeviceDriver; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.opc.Device; @@ -34,7 +30,6 @@ import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.route.service.impl.RouteLineServiceImpl; -import org.nl.acs.task.enums.TaskTypeEnum; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.exception.BadRequestException; @@ -207,7 +202,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu public Instruction findById(String instruction_id) { WQLObject wo = WQLObject.getWQLObject("acs_instruction"); JSONObject json = wo.query("instruction_id ='" + instruction_id + "'").uniqueResult(0); - if(ObjectUtil.isNotEmpty(json)){ + if (ObjectUtil.isNotEmpty(json)) { final Instruction obj = json.toJavaObject(Instruction.class); return obj; } @@ -237,8 +232,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } WQLObject wo = WQLObject.getWQLObject("acs_instruction"); JSONObject json = wo.query("task_id ='" + id + "'" + wherecaluse).uniqueResult(0); - if (ObjectUtil.isNotEmpty(json)) + if (ObjectUtil.isNotEmpty(json)) { return json.toJavaObject(Instruction.class); + } return null; } @@ -288,27 +284,27 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu dto.setStart_parent_code(task.getStart_parent_code()); dto.setNext_parent_code(task.getNext_parent_code()); // 1 双工agv系统 2叉车agv系统 - if(StrUtil.equals(task.getAgv_system_type(),"1") ){ + if (StrUtil.equals(task.getAgv_system_type(), "1")) { dto.setAgv_system_type("1"); - } else if(StrUtil.equals(task.getAgv_system_type(),"2") ) { + } else if (StrUtil.equals(task.getAgv_system_type(), "2")) { dto.setAgv_system_type("2"); } - if(StrUtil.equals(task.getTask_type(),"1")){ + if (StrUtil.equals(task.getTask_type(), "1")) { dto.setAgv_inst_type("1"); - } else if(StrUtil.equals(task.getTask_type(),"2")){ + } else if (StrUtil.equals(task.getTask_type(), "2")) { dto.setAgv_inst_type("2"); - } else if(StrUtil.equals(task.getTask_type(),"3")){ + } else if (StrUtil.equals(task.getTask_type(), "3")) { dto.setAgv_inst_type("3"); - } else if(StrUtil.equals(task.getTask_type(),"4")){ + } else if (StrUtil.equals(task.getTask_type(), "4")) { dto.setAgv_inst_type("4"); - } else if(StrUtil.equals(task.getTask_type(),"5")){ + } else if (StrUtil.equals(task.getTask_type(), "5")) { dto.setAgv_inst_type("5"); - } else if(StrUtil.equals(task.getTask_type(),"6")){ + } else if (StrUtil.equals(task.getTask_type(), "6")) { dto.setAgv_inst_type("1"); - } else if(StrUtil.equals(task.getTask_type(),"7")){ + } else if (StrUtil.equals(task.getTask_type(), "7")) { dto.setAgv_inst_type("2"); - } else if(StrUtil.equals(task.getTask_type(),"8")){ + } else if (StrUtil.equals(task.getTask_type(), "8")) { dto.setAgv_inst_type("3"); } @@ -317,7 +313,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code()); StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; - LampThreecolorDeviceDriver lampThreecolorDeviceDriver; StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver; StandardCoveyorControlWithPlcScannerDeviceDriver standardCoveyorControlWithPlcScannerDeviceDriver; StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver; @@ -354,9 +349,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu * 7 不去称重平台称重PS20 agvtype:2 * 8 RT20 agvtype:3 */ - if(StrUtil.equals("1",dto.getAgv_system_type())){ - agvService.sendAgvTwoInstToNDC(dto,null); - } else if(StrUtil.equals("2",dto.getAgv_system_type())){ + if (StrUtil.equals("1", dto.getAgv_system_type())) { + agvService.sendAgvTwoInstToNDC(dto, null); + } else if (StrUtil.equals("2", dto.getAgv_system_type())) { agvService.sendAgvOneInstToNDC(dto); } dto.setSend_status("1"); @@ -395,7 +390,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu @Override public void createTwoInst(Instruction dto, Instruction dto2) throws Exception { WQLObject instwo = WQLObject.getWQLObject("acs_instruction"); - if(ObjectUtils.isNotEmpty(dto)){ + if (ObjectUtils.isNotEmpty(dto)) { dto = foramte(dto); String task_code = dto.getTask_code(); TaskDto task = taskService.findByCodeFromCache(task_code); @@ -440,7 +435,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu dto.setNext_parent_code(task.getNext_parent_code()); } - if(ObjectUtils.isNotEmpty(dto2)){ + if (ObjectUtils.isNotEmpty(dto2)) { dto2 = foramte(dto2); String task_code2 = dto2.getTask_code(); TaskDto task2 = taskService.findByCodeFromCache(task_code2); @@ -501,36 +496,36 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu * 7 不去称重平台称重PS20 agvtype:2 * 8 RT20 agvtype:3 */ - if(StrUtil.equals("1",dto.getInstruction_type())){ - agvService.sendAgvTwoInstToNDC(dto,dto2); + if (StrUtil.equals("1", dto.getInstruction_type())) { + agvService.sendAgvTwoInstToNDC(dto, dto2); dto.setSend_status("1"); dto2.setSend_status("1"); - } else if(StrUtil.equals("2",dto.getInstruction_type())){ + } else if (StrUtil.equals("2", dto.getInstruction_type())) { dto.setSend_status("1"); - agvService.sendAgvTwoInstToNDC(dto,null); - } else if(StrUtil.equals("3",dto.getInstruction_type())){ + agvService.sendAgvTwoInstToNDC(dto, null); + } else if (StrUtil.equals("3", dto.getInstruction_type())) { - } else if(StrUtil.equals("4",dto.getInstruction_type())){ + } else if (StrUtil.equals("4", dto.getInstruction_type())) { - } else if(StrUtil.equals("5",dto.getInstruction_type())){ + } else if (StrUtil.equals("5", dto.getInstruction_type())) { - } else if(StrUtil.equals("6",dto.getInstruction_type())){ + } else if (StrUtil.equals("6", dto.getInstruction_type())) { dto.setSend_status("1"); agvService.sendAgvOneInstToNDC(dto); - } else if(StrUtil.equals("7",dto.getInstruction_type())){ + } else if (StrUtil.equals("7", dto.getInstruction_type())) { agvService.sendAgvOneInstToNDC(dto); dto.setSend_status("1"); - } else if(StrUtil.equals("8",dto.getInstruction_type())){ + } else if (StrUtil.equals("8", dto.getInstruction_type())) { dto.setSend_status("1"); agvService.sendAgvOneInstToNDC(dto); } } } catch (Exception e) { - if(ObjectUtil.isNotEmpty(dto)){ + if (ObjectUtil.isNotEmpty(dto)) { dto.setSend_status("2"); } - if(ObjectUtil.isNotEmpty(dto2)){ + if (ObjectUtil.isNotEmpty(dto2)) { dto2.setSend_status("2"); } e.printStackTrace(); @@ -596,7 +591,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code()); StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; - LampThreecolorDeviceDriver lampThreecolorDeviceDriver; StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver; //将指令赋予对象 下发指令号给电气 @@ -616,10 +610,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu String lamd_device = nextdevice.getExtraValue().get("link_three_lamp").toString(); Device lamddevice = appService.findDeviceByCode(lamd_device); - if (lamddevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { - lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lamddevice.getDeviceDriver(); - lampThreecolorDeviceDriver.writing(2); - } } @@ -752,16 +742,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu log.debug("地址对应设备未找到"); throw new BadRequestException("地址对应设备未找到"); } - if(deviceByCode.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){ - jo1.put("hasGoodStatus", "2"); - jo1.put("material_type",startdevice.getMaterial_type()); - } else if (deviceByCode.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){ - jo1.put("hasGoodStatus", "1"); - jo1.put("material_type", ""); - } else { - jo1.put("hasGoodStatus", "1"); - jo1.put("material_type",startdevice.getMaterial_type()); - } + + jo1.put("hasGoodStatus", "1"); + jo1.put("material_type", startdevice.getMaterial_type()); + jo1.put("quantity", startdevice.getQuantity()); jo1.put("remark", startdevice.getRemark()); jo1.put("batch", startdevice.getBatch()); @@ -795,27 +779,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu finishAndCreateNextInst(entity); } } - LampThreecolorDeviceDriver lampThreecolorDeviceDriver; - //交通灯 - TrafficLightDeviceDriver trafficLightDeviceDriver; - //变更三色灯状态 - if (!ObjectUtils.isEmpty(device.getExtraValue().get("link_three_lamp"))) { - String lamd_device = device.getExtraValue().get("link_three_lamp").toString(); - Device lamddevice = appService.findDeviceByCode(lamd_device); - if (lamddevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { - lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lamddevice.getDeviceDriver(); - lampThreecolorDeviceDriver.writing(0); - } - } - //变更交通灯状态 - if (!ObjectUtils.isEmpty(device.getExtraValue().get("link_three_lamp"))) { - String lamd_device = device.getExtraValue().get("link_three_lamp").toString(); - Device lamddevice = appService.findDeviceByCode(lamd_device); - if (lamddevice.getDeviceDriver() instanceof TrafficLightDeviceDriver) { - trafficLightDeviceDriver = (TrafficLightDeviceDriver) lamddevice.getDeviceDriver(); - trafficLightDeviceDriver.writing(2); - } - } + removeByCodeFromCache(entity.getInstruction_code()); } @@ -870,19 +834,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu jo1.put("material_type", dto.getMaterial()); jo1.put("batch", dto.getBatch()); deviceService.changeDeviceStatus(jo1); - LampThreecolorDeviceDriver lampThreecolorDeviceDriver; - - - //变更三色灯状态 - if (!ObjectUtils.isEmpty(device.getExtraValue().get("link_three_lamp"))) { - String lamd_device = device.getExtraValue().get("link_three_lamp").toString(); - Device lamddevice = appService.findDeviceByCode(lamd_device); - - if (lamddevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { - lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lamddevice.getDeviceDriver(); - lampThreecolorDeviceDriver.writing(0); - } - } removeByCodeFromCache(dto.getInstruction_code()); @@ -954,7 +905,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu //flag= true时取消指令 boolean flag = false; Instruction entity = this.findById(id); - if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + if (entity == null) { + throw new BadRequestException("被删除或无权限,操作失败!"); + } TaskDto task = taskService.findByCodeFromCache(entity.getTask_code()); if (StrUtil.isEmpty(entity.getRoute_plan_code())) { entity.setRoute_plan_code(task.getRoute_plan_code()); @@ -1022,16 +975,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu log.debug("地址对应设备未找到"); return; } - LampThreecolorDeviceDriver lampThreecolorDeviceDriver; - //变更三色灯状态 - if (!ObjectUtils.isEmpty(device.getExtraValue().get("link_three_lamp"))) { - String lamd_device = device.getExtraValue().get("link_three_lamp").toString(); - Device lamddevice = appService.findDeviceByCode(lamd_device); - if (lamddevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { - lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lamddevice.getDeviceDriver(); - lampThreecolorDeviceDriver.writing(0); - } - } removeByCodeFromCache(entity.getInstruction_code()); } @@ -1041,7 +984,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu public void cancelNOSendAgv(String id) throws Exception { //flag= true时取消指令 Instruction entity = this.findById(id); - if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + if (entity == null) { + throw new BadRequestException("被删除或无权限,操作失败!"); + } TaskDto task = taskService.findByCodeFromCache(entity.getTask_code()); if (StrUtil.isEmpty(entity.getRoute_plan_code())) { entity.setRoute_plan_code(task.getRoute_plan_code()); @@ -1087,16 +1032,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu log.debug("地址对应设备未找到"); return; } - LampThreecolorDeviceDriver lampThreecolorDeviceDriver; - //变更三色灯状态 - if (!ObjectUtils.isEmpty(device.getExtraValue().get("link_three_lamp"))) { - String lamd_device = device.getExtraValue().get("link_three_lamp").toString(); - Device lamddevice = appService.findDeviceByCode(lamd_device); - if (lamddevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { - lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lamddevice.getDeviceDriver(); - lampThreecolorDeviceDriver.writing(0); - } - } + removeByCodeFromCache(entity.getInstruction_code()); } @@ -1106,7 +1042,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu public Instruction findByLinkNumSend(String code) { for (int i = 0; i < this.instructions.size(); i++) { Instruction inst = instructions.get(i); - if (StrUtil.equals(code, inst.getLink_num()) && StrUtil.equals(inst.getIs_send(),"1")) { + if (StrUtil.equals(code, inst.getLink_num()) && StrUtil.equals(inst.getIs_send(), "1")) { return inst; } } @@ -1115,11 +1051,11 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu @Override - public List findByLinkNum(String code) { + public List findByLinkNum(String code) { List list = new ArrayList<>(); for (int i = 0; i < this.instructions.size(); i++) { Instruction inst = instructions.get(i); - if (StrUtil.equals(code, inst.getLink_num()) && StrUtil.equals(inst.getIs_send(),"0")) { + if (StrUtil.equals(code, inst.getLink_num()) && StrUtil.equals(inst.getIs_send(), "0")) { list.add(inst); } } @@ -1130,7 +1066,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu public Instruction findByLinkNumNoSend(String code) { for (int i = 0; i < this.instructions.size(); i++) { Instruction inst = instructions.get(i); - if (StrUtil.equals(code, inst.getLink_num()) && StrUtil.equals(inst.getIs_send(),"0")) { + if (StrUtil.equals(code, inst.getLink_num()) && StrUtil.equals(inst.getIs_send(), "0")) { return inst; } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java deleted file mode 100644 index 739e507..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java +++ /dev/null @@ -1,95 +0,0 @@ - -package org.nl.acs.order.rest; - - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -import org.nl.annotation.Log; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import io.swagger.annotations.*; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.Map; -import lombok.extern.slf4j.Slf4j; - -/** -* @author geng by -* @date 2022-06-06 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "工单信息管理") -@RequestMapping("/api/produceshiftorder") -@Slf4j -public class ProduceshiftorderController { - - private final ProduceshiftorderService produceshiftorderService; - - @GetMapping - @Log("查询工单信息") - @ApiOperation("查询工单信息") - //@PreAuthorize("@el.check('produceshiftorder:list')") - public ResponseEntity query(@RequestParam Map whereJson, Pageable page){ - return new ResponseEntity<>(produceshiftorderService.queryAll(whereJson,page),HttpStatus.OK); - } - - @PostMapping - @Log("新增工单信息") - @ApiOperation("新增工单信息") - //@PreAuthorize("@el.check('produceshiftorder:add')") - public ResponseEntity create(@Validated @RequestBody ProduceshiftorderDto dto){ - produceshiftorderService.create(dto); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @PutMapping - @Log("修改工单信息") - @ApiOperation("修改工单信息") - //@PreAuthorize("@el.check('produceshiftorder:edit')") - public ResponseEntity update(@Validated @RequestBody ProduceshiftorderDto dto){ - produceshiftorderService.update(dto); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除工单信息") - @ApiOperation("删除工单信息") - //@PreAuthorize("@el.check('produceshiftorder:del')") - @DeleteMapping - public ResponseEntity delete(@RequestBody String[] ids) { - produceshiftorderService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("导出工单信息") - @ApiOperation("导出工单信息") - @GetMapping(value = "/download") - //@PreAuthorize("@el.check('produceshiftorder:list')") - public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { - produceshiftorderService.download(produceshiftorderService.queryAll(whereJson), response); - } - - @PostMapping("/finishd") - @Log("工单强制完成") - @ApiOperation("工单强制完成") - //@PreAuthorize("@el.check('produceshiftorder:add')") - public ResponseEntity finishd(@RequestBody JSONObject param){ - produceshiftorderService.finishd(param); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @PostMapping("/synchron") - @Log("工单同步") - @ApiOperation("工单同步") - //@PreAuthorize("@el.check('produceshiftorder:add')") - public ResponseEntity synchron(){ - produceshiftorderService.synchron(); - return new ResponseEntity<>(HttpStatus.CREATED); - } -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java deleted file mode 100644 index 571976d..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java +++ /dev/null @@ -1,110 +0,0 @@ - -package org.nl.acs.order.service; - -import com.alibaba.fastjson.JSONObject; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @description 服务接口 -* @author geng by -* @date 2022-06-06 -**/ -public interface ProduceshiftorderService { - - /** - * 查询数据分页 - * @param whereJson 条件 - * @param page 分页参数 - * @return Map - */ - Map queryAll(Map whereJson, Pageable page); - - /** - * 查询数据 - * @param whereJson 条件 - * @return Map - */ - List queryAll(String whereJson); - - - /** - * 查询所有数据不分页 - * @param whereJson 条件参数 - * @return List - */ - List queryAll(Map whereJson); - - /** - * 根据ID查询 - * @param order_id ID - * @return Produceshiftorder - */ - ProduceshiftorderDto findById(String order_id); - - /** - * 根据编码查询 - * @param code code - * @return Produceshiftorder - */ - ProduceshiftorderDto findByCode(String code); - - - /** - * 创建 - * @param dto / - */ - void create(ProduceshiftorderDto dto); - - /** - * 编辑 - * @param dto / - */ - void update(ProduceshiftorderDto dto); - - /** - * 编辑 - * @param dto / - */ - void updateByOrderCode(ProduceshiftorderDto dto); - - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(String[] ids); - - /** - * 导出数据 - * @param dtos 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List dtos, HttpServletResponse response) throws IOException; - - /** - * 工单强制完成 - * @param param - */ - void finishd(JSONObject param); - - /** - * 数据同步 - */ - void reload(); - - List findAllOrderFromCache(); - - ProduceshiftorderDto findOrderByDeviceCode(String device_code); - - /** - * 工单同步 - */ - void synchron(); - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderDto.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderDto.java deleted file mode 100644 index d27df6b..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderDto.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.nl.acs.order.service.dto; - -import lombok.Data; - import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @description / -* @author geng by -* @date 2022-06-06 -**/ -@Data -public class ProduceshiftorderDto implements Serializable { - - /** 工单标识 */ - private String order_id; - - /** 工单编码 */ - private String order_code; - - /** 工单状态 */ - private String order_status; - - /** 下料数量 */ - private BigDecimal qty; - - /** 每框接料数量 */ - private BigDecimal one_qty; - - /** 物料编码 */ - private String material_code; - - /** 物料名称 */ - private String material_name; - - /** 物料标识 */ - private String material_uuid; - - /** 规格型号 */ - private String material_spec; - - /** 创建者 */ - private String create_by; - - /** 创建时间 */ - private String create_time; - - /** 修改者 */ - private String update_by; - - /** 修改时间 */ - private String update_time; - - /** 是否删除 */ - private String is_deleted; - - /** 工单外部标识 */ - private String ext_order_id; - - /** 设备编号 */ - private String device_code; - - /** 是否下发AGV */ - private String is_needmove; - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java deleted file mode 100644 index 4093cb0..0000000 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java +++ /dev/null @@ -1,368 +0,0 @@ - -package org.nl.acs.order.service.impl; - - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import lombok.RequiredArgsConstructor; -import org.nl.acs.config.AcsConfig; -import org.nl.acs.device.service.DeviceExtraService; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_smart_plc_test.HailiangSmartplcTestDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device.HailiangSpecialDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.order.service.ProduceshiftorderService; -import org.nl.acs.order.service.dto.ProduceshiftorderDto; -import org.nl.exception.BadRequestException; -import org.nl.modules.system.util.CodeUtil; -import org.nl.start.auto.initial.ApplicationAutoInitial; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import org.springframework.data.domain.Pageable; - -import java.math.BigDecimal; -import java.util.*; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.bean.BeanUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.nl.utils.SecurityUtils; -import org.nl.wql.core.bean.ResultBean; -import org.nl.wql.core.bean.WQLObject; -import org.nl.wql.util.WqlUtil; -import org.nl.utils.FileUtil; -import lombok.extern.slf4j.Slf4j; - -/** - * @author geng by - * @description 服务实现 - * @date 2022-06-06 - **/ -@Service -@RequiredArgsConstructor -@Slf4j -public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, ApplicationAutoInitial { - - private final org.nl.acs.opc.DeviceAppService DeviceAppService; - private final DeviceExtraService deviceExtraService; - - List order = new ArrayList(); - - @Autowired - AcsToWmsService acsToWmsService; - - @Override - public void autoInitial() throws Exception { - this.reload(); - } - - public synchronized void reload() { - this.order = this.queryAll(" order_status !='2' and order_status !='3' and is_deleted =0"); - } - - @Override - public List queryAll(String whereJson) { - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - JSONArray arr = wo.query(whereJson).getResultJSONArray(0); - List list = arr.toJavaList(ProduceshiftorderDto.class); - return list; - } - - @Override - public Map queryAll(Map whereJson, Pageable page) { - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "is_deleted = '0' and order_status != '2' and order_status != '3'", "update_time desc"); - final JSONObject json = rb.pageResult(); - return json; - } - - @Override - public List queryAll(Map whereJson) { - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - JSONArray arr = wo.query().getResultJSONArray(0); - List list = arr.toJavaList(ProduceshiftorderDto.class); - return list; - } - - @Override - public ProduceshiftorderDto findById(String order_id) { - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - JSONObject json = wo.query("order_id ='" + order_id + "'").uniqueResult(0); - final ProduceshiftorderDto obj = (ProduceshiftorderDto) JSONObject.toJavaObject(json, ProduceshiftorderDto.class); - return obj; - } - - @Override - public ProduceshiftorderDto findByCode(String code) { - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - JSONObject json = wo.query("order_code ='" + code + "'").uniqueResult(0); - final ProduceshiftorderDto obj = (ProduceshiftorderDto) JSONObject.toJavaObject(json, ProduceshiftorderDto.class); - return obj; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(ProduceshiftorderDto dto) { - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - Device device = DeviceAppService.findDeviceByCode(dto.getDevice_code()); - if (ObjectUtil.isEmpty(device)) { - throw new BadRequestException("未找到对应设备:" + dto.getDevice_code()); - } - JSONArray resultJSONArray = wo.query("is_deleted = '0' and order_status in ('0', '1') and device_code = '" + dto.getDevice_code() + "'").getResultJSONArray(0); - if (ObjectUtil.isNotEmpty(resultJSONArray)) { - throw new BadRequestException("该设备已存在未完成工单,不能下发"); - } - String currentUsername = SecurityUtils.getCurrentUsername(); - String now = DateUtil.now(); - dto.setOrder_id(IdUtil.simpleUUID()); - if (StrUtil.isEmpty(dto.getOrder_code())) { - String order_no = CodeUtil.getNewCode("ORDER_NO"); - dto.setOrder_code(order_no); - } - dto.setOrder_status("0"); - if (StrUtil.isEmpty(dto.getCreate_by())) { - dto.setCreate_by(currentUsername); - } - if (StrUtil.isEmpty(dto.getUpdate_by())) { - dto.setUpdate_by(currentUsername); - } - dto.setCreate_time(now); - dto.setUpdate_time(now); - String is_needmove = dto.getIs_needmove(); - - //海亮专机 - HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver; - //刻字机 - HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver; - //包装机 - HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver; - //smart200 - HailiangSmartplcTestDeviceDriver hailiangSmartplcTestDeviceDriver; - if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver) { - hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver(); - //专机下发工单信号:倒料数量(-99999) 当前产量清零(1) 订单生产总量 每箱接料数量 工单号 - - String extra_value = hailiangSpecialDeviceDriver.getExtraValue().get("one_qty").toString(); - - if(StrUtil.equals(is_needmove,"1")){ - if (ObjectUtil.isEmpty(extra_value)) { - throw new BadRequestException("满料框数量为空"); - } - } else { - extra_value = "99999"; - } - dto.setOne_qty(BigDecimal.valueOf((Long.parseLong(extra_value)))); - hailiangSpecialDeviceDriver.writing("to_clear", "1"); - hailiangSpecialDeviceDriver.writing("to_pause", "0"); - hailiangSpecialDeviceDriver.writing("to_one_box_num", extra_value); - hailiangSpecialDeviceDriver.writing("to_order_prod_num", dto.getQty().toString()); - hailiangSpecialDeviceDriver.writing("to_out_num", "0"); - hailiangSpecialDeviceDriver.writing("to_order", dto.getOrder_code()); - } - - if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){ - hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver(); - String extra_value = hailiangEngravingMachineDeviceDriver.getExtraValue().get("one_qty").toString(); - - if(StrUtil.equals(is_needmove,"1")){ - if (ObjectUtil.isEmpty(extra_value)) { - throw new BadRequestException("满料框数量为空"); - } - } else { - extra_value = "99999"; - } - dto.setOne_qty(BigDecimal.valueOf((Long.parseLong(extra_value)))); - hailiangEngravingMachineDeviceDriver.writing("to_clear", "1"); - hailiangEngravingMachineDeviceDriver.writing("to_one_box_num", extra_value); - hailiangEngravingMachineDeviceDriver.writing("to_order_prod_num", dto.getQty().toString()); - hailiangEngravingMachineDeviceDriver.writing("to_order", dto.getOrder_code()); - } - - if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){ - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - hailiangPackerStationDeviceDriver.writing("to_clear", "1"); - hailiangPackerStationDeviceDriver.writing("to_order_prod_num", dto.getQty().toString()); - hailiangPackerStationDeviceDriver.writing("to_order", dto.getOrder_code()); - } - - if (device.getDeviceDriver() instanceof HailiangSmartplcTestDeviceDriver) { - hailiangSmartplcTestDeviceDriver = (HailiangSmartplcTestDeviceDriver) device.getDeviceDriver(); - hailiangSmartplcTestDeviceDriver.writing("to_clear", "1"); - hailiangSmartplcTestDeviceDriver.writing("to_qty", dto.getQty().toString()); - hailiangSmartplcTestDeviceDriver.writing("to_task", dto.getOrder_code()); - hailiangSmartplcTestDeviceDriver.writing("to_material", dto.getMaterial_code()); - hailiangSmartplcTestDeviceDriver.writing("to_pause","0"); - } - - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - wo.insert(json); - order.add(dto); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ProduceshiftorderDto dto) { - ProduceshiftorderDto entity = this.findById(dto.getOrder_id()); - if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); - String currentUsername = SecurityUtils.getCurrentUsername(); - String now = DateUtil.now(); - dto.setUpdate_time(now); - dto.setUpdate_by(currentUsername); - - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - wo.update(json); - Iterator iterator = order.iterator(); - while (iterator.hasNext()) { - ProduceshiftorderDto instruction = iterator.next(); - if (instruction.getOrder_code().equals(dto.getOrder_code())) { - iterator.remove(); - } - } - if (StrUtil.equals(dto.getOrder_status(), "0") || StrUtil.equals(dto.getOrder_status(), "1")) { - order.add(dto); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void updateByOrderCode(ProduceshiftorderDto dto) { - ProduceshiftorderDto entity = this.findByCode(dto.getOrder_code()); - if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); - String currentUsername = SecurityUtils.getCurrentUsername(); - String now = DateUtil.now(); - entity.setUpdate_time(now); - entity.setOrder_status(dto.getOrder_status()); - entity.setUpdate_by(currentUsername); - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - JSONObject json = (JSONObject) JSONObject.toJSON(entity); - wo.update(json, "order_code = '" + dto.getOrder_code() + "'"); - Iterator iterator = order.iterator(); - while (iterator.hasNext()) { - ProduceshiftorderDto oneorder = iterator.next(); - if (oneorder.getOrder_code().equals(dto.getOrder_code())) { - iterator.remove(); - } - } - if (StrUtil.equals(dto.getOrder_status(), "0") || StrUtil.equals(dto.getOrder_status(), "1")) { - order.add(dto); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteAll(String[] ids) { - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - for (String order_id : ids) { - wo.delete("order_id = '" + order_id + "'"); - Iterator iterator = order.iterator(); - while (iterator.hasNext()) { - ProduceshiftorderDto instruction = iterator.next(); - if (instruction.getOrder_id().equals(order_id)) { - iterator.remove(); - } - } - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (ProduceshiftorderDto produceshiftorder : all) { - Map map = new LinkedHashMap<>(); - map.put("工单编码", produceshiftorder.getOrder_code()); - map.put("工单状态", produceshiftorder.getOrder_status()); - map.put("下料数量", produceshiftorder.getQty()); - map.put("物料编码", produceshiftorder.getMaterial_code()); - map.put("物料名称", produceshiftorder.getMaterial_name()); - map.put("物料标识", produceshiftorder.getMaterial_uuid()); - map.put("规格型号", produceshiftorder.getMaterial_spec()); - map.put("创建者", produceshiftorder.getCreate_by()); - map.put("创建时间", produceshiftorder.getCreate_time()); - map.put("修改者", produceshiftorder.getUpdate_by()); - map.put("修改时间", produceshiftorder.getUpdate_time()); - map.put("是否删除", produceshiftorder.getIs_deleted()); - map.put("工单外部标识", produceshiftorder.getExt_order_id()); - map.put("设备编号", produceshiftorder.getDevice_code()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void finishd(JSONObject param) { - param = param.getJSONObject("data"); - String now = DateUtil.now(); - String order_id = param.getString("order_id"); - String ext_order_id = param.getString("ext_order_id"); - if (StrUtil.isNotEmpty(ext_order_id)) { - // TODO - param.put("status", "3"); - param.put("type", "2"); - acsToWmsService.feedbackOrderStatus(param); - } - Device device = DeviceAppService.findDeviceByCode(param.getString("device_code")); - HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver; - HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver; - HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver; - if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver) { - hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver(); - hailiangSpecialDeviceDriver.writing("to_order_compel_finished", "1"); - } - if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) { - hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver(); - hailiangPackerStationDeviceDriver.writing("to_order_compel_finished", "1"); - } - if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) { - hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver(); - hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished", "1"); - } - JSONObject map = new JSONObject(); - map.put("order_id", order_id); - map.put("order_status", "3"); - map.put("update_by", SecurityUtils.getNickName()); - map.put("update_time", now); - WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); - wo.update(map); - Iterator iterator = order.iterator(); - while (iterator.hasNext()) { - ProduceshiftorderDto instruction = iterator.next(); - if (instruction.getOrder_code().equals(param.getString("order_code"))) { - iterator.remove(); - } - } - } - - @Override - public List findAllOrderFromCache() { - return order; - } - - @Override - public ProduceshiftorderDto findOrderByDeviceCode(String device_code) { - for (int i = 0; i < this.order.size(); i++) { - ProduceshiftorderDto dto = order.get(i); - if (StrUtil.equals(device_code, dto.getDevice_code())) { - return dto; - } - } - return null; - } - - @Override - public void synchron() { - this.reload(); - } - -} diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls deleted file mode 100644 index 89d456db335a3f66cd12d666e74131dc2ac5ef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z(l9?W7v)b@!KwV~*L1&WzA>(Wa(AxA_#w?Tkr%QvkD&+3* zm2UbFOAXFd0MjDoHB%MR-X7ZYC3>@7mt`_&)UX}_FW1_#)n>avPi$OcOVi@pen#uE zv9PQd+a3!%v)!#rm$wC&wbX4j8u`cOcafL0L13(;EP<&>mt;^tvZHY0BZV%Mt24() z*Nhh1|81&}_O9PG0EYzWWYEGS1Yh|uri~VXE^~#hxISM~kG^R=`s#Z0HD2!9m0Y_$ zap=E{#dWiik`be>;NOwV&p925cG7U(;d?FDqul0eq5KaB--uEYn>Ze%N01~U40KEav1BmK&U<@J+Kc!K;c%kGb zeAzY(reSbXcqE`hj+A<Oar_#KU zbo_bK{YK&u?t=j88`MXL_FDm+`v&=8f3Q=Rp5{E<|)sUBZkXietf@%AA8c_47M%r!rOHPLVyh zQ<@LrPJHEY+^H|^^*vJ>(SQPL@%YN3X|4sOu7$S6MP;rDSyH+*1uw9dJ4?&3u~wQy zQZCe@1=!3tr?OfKld>cct+Qtq4pA+0E+z>{D#}0#$G3+UlvdWdd&rK8NmJSaxfJ+Z z(e%p7GB+(lROD6^xuo(_-=370i=~p{+M=4w+S0OO2v<^-s8BxB%z5K#ON-mzGqnd= z;^pxzA6otVkbL~SZ?3b#Wg#L+F2eqB*`M0#-SfZx^p#_Bd*ZS6xUQ;Od}=$L#;C*Y z#AI!XE~o#+2z zFug6tywWer9)x@BWsF;dK&cmf6hs7&Sz1zJmel7GW0wzHOg6I{)C0&_{@?fezW^Dp Bm>K{8 diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java index 26422b5..87a7f9c 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java @@ -14,36 +14,11 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.common.IDriverService; import org.nl.acs.device.service.StorageCellService; -import org.nl.acs.device.service.dto.StorageCellDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver; -import org.nl.acs.device_driver.basedriver.agv.ndctwo.AgvNdcTwoDeviceDriver; -import org.nl.acs.device_driver.basedriver.agv.utils.IAgv; -import org.nl.acs.device_driver.basedriver.agv.utils.OneAgvPhase; -import org.nl.acs.device_driver.basedriver.agv.utils.TwoAgvPhase; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache.HailiangEngravingCacheDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_device.HailiangSpecialDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station.HailiangSpecialEmptyStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station.HailiangSpecialFullStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pick_station.HailiangSpecialPickStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_autodoor.StandardAutodoorDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_scanner.StandardScannerDeviceDriver; -import org.nl.acs.device_driver.hailiang.hailiang_packing.HaiLiangPackingDeviceDriver; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.stage.service.StageActorService; import org.nl.acs.stage.service.dto.StageActorDto; -import org.nl.acs.stage.service.utils.StageActorUtil; import org.nl.exception.BadRequestException; import org.nl.utils.FileUtil; import org.nl.utils.RedisUtils; @@ -132,7 +107,9 @@ public class StageActorServiceImpl implements StageActorService { @Transactional(rollbackFor = Exception.class) public void update(StageActorDto dto) { StageActorDto entity = this.findById(dto.getActor_uuid()); - if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + if (entity == null) { + throw new BadRequestException("被删除或无权限,操作失败!"); + } String currentUsername = SecurityUtils.getCurrentUsername(); String now = DateUtil.now(); diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateAGVTwoInst.java b/wcs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateAGVTwoInst.java index 3f48504..cc67007 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateAGVTwoInst.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateAGVTwoInst.java @@ -7,17 +7,12 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device_driver.basedriver.lamp_three_color.LampThreecolorDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.enums.TaskTypeEnum; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.modules.log.LogMarkerTypeEnum; @@ -26,7 +21,6 @@ import org.nl.utils.SpringContextHolder; import org.springframework.stereotype.Component; import java.text.SimpleDateFormat; -import java.util.Arrays; import java.util.Date; import java.util.List; diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java b/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java index 6b59e2d..04b39cb 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java @@ -32,14 +32,17 @@ public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut); } + @Override public String getCode() { return LetteringSocketConnectionAutoRun.class.getSimpleName(); } + @Override public String getName() { return "海亮激光刻字在线连接"; } + @Override public void autoRun() throws IOException { AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigServiceImpl.class); diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java b/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java index e711d98..f39e75b 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java @@ -7,7 +7,6 @@ import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.config.server.impl.AcsConfigServiceImpl; import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.basedriver.agv.ndctwo.AgvNdcTwoDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.instruction.service.InstructionService; @@ -57,14 +56,17 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut); } + @Override public String getCode() { return NDCSocketConnectionAutoRun.class.getSimpleName(); } + @Override public String getName() { return "双工NDC在线连接"; } + @Override public void autoRun() { try { AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigServiceImpl.class); @@ -92,8 +94,9 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { for (int i = 0; i < count; i++) { int temp = b[i]; - if (temp < 0) + if (temp < 0) { temp += 256; + } arr[i] = temp; StringBuffer bs1 = new StringBuffer("0"); bs.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp)); @@ -118,7 +121,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { List insts = null; boolean link_flag = false; Device agv_device = null; - if(carno != 0){ + if (carno != 0) { agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno)); } if (ikey != 0) { @@ -133,9 +136,6 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { String device_code = null; - // - AgvNdcTwoDeviceDriver agvNdcTwoDeviceDriver; - //开始任务/上报订单号 if (phase == 0x01) { for (Instruction inst : insts) { @@ -156,10 +156,10 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { } data = AgvService.sendAgvTwoModeInst(phase, index, 0); - } else if(phase == 0x30){ + } else if (phase == 0x30) { data = AgvService.sendAgvTwoModeInst(143, index, 0); - } else if(phase == 0xFF){ + } else if (phase == 0xFF) { for (Instruction inst : insts) { if (!ObjectUtil.isEmpty(inst)) { @@ -170,20 +170,15 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { } else { - if(phase == 0x67){ + if (phase == 0x67) { device = deviceAppService.findDeviceByCode(Integer.toString(arr[27])); } else { device = deviceAppService.findDeviceByCode(Integer.toString(arr[20])); } - if(ObjectUtil.isEmpty(device)){ + if (ObjectUtil.isEmpty(device)) { return; } - if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) { - agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver(); - - agvNdcTwoDeviceDriver.processSocket(arr); - } } if (!ObjectUtil.isEmpty(data)) { write(data); diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/OneNDCSocketConnectionAutoRun.java b/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/OneNDCSocketConnectionAutoRun.java index 20d1bd0..8a64768 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/OneNDCSocketConnectionAutoRun.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/OneNDCSocketConnectionAutoRun.java @@ -7,7 +7,6 @@ import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.config.server.impl.AcsConfigServiceImpl; import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.instruction.service.InstructionService; @@ -57,14 +56,17 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut); } + @Override public String getCode() { return OneNDCSocketConnectionAutoRun.class.getSimpleName(); } + @Override public String getName() { return "单工NDC在线连接"; } + @Override public void autoRun() throws IOException { System.out.println("OneAgv链接开始"); AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigServiceImpl.class); @@ -96,8 +98,9 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { for (int i = 0; i < count; i++) { int temp = b[i]; - if (temp < 0) + if (temp < 0) { temp += 256; + } arr[i] = temp; StringBuffer bs1 = new StringBuffer("0"); bs.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp)); @@ -122,7 +125,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { List insts = null; boolean link_flag = false; Device agv_device = null; - if(carno != 0){ + if (carno != 0) { agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno)); } if (ikey != 0) { @@ -137,9 +140,6 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { String device_code = null; - // - AgvNdcOneDeviceDriver agvNdcOneDeviceDriver; - //开始任务/上报订单号 if (phase == 0x01) { for (Instruction inst : insts) { @@ -160,10 +160,10 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } data = AgvService.sendAgvOneModeInst(phase, index, 0); - } else if(phase == 0x30){ + } else if (phase == 0x30) { data = AgvService.sendAgvOneModeInst(143, index, 0); - } else if(phase == 0xFF) { + } else if (phase == 0xFF) { for (Instruction inst : insts) { if (!ObjectUtil.isEmpty(inst)) { @@ -172,25 +172,20 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } data = AgvService.sendAgvOneModeInst(phase, index, 0); - }else if(phase == 0x50){//离开区域 + } else if (phase == 0x50) {//离开区域 data = AgvService.sendAgvOneModeInst(phase, index, 0); - }else if(phase == 0x51){//离开区域 + } else if (phase == 0x51) {//离开区域 data = AgvService.sendAgvOneModeInst(phase, index, 0); } else { - if(phase == 0x67){ + if (phase == 0x67) { device = deviceAppService.findDeviceByCode(Integer.toString(arr[27])); } else { device = deviceAppService.findDeviceByCode(Integer.toString(arr[20])); } - if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) { - agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver(); - - agvNdcOneDeviceDriver.processSocket(arr); - } } if (!ObjectUtil.isEmpty(data)) { write(data); @@ -203,7 +198,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } catch (Exception e) { System.out.println("OneAgv链接异常"); - if(ObjectUtil.isNotEmpty(s)){ + if (ObjectUtil.isNotEmpty(s)) { s.close(); } System.out.println(e.getMessage()); diff --git a/wcs/qd/src/api/acs/order/produceshiftorder.js b/wcs/qd/src/api/acs/order/produceshiftorder.js deleted file mode 100644 index 1c478c4..0000000 --- a/wcs/qd/src/api/acs/order/produceshiftorder.js +++ /dev/null @@ -1,42 +0,0 @@ -import request from '@/utils/request' - -export function add(data) { - return request({ - url: 'api/produceshiftorder', - method: 'post', - data - }) -} - -export function del(ids) { - return request({ - url: 'api/produceshiftorder/', - method: 'delete', - data: ids - }) -} - -export function edit(data) { - return request({ - url: 'api/produceshiftorder', - method: 'put', - data - }) -} - -export function finishd(data) { - return request({ - url: 'api/produceshiftorder/finishd', - method: 'post', - data - }) -} - -export function synchron() { - return request({ - url: 'api/produceshiftorder/synchron', - method: 'post' - }) -} - -export default { add, edit, del, finishd, synchron } diff --git a/wcs/qd/src/views/acs/device/config.vue b/wcs/qd/src/views/acs/device/config.vue index 4480f3e..0638433 100644 --- a/wcs/qd/src/views/acs/device/config.vue +++ b/wcs/qd/src/views/acs/device/config.vue @@ -43,8 +43,8 @@ @@ -75,54 +75,25 @@ import { get, selectDriverCodeList } from '@/api/acs/device/driverConfig' import { getDicts } from '@/api/system/dict' import standard_inspect_site from './driver/standard_inspect_site' import standard_ordinary_site from './driver/standard_ordinary_site' -import weighing_site from './driver/weighing_site' -import machines_site from './driver/machines_site' -import lamp_three_color from './driver/lamp_three_color' -import standard_autodoor from './driver/standard_autodoor' -import standard_emptypallet_site from './driver/standard_emptypallet_site' -import standard_manipulator_inspect_site from './driver/standard_manipulator_inspect_site' -import standard_special_inspect_site from './driver/standard_special_inspect_site' -import special_ordinary_site from './driver/special_ordinary_site' import standard_storage from '@/views/acs/device/driver/standard_storage' import standard_scanner from '@/views/acs/device/driver/standard_scanner' import standard_conveyor_control_with_scanner from '@/views/acs/device/driver/standard_conveyor_control_with_scanner' -import standard_conveyor_control_with_plcscanner from '@/views/acs/device/driver/standard_conveyor_control_with_plcscanner' import standard_conveyor_control from '@/views/acs/device/driver/standard_conveyor_control' import standard_conveyor_monitor from '@/views/acs/device/driver/standard_conveyor_monitor' -import non_line_manipulator_inspect_site from '@/views/acs/device/driver/non_line_manipulator_inspect_site' -import non_line_inspect_site from '@/views/acs/device/driver/non_line_inspect_site' -import manipulator_inspect_site_NDC from '@/views/acs/device/driver/manipulator_inspect_site_NDC' -import standard_manipulator_stacking_site from '@/views/acs/device/driver/standard_manipulator_stacking_site' -import standard_photoelectric_inspect_site from '@/views/acs/device/driver/standard_photoelectric_inspect_site' - -import hailiang_special_pick_station from '@/views/acs/device/driver/hailiang_one/hailiang_special_pick_station' -import hailiang_special_empty_station from '@/views/acs/device/driver/hailiang_one/hailiang_special_empty_station' -import hailiang_special_full_station from '@/views/acs/device/driver/hailiang_one/hailiang_special_full_station' -import hailiang_special_pour_station from '@/views/acs/device/driver/hailiang_one/hailiang_special_pour_station' -import hailiang_special_device from '@/views/acs/device/driver/hailiang_one/hailiang_special_device' -import hailiang_engraving_machine from '@/views/acs/device/driver/hailiang_one/hailiang_engraving_machine' -import hailiang_engraving_cache from '@/views/acs/device/driver/hailiang_one/hailiang_engraving_cache' -import hailiang_packer_station from '@/views/acs/device/driver/hailiang_one/hailiang_packer_station' -import hailiang_auto_cache_line from '@/views/acs/device/driver/hailiang_one/hailiang_auto_cache_line' -import hailiang_cleaning_feeding_line from '@/views/acs/device/driver/hailiang_one/hailiang_cleaning_feeding_line' -import hailiang_cleaning_machine from '@/views/acs/device/driver/hailiang_one/hailiang_cleaning_machine' -import hailiang_cleaning_machine_storage_station from '@/views/acs/device/driver/hailiang_one/hailiang_cleaning_machine_storage_station' -import agv_ndc_one from '@/views/acs/device/driver/agv/agv_ndc_one' -import agv_ndc_two from '@/views/acs/device/driver/agv/agv_ndc_two' -import hailiang_xj_plc_test from '@/views/acs/device/driver/hailiang_one/hailiang_xj_plc_test' import hailiang_smart_plc_test from '@/views/acs/device/driver/hailiang_one/hailiang_smart_plc_test' export default { name: 'DeviceConfig', - components: { standard_ordinary_site, standard_inspect_site, standard_autodoor, - standard_emptypallet_site, standard_manipulator_inspect_site, standard_special_inspect_site, - lamp_three_color, standard_storage, special_ordinary_site, standard_scanner, standard_conveyor_control_with_scanner, - standard_conveyor_control_with_plcscanner, standard_conveyor_control, standard_conveyor_monitor, weighing_site, machines_site, non_line_manipulator_inspect_site, - non_line_inspect_site, manipulator_inspect_site_NDC, standard_manipulator_stacking_site, - standard_photoelectric_inspect_site, agv_ndc_two, agv_ndc_one, hailiang_packer_station, hailiang_engraving_cache, - hailiang_special_pick_station, hailiang_special_empty_station, hailiang_special_full_station, hailiang_special_pour_station, hailiang_special_device, - hailiang_engraving_machine, hailiang_auto_cache_line, hailiang_cleaning_feeding_line, hailiang_cleaning_machine, hailiang_cleaning_machine_storage_station, - hailiang_xj_plc_test, hailiang_smart_plc_test }, + components: { + standard_ordinary_site, + standard_inspect_site, + standard_storage, + standard_scanner, + standard_conveyor_control_with_scanner, + standard_conveyor_control, + standard_conveyor_monitor, + hailiang_smart_plc_test + }, dicts: ['device_type'], mixins: [crud], data() { diff --git a/wcs/qd/src/views/acs/order/index.vue b/wcs/qd/src/views/acs/order/index.vue deleted file mode 100644 index 8f8c6c9..0000000 --- a/wcs/qd/src/views/acs/order/index.vue +++ /dev/null @@ -1,215 +0,0 @@ - - - - -