From 39e9afae00bf794a20688bda8c6be98b477ddb7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E4=BF=8A=E6=9D=B0?= <9463626+zhou-junjiezjj@user.noreply.gitee.com> Date: Thu, 6 Jul 2023 14:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E4=BA=AE=E6=B5=B7=E6=9F=94=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/device_driver/DriverTypeEnum.java | 4 + .../acs/device_driver/FeedLmsRealFailed.java | 11 + .../agv/liku_agv/LiKuDefination.java | 46 + .../agv/liku_agv/LiKuDeviceDriver.java | 113 ++ .../HailiangHrSsxDefination.java | 54 + .../HailiangHrSsxDeviceDriver.java | 239 ++++ .../hailiang_hr_ssx/ItemProtocol.java | 143 +++ .../siemens_conveyor/ItemProtocol.java | 160 +++ .../SiemensConveyorDefination.java | 64 + .../SiemensConveyorDeviceDriver.java | 1137 +++++++++++++++++ .../driver/AbstractOpcDeviceDriver.java | 66 +- .../driver/ExecutableDeviceDriver.java | 4 +- .../main/java/org/nl/acs/ext/wms/AcsUtil.java | 53 + .../java/org/nl/acs/ext/wms/RespUtil.java | 18 + .../data/ApplyLabelingAndBindingRequest.java | 20 + .../data/ApplyLabelingAndBindingResponse.java | 13 + .../org/nl/acs/ext/wms/data/BaseRequest.java | 49 + .../org/nl/acs/ext/wms/data/BaseResponse.java | 52 + .../acs/ext/wms/data/CancelTaskRequest.java | 30 + .../acs/ext/wms/data/CancelTaskResponse.java | 7 + .../acs/ext/wms/data/CreateTaskRequest.java | 123 ++ .../acs/ext/wms/data/CreateTaskResponse.java | 6 + .../java/org/nl/acs/ext/wms/data/JsonUtl.java | 4 +- .../ext/wms/data/LiKuApplyTakResponse.java | 9 + .../ext/wms/data/LiKuApplyTaskRequest.java | 9 + .../nl/acs/ext/wms/data/PutActionRequest.java | 30 + .../acs/ext/wms/data/PutActionResponse.java | 7 + .../acs/ext/wms/data/UpdateLKTaskRequest.java | 42 + .../ext/wms/data/UpdateLKTaskResponse.java | 6 + .../ext/wms/liKuData/BaseResponseData.java | 24 + .../wms/liKuData/BaseStoreReportRequest.java | 44 + .../ext/wms/liKuData/BaseStoreRequest.java | 42 + .../ext/wms/liKuData/CancelTaskRequest.java | 37 + .../ext/wms/liKuData/CancelTaskResponse.java | 13 + .../ext/wms/liKuData/DeviceStatusData.java | 35 + .../ext/wms/liKuData/DeviceStatusRequest.java | 11 + .../wms/liKuData/DeviceStatusResponse.java | 14 + .../liKuData/EmptyVehicleOutStoreRequest.java | 13 + .../EmptyVehicleOutStoreResponse.java | 13 + .../wms/liKuData/InStoreReportRequest.java | 13 + .../wms/liKuData/InStoreReportResponse.java | 14 + .../acs/ext/wms/liKuData/InStoreRequest.java | 18 + .../ext/wms/liKuData/InStoreResetRequest.java | 12 + .../wms/liKuData/InStoreResetResponse.java | 12 + .../acs/ext/wms/liKuData/InStoreResponse.java | 12 + .../liKuData/InStoreTaskUpdateRequest.java | 33 + .../liKuData/InStoreTaskUpdateResponse.java | 7 + .../wms/liKuData/MoveStoreReportRequest.java | 10 + .../wms/liKuData/MoveStoreReportResponse.java | 12 + .../ext/wms/liKuData/MoveStoreRequest.java | 25 + .../wms/liKuData/MoveStoreResetRequest.java | 13 + .../wms/liKuData/MoveStoreResetResponse.java | 13 + .../ext/wms/liKuData/MoveStoreResponse.java | 13 + .../liKuData/MoveStoreTaskUpdateRequest.java | 32 + .../liKuData/MoveStoreTaskUpdateResponse.java | 7 + .../liKuData/OutConfirmReportResponse.java | 12 + .../ext/wms/liKuData/OutConfirmRequest.java | 14 + .../wms/liKuData/OutStoreReportRequest.java | 13 + .../wms/liKuData/OutStoreReportResponse.java | 12 + .../acs/ext/wms/liKuData/OutStoreRequest.java | 27 + .../ext/wms/liKuData/OutStoreResponse.java | 13 + .../org/nl/acs/ext/wms/liKuData/Resp.java | 37 + .../wms/liKuData/RoadWayIsLockRequest.java | 28 + .../liKuData/a/AbnormarReportingRequest.java | 44 + .../liKuData/a/AbnormarReportingResponse.java | 7 + .../ext/wms/liKuData/a/BaseResponseData.java | 16 + .../acs/ext/wms/liKuData/a/CancelRequest.java | 13 + .../ext/wms/liKuData/a/CancelResponse.java | 7 + .../liKuData/a/ContainerArrivedRequest.java | 21 + .../liKuData/a/ContainerArrivedResponse.java | 14 + .../nl/acs/ext/wms/liKuData/a/Conveyors.java | 17 + .../org/nl/acs/ext/wms/liKuData/a/Datas.java | 11 + .../ext/wms/liKuData/a/InTaskDescribe.java | 13 + .../a/LoadContainerFinishRequest.java | 15 + .../a/LoadContainerFinishResponse.java | 9 + .../wms/liKuData/a/LocationQueryRequest.java | 27 + .../wms/liKuData/a/LocationQueryResponse.java | 12 + .../nl/acs/ext/wms/liKuData/a/Locations.java | 31 + .../wms/liKuData/a/MoveContainerRequest.java | 23 + .../wms/liKuData/a/MoveContainerResponse.java | 9 + .../nl/acs/ext/wms/liKuData/a/NodeStates.java | 31 + .../wms/liKuData/a/QueryConveyorRequest.java | 12 + .../wms/liKuData/a/QueryConveyorResponse.java | 14 + .../liKuData/a/QueryNodeReaderRequest.java | 5 + .../liKuData/a/QueryNodeReaderResponse.java | 41 + .../org/nl/acs/ext/wms/liKuData/a/Rfid.java | 19 + .../ext/wms/liKuData/a/RobotQueryRequest.java | 17 + .../wms/liKuData/a/RobotQueryResponse.java | 22 + .../org/nl/acs/ext/wms/liKuData/a/Robots.java | 89 ++ .../acs/ext/wms/liKuData/a/TaskDescribe.java | 8 + .../a/TaskstatusReportingRequest.java | 52 + .../a/TaskstatusReportingResponse.java | 8 + .../ext/wms/liKuData/a/ToteActionTask.java | 54 + .../acs/ext/wms/liKuData/a/ToteCarryTask.java | 42 + .../acs/ext/wms/liKuData/a/ToteCheckTask.java | 21 + .../org/nl/acs/ext/wms/liKuData/a/Tray.java | 28 + .../a/UnloadContainerFinishRequest.java | 19 + .../a/UnloadContainerFinishResponse.java | 7 + .../liKuData/a/UnloadContainerReqRequest.java | 15 + .../a/UnloadContainerReqResponse.java | 11 + .../org/nl/acs/ext/wms/liKuData/a/Weight.java | 17 + .../nl/acs/ext/wms/liKuData/b/AGVTask.java | 24 + .../ext/wms/liKuData/b/CarryTaskDescribe.java | 29 + .../ext/wms/liKuData/b/CheckTaskDescribe.java | 20 + .../acs/ext/wms/liKuData/b/CreateRequest.java | 57 + .../ext/wms/liKuData/b/CreateResponse.java | 9 + .../ext/wms/liKuData/b/InTaskDescribe.java | 32 + .../ext/wms/liKuData/b/OutTaskDescribe.java | 31 + .../liKuData/b/RelocationTaskDescribe.java | 23 + .../wms/liKuData/putEmptyPalletRequest.java | 14 + .../acs/ext/wms/rest/AcsToLiKuController.java | 64 + .../acs/ext/wms/rest/LiKuToACSController.java | 91 ++ .../acs/ext/wms/service/AcsToLiKuService.java | 54 + .../acs/ext/wms/service/AcsToWmsService.java | 7 +- .../acs/ext/wms/service/LiKuToAcsService.java | 69 + .../service/impl/AcsToLiKuServiceImpl.java | 113 ++ .../wms/service/impl/AcsToWmsServiceImpl.java | 59 +- .../service/impl/LiKuToAcsServiceImpl.java | 321 +++++ .../service/InstructionService.java | 4 +- .../service/impl/InstructionServiceImpl.java | 139 +- .../java/org/nl/acs/opc/BlockedRunable.java | 2 +- .../org/nl/acs/opc/DeviceExecuteAutoRun.java | 2 +- .../org/nl/acs/task/service/TaskService.java | 8 +- .../task/service/impl/TaskServiceImpl.java | 15 + .../nl/modules/quartz/task/QueryRobot.java | 103 ++ .../main/resources/config/application-dev.yml | 8 +- .../src/main/resources/log/AcsToLk.xml | 33 + .../src/main/resources/log/LkToAcs.xml | 33 + .../src/main/resources/logback-spring.xml | 3 +- .../src/views/acs/device/config.vue | 5 +- .../views/acs/device/driver/agv/liku_agv.vue | 103 ++ .../device/driver/hailiang_hr_ssx_station.vue | 489 +++++++ wcs/nladmin-ui/src/views/acs/task/index.vue | 16 + .../src/views/system/monitor/device/index.vue | 54 + 134 files changed, 5993 insertions(+), 29 deletions(-) create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/FeedLmsRealFailed.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/liku_agv/LiKuDefination.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/liku_agv/LiKuDeviceDriver.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/HailiangHrSsxDefination.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/HailiangHrSsxDeviceDriver.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/ItemProtocol.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/ItemProtocol.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefination.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/RespUtil.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/BaseRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/BaseResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/LiKuApplyTakResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/LiKuApplyTaskRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/PutActionRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/PutActionResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/UpdateLKTaskRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/UpdateLKTaskResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseResponseData.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseStoreReportRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseStoreRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/CancelTaskRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/CancelTaskResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusData.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/EmptyVehicleOutStoreRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/EmptyVehicleOutStoreResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreReportRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreReportResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResetRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResetResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreTaskUpdateRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreTaskUpdateResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreReportRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreReportResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResetRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResetResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreTaskUpdateRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreTaskUpdateResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutConfirmReportResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutConfirmRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreReportRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreReportResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/Resp.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/RoadWayIsLockRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/AbnormarReportingRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/AbnormarReportingResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/BaseResponseData.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/CancelRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/CancelResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ContainerArrivedRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ContainerArrivedResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Conveyors.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Datas.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/InTaskDescribe.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LoadContainerFinishRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LoadContainerFinishResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LocationQueryRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LocationQueryResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Locations.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/MoveContainerRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/MoveContainerResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/NodeStates.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryConveyorRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryConveyorResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryNodeReaderRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryNodeReaderResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Rfid.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/RobotQueryRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/RobotQueryResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Robots.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskDescribe.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskstatusReportingRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskstatusReportingResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteActionTask.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteCarryTask.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteCheckTask.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Tray.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerFinishRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerFinishResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerReqRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerReqResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Weight.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/AGVTask.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CarryTaskDescribe.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CheckTaskDescribe.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CreateRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CreateResponse.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/InTaskDescribe.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/OutTaskDescribe.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/RelocationTaskDescribe.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/putEmptyPalletRequest.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToLiKuController.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/LiKuToACSController.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToLiKuService.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/LiKuToAcsService.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java create mode 100644 wcs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryRobot.java create mode 100644 wcs/nladmin-system/src/main/resources/log/AcsToLk.xml create mode 100644 wcs/nladmin-system/src/main/resources/log/LkToAcs.xml create mode 100644 wcs/nladmin-ui/src/views/acs/device/driver/agv/liku_agv.vue create mode 100644 wcs/nladmin-ui/src/views/acs/device/driver/hailiang_hr_ssx_station.vue diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java index 1affdc9b..38761068 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java @@ -61,6 +61,10 @@ public enum DriverTypeEnum { HAILIANG_PACKER_STATION(26, "hailiang_packer_station", "海亮-包装机工位", "conveyor"), + LIKU_AGV(27, "liku_agv", "LIKUAGV机器人查询", "agv"), + + HAILIANG_HR_SSX(28, "hailiang_hr_ssx_station", "海亮-海柔-输送线", "conveyor"), + //HAILIANG_XJ_PLC_TEST(27, "hailiang_xj_plc_test", "海亮-信捷PLC", "conveyor"), //HAILIANG_SMART_PLC_TEST(28, "hailiang_smart_plc_test", "海亮-西门子SMART200PLC", "conveyor"), diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/FeedLmsRealFailed.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/FeedLmsRealFailed.java new file mode 100644 index 00000000..67390593 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/FeedLmsRealFailed.java @@ -0,0 +1,11 @@ +package org.nl.acs.device_driver; + +import com.alibaba.fastjson.JSONObject; + +/** + * @author: geng by + * @createDate: 2023/4/21 + */ +public interface FeedLmsRealFailed { + public JSONObject feedLmsRealFailedInfo(); +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/liku_agv/LiKuDefination.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/liku_agv/LiKuDefination.java new file mode 100644 index 00000000..daf21b7b --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/liku_agv/LiKuDefination.java @@ -0,0 +1,46 @@ +package org.nl.acs.device_driver.basedriver.agv.liku_agv; + +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 LiKuDefination implements DeviceDriverDefination { + @Override + public String getDriverCode() { + return "liku_agv"; + } + + @Override + public String getDriverName() { + return "LK机器人查询"; + } + + @Override + public String getDriverDescription() { + return "LK机器人查询"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new LiKuDeviceDriver()).setDevice(device).setDriverDefination(this); + + } + + @Override + public Class getDeviceDriverType() { + return LiKuDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList(); + types.add(DeviceType.agv); + return types; + } + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/liku_agv/LiKuDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/liku_agv/LiKuDeviceDriver.java new file mode 100644 index 00000000..a6f7937d --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/liku_agv/LiKuDeviceDriver.java @@ -0,0 +1,113 @@ +package org.nl.acs.device_driver.basedriver.agv.liku_agv; + +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.NDCAgvService; +import org.nl.acs.agv.server.impl.NDCAgvServiceImpl; +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.AbstractDeviceDriver; +import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.ext.wms.liKuData.a.Tray; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.instruction.service.impl.InstructionServiceImpl; +import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl; +import org.nl.acs.monitor.DeviceStageMonitor; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.task.service.TaskService; +import org.nl.acs.task.service.impl.TaskServiceImpl; +import org.nl.modules.wql.util.SpringContextHolder; + +import java.util.ArrayList; +import java.util.List; + +/** +*立库驱动 +*/ +@Slf4j +@Data +@RequiredArgsConstructor +public class LiKuDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { + + private InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); + private NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class); + private DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); + private DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); + private DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogServiceImpl.class); + private TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class); + + + + String robotCode = ""; + String robotTypeCode = ""; + String pointCode = ""; + Long positionX = 0l; + Long positionY = 0l; + Integer theta = 0; + Long forkHeight = 0l; + Long forkLength = 0l; + Integer forkTheta = 0; + String stationCode = ""; + String locationCode = ""; + String state = ""; + String hardwareState = ""; + List trays=new ArrayList<>(); + + String locationTypeCode = ""; + String stationModelCode = ""; + Long positionZ = 0l; + String loadContainerCode = ""; + Long updateTime = 0l; + + Integer trayLevel = 0; + String containerCode = ""; + List taskCodes=null; + String positionCode = ""; +public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + jo.put("robotCode",robotCode); + jo.put("robotTypeCode", robotTypeCode); + jo.put("pointCode", pointCode); + jo.put("positionX",this.getPositionX()); + jo.put("positionY",this. getPositionY()); + jo.put("theta", this.getTheta()); + jo.put("forkHeight", this.getForkHeight()); + jo.put("forkLength", this.getForkLength()); + jo.put("forkTheta", this.getForkTheta()); + jo.put("stationCode", stationCode); + jo.put("locationCode", locationCode); + jo.put("state", state); + jo.put("hardwareState",hardwareState); + jo.put("trays", this.getTrayList()); + return jo; +} + + @Override + public void setDeviceStatus(JSONObject data) { + + } + + + private JSONArray getTrayList(){ + JSONArray ja=new JSONArray(); + for (Tray tray : trays) { + JSONObject jo = new JSONObject(); + jo.put("trayLevel", tray.getTrayLevel()); + jo.put("containerCode", tray.containerCode); + jo.put("taskCodes", tray.getTaskCodes()); + jo.put("positionCode", tray.positionCode); + ja.add(jo); + } + return ja; + } + + @Override + public void execute() { + + } +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/HailiangHrSsxDefination.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/HailiangHrSsxDefination.java new file mode 100644 index 00000000..04474f63 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/HailiangHrSsxDefination.java @@ -0,0 +1,54 @@ +package org.nl.acs.device_driver.basedriver.hailiang_hr_ssx; + +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 HailiangHrSsxDefination implements OpcDeviceDriverDefination { + @Override + public String getDriverCode() { return "hailiang_hr_ssx_station"; } + + @Override + public String getDriverName() { + return "海亮-海柔-输送线"; + } + + @Override + public String getDriverDescription() { + return "海亮-海柔-输送线"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new HailiangHrSsxDeviceDriver()).setDevice(device).setDriverDefination(this); + + } + + @Override + public Class getDeviceDriverType() { + return HailiangHrSsxDeviceDriver.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/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/HailiangHrSsxDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/HailiangHrSsxDeviceDriver.java new file mode 100644 index 00000000..5d84ddce --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/HailiangHrSsxDeviceDriver.java @@ -0,0 +1,239 @@ +package org.nl.acs.device_driver.basedriver.hailiang_hr_ssx; + +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.acsEnum.WorkerOrderEnum; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo; +import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; +import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.ext.wms.liKuData.Resp; +import org.nl.acs.ext.wms.liKuData.a.ContainerArrivedRequest; +import org.nl.acs.ext.wms.liKuData.a.NodeStates; +import org.nl.acs.ext.wms.service.AcsToLiKuService; +import org.nl.acs.ext.wms.service.LiKuToAcsService; +import org.nl.acs.ext.wms.service.impl.AcsToLiKuServiceImpl; +import org.nl.acs.ext.wms.service.impl.LiKuToAcsServiceImpl; +import org.nl.acs.history.ErrorUtil; +import org.nl.acs.history.service.DeviceErrorLogService; +import org.nl.acs.history.service.dto.DeviceErrorLogDto; +import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; +import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.monitor.DeviceStageMonitor; +import org.nl.acs.opc.Device; +import org.nl.acs.order.service.dto.EalingOrderDto; +import org.nl.acs.order.service.dto.ProduceshiftorderDto; +import org.nl.modules.wql.util.SpringContextHolder; +import org.springframework.beans.factory.annotation.Autowired; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +@Slf4j +@Data +@RequiredArgsConstructor +public class HailiangHrSsxDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo { + protected ItemProtocol itemProtocol=new ItemProtocol(this); + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + @Autowired + DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + @Autowired + LiKuToAcsService liKuToAcsService = SpringContextHolder.getBean(LiKuToAcsServiceImpl.class); + @Autowired + AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuServiceImpl.class); + + int heartbeat = 0; + int mode = 0; + int action = 0; + int error = 0; + int task = 0; + int move = 0; + int to_command = 0; + String barcode,last_barcode; + + int last_heartbeat = 0; + int last_mode = 0; + int last_error = 0; + int last_task = 0; + int last_move = 0; + + + Boolean isonline = true; + String message = null; + Boolean iserror = false; + private Date instruction_require_time = new Date(); + private int instruction_require_time_out = 3000; + boolean requireSucess = false; + + private int instruction_finished_time_out; + String device_code = null; + + @Override + public Device getDevice() { + return this.device; + } + + + @Override + public void execute() throws Exception { + try { + device_code = this.getDeviceCode(); + mode = this.itemProtocol.getMode(); + move = this.itemProtocol.getMove(); + action = this.itemProtocol.getAction(); + error = this.itemProtocol.getError(); + task = this.itemProtocol.getTask(); + barcode = this.itemProtocol.getBarcode(); + to_command = this.itemProtocol.getToCommand(); + if (mode != last_mode) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记"); + } + if (move != last_move){ + message = null; + requireSucess =false; + + } + if (error != last_error) { + if (error != 0) { + DeviceErrorLogDto dto = new DeviceErrorLogDto(); + dto.setDevice_code(device_code); + dto.setError_code(String.valueOf(error)); + dto.setError_info(ErrorUtil.getDictDetail("unbox_error_type", String.valueOf(error))); + deviceErrorLogService.create(dto); + } + logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error + "复位请求标记"); + } + if (task != last_task) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task + "复位请求标记"); + } + + } catch (Exception var17) { + var17.printStackTrace(); + logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17); + } + + if (mode == 0) { + message = "未联机"; + } else { + Instruction instruction = null; + List toInstructions; + + if(move ==1 && barcode.length()>0 && !requireSucess ){ + ContainerArrivedRequest containerArrivedRequest=new ContainerArrivedRequest(); + NodeStates nodeStates=new NodeStates(); + containerArrivedRequest.setSlotCode(device_code); + containerArrivedRequest.setContainerCode(barcode); + Date date = new Date(); + SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss"); + nodeStates.setLastHasContainerTime(Long.parseLong(dateFormat.format(date))); + nodeStates.setLastReadTime(Long.parseLong(dateFormat.format(date))); + nodeStates.setLastReportTime(Long.parseLong(dateFormat.format(date))); + Resp containerArrivedResp=acsToLiKuService.containerArrived(containerArrivedRequest); + JSONObject response1=JSONObject.parseObject(String.valueOf(containerArrivedResp)); + int code=response1.getInteger("code"); + String msg=response1.getString("msg"); + if(code == 0) { + log.info("请求成功 请求结果{}", code,msg); + requireSucess = true; + } + } + } + + last_mode = mode; + last_move = move; + last_error = error; + last_task = task; + last_barcode = barcode; + } + + + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + jo.put("device_name", this.getDevice().getDevice_name()); + String mode = ""; + String action = ""; + String move = ""; + if (this.getMode() == 0) { + mode = "未联机"; + jo.put("isOnline", false); + } else if (this.getMode() == 1) { + mode = "单机"; + jo.put("isOnline", false); + } else if (this.getMode() == 2) { + mode = "联机"; + jo.put("isOnline", true); + } else if (this.getMode() == 3) { + mode = "运行中"; + jo.put("isOnline", true); + } + if (this.getMove() == 0) { + move = "无货"; + jo.put("hasGoods", false); + } else if (this.getMove() > 0) { + move = "有货"; + jo.put("hasGoods", true); + } + jo.put("move", move); + jo.put("mode", mode); + jo.put("isOnline", this.getIsonline()); + jo.put("isError", this.getIserror()); + jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error))); + jo.put("task", task); + jo.put("barcode", barcode); + jo.put("isOnline", this.itemProtocol.getIsonline()); + jo.put("message", message); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } + + @Override + public void issuedOrderInfo(ProduceshiftorderDto dto) { + EalingOrderDto ealingOrderDto = dto.getEalingOrderDto(); + if (ealingOrderDto != null) { + String is_foreward = ealingOrderDto.getIs_foreward(); + Map map = new HashMap<>(); + map.put("to_clear", "1"); + map.put("to_is_foreward", is_foreward); + map.put("to_order_box_num", ealingOrderDto.getOrder_box_num()); + map.put("to_order", ealingOrderDto.getOrder_code()); + this.writing(map); + } + } + + + + @Override + public void issuedOrderFinish(String autoFinish) { + if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) { + this.writing("to_order_compel_finished", "1"); + } else { + this.writing("to_confirm_finished", "1"); + } + } + + @Override + public void toStop() { + + } + + @Override + public void toStart() { + + } +} + + diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/ItemProtocol.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/ItemProtocol.java new file mode 100644 index 00000000..54307590 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_hr_ssx/ItemProtocol.java @@ -0,0 +1,143 @@ +package org.nl.acs.device_driver.basedriver.hailiang_hr_ssx; + +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_direction = "direction"; + public static String item_is_flip = "is_flip"; + public static String item_task = "task"; + public static String item_barcode = "barcode"; + + + public static String item_to_command = "to_command"; + public static String item_to_target = "to_target"; + public static String item_to_task = "to_task"; + public static String item_to_is_flip = "to_is_flip"; + public static String item_to_barcode = "to_barcode"; + + + + + private HailiangHrSsxDeviceDriver driver; + + public ItemProtocol(HailiangHrSsxDeviceDriver 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 getAction() { + return this.getOpcIntegerValue(item_action); + } + + public String getBarcode() { + return this.getOpcStringValue(item_barcode); + } + + public int getError() { + return this.getOpcIntegerValue(item_error); + } + + public int getIsflip() { + return this.getOpcIntegerValue(item_is_flip); + } + + public int getTask() { + return this.getOpcIntegerValue(item_task); + } + + public int getToCommand() { + return this.getOpcIntegerValue(item_to_command); + } + + public int getToTarget() { + return this.getOpcIntegerValue(item_to_target); + } + + public int getToTask() { + return this.getOpcIntegerValue(item_to_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 String getOpcStringValue(String protocol) { + String value = this.driver.getStringValue(protocol); + if (value == null) { + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return ""; + + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_heartbeat, "心跳", "DB600.W0")); + list.add(new ItemDto(item_mode, "工作状态", "DB600.W2", Boolean.valueOf(true))); + list.add(new ItemDto(item_move, "光电开关信号", "DB600.W4")); + list.add(new ItemDto(item_action, "取放信号", "DB600.W6")); + list.add(new ItemDto(item_direction, "电机方向", "DB600.W8")); + list.add(new ItemDto(item_is_flip, "是否翻转", "DB600.W10")); + list.add(new ItemDto(item_error, "报警信号", "DB600.W12")); + list.add(new ItemDto(item_task, "任务号", "DB600.D14")); + list.add(new ItemDto(item_barcode, "条码", "DB600.STRING18.20")); + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_to_command, "下发作业命令", "DB610.W2", Boolean.valueOf(true))); + list.add(new ItemDto(item_to_target, "下发目标站", "DB610.W4")); + list.add(new ItemDto(item_to_is_flip, "下发是否翻转", "DB610.W6")); + list.add(new ItemDto(item_to_task, "下发任务号", "DB610.D8")); + list.add(new ItemDto(item_to_barcode, "下发条码", "DB610.STRING12.20")); + return list; + } + + + @Override + public String toString() { + return ""; + } +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/ItemProtocol.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/ItemProtocol.java new file mode 100644 index 00000000..fe28d286 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/ItemProtocol.java @@ -0,0 +1,160 @@ +package org.nl.acs.device_driver.basedriver.siemens_conveyor; + +import cn.hutool.core.util.StrUtil; +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_carrier_direction = "carrier_direction"; + //报警 + public static String item_error = "error"; + //任务号 + public static String item_task = "task"; + + //下发命令 + public static String item_to_command = "to_command"; + //下发目标站 + public static String item_to_target = "to_target"; + //下发托盘类型 + public static String item_to_container_type = "to_container_type"; + //下发任务号 + public static String item_to_task = "to_task"; + //困扎次数 + public static String item_to_strap_times = "to_strap_times"; + //木箱长度 + public static String item_to_length = "to_length"; + //木箱宽度 + public static String item_to_weight = "to_weight"; + //木箱高度 + public static String item_to_height = "to_height"; + + + private SiemensConveyorDeviceDriver driver; + + public ItemProtocol(SiemensConveyorDeviceDriver 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 getCarrier_direction() { + return this.getOpcIntegerValue(item_carrier_direction); + } + + public int getError() { + return this.getOpcIntegerValue(item_error); + } + + public int getTask() { + return this.getOpcIntegerValue(item_task); + } + + public int getTo_command() { + return this.getOpcIntegerValue(item_to_command); + } + + public int getTo_target() { + return this.getOpcIntegerValue(item_to_target); + } + + public int getTo_task() { + return this.getOpcIntegerValue(item_to_task); + } + + public int getTo_strap_times() { + return this.getOpcIntegerValue(item_to_strap_times); + } + + public int getTo_length() { + return this.getOpcIntegerValue(item_to_length); + } + + public int getTo_weight() { + return this.getOpcIntegerValue(item_to_weight); + } + + public int getTo_height() { + return this.getOpcIntegerValue(item_to_height); + } + + + Boolean isonline; + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + if (value == null) { + // log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + + } + + public String getOpcStringValue(String protocol) { + String value = this.driver.getStringValue(protocol); + if (StrUtil.isEmpty(value)) { + + } else { + return value; + } + return "0"; + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0")); + list.add(new ItemDto(item_mode, "工作模式", "DB600.B2")); + list.add(new ItemDto(item_move, "光电信号", "DB600.B3")); + list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB600.B4")); + list.add(new ItemDto(item_error, "报警信号", "DB600.B6")); + list.add(new ItemDto(item_task, "任务号", "DB600.D10")); + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_to_command, "下发命令", "DB601.W2")); + list.add(new ItemDto(item_to_target, "下发目标站", "DB601.W4")); + list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB601.W6")); + list.add(new ItemDto(item_to_task, "下发任务号", "DB601.D8")); + list.add(new ItemDto(item_to_strap_times, "困扎次数", "DB601.W12")); + list.add(new ItemDto(item_to_length, "木箱长度", "DB601.W14")); + list.add(new ItemDto(item_to_weight, "木箱宽度", "DB601.W16")); + list.add(new ItemDto(item_to_height, "木箱高度", "DB601.W18")); + return list; + } + + @Override + public String toString() { + return ""; + } + +} + diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefination.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefination.java new file mode 100644 index 00000000..465f0a75 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefination.java @@ -0,0 +1,64 @@ +package org.nl.acs.device_driver.basedriver.siemens_conveyor; + +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 SiemensConveyorDefination implements OpcDeviceDriverDefination { + @Override + public String getDriverCode() { + return "siemens_conveyor"; + } + + @Override + public String getDriverName() { + return "西门子-输送机驱动"; + } + + @Override + public String getDriverDescription() { + return "西门子-输送机驱动"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new SiemensConveyorDeviceDriver()).setDevice(device).setDriverDefination(this); + + } + + @Override + public Class getDeviceDriverType() { + return SiemensConveyorDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList(); + types.add(DeviceType.station); + return types; + } + + @Override + public List getReadableItemDtos() { + return ItemProtocol.getReadableItemDtos(); + } + + + + @Override + public List getWriteableItemDtos() { + return ItemProtocol.getWriteableItemDtos(); + } + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java new file mode 100644 index 00000000..afb76bdc --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -0,0 +1,1137 @@ +package org.nl.acs.device_driver.basedriver.siemens_conveyor; + +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.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; +import org.nl.acs.AcsConfig; +import org.nl.acs.agv.server.NDCAgvService; +import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.FeedLmsRealFailed; +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.data.ApplyLabelingAndBindingRequest; +import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; +import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.history.ErrorUtil; +import org.nl.acs.history.service.DeviceErrorLogService; +import org.nl.acs.history.service.dto.DeviceErrorLogDto; +import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.monitor.DeviceStageMonitor; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; +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.service.ParamService; +import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.modules.wql.util.SpringContextHolder; +import org.openscada.opc.lib.da.Server; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.*; + +/** + * 西门子-输送机驱动 + */ +@Slf4j +@Data +@RequiredArgsConstructor +public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed { + protected ItemProtocol itemProtocol = new ItemProtocol(this); + @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 + DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); + @Autowired + RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); + @Autowired + ParamService paramService = SpringContextHolder.getBean(ParamService.class); + @Autowired + AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class); + @Autowired + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + @Autowired + NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); + @Autowired + DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + //当前指令 + Instruction inst = null; + + private String error_type = "ssx_error_type"; + + //工作模式 + int mode = 0; + int last_mode = 0; + //光电信号 + int move = 0; + int last_move = 0; + //托盘方向 + int carrier_direction = 0; + int last_carrier_direction = 0; + //报警信号 + int error = 0; + int last_error = 0; + //任务号 + int task = 0; + int last_task = 0; + int agvphase = 0; + String task_code = null; + int to_command = 0; + int last_to_command = 0; + + int to_target = 0; + int last_to_target = 0; + + int to_task = 0; + int last_to_task = 0; + + int to_strap_times = 0; + int last_to_strap_times = 0; + int to_length = 0; + int last_to_length = 0; + int to_weight = 0; + int last_to_weight = 0; + int to_height = 0; + int last_to_height = 0; + + int phase = 0; + int index = 0; + Boolean isonline = true; + int hasGoods = 0; + String message = null; + Boolean iserror = false; + + String hand_barcode = null; + + Integer heartbeat_tag; + private Date instruction_update_time = new Date(); + private int instruction_update_time_out = 500; + + private Date instruction_require_time = new Date(); + private Date require_apply_labeling_time = new Date(); + private Date require_apply_strangulation_time = new Date(); + private Date require_empty_in_time = new Date(); + private Date require_empty_out_time = new Date(); + + private int instruction_require_time_out = 3000; + //行架机械手申请任务成功标识 + boolean requireSucess = false; + boolean requireEmptyInSuccess = false; + boolean requiresShipDeviceUpdate = true; + private int instruction_finished_time_out; + + int branchProtocol = 0; + String inst_message; + String last_inst_message; + int heartbeat = 0; + int last_heartbeat = 0; + //当前指令 + + //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 + int flag; + + String device_code; + + String vehicle_code; + String last_vehicle_code; + + @Override + public Device getDevice() { + return this.device; + } + + + @Override + public void execute() { + try { + device_code = this.getDeviceCode(); + mode = this.itemProtocol.getMode(); + move = this.itemProtocol.getMove(); + carrier_direction = this.itemProtocol.getCarrier_direction(); + error = this.itemProtocol.getError(); + task = this.itemProtocol.getTask(); + to_command = this.itemProtocol.getTo_command(); + to_target = this.itemProtocol.getTo_target(); + to_task = this.itemProtocol.getTo_task(); + heartbeat = this.itemProtocol.getHeartbeat(); + to_strap_times = this.itemProtocol.getTo_strap_times(); + to_length = this.itemProtocol.getTo_length(); + to_weight = this.itemProtocol.getTo_weight(); + to_height = this.itemProtocol.getTo_height(); +// if(heartbeat != last_heartbeat){ +// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat); +// } + + if (to_strap_times != last_to_strap_times) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_strap_times:" + last_to_strap_times + "->" + to_strap_times); + } + if (to_length != last_to_length) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_length:" + last_to_length + "->" + to_length); + } + if (to_weight != last_to_weight) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_weight:" + last_to_weight + "->" + to_weight); + } + if (to_height != last_to_height) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_height:" + last_to_height + "->" + to_height); + } + if (to_command != last_to_command) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command); + } + if (to_target != last_to_target) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target); + } + if (to_task != last_to_task) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task); + } + if (mode != last_mode) { + + //Boolean flag = ObjectUtil.isEmpty(this.device.getExtraValue().get("special_flag")) ? false : Boolean.valueOf(this.device.getExtraValue().get("special_flag").toString()); + //暂时这样写 后续通过配置判断 + if (StrUtil.equals(this.device_code, "1018")) { + if (mode == 6 && last_mode == 2) { + requireSucess = false; + requireEmptyInSuccess = false; + } + } else if (StrUtil.equals(this.device_code, "1016")) { + if (mode == 8 && last_mode == 2) { + requireSucess = false; + requireEmptyInSuccess = false; + } + } else { + requireSucess = false; + requireEmptyInSuccess = false; + } + logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); + logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); + } + if (move != last_move) { + message = null; + if (move == 0) { + inst_message = null; + this.hand_barcode = null; + this.clearWrite(); + } + if (move == 0 && last_move == 1) { + last_vehicle_code = vehicle_code; + last_inst_message = inst_message; + if ("true".equals(this.device.getExtraValue().get("ship_device_update"))) { + this.requiresShipDeviceUpdate = false; + } + } + logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); + } + if (carrier_direction != last_carrier_direction) { + logServer.deviceItemValue(this.device_code, "carrier_direction", String.valueOf(carrier_direction)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction:" + last_carrier_direction + "->" + carrier_direction); + } + if (error != last_error) { + if (error != 0) { + DeviceErrorLogDto dto = new DeviceErrorLogDto(); + dto.setDevice_code(device_code); + dto.setError_code(String.valueOf(error)); + dto.setError_info(ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error))); + deviceErrorLogService.create(dto); + } + logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); + } + if (task != last_task) { + logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); + } + + if (move != 0 && task > 0) { +// logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,指令号:" + task); + //inst_message + update_instruction_status(); + } + + } catch (Exception var17) { + var17.printStackTrace(); + logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); + } + + if ("true".equals(this.device.getExtraValue().get("ship_device_update"))) { + if (ObjectUtil.equal(this.getDevice().getExtraValue().get("noIdleRequest"), "true")) { + if (!requiresShipDeviceUpdate && move == 0) { + this.shipDeviceUpdate(); + } + } else { + if (mode == 2 && !requiresShipDeviceUpdate && move == 0) { + this.shipDeviceUpdate(); + } + } + } + + + if (mode == 0) { + this.setIsonline(false); + message = "未联机"; + //有报警 + + } else { + this.setIsonline(true); + this.setIserror(false); + if (error != 0) { + this.setIserror(true); + message = "有报警"; + } + + Instruction instruction = null; + List toInstructions; + + switch (mode) { + case 1: + log.debug("设备运转模式:等待工作"); + break; + case 2: + //申请任务 + if (move > 0 && !requireSucess) { + instruction_require(); + } + break; + case 4: + //申请捆扎 + if (move > 0 && !requireSucess) { + applyLaStrangulation(String.valueOf(mode)); + } + break; + case 5: + //申请贴标 + if (move > 0 && !requireSucess) { + //applyLabeling(); + } + break; + case 6: + //空托盘满垛入库申请 + if (move > 0 && !requireEmptyInSuccess) { + emptyIn(); + } + if (move > 0 && !requireSucess) { + instruction_require(); + } + break; + case 7: + //空盘出库申请 + if (move == 0 && !requireSucess) { + emptyOut(); + } + break; + case 8: + //申请AGV任务 + if (move == 1 && !requireSucess) { + applyAgvTask(); + } + break; + case 9: + //申请捆扎 + if (move > 0 && !requireSucess) { + applyLaStrangulation(String.valueOf(mode)); + } + break; + + } + } + last_mode = mode; + last_move = move; + last_carrier_direction = carrier_direction; + last_error = error; + last_task = task; + last_heartbeat = heartbeat; + last_to_task = to_task; + last_to_command = to_command; + last_to_target = to_target; + last_to_strap_times = to_strap_times; + last_to_length = to_length; + last_to_weight = to_weight; + last_to_height = to_height; + } + + private void shipDeviceUpdate() { + JSONObject param = new JSONObject() {{ + put("device_code", device_code); + }}; + logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,参数:" + param); + HttpResponse response = acsToWmsService.shipDeviceUpdate(param); + if (response == null || response.getStatus() == 200) { + logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,接口返回:" + response.body()); + this.requiresShipDeviceUpdate = true; + } + } + + + public boolean exe_error() { + if (this.error == 0) { + return true; + } else { + log.debug("设备报警"); + return false; + } + } + + public void clearWrite() { + + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_target"); + map.put("value", "0"); + list.add(map); + Map map2 = new HashMap(); + map2.put("code", "to_task"); + map2.put("value", "0"); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code", "to_command"); + map3.put("value", "0"); + list.add(map3); + Map map4 = new HashMap(); + map4.put("code", "to_strap_times"); + map4.put("value", "0"); + list.add(map4); + Map map5 = new HashMap(); + map5.put("code", "to_length"); + map5.put("value", "0"); + list.add(map5); + Map map6 = new HashMap(); + map6.put("code", "to_weight"); + map6.put("value", "0"); + list.add(map6); + Map map7 = new HashMap(); + map7.put("code", "to_height"); + map7.put("value", "0"); + list.add(map7); + this.writing(list); + message = null; + vehicle_code = null; + } + + public boolean exe_business() { + return true; + } + + public synchronized boolean finish_instruction() throws Exception { + instructionService.finish(inst); + return true; + } + + + protected void thingToNothing() throws Exception { + requireSucess = false; + } + + + 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; + Map itemMap = new HashMap(); + + itemMap.put(to_param, Integer.parseInt(value)); + this.control(itemMap); + logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); + } + + public void executing(Server server, Map itemMap) { + this.control(itemMap); + } + + public void writing(int command) { + Map itemMap = new HashMap(); + this.control(itemMap); + } + + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String move = ""; + String carrier_direction = ""; + if (this.getMode() == 0) { + mode = "脱机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "待机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } else if (this.getMode() == 4) { + mode = "申请捆扎中"; + } else if (this.getMode() == 5) { + mode = "申请贴标中"; + } else if (this.getMode() == 6) { + mode = "申请空盘入库中"; + } else if (this.getMode() == 7) { + mode = "申请空盘出库中"; + } else if (this.getMode() == 8) { + mode = "申请AGV任务中"; + } + + if (this.getMove() == 0) { + move = "无货"; + jo.put("hasGoods", false); + } else if (this.getMove() == 1) { + move = "有货"; + jo.put("hasGoods", true); + } else if (this.getMove() == 2) { + move = "有托盘有货"; + jo.put("hasGoods", true); + } + + if (this.carrier_direction == 1) { + carrier_direction = "正转"; + } else if (this.carrier_direction == 2) { + carrier_direction = "反转"; + } + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("carrier_direction", carrier_direction); + jo.put("task", task); + jo.put("last_task", last_task); + jo.put("task_code", task_code); + jo.put("inst_message", this.inst_message); + jo.put("last_inst_message", this.last_inst_message); + jo.put("isOnline", this.getIsonline()); + jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + jo.put("hand_barcode", hand_barcode); + jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code()); + jo.put("is_click", true); + jo.put("requireSucess", requireSucess); + jo.put("driver_type", "siemens_conveyor"); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + String requestSucess = data.getString("requireSucess"); + if (StrUtil.equals(requestSucess, "0")) { + this.requireSucess = false; + } else if (StrUtil.equals(requestSucess, "1")) { + this.requireSucess = true; + } + + String hand_barcode = data.getString("hand_barcode"); + this.setHand_barcode(hand_barcode); + } + + @Override + public JSONObject feedLmsRealFailedInfo() { + JSONObject jo = new JSONObject(); + jo.put("device_code", this.getDevice().getDevice_code()); + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("fault_code", String.valueOf(error)); + jo.put("fault_info", ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError()))); + jo.put("fault_type", error_type); + return jo; + } + + public void writing(List list) { + + Map itemMap = new HashMap(); + for (int i = 0; i < list.size(); i++) { + Object ob = list.get(i); + JSONObject json = (JSONObject) JSONObject.toJSON(ob); + if (!StrUtil.isEmpty(json.getString("value"))) { + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + json.getString("code"); + itemMap.put(to_param, json.getString("value")); + } + } + logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); + try { + this.checkcontrol(itemMap); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + /** + * 请求指令 + */ + public synchronized boolean instruction_require() { + 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 taskdto = taskserver.findByStartCodeAndReady(device_code); + if (!ObjectUtil.isEmpty(taskdto)) { +// if (!ObjectUtils.isEmpty(instructionService.findByBarcodeFromCache(container_code))) { +// return false; +// } + //需要判断当前设备是否已经存在就绪的指令 如果存在就直接下发 不存在则创建 + Instruction inst = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()); + if (ObjectUtil.isNotEmpty(inst)) { + List list = new ArrayList(); + Map map = new HashMap(); + + if (StrUtil.isNotEmpty(taskdto.getTo_z())) { + if (StrUtil.equals(taskdto.getTo_z(), "01")) { + map.put("code", "to_target"); + map.put("value", "102"); + } else if (StrUtil.equals(taskdto.getTo_z(), "02")) { + map.put("code", "to_target"); + map.put("value", "201"); + } else if (StrUtil.equals(taskdto.getTo_z(), "03")) { + map.put("code", "to_target"); + map.put("value", "301"); + } + } + list.add(map); + Map map2 = new HashMap(); + map2.put("code", "to_task"); + map2.put("value", inst.getInstruction_code()); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code", "to_command"); + map3.put("value", "1"); + list.add(map3); + this.writing(list); + requireSucess = true; + while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() + , inst.getInstruction_code())) { + this.writing(list); + logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发信号"); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + if(ObjectUtil.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))){ + requireSucess = false; + return false; + } + } + +// if (task != Integer.parseInt(inst.getInstruction_code())) { +// this.writing(list); +// message = "重新下发电气信号"; +// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号"); +// } + message = "下发电气任务号成功"; + requireSucess = true; + return true; + } + + // type 5 输送任务 + if (!StrUtil.equals(taskdto.getTask_type(), "5")) { + return false; + } + String taskid = taskdto.getTask_id(); + String taskcode = taskdto.getTask_code(); + String vehiclecode = taskdto.getVehicle_code(); + String priority = taskdto.getPriority(); + String start_point_code = taskdto.getStart_point_code(); + String start_device_code = taskdto.getStart_device_code(); + String route_plan_code = taskdto.getRoute_plan_code(); + String next_device_code = ""; + + /** + * 开始平均分配 + */ + String this_coevice_code = taskserver.queryAssignedByDevice(device_code, taskdto.getNext_device_code()); + if (StrUtil.isEmpty(this_coevice_code)) { + List shortPathsList = routeLineService.getShortPathLines(start_device_code, taskdto.getNext_device_code(), route_plan_code); + RouteLineDto routeLineDto = shortPathsList.get(0); + + String path = routeLineDto.getPath(); + String type = routeLineDto.getType(); + String[] str = path.split("->"); + + List pathlist = Arrays.asList(str); + int index = 0; + for (int m = 0; m < pathlist.size(); m++) { + if (pathlist.get(m).equals(start_device_code)) { + index = m + 1; + break; + } + } + next_device_code = pathlist.get(index); + } else { + next_device_code = this_coevice_code; + } + //校验路由关系 + List shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); + if (ObjectUtils.isEmpty(shortPathsList)) { + throw new RuntimeException("路由不通!"); + } + + Device startdevice = deviceAppservice.findDeviceByCode(start_device_code); + Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code); + String next_point_code; + if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) { + next_point_code = taskdto.getTo_x() + "-" + taskdto.getTo_y() + "-" + taskdto.getTo_z(); + } else { + next_point_code = next_device_code; + } + Instruction instdto = new Instruction(); + instdto.setInstruction_id(IdUtil.simpleUUID()); + instdto.setRoute_plan_code(route_plan_code); + instdto.setRemark(taskdto.getRemark()); + instdto.setMaterial(taskdto.getMaterial()); + instdto.setQuantity(taskdto.getQuantity()); + instdto.setTask_id(taskid); + instdto.setTask_code(taskcode); + instdto.setVehicle_code(vehiclecode); + String now = DateUtil.now(); + instdto.setCreate_time(now); + instdto.setCreate_by("auto"); + instdto.setStart_device_code(start_device_code); + instdto.setNext_device_code(next_device_code); + instdto.setStart_point_code(start_point_code); + instdto.setNext_point_code(next_point_code); + instdto.setPriority(priority); + instdto.setInstruction_status("0"); + instdto.setExecute_device_code(start_point_code); + try { + instructionService.create(instdto); + } catch (Exception e) { + e.printStackTrace(); + log.error("指令创建失败!", e.getMessage()); + return false; + } + //创建指令后修改任务状态 + taskdto.setTask_status("1"); + taskserver.update(taskdto); + requireSucess = true; + String next_addr = nextdevice.getExtraValue().get("address").toString(); + + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_target"); + map.put("value", next_addr); + list.add(map); + Map map2 = new HashMap(); + map2.put("code", "to_task"); + map2.put("value", instdto.getInstruction_code()); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code", "to_command"); + map3.put("value", "1"); + list.add(map3); + this.writing(list); + requireSucess = true; + while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() + , instdto.getInstruction_code())) { + this.writing(list); + logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号"); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + if(ObjectUtil.isEmpty(taskserver.findByCode(taskdto.getTask_code()))){ + requireSucess = false; + return false; + } + } + + + +// if (task != Integer.parseInt(inst.getInstruction_code())) { +// this.writing(list); +// message = "重新下发电气信号"; +// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号"); +// } + } else { + //如果不存在则直接找对应指令 + Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code); + if (ObjectUtil.isEmpty(inst)) { + return false; + } + //当起点为行架任务的时候不需要请求下发 + if (StrUtil.equals(inst.getInstruction_type(), "6")) { + return false; + } + Device nextdevice = deviceAppservice.findDeviceByCode(inst.getNext_device_code()); + String next_addr = nextdevice.getExtraValue().get("address").toString(); + if(StrUtil.equals(next_addr,"0")){ + if (StrUtil.isNotEmpty(inst.getTo_z())) { + if (StrUtil.equals(inst.getTo_z(), "01")) { + next_addr = "102"; + } else if (StrUtil.equals(inst.getTo_z(), "02")) { + next_addr = "201"; + } else if (StrUtil.equals(inst.getTo_z(), "03")) { + next_addr = "301"; + } + } + } + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_target"); + map.put("value", next_addr); + list.add(map); + Map map2 = new HashMap(); + map2.put("code", "to_task"); + map2.put("value", inst.getInstruction_code()); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code", "to_command"); + map3.put("value", "1"); + list.add(map3); + this.writing(list); + requireSucess = true; + while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() + , inst.getInstruction_code())) { + this.writing(list); + logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号"); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + if(ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))){ + requireSucess = false; + return false; + } + } +// if (task != Integer.parseInt(inst.getInstruction_code())) { +// this.writing(list); +// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号"); +// } + } + return true; + } + } + + //申请捆扎 + @SneakyThrows + public synchronized void applyLaStrangulation(String mode) { + Date date = new Date(); + if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return; + } else { + this.require_apply_strangulation_time = date; + String vehicle_code = ""; + if (StrUtil.isNotEmpty(hand_barcode)) { + vehicle_code = hand_barcode; + } else { + if (task > 0) { + Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); + if (ObjectUtil.isEmpty(instruction)) { + message = "申请捆扎电气设备任务号:" + task + "未找到对应指令"; + logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "未找到对应指令"); + return; + } + vehicle_code = instruction.getVehicle_code(); + } else { + logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "异常"); + message = "申请捆扎电气设备任务号:" + task + "异常"; + return; + } + if (StrUtil.isEmpty(vehicle_code)) { + logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "未找到载具号"); + message = "申请捆扎电气设备任务号:" + task + "未找到载具号"; + return; + } + } + ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest = + new ApplyLabelingAndBindingRequest(); + JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0); + String start_point_code = null; + if (!ObjectUtil.isEmpty(device_json)) { + start_point_code = (String) device_json.get("parent_storage_code") == null ? this.device_code : (String) device_json.get("parent_storage_code"); + } + applyLabelingAndBindingRequest.setDevice_code(start_point_code); + applyLabelingAndBindingRequest.setType("2"); + applyLabelingAndBindingRequest.setVehicle_code(vehicle_code); + if (StrUtil.equals(mode, "9")) { + applyLabelingAndBindingRequest.setIs_bind("0"); + } else { + applyLabelingAndBindingRequest.setIs_bind("1"); + } + logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,请求参数:" + applyLabelingAndBindingRequest); + ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); + if (applyLabelingAndBindingResponse.getstatus() == 200) { + if (ObjectUtil.isNotEmpty(applyLabelingAndBindingResponse.getData())) { + Map datas = applyLabelingAndBindingResponse.getData(); + String length = datas.get("box_length").toString(); + String width = datas.get("box_width").toString(); + String box_high = datas.get("box_high").toString(); + String bundle_times = datas.get("bundle_times").toString(); + + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_length"); + map.put("value", length); + list.add(map); + Map map2 = new HashMap(); + map2.put("code", "to_weight"); + map2.put("value", width); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code", "to_height"); + map3.put("value", box_high); + list.add(map3); + Map map4 = new HashMap(); + map4.put("code", "to_strap_times"); + map4.put("value", bundle_times); + list.add(map4); + Map map5 = new HashMap(); + map5.put("code", "to_command"); + map5.put("value", mode); + list.add(map5); + this.writing(list); +// this.writing(list); + logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:" + applyLabelingAndBindingResponse); + message = "申请捆扎成功"; + //requireSucess = true; + } else { + message = "未返回尺寸信息"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:" + applyLabelingAndBindingResponse); + } + + } else { + message = applyLabelingAndBindingResponse.getMessage(); + logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:" + applyLabelingAndBindingResponse); + } + + } + } + + + public synchronized void emptyIn() { + Date date = new Date(); + if (date.getTime() - this.require_empty_in_time.getTime() < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return; + } else { + this.require_empty_in_time = date; + + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + message = "申请空盘入库任务中..."; + + if(taskserver.querySameOriginTask(this.device_code) > 0 ){ + message = "已存在空盘出库任务不再请求"; + return; + } + + JSONObject apply = new JSONObject(); + apply.put("device_code", device_code); + apply.put("type", "2"); + HttpResponse httpResponse = acsToWmsService.applyTaskToWms(apply); + logServer.deviceExecuteLog(this.device_code, "", "", "申请空盘入库,请求参数:" + apply); + String str=httpResponse.toString(); + JSONObject jo = JSON.parseObject(str); + if (ObjectUtil.isEmpty(jo)) { + message = "申请空盘入库接口不通"; + } else { + if (jo.getInteger("status") == 200) { + message = "申请空盘入库成功"; + requireEmptyInSuccess = true; + } else { + message = "申请空盘入库失败," + jo.get("message").toString(); + } + } + } + } + } + + public synchronized void applyAgvTask() { + 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; + } else { + this.instruction_require_time = date; + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + //判断是否有手动补码 如果有就申请补码agv任务 + if (StrUtil.isNotEmpty(hand_barcode)) { + message = "申请补码AGV搬运任务中..."; + JSONObject apply = new JSONObject(); + apply.put("device_code", device_code); + apply.put("type", "4"); + apply.put("vehicle_code", hand_barcode); + + HttpResponse httpResponse = acsToWmsService.applyTaskToWms(apply); + String str=httpResponse.toString(); + logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数," + str); + JSONObject jo = JSON.parseObject(str); + if (ObjectUtil.isEmpty(jo)) { + message = "申请补码AGV搬运任务接口不通"; +// requireSucess = true; + } else { + if (jo.getInteger("status") == 200) { + message = "申请补码AGV搬运任务成功"; + List list = new ArrayList(); + while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".to_command").toString() + , "8")) { + this.writing(list); + logServer.deviceExecuteLog(device_code, "", "", "再次下发mode信号"); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + logServer.deviceExecuteLog(this.device_code, "", "", "申请补码AGV任务,返回参数:" + jo); + requireSucess = true; + } else { +// requireSucess = true; + message = "申请补码AGV搬运任务失败," + jo.get("message").toString(); + } + } + return; + } + //没有就正常申请agv任务 + Instruction instruction = instructionService.findByCode(String.valueOf(task)); + if (ObjectUtil.isEmpty(instruction)) { + message = "指令号" + task + "未找到对应指令"; + return; + } + if (StrUtil.isEmpty(instruction.getVehicle_code())) { + message = "指令号" + task + "未找到对应木箱号"; + return; + } + + message = "申请AGV搬运任务中..."; + JSONObject apply = new JSONObject(); + apply.put("device_code", device_code); + apply.put("type", "4"); + apply.put("vehicle_code", instruction.getVehicle_code()); + + HttpResponse httpResponse = acsToWmsService.applyTaskToWms(apply); + logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数"); + String str=httpResponse.toString(); + JSONObject jo = JSON.parseObject(str); + if (ObjectUtil.isEmpty(jo)) { + message = "申请AGV搬运任务接口不通"; +// requireSucess = true; + } else { + if (jo.getInteger("status") == 200) { + message = "申请AGV搬运任务成功"; + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_command"); + map.put("value", "8"); + list.add(map); + this.writing(list); + while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".to_command").toString() + , "8")) { + this.writing(list); + logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发mode信号"); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo); + requireSucess = true; + } else { +// requireSucess = true; + message = "申请AGV搬运任务失败," + jo.get("message").toString(); + } + } + + } + } + } + + public synchronized void emptyOut() { + Date date = new Date(); + if (date.getTime() - this.require_empty_out_time.getTime() < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return; + } else { + this.require_empty_out_time = date; + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + if (taskserver.querySameDestinationTask(this.device_code) > 0) { + message = "已存在空盘出库任务不再请求"; + return; + } + message = "申请空盘出库任务中..."; + JSONObject apply = new JSONObject(); + apply.put("device_code", device_code); + apply.put("type", "3"); + HttpResponse httpResponse = acsToWmsService.applyTaskToWms(apply); + String str=httpResponse.toString(); + JSONObject jo = JSON.parseObject(str); + if (ObjectUtil.isEmpty(jo)) { + message = "申请空盘出库接口不通"; + requireSucess = true; + } else { + if (jo.getInteger("status") == 200) { + message = "申请空盘出库成功"; + requireSucess = true; + } else { + message = "申请空盘出库失败," + jo.get("message").toString(); + } + } + + } + } + } + + /** + * 更新指令状态 + */ + public synchronized void update_instruction_status() throws Exception { + Date date = new Date(); + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); + + } else { + this.instruction_update_time = date; + inst = instructionService.findByCodeFromCache(String.valueOf(task)); + if (inst != null) { + inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); + vehicle_code = inst.getVehicle_code(); + task_code = inst.getTask_code(); + if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) { + inst.setInstruction_status("1"); + inst.setExecute_device_code(this.device_code); + instructionService.update(inst); + logServer.deviceExecuteLog(device_code, "", "", "入库输送线任务开始反馈执行中状态,反馈成功,指令号:" + task + ",载具号:"+ inst.getVehicle_code()); + } + if (StrUtil.equals(inst.getInstruction_status(), "1") || StrUtil.equals(inst.getInstruction_status(), "0") ) { + if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { + vehicle_code = inst.getVehicle_code(); + inst.setExecute_device_code(this.device_code); + finish_instruction(); + logServer.deviceExecuteLog(device_code, "", "", "入库输送线任务开始反馈完成状态,反馈成功,指令号:" + task + ",载具号:"+ inst.getVehicle_code()); + } else { + + } + } + } else { +// message = "输送线任务反馈状态,查询不到指令号:" + task +"指令已完成"; + inst_message = null; + } + + } + } +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java index f3a0fa8f..5679c931 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java @@ -3,13 +3,11 @@ package org.nl.acs.device_driver.driver; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; +import org.jinterop.dcom.common.JIException; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.ext.wms.data.JsonUtl; import org.nl.acs.log.service.DeviceExecuteLogService; -import org.nl.acs.opc.OpcConfig; -import org.nl.acs.opc.OpcServerService; -import org.nl.acs.opc.OpcServerServiceImpl; -import org.nl.acs.opc.WcsConfig; +import org.nl.acs.opc.*; import org.nl.acs.udw.UnifiedDataAccessor; import org.nl.acs.udw.UnifiedDataAccessorFactory; import org.nl.acs.udw.UnifiedDataAppService; @@ -17,11 +15,14 @@ import org.nl.modules.lucene.service.LuceneExecuteLogService; import org.nl.modules.lucene.service.dto.LuceneLogDto; import org.nl.modules.wql.exception.WDKException; import org.nl.modules.wql.util.SpringContextHolder; -import org.openscada.opc.lib.da.Server; +import org.openscada.opc.lib.da.*; +import org.springframework.beans.factory.annotation.Autowired; import java.util.*; public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements OpcDeviceDriver { + @Autowired + private OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerService .class); UnifiedDataAccessor opcUdw; private Date sendTime; @@ -38,6 +39,61 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc public UnifiedDataAccessor getOpcValueAccessor() { return this.opcUdw; } + public void checkcontrol(Map itemValues) throws JIException, AddFailedException { + Group group = opcServerService.getServer(this.getOpcServer()); + Map write = new HashMap(); + Map readitems = new LinkedHashMap(); + List itemsString = new ArrayList(); + itemsString = new ArrayList<> (itemValues.keySet()); + Iterator is = itemsString.iterator(); + + while (is.hasNext()) { + String string = (String) is.next(); + try { + readitems.put(string, group.addItem(string)); + } catch (Exception e) { + e.printStackTrace(); + } + } + int i = 0; + while(true) { + //下发信号 + control( itemValues); + Map read = new HashMap(); + Map itemStatus = group.read(true, (Item[])readitems.values().toArray(new Item[0])); + Set items = itemStatus.keySet(); + Iterator var15 = items.iterator(); + + while(var15.hasNext()) { + Item item = (Item)var15.next(); + ItemState itemState = (ItemState)itemStatus.get(item); + Object value = OpcUtl.getValue(item, itemState); + read.put(item.getId(), value); + } + + boolean check = true; + Iterator var24 = itemsString.iterator(); + + while(var24.hasNext()) { + String itemString = (String)var24.next(); + if (!ObjectUtl.isEquals(itemValues.get(itemString), JsonUtl.parse(read.get(itemString)))) { + check = false; + } + } + if (check) { + return; + } + + if (i > 0) { + ThreadUtl.sleep(300L); + } + + if (i > 3) { + throw new WDKException("写入次数超过3次而失败"); + } + ++i; + } + } public boolean control(Map itemValues) { diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java index 326d1896..33167345 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java @@ -4,7 +4,7 @@ import com.esotericsoftware.minlog.Log; import org.nl.acs.device_driver.DeviceDriver; public interface ExecutableDeviceDriver extends DeviceDriver { - default void executeAuto() { + default void executeAuto() throws Exception { // try { // this.execute(); // } catch (Throwable var6) { @@ -16,5 +16,5 @@ public interface ExecutableDeviceDriver extends DeviceDriver { } - void execute(); + void execute() throws Exception; } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java new file mode 100644 index 00000000..e19c94d8 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/AcsUtil.java @@ -0,0 +1,53 @@ + +package org.nl.acs.ext.wms; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.log.LokiLog; +import org.nl.acs.log.LokiLogType; +import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.system.service.ParamService; +import org.nl.modules.system.service.impl.ParamServiceImpl; +import org.nl.modules.wql.util.SpringContextHolder; + +/** + * ACS连接外部系统工具类: + */ +@Slf4j +public class AcsUtil { + + + @LokiLog(type = LokiLogType.ACS_TO_LK) + public static String notifyAcs(String api, W requestParam) { + DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);; + ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class); + //判断是否连接立库WCS系统 + String isConnect = paramService.findByCode("is_connect_liKu_Wcs").getValue(); + if (StrUtil.equals("0", isConnect)) { + throw new BadRequestException("参数配置表中-is_connect_liKu_Wcs为:0"); + } + String liKu_wcs_url = paramService.findByCode("liKu_wcs_url").getValue(); + try { + logServer.extLog(LokiLogType.ACS_TO_LK.name(),"下发立库任务请求参数:{}"+JSON.toJSONString(requestParam) ); + log.info("下发立库任务请求参数:{}", JSON.toJSONString(requestParam)); + String body = HttpRequest + .post(liKu_wcs_url + api).setConnectionTimeout(3000) + .body(JSON.toJSONString(requestParam)) + .execute() + .body(); + log.info("下发立库任务返回参数:{}", body); + return body; + } catch (Exception e) { + JSONObject result = new JSONObject(); + result.put("result", "false"); + result.put("code", "1"); + result.put("comment", e.getMessage()); + log.info("下发立库任务异常返回参数:{}", String.valueOf(result)); + return String.valueOf(result); + } + } +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/RespUtil.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/RespUtil.java new file mode 100644 index 00000000..354547fb --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/RespUtil.java @@ -0,0 +1,18 @@ +package org.nl.acs.ext.wms; + +import com.alibaba.fastjson.JSONObject; +import org.nl.acs.ext.wms.liKuData.Resp; + +/** + * @author: geng by + * @createDate: 2022/11/24 + */ +public class RespUtil { + public static Resp getResp(String result, T t) { + JSONObject jsonObject = JSONObject.parseObject(result); + Resp resp = new Resp<>(); + resp.setData(t); + resp = JSONObject.toJavaObject(jsonObject, Resp.class); + return resp; + } +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingRequest.java new file mode 100644 index 00000000..3d116b04 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingRequest.java @@ -0,0 +1,20 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +@Data +public class ApplyLabelingAndBindingRequest extends BaseRequest { + private String vehicle_code; + private String device_code; + /** + * 1:贴标申请 + * 2:捆扎申请 + * 3:烘箱 + */ + private String type; + + private String weight; + + private String is_bind; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingResponse.java new file mode 100644 index 00000000..d6c0c884 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingResponse.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class ApplyLabelingAndBindingResponse extends BaseResponse { + + private Map data = new HashMap(); + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/BaseRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/BaseRequest.java new file mode 100644 index 00000000..4533d4e4 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/BaseRequest.java @@ -0,0 +1,49 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class BaseRequest { + private Map parameters = new HashMap(); + private String systemCode; + private String houseCode; + + public String getSystemCode() { + return this.systemCode; + } + + public void setSystemCode(String systemCode) { + this.systemCode = systemCode; + } + + public String getHouseCode() { + return this.houseCode; + } + + public void setHouseCode(String houseCode) { + this.houseCode = houseCode; + } + + public BaseRequest() { + } + + public Map getParameters() { + return this.parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + public Object getParameter(String key) { + return this.parameters.get(key); + } + + public void putParameter(String key, String object) { + this.parameters.put(key, object); + } +} + diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/BaseResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/BaseResponse.java new file mode 100644 index 00000000..0920b034 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/BaseResponse.java @@ -0,0 +1,52 @@ +package org.nl.acs.ext.wms.data; + +import com.alibaba.fastjson.JSONArray; +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class BaseResponse { + + private Integer status = 0; + private String message; + private JSONArray errArr = new JSONArray(); + private Map parameters = new HashMap(); + + public BaseResponse() { + } + + public Integer getstatus() { + return this.status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getMessage() { + return this.message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Map getParameters() { + return this.parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + public Object getParameter(String key) { + return this.parameters.get(key); + } + + public void putParameter(String key, String object) { + this.parameters.put(key, object); + } + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskRequest.java new file mode 100644 index 00000000..e2aea4c8 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskRequest.java @@ -0,0 +1,30 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +import java.util.Map; + +@Data +public class CancelTaskRequest extends BaseRequest { + + /** + * 任务标识 + */ + private String ext_task_id; + + /** + * 任务编号 + */ + private String task_code; + + /** + * 载具号 + */ + String vehicle_code; + + /** + * 扩展属性 + */ + Map params; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskResponse.java new file mode 100644 index 00000000..7a24424d --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskResponse.java @@ -0,0 +1,7 @@ +package org.nl.acs.ext.wms.data; + +public class CancelTaskResponse extends BaseResponse { + + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java new file mode 100644 index 00000000..d9b4cb33 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java @@ -0,0 +1,123 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +import java.util.Map; + +@Data +public class CreateTaskRequest extends BaseRequest { + + /** + * 任务标识 + */ + private String ext_task_id; + + /** + * 任务编号 + */ + private String task_code; + + + /** + * 取货点1 + */ + String start_device_code; + + /** + * 放货点1 + */ + String next_device_code; + + /** + * 取货点2 + */ + String start_device_code2; + + /** + * 放货点2 + */ + String next_device_code2; + + /** + * 烘箱对接位 + */ + String put_device_code; + + /** + * 优先级 + */ + String priority; + + /** + * 载具号 + */ + String vehicle_code; + + /** + * 载具类型 + */ + String vehicle_type; + + /** + * 路由方案 + */ + String route_plan_code; + + /** + * 1、生箔; + * 2、分切 + * 3、普通任务 + * 4、叉车任务 + * 5、输送任务 + * 6、行架 + * 7、立库 + * 任务类型 + */ + String task_type; + + /** + * 立库任务类型 + * + */ + String dtl_type; + + /** + * Agv系统类型 + * 1:1楼叉车系统 + * 2:2楼1区域AGV系统 + * 3:2楼2区域AGV系统 + */ + String agv_system_type; + + /** + * 备注 + */ + String remark; + + /** + * 烘箱时间 + */ + String oven_time; + + /** + * 烘箱温度 + */ + String temperature; + + /** + * agv取货高度 + */ + private String start_height; + + + /** + * agv放货高度 + */ + private String next_height; + + /** + * 扩展属性 + */ + Map params; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskResponse.java new file mode 100644 index 00000000..40a39188 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskResponse.java @@ -0,0 +1,6 @@ +package org.nl.acs.ext.wms.data; + +public class CreateTaskResponse extends BaseResponse { + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/JsonUtl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/JsonUtl.java index 2e1875af..d60d403c 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/JsonUtl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/JsonUtl.java @@ -1,6 +1,5 @@ package org.nl.acs.ext.wms.data; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -10,7 +9,6 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.type.TypeFactory; import java.io.IOException; -import java.util.Date; import java.util.List; import java.util.Map; @@ -52,7 +50,7 @@ public class JsonUtl { synchronized(JsonUtl.class) { if (objectMapperLog == null) { objectMapperLog = init(); - objectMapperLog.setSerializationInclusion(JsonInclude.Include.NON_NULL); + objectMapperLog.setSerializationInclusion(Include.NON_NULL); } } } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/LiKuApplyTakResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/LiKuApplyTakResponse.java new file mode 100644 index 00000000..73855488 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/LiKuApplyTakResponse.java @@ -0,0 +1,9 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +@Data +public class LiKuApplyTakResponse extends BaseResponse { + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/LiKuApplyTaskRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/LiKuApplyTaskRequest.java new file mode 100644 index 00000000..5eca1953 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/LiKuApplyTaskRequest.java @@ -0,0 +1,9 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +@Data +public class LiKuApplyTaskRequest extends BaseRequest { + private String vehicle_code; + private String device_code; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/PutActionRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/PutActionRequest.java new file mode 100644 index 00000000..4f2ddf2b --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/PutActionRequest.java @@ -0,0 +1,30 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +import java.util.Map; + +@Data +public class PutActionRequest extends BaseRequest { + + /** + * 设备号 + */ + String device_code; + + /** + * + */ + String code; + + /** + * + */ + String value; + + /** + * 扩展属性 + */ + Map params; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/PutActionResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/PutActionResponse.java new file mode 100644 index 00000000..9fd64b94 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/PutActionResponse.java @@ -0,0 +1,7 @@ +package org.nl.acs.ext.wms.data; + +public class PutActionResponse extends BaseResponse { + + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/UpdateLKTaskRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/UpdateLKTaskRequest.java new file mode 100644 index 00000000..a83fe448 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/UpdateLKTaskRequest.java @@ -0,0 +1,42 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +@Data +public class UpdateLKTaskRequest extends BaseRequest { + + /** + * 任务标识 + */ + private String ext_task_id; + + /** + * 任务编号 + */ + private String task_code; + + /** + * 载具号 + */ + String vehicle_code; + + /** + * 立库任务类型 + */ + String dtl_type; + + /** + * 类型 + */ + String type; + + /** + * 原库位 + */ + String srcLocation; + + /** + * 新库位 + */ + String destLocation; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/UpdateLKTaskResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/UpdateLKTaskResponse.java new file mode 100644 index 00000000..f6db1eb7 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/UpdateLKTaskResponse.java @@ -0,0 +1,6 @@ +package org.nl.acs.ext.wms.data; + +public class UpdateLKTaskResponse extends BaseResponse { + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseResponseData.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseResponseData.java new file mode 100644 index 00000000..01732d7e --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseResponseData.java @@ -0,0 +1,24 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 响应 data 公共基础类 + * 1、入库任务下发 + * 2、出库任务下发 + * 3、空托盘出库任务下发 + * 4、移库任务下发 + * 5、入库任务调整 + * 6、移库任务调整 + * 7、入库任务上报 + * 8、出库任务上报 + * 9、移库任务上报 + * 10、任务取消 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class BaseResponseData { + public String orderId; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseStoreReportRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseStoreReportRequest.java new file mode 100644 index 00000000..ed5e9574 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseStoreReportRequest.java @@ -0,0 +1,44 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 任务上报请求参数基础类 + * 1、入库上报 + * 2、出库上报 + * 3、移库上报 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class BaseStoreReportRequest { + /** + * 任务编号 + * WCS内部任务编号,本次任务的唯一标识 + */ + public String orderId; + /** + * 托盘条码信息 + */ + public String palletCode; + /** + * 原库位号 + * 托盘的存储库位编号。具体库位编号需要双方商定 + */ + public String srcLocation; + /** + * 目的库位号 + * 托盘的目的存储库位编号。具体库位编号需要双方商定 + */ + public String destLocation; + /** + * 入库任务上报 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞 + * 出库任务上报 1已接收任务,2开始执行,3执行完成 + * 移库任务上报 1 已接收 2开始执行3 执行完成 4 起点库位有货被阻挡 5目的点库位无货被阻挡 + */ + public String state; + + public String robotId; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseStoreRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseStoreRequest.java new file mode 100644 index 00000000..0c6842a8 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/BaseStoreRequest.java @@ -0,0 +1,42 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 任务下发请求参数基础类 + * 1、入库任务下发 + * 2、出库任务-批量下发 + * 3、空托盘出库任务下发 + * 4、移库任务-批量下发 + * 5、入库任务调整 + * 6、移库任务调整 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class BaseStoreRequest { + /** + * 任务编号 + * WCS内部任务编号,本次任务的唯一标识 + */ + public String orderId; + /** + * 楼层编号 + */ + public int floorNo; + /** + * 托盘条码信息 + */ + public String palletCode; + /** + * 原库位号 + * 托盘的存储库位编号。具体库位编号需要双方商定 + */ + public String srcLocation; + /** + * 目的库位号 + * 托盘的目的存储库位编号。具体库位编号需要双方商定 + */ + public String destLocation; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/CancelTaskRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/CancelTaskRequest.java new file mode 100644 index 00000000..bea5ccea --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/CancelTaskRequest.java @@ -0,0 +1,37 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 取消任务请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class CancelTaskRequest { + /** + * 任务编号 + * WCS内部任务编号,本次任务的唯一标识 + */ + public String orderId; + /** + * 托盘条码信息 + */ + public String palletCode; + /** + * 原库位号 + * 托盘的存储库位编号。具体库位编号需要双方商定 + */ + public String srcLocation; + /** + * 目的库位号 + * 托盘的目的存储库位编号。具体库位编号需要双方商定 + */ + public String destLocation; + /** + * 任务类型 + * 1 入库,2 出库,3 移库,4 空托盘入库,5 空托盘出库 + */ + public int taskType; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/CancelTaskResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/CancelTaskResponse.java new file mode 100644 index 00000000..b89f4f11 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/CancelTaskResponse.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 取消任务响应参数 Data类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class CancelTaskResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusData.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusData.java new file mode 100644 index 00000000..4f8f125a --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusData.java @@ -0,0 +1,35 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +@Data +public class DeviceStatusData { + + String deviceId; + + String x; + + String y; + + //楼层 + String mapId; + + //电量 + String power; + + //托盘 + String pallet; + + //有无货 + String load; + + //报警 + String alarm; + + //任务号 + String taskId; + + //楼层 + String floor; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusRequest.java new file mode 100644 index 00000000..006bbaa7 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusRequest.java @@ -0,0 +1,11 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +@Data +public class DeviceStatusRequest { + + String deviceId; + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusResponse.java new file mode 100644 index 00000000..b50b15be --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusResponse.java @@ -0,0 +1,14 @@ +package org.nl.acs.ext.wms.liKuData; + +public class DeviceStatusResponse { + + String result; + + String code; + + String comment; + + DeviceStatusData data; + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/EmptyVehicleOutStoreRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/EmptyVehicleOutStoreRequest.java new file mode 100644 index 00000000..207894bc --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/EmptyVehicleOutStoreRequest.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 空托盘出库任务下发 请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class EmptyVehicleOutStoreRequest extends BaseStoreRequest { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/EmptyVehicleOutStoreResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/EmptyVehicleOutStoreResponse.java new file mode 100644 index 00000000..d189f410 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/EmptyVehicleOutStoreResponse.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 空托盘任务下发响应参数Data类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class EmptyVehicleOutStoreResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreReportRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreReportRequest.java new file mode 100644 index 00000000..70493dcd --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreReportRequest.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 入库任务上报请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class InStoreReportRequest extends BaseStoreReportRequest { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreReportResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreReportResponse.java new file mode 100644 index 00000000..e12fb501 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreReportResponse.java @@ -0,0 +1,14 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 入库任务上报 响应参数Data类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class InStoreReportResponse extends BaseResponseData { + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreRequest.java new file mode 100644 index 00000000..9d72850b --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreRequest.java @@ -0,0 +1,18 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 入库任务下发请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class InStoreRequest extends BaseStoreRequest { + /** + * 任务类型 + * 1代表正常载货托盘入库,2代表空托盘入库 + */ + public int type; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResetRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResetRequest.java new file mode 100644 index 00000000..2d276a21 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResetRequest.java @@ -0,0 +1,12 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 入库任务调整请求参数类 + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class InStoreResetRequest extends BaseStoreRequest { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResetResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResetResponse.java new file mode 100644 index 00000000..525c1424 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResetResponse.java @@ -0,0 +1,12 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 入库任务调整 响应参数Data类 + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class InStoreResetResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResponse.java new file mode 100644 index 00000000..fb409f6f --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreResponse.java @@ -0,0 +1,12 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 入库任务下发响应参数 Data类 + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class InStoreResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreTaskUpdateRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreTaskUpdateRequest.java new file mode 100644 index 00000000..30a2060f --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreTaskUpdateRequest.java @@ -0,0 +1,33 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +@Data +public class InStoreTaskUpdateRequest extends BaseResponseData { + + /** + * 任务编号 + * WCS内部任务编号,本次任务的唯一标识 + */ + public String orderId; + /** + * 托盘条码信息 + */ + public String palletCode; + /** + * 原库位号 + * 托盘的存储库位编号。具体库位编号需要双方商定 + */ + public String srcLocation; + /** + * 目的库位号 + * 托盘的目的存储库位编号。具体库位编号需要双方商定 + */ + public String destLocation; + + /** + * 楼层 + */ + public int floorNo; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreTaskUpdateResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreTaskUpdateResponse.java new file mode 100644 index 00000000..8dcb1ea7 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/InStoreTaskUpdateResponse.java @@ -0,0 +1,7 @@ +package org.nl.acs.ext.wms.liKuData; + + +public class InStoreTaskUpdateResponse extends BaseStoreRequest { + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreReportRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreReportRequest.java new file mode 100644 index 00000000..93f933c5 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreReportRequest.java @@ -0,0 +1,10 @@ +package org.nl.acs.ext.wms.liKuData; + +/** + * 移库上报请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +public class MoveStoreReportRequest extends BaseStoreReportRequest { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreReportResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreReportResponse.java new file mode 100644 index 00000000..d338bc65 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreReportResponse.java @@ -0,0 +1,12 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 移库上报响应参数 Data类 + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class MoveStoreReportResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreRequest.java new file mode 100644 index 00000000..e2873c63 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreRequest.java @@ -0,0 +1,25 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +import java.util.List; + +/** + * 移库任务下发请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class MoveStoreRequest { + /** + * 任务组编号 + * WCS内部任务组编号,本组任务的唯一标识 + */ + public String groupId; + + /** + * 任务信息,可批量下发 + */ + public List orderInfos; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResetRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResetRequest.java new file mode 100644 index 00000000..48c6ef13 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResetRequest.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 移库任务调整请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class MoveStoreResetRequest extends BaseStoreRequest { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResetResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResetResponse.java new file mode 100644 index 00000000..39b81e31 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResetResponse.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 移库任务调整响应参数Data类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class MoveStoreResetResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResponse.java new file mode 100644 index 00000000..514303ae --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreResponse.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 移库任务下发响应参数Data类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class MoveStoreResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreTaskUpdateRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreTaskUpdateRequest.java new file mode 100644 index 00000000..20b73d8d --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreTaskUpdateRequest.java @@ -0,0 +1,32 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +@Data +public class MoveStoreTaskUpdateRequest { + + /** + * 任务编号 + * WCS内部任务编号,本次任务的唯一标识 + */ + public String orderId; + /** + * 托盘条码信息 + */ + public String palletCode; + /** + * 原库位号 + * 托盘的存储库位编号。具体库位编号需要双方商定 + */ + public String srcLocation; + /** + * 目的库位号 + * 托盘的目的存储库位编号。具体库位编号需要双方商定 + */ + public String destLocation; + + /** + * 楼层 + */ + public int floorNo; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreTaskUpdateResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreTaskUpdateResponse.java new file mode 100644 index 00000000..248ac3df --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/MoveStoreTaskUpdateResponse.java @@ -0,0 +1,7 @@ +package org.nl.acs.ext.wms.liKuData; + + +public class MoveStoreTaskUpdateResponse extends BaseStoreRequest { + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutConfirmReportResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutConfirmReportResponse.java new file mode 100644 index 00000000..9a088c0b --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutConfirmReportResponse.java @@ -0,0 +1,12 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 出库任务库位解锁Data类 + * @author: wangs + * @createDate: 2022/11/24 + */ +@Data +public class OutConfirmReportResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutConfirmRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutConfirmRequest.java new file mode 100644 index 00000000..7217c633 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutConfirmRequest.java @@ -0,0 +1,14 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 出库库位解锁 请求参数类 + * + * @author: wangs by + * @createDate: 2022/11/24 + */ +@Data +public class OutConfirmRequest extends BaseStoreRequest { + String outPortNo; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreReportRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreReportRequest.java new file mode 100644 index 00000000..d0557059 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreReportRequest.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 出库任务上报请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class OutStoreReportRequest extends BaseStoreReportRequest { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreReportResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreReportResponse.java new file mode 100644 index 00000000..e22ec421 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreReportResponse.java @@ -0,0 +1,12 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 出库任务上报响应参数Data类 + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class OutStoreReportResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreRequest.java new file mode 100644 index 00000000..3fefe797 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreRequest.java @@ -0,0 +1,27 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +import java.util.List; + +/** + * 出库任务下发请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class OutStoreRequest { + + /** + * 任务组编号 + * WCS内部任务组编号,本组任务的唯一标识 + */ + public String groupId; + + /** + * 任务信息,可批量下发 + */ + public List orderInfos; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreResponse.java new file mode 100644 index 00000000..b1500618 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/OutStoreResponse.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 出库任务下发响应参数Data类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class OutStoreResponse extends BaseResponseData { +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/Resp.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/Resp.java new file mode 100644 index 00000000..a16e111c --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/Resp.java @@ -0,0 +1,37 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 调用立库接口统一返回参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class Resp { + /** + * 成功返回true,失败返回false + */ + public String result; + + /** + * 错误码(0表示成功)1代表入库目的位置有货,其他更多情况待定 + */ + public String code; + + /** + * 错误信息,如果成功则为null + */ + public String comment; + + /** + * 报文携带的数据 + */ + public T data; + /** + * 成功返回true,失败返回false + */ + public String msg; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/RoadWayIsLockRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/RoadWayIsLockRequest.java new file mode 100644 index 00000000..7e6852ec --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/RoadWayIsLockRequest.java @@ -0,0 +1,28 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +/** + * 巷道锁定解锁请求参数类 + * + * @author: geng by + * @createDate: 2022/11/24 + */ +@Data +public class RoadWayIsLockRequest { + /** + * 楼层编号 + */ + public int floorNo; + /** + * 是否锁定 + * true代表锁定,false代表解锁 + */ + public String isLock; + /** + * 巷道编号 + * 需要解锁或锁定的巷道编号。具体巷道编号需要双方商定 + */ + public String roadwayNo; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/AbnormarReportingRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/AbnormarReportingRequest.java new file mode 100644 index 00000000..66ade4aa --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/AbnormarReportingRequest.java @@ -0,0 +1,44 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class AbnormarReportingRequest { + /** + * 事件类型 + * location_abnormal:⼯作位异常 + * robot_abnormal:机器⼈异常 + */ + public String eventType; + /** + * 机器⼈编码 + * + */ + public String robotCode; + /** + * 容器编码 + */ + public String containerCode; + /** + * ⼯作位编码 + */ + public String locationCode; + /** + * ⼯作站编码 + */ + public String stationCode; + /** + * 描述信息 + * 异常原因/挂起原因等 + */ + public String message; + /** + * 解决⽅案 + *系统建议的解决⽅案 + */ + public String solution; + /** + * 更新时间 + */ + public Long updateTime; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/AbnormarReportingResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/AbnormarReportingResponse.java new file mode 100644 index 00000000..8899cbeb --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/AbnormarReportingResponse.java @@ -0,0 +1,7 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class AbnormarReportingResponse{ +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/BaseResponseData.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/BaseResponseData.java new file mode 100644 index 00000000..63294afa --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/BaseResponseData.java @@ -0,0 +1,16 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +/** + + * + * @author: zjj by + * @createDate: 2023/6/26 + */ +@Data +public class BaseResponseData { + public Integer code; + public String msg; + public String data; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/CancelRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/CancelRequest.java new file mode 100644 index 00000000..1463e600 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/CancelRequest.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +import java.util.List; +@Data +public class CancelRequest { + /** + * 任务编码 + * 业务任务和系统任务都可取消 + */ + public List taskCodes; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/CancelResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/CancelResponse.java new file mode 100644 index 00000000..7d33468d --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/CancelResponse.java @@ -0,0 +1,7 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class CancelResponse extends BaseResponseData{ +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ContainerArrivedRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ContainerArrivedRequest.java new file mode 100644 index 00000000..2a3a7b8b --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ContainerArrivedRequest.java @@ -0,0 +1,21 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class ContainerArrivedRequest { + /** + * 输送线节点编码 + * + */ + public String slotCode; + /** + * 容器编码 + * 输送线有读码器可以识别或已知料⾝份时,该字段传料箱编码;否则空 + */ + public String containerCode; + /** + * 容器属性 + */ + public Object containerAttribute; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ContainerArrivedResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ContainerArrivedResponse.java new file mode 100644 index 00000000..5eef0783 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ContainerArrivedResponse.java @@ -0,0 +1,14 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class ContainerArrivedResponse extends BaseResponseData{ + /** + * 流动⽅向 + * 回库⼝: + * 100:流向上料⼝ + * 200:等待 + */ + public String direction; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Conveyors.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Conveyors.java new file mode 100644 index 00000000..0e2c1e53 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Conveyors.java @@ -0,0 +1,17 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +import java.util.List; + +@Data +public class Conveyors { + /** + * 输送线编码 + */ + public String code; + /** + * + */ + public List nodeStates; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Datas.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Datas.java new file mode 100644 index 00000000..f4ee892a --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Datas.java @@ -0,0 +1,11 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +import java.util.List; + +@Data +public class Datas { + List robots; + List locations; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/InTaskDescribe.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/InTaskDescribe.java new file mode 100644 index 00000000..e80fcf13 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/InTaskDescribe.java @@ -0,0 +1,13 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class InTaskDescribe extends TaskDescribe{ + + String containerCode; + + + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LoadContainerFinishRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LoadContainerFinishRequest.java new file mode 100644 index 00000000..313069c2 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LoadContainerFinishRequest.java @@ -0,0 +1,15 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class LoadContainerFinishRequest { + /** + * 输送线节点编码 + */ + public String slotCode; + /** + * 容器编码 + */ + public String containerCode; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LoadContainerFinishResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LoadContainerFinishResponse.java new file mode 100644 index 00000000..82ac7549 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LoadContainerFinishResponse.java @@ -0,0 +1,9 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; +import org.nl.acs.ext.wms.data.BaseResponse; + +@Data +public class LoadContainerFinishResponse{ + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LocationQueryRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LocationQueryRequest.java new file mode 100644 index 00000000..c60acba2 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LocationQueryRequest.java @@ -0,0 +1,27 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +public class LocationQueryRequest { + /** + * ⼯作位编码 + * 可传多个⼯作位,若不传则查全部 + * 若多个字段均填写,则互为且关系 + */ + public Map> locationCodes ; + /** + * 容器编码 + * 查看容器下的所有⼯作位 + */ + public String containerCode; + /** + * ⼯作位类型编码 + * 可传多个⼯作位,若不传则查全部 + * 若多个字段均填写,则互为且关系 + */ + public Map> locationTypeCodes ; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LocationQueryResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LocationQueryResponse.java new file mode 100644 index 00000000..fde190d7 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/LocationQueryResponse.java @@ -0,0 +1,12 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class LocationQueryResponse { + String msg; + + String code; + + Datas datas; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Locations.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Locations.java new file mode 100644 index 00000000..d84867b7 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Locations.java @@ -0,0 +1,31 @@ +package org.nl.acs.ext.wms.liKuData.a; + +public class Locations { + /** + * ⼯作位编码 + */ + public String locationCode; + /** + * ⼯作位类型 + */ + public String locationTypeCode; + /** + * ⼯作站编码 + * 若为⼯作位不会具有⼯作站编码 + */ + public String pointCode; + /** + * 坐标x + * 机器⼈实际坐标xmm + */ + public Long positionX; + /** + * 坐标y + * 机器⼈实际坐标ymm + */ + public Long positionY; + /** + * 机器⼈⻆度 + */ + public Integer theta; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/MoveContainerRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/MoveContainerRequest.java new file mode 100644 index 00000000..fd23ed49 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/MoveContainerRequest.java @@ -0,0 +1,23 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class MoveContainerRequest { + /** + * 输送线节点编码 + */ + public String slotCode; + /** + * 容器编码 + */ + public String containerCode; + /** + * 流动⽅向 + * 拣选位 + * 100:向前流动,离开拣选位(只有 + * ⼀个流向的话,可以不传,默认向流) + * 200:空箱取出 + */ + public String direction; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/MoveContainerResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/MoveContainerResponse.java new file mode 100644 index 00000000..88727d89 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/MoveContainerResponse.java @@ -0,0 +1,9 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; +import lombok.ToString; + +@Data +@ToString +public class MoveContainerResponse{ +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/NodeStates.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/NodeStates.java new file mode 100644 index 00000000..44fad930 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/NodeStates.java @@ -0,0 +1,31 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class NodeStates { + /** + * 输送线上的位置编码 + */ + public String slotCode; + /** + * 是否有箱 + * 有箱则为true,否则为false + */ + public Boolean hasContainer; + /** + * 最近⼀次读取箱⼦状 + * 态的时间 + */ + public Long lastReadTime; + /** + * 最后⼀次上报料箱到 + * 达的时间 + */ + public Long lastReportTime; + /** + * 最后⼀次有箱⼦的时 + * 间 + */ + public Long lastHasContainerTime; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryConveyorRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryConveyorRequest.java new file mode 100644 index 00000000..4470d3a0 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryConveyorRequest.java @@ -0,0 +1,12 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class QueryConveyorRequest { + /** + * 输送线编码 + * 根据输送线编码列表查询状态 + */ + public String conveyorCodes; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryConveyorResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryConveyorResponse.java new file mode 100644 index 00000000..f82aba56 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryConveyorResponse.java @@ -0,0 +1,14 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.BaseStoreRequest; + +import java.util.List; + +@Data +public class QueryConveyorResponse { + /** + * + */ + public List conveyors; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryNodeReaderRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryNodeReaderRequest.java new file mode 100644 index 00000000..004ea23e --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryNodeReaderRequest.java @@ -0,0 +1,5 @@ +package org.nl.acs.ext.wms.liKuData.a; + +public class QueryNodeReaderRequest { + public String slotCode; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryNodeReaderResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryNodeReaderResponse.java new file mode 100644 index 00000000..6c10bf58 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/QueryNodeReaderResponse.java @@ -0,0 +1,41 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class QueryNodeReaderResponse{ + /** + * 容器编码 + */ + public String barcode; + /** + * 容器⾼度 + */ + public Long height; + /** + * 容器长度 + */ + public Long length; + /** + * 容器宽度 + */ + public Long width; + /** + * 容器重量 + */ + public Long weight; + /** + * 容器材料 + * 1.料箱2.纸箱 + */ + public Long material; + /** + * 容器朝向 + */ + public String orientation; + /** + * 容器材料 + * 料箱上⼆维码信息 + */ + public String qrCode; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Rfid.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Rfid.java new file mode 100644 index 00000000..d8160209 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Rfid.java @@ -0,0 +1,19 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +import java.util.List; + +@Data +public class Rfid extends TaskstatusReportingRequest{ + /** + * 背篓层号 + * 从0层开始编号,64表⽰放在了货叉上 + */ + public Integer trayLevel; + /** + * rfid盘点信息 + * 仅限于rfid盘点 + */ + public List rfidInfo; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/RobotQueryRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/RobotQueryRequest.java new file mode 100644 index 00000000..f15b914a --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/RobotQueryRequest.java @@ -0,0 +1,17 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +public class RobotQueryRequest { + /** + * 机器⼈编码 + * 可传多个,若不传则查全部 + */ + public Map> robotCodes ; + + //public List robotCodes; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/RobotQueryResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/RobotQueryResponse.java new file mode 100644 index 00000000..5b46d13d --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/RobotQueryResponse.java @@ -0,0 +1,22 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.DeviceStatusData; +import org.nl.acs.ext.wms.liKuData.b.AGVTask; + +import java.util.List; + +@Data +public class RobotQueryResponse{ + String msg; + + String code; + + Datas datas; +// /** +// * 任务 +// * +// */ +// public List robots; +} + diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Robots.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Robots.java new file mode 100644 index 00000000..39a71f87 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Robots.java @@ -0,0 +1,89 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +import java.util.List; +@Data +public class Robots { + /** + * 编码 + */ + public String robotCode; + /** + * 型号 + */ + public String robotTypeCode; + /** + * 节点编码 + * 机器⼈当前所处节点 + */ + public String pointCode; + /** + * 坐标x + * 机器⼈实际坐标xmm + */ + public Long positionX; + /** + * 坐标y + * 机器⼈实际坐标ymm + */ + public Long positionY; + /** + * 机器⼈⻆度 + */ + public Integer theta; + /** + * 货叉⾼度 + */ + public Long forkHeight; + /** + * 货叉⻓度 + */ + public Long forkLength; + /** + * 货叉相对机 + * 器⼈⻆度 + */ + public Integer forkTheta; + /** + * ⼯作站编码 + * 当机器⼈在⼯作站⼯作时会具有 + */ + public String stationCode; + /** + * ⼯作位编码 + * 当机器⼈控制权在⼯作位上时会具有 + */ + public String locationCode; + /** + * 机器⼈状态 + * UNAVAILABLE =杀机器⼈后,在场外 + * 的状态 + * UNKNOWN =未知,待初始化 + * ERROR =错误(机器⼈状态更新超时) + * IDLE =空闲 + * EXECUTING =执⾏任务中 + * AWAITING =原地等待 + */ + public String state; + /** + * 机器⼈硬件状态 + * ROBOT_READY_TO_INIT? =机器⼈启动 + * 以后的初始状态,等待初始化指令 + * ROBOT_IDLE? =空闲状态,等待任务指 + * 令(MOVE、BIN_OP) + * ROBOT_RUNNING? =运⾏状态(正在执 + * ⾏任务) + * ROBOT_ABNORMAL? =异常状态(内部 + * 故障,或者执⾏任务过程中发⽣异常需 + * 要处理) + * ROBOT_RECOVERY? =恢复状态 + * ROBOT_PAUSED? =暂停状态 + */ + public String hardwareState; + /** + * 背篓描述 + */ + public List trays; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskDescribe.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskDescribe.java new file mode 100644 index 00000000..a650868e --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskDescribe.java @@ -0,0 +1,8 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class TaskDescribe { + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskstatusReportingRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskstatusReportingRequest.java new file mode 100644 index 00000000..a0fff83e --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskstatusReportingRequest.java @@ -0,0 +1,52 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class TaskstatusReportingRequest { + /** + * 任务号 + *业务任务号 + */ + public String taskCode; + /** + * 上报事件类型 + * task:上报任务状态 + * tote_load:上报取箱状态 + * tote_unload:上报放箱状态 + * robot_reach:机器⼈到达⼯作站 + * weight:称重事件回调 + * rfid:RFID识别事件回调 + */ + public String eventType; + /** + * 状态 + * success: + * fail:失败 + * cancel:取消 + * suspend:挂起 + */ + public String status; + /** + * 机器⼈编码 + * + */ + public String robotCode; + /** + * 容器编码 + */ + public String containerCode; + /** + * ⼯作位编码 + */ + public String locationCode; + /** + * ⼯作站编码 + */ + public String stationCode; + /** + * 描述信息 + * 异常原因/挂起原因等 + */ + public String message; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskstatusReportingResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskstatusReportingResponse.java new file mode 100644 index 00000000..3d6bf2b1 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/TaskstatusReportingResponse.java @@ -0,0 +1,8 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class TaskstatusReportingResponse{ + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteActionTask.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteActionTask.java new file mode 100644 index 00000000..e47c8f89 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteActionTask.java @@ -0,0 +1,54 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.b.AGVTask; + +@Data +public class ToteActionTask extends AGVTask { + /** + * 任务⾏为 + * load取货箱,⾃带移动 + * unload放货箱,⾃带移动 + * nop纯移动 + */ + public String taskAction; + /** + * ⾏为结束是否暂停 + * 默认0。指任务结束后不暂停,机器 + * ⼈被释放。 + * 1,指任务结束后会暂停,直⾄使⽤ + * 暂停恢复接⼝继续执⾏后续任务。 + * ⾏为取消不再⽣效,成功会⽣效。 + * 暂停机器⼈后,可继续往机器⼈任 + * 务列表追加任务,再恢复后机器⼈ + * 会继续执⾏后续任务。 + */ + public Boolean isFinallyPaused; + /** + * 容器编码 + *LOAD时容器和⼯作位⼆选⼀ + * UNLOAD时必填 + */ + public String containerCode; + /** + * ⼯作位编码 + *LOAD时容器和⼯作位⼆选⼀ + * UNLOAD时必填 + * NOP模式若填写,则系统会寻找该 + * ⼯作位对应的⼯作点进⾏停靠,若 + * ⼯作位和节点都填写,则优先⼯作 + * 位 + */ + public String locationCode; + /** + * 节点编码 + *仅NOP纯移动模式可⽤ + */ + public String pointCode; + /** + * 机器⼈姿态⻆度 + * 仅NOP纯移动模式可⽤ + * 0,90,?180,270 + */ + public Integer robotTheta; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteCarryTask.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteCarryTask.java new file mode 100644 index 00000000..0b6794c2 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteCarryTask.java @@ -0,0 +1,42 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.b.AGVTask; + +@Data +public class ToteCarryTask extends AGVTask { + /** + * 容器编码 + * 容器和⼯作位⼆选⼀,优先取容器code,容器 + * 不存在则⾃动创建 + */ + public String containerCode; + /** + * 容器型号 + * 默认为“CT_KUBOT_STANDARD“ + */ + public String containerType; + /** + * ⼯作位标签 + *⽤于逻辑分区分配对应⼯作位 + */ + public String storageTag; + /** + * 起始⼯作位 + * containerCode、fromLocationCode⾄少⼀个 + * 不为空 + * 开启容器⾃动⼊场配置时,容器⼊场到 + * fromLocationCode + */ + public String fromLocationCode; + /** + * ⽬标⼯作位 + *toLocationCode、toStationCode⾄少⼀个不 + * 为空 + */ + public Integer toLocationCode; + /** + * ⽬标⼯作站 + */ + public Integer toStationCode; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteCheckTask.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteCheckTask.java new file mode 100644 index 00000000..ec4a227d --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/ToteCheckTask.java @@ -0,0 +1,21 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.b.AGVTask; + +@Data +public class ToteCheckTask extends AGVTask { + /** + * 容器编码 + */ + public String containerCode; + /** + * ⽬标⼯作位 + * 即要进⾏盘库的⽬标库位 + */ + public String locationCode; + /** + * 盘库类型 + */ + public String checkType; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Tray.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Tray.java new file mode 100644 index 00000000..9e930632 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Tray.java @@ -0,0 +1,28 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +import java.util.List; + +@Data +public class Tray { + /** + * 背篓序号 + * 货叉标识64 + */ + public Integer trayLevel; + /** + * 容器编码 + * 若背篓为空则为空 + */ + public String containerCode; + /** + * 业务任务 + */ + public List taskCodes; + /** + * 位置编码 + * 格式为机器⼈id#背篓序号 + */ + public String positionCode; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerFinishRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerFinishRequest.java new file mode 100644 index 00000000..08ad630c --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerFinishRequest.java @@ -0,0 +1,19 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class UnloadContainerFinishRequest { + /** + * 输送线节点编码 + */ + public String slotCode; + /** + * 容器编码 + */ + public String containerCode; + /** + * 容器属性 + */ + public String containerAttribute; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerFinishResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerFinishResponse.java new file mode 100644 index 00000000..91ebd733 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerFinishResponse.java @@ -0,0 +1,7 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class UnloadContainerFinishResponse{ +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerReqRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerReqRequest.java new file mode 100644 index 00000000..b3004ea8 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerReqRequest.java @@ -0,0 +1,15 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class UnloadContainerReqRequest { + /** + * 输送线节点编码 + */ + public String slotCode; + /** + * 容器编码 + */ + public String containerCode; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerReqResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerReqResponse.java new file mode 100644 index 00000000..5f062c43 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/UnloadContainerReqResponse.java @@ -0,0 +1,11 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class UnloadContainerReqResponse{ + /** + * 允许放箱 + */ + public Boolean allow; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Weight.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Weight.java new file mode 100644 index 00000000..5c0776a8 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/a/Weight.java @@ -0,0 +1,17 @@ +package org.nl.acs.ext.wms.liKuData.a; + +import lombok.Data; + +@Data +public class Weight extends TaskstatusReportingRequest{ + /** + * 背篓层号 + * 从0层开始编号,64表⽰放在了货叉上 + */ + public Integer trayLevel; + /** + * 重量 + * 单位g仅限于重量盘点 + */ + public Integer weight; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/AGVTask.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/AGVTask.java new file mode 100644 index 00000000..bee83966 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/AGVTask.java @@ -0,0 +1,24 @@ +package org.nl.acs.ext.wms.liKuData.b; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.a.TaskDescribe; + +@Data +public class AGVTask { + /** + * 业务任务号 + * + */ + public String taskCode; + /** + * 任务优先级 + * 0代表不区分优先级;从1开始,数 + * 值越⼤,优先级越⾼;系统会优先 + * 分配优先级⾼的任务 + */ + public String taskPriority; + /** + * 任务描述 + */ + public TaskDescribe taskDescribe; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CarryTaskDescribe.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CarryTaskDescribe.java new file mode 100644 index 00000000..e943c247 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CarryTaskDescribe.java @@ -0,0 +1,29 @@ +package org.nl.acs.ext.wms.liKuData.b; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.a.TaskDescribe; +@Data +public class CarryTaskDescribe extends TaskDescribe { + /** + * 容器编码 + * 容器和⼯作位⼆选⼀,优先取容器code,容器 + * 不存在则⾃动创建 + */ + String containerCode; + /** + * 起始⼯作位 + * 适⽤于缓存货架场景,若填写,系统可以校验容 + * 器和库位是否匹配 + */ + String fromLocationCode; + /** + * ⽬标⼯作位 + * 若没有填写,则系统会随机找⼀个允许放的库位 + */ + public String toLocationCode; + /** + * 容器型号 + * 默认为“CT_KUBOT_STANDARD“ + */ + String containerType; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CheckTaskDescribe.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CheckTaskDescribe.java new file mode 100644 index 00000000..464fb87d --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CheckTaskDescribe.java @@ -0,0 +1,20 @@ +package org.nl.acs.ext.wms.liKuData.b; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.a.TaskDescribe; +@Data +public class CheckTaskDescribe extends TaskDescribe { + /** + * 容器编码 + */ + public String containerCode; + /** + * ⽬标⼯作位 + * 即要进⾏盘库的⽬标库位 + */ + public String locationCode; + /** + * 盘库类型 + */ + public String checkType; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CreateRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CreateRequest.java new file mode 100644 index 00000000..622950a7 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CreateRequest.java @@ -0,0 +1,57 @@ +package org.nl.acs.ext.wms.liKuData.b; + +import lombok.Data; + +import java.util.List; + +@Data +public class CreateRequest { + /** + * 任务类型 + * tote_outbound:容器出库 + * tote_relocation:容器移库 + * tote_inbound:容器⼊库 + * tote_check:容器盘库 + * tote_carry:容器搬运 + */ + public String taskType; + +// /** +// * 业务类型 +// *当任务类型是出库时,可选填业务类型 +// * pick_outbound:拣选出库 +// * count_outbound:盘点出库 +// * empty_outbound:空箱出库 +// * reorg_outbound:理货出库 +// */ +// public String businessType; + +// /** +// * 任务组号 +// * 任务组,若不传则系统⾃动⽣成? +// */ +// public String taskGroupCode; + + /** + * 组优先级 + * 0代表不区分优先级;从1开始,数值越 + * ⼤,优先级越⾼;系统会优先执⾏⾼优 + * 先级组的任务 + */ + public Integer groupPriority; + + /** + * 任务 + * + */ + public List tasks; + /** + * 机器⼈编码 + * 指定机器⼈执⾏任务: + * 只有下发指令集任务的时候会有⽤,如 + * 果下发指令集任务不指定机器⼈,系统 + * 将⾃动指定⼀台空闲机器⼈ + */ + public String robotCode; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CreateResponse.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CreateResponse.java new file mode 100644 index 00000000..92fd55fb --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/CreateResponse.java @@ -0,0 +1,9 @@ +package org.nl.acs.ext.wms.liKuData.b; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.a.BaseResponseData; + +@Data +public class CreateResponse extends BaseResponseData { + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/InTaskDescribe.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/InTaskDescribe.java new file mode 100644 index 00000000..90313573 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/InTaskDescribe.java @@ -0,0 +1,32 @@ +package org.nl.acs.ext.wms.liKuData.b; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.a.TaskDescribe; + +import java.util.List; + +@Data +public class InTaskDescribe extends TaskDescribe { + /** + * 容器编码 + */ + String containerCode; + /** + * 起始⼯作位 + * 适⽤于缓存货架场景,若填写,系统可以校验容 + * 器和库位是否匹配 + */ + String fromLocationCode; + /** + * ⽬标⼯作位 + * 若没有填写,则系统会随机找⼀个允许放的库位 + */ + public String locationCode; + /** + * 容器型号 + * 必须指定⼀个型号才能⼊库 + */ + String containerType; + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/OutTaskDescribe.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/OutTaskDescribe.java new file mode 100644 index 00000000..1b329c71 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/OutTaskDescribe.java @@ -0,0 +1,31 @@ +package org.nl.acs.ext.wms.liKuData.b; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.a.TaskDescribe; + +import java.util.List; + +/** + * 出库任务类型 + */ +@Data +public class OutTaskDescribe extends TaskDescribe { + /** + * 容器编码 + * 容器和⼯作位⼆选⼀,优先取容器 + * code + */ + String containerCode; + /** + * 起始⼯作位 + */ + String fromLocationCode; + /** + * ⽬标⼯作站编码 + * ⽀持传多个⼯作站,系统均衡分配 + */ + List toStationCode ; + + + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/RelocationTaskDescribe.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/RelocationTaskDescribe.java new file mode 100644 index 00000000..b64d4690 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/b/RelocationTaskDescribe.java @@ -0,0 +1,23 @@ +package org.nl.acs.ext.wms.liKuData.b; + +import lombok.Data; +import org.nl.acs.ext.wms.liKuData.a.TaskDescribe; +@Data +public class RelocationTaskDescribe extends TaskDescribe { + /** + * 容器编码 + *fromLocationCode未指定时必填 + */ + public String containerCode; + /** + * 起始⼯作位 + * 即容器所在源库位,containerCode未 + * 指定时必填 + */ + public String fromLocationCode; + /** + * 任务描述⽬标⼯作位 + * 即给容器指定的⽬标库位 + */ + public String toLocationCode; +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/putEmptyPalletRequest.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/putEmptyPalletRequest.java new file mode 100644 index 00000000..2d921b86 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/putEmptyPalletRequest.java @@ -0,0 +1,14 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +@Data +public class putEmptyPalletRequest { + + String deviceId; + + String orderId; + + String type; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToLiKuController.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToLiKuController.java new file mode 100644 index 00000000..154a55a6 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToLiKuController.java @@ -0,0 +1,64 @@ +package org.nl.acs.ext.wms.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.ext.wms.liKuData.a.CancelRequest; +import org.nl.acs.ext.wms.liKuData.a.ContainerArrivedRequest; +import org.nl.acs.ext.wms.liKuData.a.LocationQueryRequest; +import org.nl.acs.ext.wms.liKuData.a.RobotQueryRequest; +import org.nl.acs.ext.wms.liKuData.b.CreateRequest; +import org.nl.acs.ext.wms.service.AcsToLiKuService; +import org.nl.modules.logging.InterfaceLogType; +import org.nl.modules.logging.annotation.Log; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author ludj + * @date 2021-07-21 + **/ +@RestController +@RequiredArgsConstructor +@Api(tags = "立库接口") +@RequestMapping("/task") +@Slf4j +public class AcsToLiKuController { + private final AcsToLiKuService acsToLiKuService; + + @PostMapping("/containerArrived") + @Log(value = "容器到达通知",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK) + @ApiOperation("容器到达通知") + public ResponseEntity containerArrived(@RequestBody ContainerArrivedRequest requestParam) throws Exception { + return new ResponseEntity<>(acsToLiKuService.containerArrived(requestParam), HttpStatus.OK); + } + @PostMapping("/create") + @Log(value = "任务下发请求",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK) + @ApiOperation("任务下发请求") + public ResponseEntity create(@RequestBody CreateRequest requestParam) throws Exception { + return new ResponseEntity<>(acsToLiKuService.create(requestParam), HttpStatus.OK); + } + @PostMapping("/cancel") + @Log(value = "任务取消请求",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK) + @ApiOperation("任务取消请求") + public ResponseEntity cancel(@RequestBody CancelRequest requestParam) throws Exception { + return new ResponseEntity<>(acsToLiKuService.cancel(requestParam), HttpStatus.OK); + } + @PostMapping("/robot/query") + @Log(value = "机器⼈查询接⼝",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK) + @ApiOperation("机器⼈查询接⼝") + public ResponseEntity robotQuery(@RequestBody RobotQueryRequest requestParam) throws Exception { + return new ResponseEntity<>(acsToLiKuService.robotQuery(requestParam), HttpStatus.OK); + } + @PostMapping("/location/query") + @Log(value = "⼯作位查询接⼝",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK) + @ApiOperation("⼯作位查询接⼝") + public ResponseEntity locationQuery(@RequestBody LocationQueryRequest requestParam) throws Exception { + return new ResponseEntity<>(acsToLiKuService.locationQuery(requestParam), HttpStatus.OK); + } +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/LiKuToACSController.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/LiKuToACSController.java new file mode 100644 index 00000000..e129bb9f --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/LiKuToACSController.java @@ -0,0 +1,91 @@ +package org.nl.acs.ext.wms.rest; + +import cn.dev33.satoken.annotation.SaIgnore; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.ext.wms.liKuData.InStoreReportRequest; +import org.nl.acs.ext.wms.liKuData.MoveStoreReportRequest; +import org.nl.acs.ext.wms.liKuData.OutStoreReportRequest; +import org.nl.acs.ext.wms.liKuData.a.*; +import org.nl.acs.ext.wms.liKuData.putEmptyPalletRequest; +import org.nl.acs.ext.wms.service.LiKuToAcsService; +import org.nl.modules.logging.InterfaceLogType; +import org.nl.modules.logging.annotation.Log; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wangs + * @date 2021-07-21 + **/ +@RestController +@RequiredArgsConstructor +@Api(tags = "立库接口") +@RequestMapping("/task") +@Slf4j +public class LiKuToACSController { + private final LiKuToAcsService liKuToAcsService; + + @SaIgnore + @PostMapping("/queryConveyor") + @Log(value = "查询输送线料箱状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS) + @ApiOperation("查询输送线料箱状态") + public ResponseEntity queryConveyor(@RequestBody QueryConveyorRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.queryConveyor(requestParam), HttpStatus.OK); + } + @SaIgnore + @PostMapping("/queryNodeReader") + @Log(value = "查询输送线点位状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS) + @ApiOperation("查询输送线点位状态") + public ResponseEntity queryNodeReader(@RequestBody QueryNodeReaderRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.queryNodeReader(requestParam), HttpStatus.OK); + } + @SaIgnore + @PostMapping("/loadContainerFinish") + @Log(value = "取容器完成通知",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS) + @ApiOperation("取容器完成通知") + public ResponseEntity loadContainerFinish(@RequestBody LoadContainerFinishRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.loadContainerFinish(requestParam), HttpStatus.OK); + } + @SaIgnore + @PostMapping("/unloadContainerReq") + @Log(value = "放容器请求",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS) + @ApiOperation("放容器请求") + public ResponseEntity unloadContainerReq(@RequestBody UnloadContainerReqRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.unloadContainerReq(requestParam), HttpStatus.OK); + } + @SaIgnore + @PostMapping("/unloadContainerFinish") + @Log(value = "放容器完成通知",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS) + @ApiOperation("放容器完成通知") + public ResponseEntity unloadContainerFinish(@RequestBody UnloadContainerFinishRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.unloadContainerFinish(requestParam), HttpStatus.OK); + } + @SaIgnore + @PostMapping("/moveContainer") + @Log(value = "容器流动请求",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS) + @ApiOperation("容器流动请求") + public ResponseEntity moveContainer(@RequestBody MoveContainerRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.moveContainer(requestParam), HttpStatus.OK); + } + @SaIgnore + @PostMapping("/taskstatusreporting") + @Log(value = "任务状态上报",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS) + @ApiOperation("任务状态上报") + public ResponseEntity taskstatusreporting(@RequestBody TaskstatusReportingRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.taskstatusreporting(requestParam), HttpStatus.OK); + } + @SaIgnore + @PostMapping("/abnormalreporting") + @Log(value = "异常上报",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS) + @ApiOperation("异常上报") + public ResponseEntity abnormalreporting(@RequestBody AbnormarReportingRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.abnormalreporting(requestParam), HttpStatus.OK); + } +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToLiKuService.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToLiKuService.java new file mode 100644 index 00000000..d0e089b0 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToLiKuService.java @@ -0,0 +1,54 @@ +package org.nl.acs.ext.wms.service; + +import com.alibaba.fastjson.JSONObject; +import org.nl.acs.ext.wms.liKuData.*; +import org.nl.acs.ext.wms.liKuData.a.*; +import org.nl.acs.ext.wms.liKuData.b.CreateRequest; +import org.nl.acs.ext.wms.liKuData.b.CreateResponse; + +/** + * @author: zjj + * @createDate: 2023/6/27 + */ +public interface AcsToLiKuService { + + + + /** + * 容器到达通知 + * @param requestParam + * @return + */ + public Resp containerArrived(ContainerArrivedRequest requestParam) throws Exception; + + /** + * 任务下发请求 + * @param requestParam + * @return + */ + public Resp create(CreateRequest requestParam) throws Exception; + + /** + * 任务取消请求 + * @param requestParam + * @return + */ + public Resp cancel(CancelRequest requestParam) throws Exception; + + /** + * 机器⼈查询接⼝ + * @param requestParam + * @return + */ + public Resp robotQuery(RobotQueryRequest requestParam) throws Exception; + + + /** + * ⼯作位查询接⼝ + * @param requestParam + * @return + */ + public Resp locationQuery(LocationQueryRequest requestParam) throws Exception; + +} + diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index a16d717c..14bde518 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -3,6 +3,8 @@ package org.nl.acs.ext.wms.service; import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest; +import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import java.util.Map; @@ -156,8 +158,9 @@ public interface AcsToWmsService { * @returna */ JSONObject stackingCompleted(JSONObject param); - - + // 输送线有货变成无货时向lms请求 + HttpResponse shipDeviceUpdate(JSONObject param); + ApplyLabelingAndBindingResponse applyLabelingAndBindingRequest(ApplyLabelingAndBindingRequest param); } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/LiKuToAcsService.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/LiKuToAcsService.java new file mode 100644 index 00000000..ed7d56bf --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/LiKuToAcsService.java @@ -0,0 +1,69 @@ +package org.nl.acs.ext.wms.service; + +import com.alibaba.fastjson.JSONObject; +import org.nl.acs.ext.wms.liKuData.a.*; + +/** + * @author: zjj + * @createDate: 2023/6/27 + */ +public interface LiKuToAcsService { + + /** + * 查询输送线料箱状态 + * @param requestParam + * @return + */ + public JSONObject queryConveyor(QueryConveyorRequest requestParam) throws Exception; + + /** + * 查询输送线点位状态 + * @param requestParam + * @return + */ + public JSONObject queryNodeReader(QueryNodeReaderRequest requestParam) throws Exception; + + /** + * 取容器完成通知 + * @param requestParam + * @return + */ + public JSONObject loadContainerFinish(LoadContainerFinishRequest requestParam) throws Exception; + + + /** + * 放容器请求 + * @param requestParam + * @return + */ + public JSONObject unloadContainerReq(UnloadContainerReqRequest requestParam) throws Exception; + + /** + * 放容器完成通知 + * @param requestParam + * @return + */ + public JSONObject unloadContainerFinish(UnloadContainerFinishRequest requestParam) throws Exception; + + /** + * 容器流动请求 + * @param requestParam + * @return + */ + public JSONObject moveContainer(MoveContainerRequest requestParam) throws Exception; + + /** + * 任务状态上报 + * @param requestParam + * @return + */ + public Object taskstatusreporting(TaskstatusReportingRequest requestParam) throws Exception; + + /** + * 异常上报 + * @param requestParam + * @return + */ + public JSONObject abnormalreporting(AbnormarReportingRequest requestParam) throws Exception; + +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java new file mode 100644 index 00000000..577fc88c --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java @@ -0,0 +1,113 @@ +package org.nl.acs.ext.wms.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.address.service.AddressService; +import org.nl.acs.ext.wms.AcsUtil; +import org.nl.acs.ext.wms.RespUtil; +import org.nl.acs.ext.wms.liKuData.*; +import org.nl.acs.ext.wms.liKuData.a.*; +import org.nl.acs.ext.wms.liKuData.b.CreateRequest; +import org.nl.acs.ext.wms.liKuData.b.CreateResponse; +import org.nl.acs.ext.wms.service.AcsToLiKuService; +import org.slf4j.MDC; +import org.springframework.stereotype.Service; + +/** + * 立库WCS接口 + * + * @author: zjj by + * @createDate: 2024/6/28 + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class AcsToLiKuServiceImpl implements AcsToLiKuService { + + private final AddressService addressService; + + private String log_file_type = "log_file_type"; + private String log_type = "ACS请求立库"; + + + @Override + public Resp containerArrived(ContainerArrivedRequest requestParam) throws Exception { + try { + MDC.put(log_file_type, log_type); + log.info("containerArrivedRequest-----输入参数{}", JSON.toJSONString(requestParam)); + String api = addressService.findByCode("containerArrived").getMethods_url(); + String result = AcsUtil.notifyAcs(api, requestParam); + log.info("containerArrivedRequest-----输出参数{}", result); + return RespUtil.getResp(result, new JSONObject()); + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public Resp create(CreateRequest requestParam) throws Exception { + try { + MDC.put(log_file_type, log_type); + log.info("CreateRequest-----输入参数{}", JSON.toJSONString(requestParam)); + String api = addressService.findByCode("createLikuTask").getMethods_url(); + String result = AcsUtil.notifyAcs(api, requestParam); + log.info("CreateRequest-----输出参数{}", result); + return RespUtil.getResp(result, new CreateResponse()); + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public Resp cancel(CancelRequest requestParam) throws Exception { + try { + MDC.put(log_file_type, log_type); + log.info("CancelRequest-----输入参数{}", JSON.toJSONString(requestParam)); + String api = addressService.findByCode("cancelLikuTask").getMethods_url(); + String result = AcsUtil.notifyAcs(api, requestParam); + log.info("CancelRequest-----输出参数{}", result); + return RespUtil.getResp(result, new CancelResponse()); + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public Resp robotQuery(RobotQueryRequest requestParam) throws Exception { + try { + MDC.put(log_file_type, log_type); + log.info("RobotQueryRequest-----输入参数{}", JSON.toJSONString(requestParam)); + String api = addressService.findByCode("robotQuery").getMethods_url(); + String result = AcsUtil.notifyAcs(api, requestParam); +// String result="{\"code\":0,\"msg\":\"success\",\"data\":{\"robots\":[{\"robotCode\":\"AGVLK\",\"robotTypeCode\":\"RT_KUBOT\",\"pointCode\":\"POINT:1280:5070\",\"positionX\":1283,\"positionY\":5057,\"theta\":269,\"forkHeight\":679,\"forkLength\":4,\"forkTheta\":1,\"stationCode\":\"1\",\"locationCode\":\"LT_CONVEYOR_OUTPUT:POINT:1280:5070\",\"state\":\"IDLE\",\"hardwareState\":\" ROBOT_IDLE \",\"trays\":[{\"trayLevel\":0,\"containerCode\":null,\"taskCodes\":[],\"positionCode\":\"kubot-1#0\"},{\"trayLevel\":1,\"containerCode\":null,\"taskCodes\":[],\"positionCode\":\"kubot-1#1\"},{\"trayLevel\":2,\"containerCode\":null,\"taskCodes\":[],\"positionCode\":\"kubot-1#2\"},{\"trayLevel\":3,\"containerCode\":null,\"taskCodes\":[],\"positionCode\":\"kubot-1#3\"},{\"trayLevel\":4,\"containerCode\":null,\"taskCodes\":[],\"positionCode\":\"kubot-1#4\"},{\"trayLevel\":64,\"containerCode\":null,\"taskCodes\":[],\"positionCode\":\"kubot-1#64\"}]}]}}"; + log.info("RobotQueryRequest-----输出参数{}", result); + + return RespUtil.getResp(result, new JSONObject()); + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public Resp locationQuery(LocationQueryRequest requestParam) throws Exception { + try { + MDC.put(log_file_type, log_type); + log.info("LocationQueryRequest-----输入参数{}", JSON.toJSONString(requestParam)); + String api = addressService.findByCode("locationQuery").getMethods_url(); + String result = AcsUtil.notifyAcs(api, requestParam); + log.info("LocationQueryRequest-----输出参数{}", result); + return RespUtil.getResp(result, new LocationQueryResponse()); + } finally { + MDC.remove(log_file_type); + } + } + + + public static void main(String[] args) { + JSONObject jo = new JSONObject(); + jo.put("code", 0); + jo.put("msg", "111"); + } +} diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 59dc81fa..cc8c5021 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -1,5 +1,6 @@ package org.nl.acs.ext.wms.service.impl; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; @@ -12,6 +13,8 @@ import org.nl.acs.AcsConfig; import org.nl.acs.device.address.service.AddressService; import org.nl.acs.device.address.service.dto.AddressDto; import org.nl.acs.device.service.DeviceService; +import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest; +import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.modules.system.service.ParamService; import org.slf4j.MDC; @@ -63,8 +66,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } finally { MDC.remove(log_file_type); } - } + } @Override public HttpResponse feedbackTaskStatusToWms(JSONArray data) { try { @@ -631,5 +634,59 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { MDC.remove(log_file_type); } } + @Override + public ApplyLabelingAndBindingResponse applyLabelingAndBindingRequest(ApplyLabelingAndBindingRequest param) { + try { + MDC.put(log_file_type, log_type); + ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = new ApplyLabelingAndBindingResponse(); + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); + AddressDto addressDto = addressService.findByCode("applyLabelingAndBinding"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + log.info("ApplyLabelingAndBindingRequest----请求参数{}", param); + try { +// String result = ""; + String result = HttpRequest.post(url) + .body(JSON.toJSONString(param)) + .execute().body(); + JSONObject jsonObject = JSONObject.parseObject(result); + log.info("ApplyLabelingAndBindingResponse----返回参数{}", result); + applyLabelingAndBindingResponse = JSONObject.toJavaObject(jsonObject, ApplyLabelingAndBindingResponse.class); + } catch (Exception e) { + JSONObject map = new JSONObject(); + map.put("status", 400); + map.put("message", e.getMessage()); + return JSONObject.toJavaObject(map, ApplyLabelingAndBindingResponse.class); + } + } + return applyLabelingAndBindingResponse; + } finally { + MDC.remove(log_file_type); + } + + } + @Override + public HttpResponse shipDeviceUpdate(JSONObject param) { + try { + MDC.put(log_file_type, log_type); +// log.info("shipDeviceUpdate-----输入参数{}", param); + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); + AddressDto addressDto = addressService.findByCode("shipDeviceUpdate"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + return HttpRequest + .post(url) + .body(param.toString()) + .execute(); + } + } catch (Throwable ignored) { + + } finally { + MDC.remove(log_file_type); + } + return null; + } } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java new file mode 100644 index 00000000..0e866796 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java @@ -0,0 +1,321 @@ +package org.nl.acs.ext.wms.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.address.service.AddressService; +import org.nl.acs.device_driver.basedriver.agv.liku_agv.LiKuDeviceDriver; +import org.nl.acs.device_driver.basedriver.hailiang_hr_ssx.HailiangHrSsxDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; +import org.nl.acs.ext.wms.RespUtil; +import org.nl.acs.ext.wms.liKuData.a.*; +import org.nl.acs.ext.wms.service.AcsToLiKuService; +import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.ext.wms.service.LiKuToAcsService; +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.task.service.TaskService; +import org.nl.acs.task.service.dto.TaskDto; +import org.nl.modules.common.utils.StringUtils; +import org.nl.modules.wql.util.SpringContextHolder; +import org.slf4j.MDC; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 立库WCS接口 + * + * @author: wangs + * @createDate: 2022/11/24 + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class LiKuToAcsServiceImpl implements LiKuToAcsService { + + private final AddressService addressService; + + private final TaskService taskService; + + private final InstructionService instructionService; + + private final DeviceAppService deviceAppService; + + private final AcsToWmsService acsToWmsService; + + private final AcsToLiKuService acsToLiKuService; + + +// DeviceAppService appService= SpringContextHolder.getBean(DeviceAppServiceImpl.class); + + + private String log_file_type = "log_file_type"; + private String log_type = "立库请求ACS"; + + @Override + public JSONObject queryConveyor(QueryConveyorRequest requestParam) throws Exception { + try{ + log.info("查询输送线料箱状态-----输入参数{}", JSON.toJSONString(requestParam)); + String conveyorCodes = requestParam.conveyorCodes; + NodeStates nodeStates=new NodeStates(); + List list2 = new ArrayList<>(); + Conveyors conveyors=new Conveyors(); + JSONObject result = new JSONObject(); + Device device=deviceAppService.findDeviceByCode(conveyorCodes); + result.put("code", "0"); + result.put("msg", "success"); + QueryConveyorResponse queryConveyorResponse = new QueryConveyorResponse(); + if (device != null && device.getDeviceDriver() instanceof HailiangHrSsxDeviceDriver) { + HailiangHrSsxDeviceDriver hailiangHrSsxDeviceDriver= (HailiangHrSsxDeviceDriver) device.getDeviceDriver(); + if (!ObjectUtil.isEmpty(device.getDevice_code())) { + conveyors.setCode(device.getDevice_code()); + } + if (!ObjectUtil.isEmpty(device.getLocation())) { + nodeStates.setSlotCode(device.getDevice_code()); + } + if (!ObjectUtil.equals(hailiangHrSsxDeviceDriver.getMove(),"1")) { + nodeStates.setHasContainer(true); + }else { nodeStates.setHasContainer(false);} + } + list2.add(nodeStates); + conveyors.setNodeStates(list2); + List list = new ArrayList<>(); + queryConveyorResponse.setConveyors(list); + list.add(conveyors); + result.put("data", queryConveyorResponse); + log.info("查询输送线料箱状态-----输出参数{}", result); + return result; + + } finally { + MDC.remove(log_file_type); + } + } + @Override + public JSONObject queryNodeReader(QueryNodeReaderRequest requestParam) throws Exception { + try{ + log.info("查询输送线点位状态-----输入参数{}", JSON.toJSONString(requestParam)); + String slotCode = requestParam.slotCode; + QueryNodeReaderResponse queryNodeReaderResponse = new QueryNodeReaderResponse(); + JSONObject result = new JSONObject(); + result.put("code", "0"); + result.put("msg", "success"); + result.put("data", queryNodeReaderResponse); + log.info("查询输送线点位状态-----输出参数{}", result); + return result; + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public JSONObject loadContainerFinish(LoadContainerFinishRequest requestParam) throws Exception { + try{ + log.info("取容器完成通知-----输入参数{}", JSON.toJSONString(requestParam)); + String slotCode = requestParam.slotCode; + String containerCode=requestParam.containerCode; + LoadContainerFinishResponse loadContainerFinishResponse = new LoadContainerFinishResponse(); + JSONObject result = new JSONObject(); + JSONObject json = (JSONObject) JSONObject.toJSON(loadContainerFinishResponse); + result.put("code", "0"); + result.put("msg", "success"); + result.put("data", json); + log.info("取容器完成通知-----输出参数{}", result); + return result; + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public JSONObject unloadContainerReq(UnloadContainerReqRequest requestParam) throws Exception { + try{ + log.info("放容器请求-----输入参数{}", JSON.toJSONString(requestParam)); + String slotCode = requestParam.slotCode; + String containerCode=requestParam.containerCode; + UnloadContainerReqResponse unloadContainerReqResponse = new UnloadContainerReqResponse(); + JSONObject result = new JSONObject(); + result.put("code", "0"); + result.put("msg", "success"); + result.put("data", unloadContainerReqResponse); + log.info("放容器请求-----输出参数{}", result); + return result; + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public JSONObject unloadContainerFinish(UnloadContainerFinishRequest requestParam) throws Exception { + try{ + log.info("放容器完成通知-----输入参数{}", JSON.toJSONString(requestParam)); + String slotCode = requestParam.slotCode; + String containerCode=requestParam.containerCode; + String containerAttribute=requestParam.containerAttribute; + UnloadContainerFinishResponse unloadContainerFinishResponse = new UnloadContainerFinishResponse(); + JSONObject result = new JSONObject(); + JSONObject json = (JSONObject) JSONObject.toJSON(unloadContainerFinishResponse); + result.put("code", "0"); + result.put("msg", "success"); + result.put("data", json); + log.info("放容器完成通知-----输出参数{}", result); + return result; + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public JSONObject moveContainer(MoveContainerRequest requestParam) throws Exception { + try{ + log.info("容器流动请求-----输入参数{}", JSON.toJSONString(requestParam)); + String slotCode = requestParam.slotCode; + String containerCode=requestParam.containerCode; + String direction=requestParam.direction; + MoveContainerResponse moveContainerResponse = new MoveContainerResponse(); + JSONObject result=new JSONObject(); + JSONObject json = (JSONObject) JSONObject.toJSON(moveContainerResponse); + result.put("code", "0"); + result.put("msg", "success"); + result.put("data", json); + log.info("容器流动请求-----输出参数{}", result); + return result; + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public Object taskstatusreporting(TaskstatusReportingRequest requestParam) throws Exception { + try{ + log.info("任务状态上报-----输入参数{}", JSON.toJSONString(requestParam)); + String inst_id = requestParam.getTaskCode(); + String eventType=requestParam.getEventType(); + String status=requestParam.getStatus(); + String carNo=requestParam.getRobotCode(); + Instruction inst = instructionService.findById(inst_id); + if (ObjectUtil.isEmpty(inst)) { + TaskstatusReportingResponse taskstatusReportingResponse = new TaskstatusReportingResponse(); + JSONObject result = new JSONObject(); + result.put("result", "false"); + result.put("code", "0"); + result.put("comment", "未找到对应指令"); + result.put("data", taskstatusReportingResponse ); + log.info("任务状态上报-----输出参数{}", result); + return RespUtil.getResp(result.toString(), new TaskstatusReportingResponse()); + } + if (!StrUtil.equals(inst.getInstruction_status(),"0") && !StrUtil.equals(inst.getInstruction_status(),"1")) { + TaskstatusReportingResponse taskstatusReportingResponse = new TaskstatusReportingResponse(); + JSONObject result = new JSONObject(); + result.put("result", "false"); + result.put("code", "0"); + result.put("comment", "未找到对应未完成的指令"); + result.put("data", taskstatusReportingResponse ); + log.info("任务状态上报-----输出参数{}", result); + return RespUtil.getResp(result.toString(), new TaskstatusReportingResponse()); + } + TaskDto task = taskService.findByCode(inst.getTask_code()); + if (ObjectUtil.isEmpty(task)) { + TaskstatusReportingResponse taskstatusReportingResponse = new TaskstatusReportingResponse(); + JSONObject result = new JSONObject(); + result.put("result", "false"); + result.put("code", "0"); + result.put("comment", "未找到对应任务"); + result.put("data", taskstatusReportingResponse ); + log.info("任务状态上报-----输出参数{}", result); + return RespUtil.getResp(result.toString(), new TaskstatusReportingResponse()); + } + + /** + * eventType + * task:上报任务状态 + * tote_load:上报取箱状态 + * tote_unload:上报放箱状态 + * robot_reach:机器⼈到达⼯作站 + * weight:称重事件回调 + * rfid:RFID识别事件回调 + */ + + /** + * status + * success:成功 + * fail:失败 + * cancel:取消 + * suspend:挂起 + */ + + if(StrUtil.equals(inst.getInstruction_status(),"0")){ + inst.setInstruction_status("1"); + inst.setCarno(carNo); + } + + if( StrUtil.equals(eventType,"task")){ + if(StrUtil.equals(status,"success")){ + if (!StrUtil.equals(task.getTask_status(),"0") && !StrUtil.equals(task.getTask_status(),"1")) { + TaskstatusReportingResponse taskstatusReportingResponse = new TaskstatusReportingResponse(); + JSONObject result = new JSONObject(); + result.put("result", "false"); + result.put("code", "0"); + result.put("comment", "未找到未完成的对应任务"); + result.put("data", taskstatusReportingResponse); + log.info("任务状态上报-----输出参数{}", result); + return RespUtil.getResp(result.toString(), new TaskstatusReportingResponse()); + } + instructionService.finish(inst.getInstruction_id()); + } else if (StrUtil.equals(status,"fail") || StrUtil.equals(status,"cancel")){ + instructionService.cancel(inst.getInstruction_id()); + } else if (StrUtil.equals(status,"suspend")){ + + } + } else if ( StrUtil.equals(eventType,"tote_load")) { + inst.setExecute_code("2"); + instructionService.update(inst); + } else if ( StrUtil.equals(eventType,"tote_unload")) { + inst.setExecute_code("4"); + instructionService.update(inst); + } + + TaskstatusReportingResponse taskstatusReportingResponse = new TaskstatusReportingResponse(); + JSONObject json = (JSONObject) JSONObject.toJSON(taskstatusReportingResponse); + JSONObject result = new JSONObject(); + result.put("code", "0"); + result.put("msg", "success"); + result.put("data", json); + log.info("任务状态上报-----输出参数{}", result); + return result; + } finally { + MDC.remove(log_file_type); + } + } + + @Override + public JSONObject abnormalreporting(AbnormarReportingRequest requestParam) throws Exception { + try{ + log.info("异常上报-----输入参数{}", JSON.toJSONString(requestParam)); + String eventType=requestParam.getEventType(); + if(StrUtil.equals(eventType,"location_abnormal") || StrUtil.equals(eventType,"robot_abnormal") ){ + + } + AbnormarReportingResponse abnormarReportingResponse = new AbnormarReportingResponse(); + JSONObject result = new JSONObject(); + JSONObject json = (JSONObject) JSONObject.toJSON(abnormarReportingResponse); + result.put("code", "0"); + result.put("msg", "success"); + result.put("data", json); + log.info("异常上报-----输出参数{}", result); + return result; + } finally { + MDC.remove(log_file_type); + } + } +} + + diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java index b976164b..06fb89e3 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -16,7 +16,7 @@ import java.util.Map; * @date 2021-03-18 **/ public interface InstructionService { - + Instruction findByTaskcodeAndStatus(String code); /** * 查询数据分页 * @@ -351,4 +351,6 @@ public interface InstructionService { void removeCacheLinePhase(Instruction dto); Instruction findInstByDeviceCode(String device_code); + + } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 4cce4820..348b4d67 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -23,6 +23,11 @@ import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line 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.acsEnum.AgvTypeEnum; +import org.nl.acs.ext.wms.liKuData.CancelTaskRequest; +import org.nl.acs.ext.wms.liKuData.Resp; +import org.nl.acs.ext.wms.liKuData.a.CancelRequest; +import org.nl.acs.ext.wms.liKuData.b.*; +import org.nl.acs.ext.wms.service.AcsToLiKuService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.opc.Device; @@ -77,6 +82,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu private RouteLineService routeLineService; @Autowired private TaskService taskService; + @Autowired + AcsToLiKuService acsToLiKuService; @Override public void autoInitial() { @@ -88,7 +95,18 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu List list = this.queryAll("instruction_status < 2 and is_delete = 0"); this.instructions = list == null ? new CopyOnWriteArrayList<>() : new CopyOnWriteArrayList<>(list); } - + @Override + public Instruction findByTaskcodeAndStatus(String code) { + Iterator var3 = instructions.iterator(); + while (var3.hasNext()) { + Instruction instruction = (Instruction) var3.next(); + if (StrUtil.equals(instruction.getTask_code(), code) + && StrUtil.equals(instruction.getInstruction_status(), "0")) { + return instruction; + } + } + return null; + } @Override public Map queryAll(Map whereJson, Pageable page) { String code = (String) whereJson.get("code"); @@ -336,12 +354,107 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu * 7 不去称重平台称重PS20 agvtype:2 * 8 RT20 agvtype:3 */ - if (StrUtil.equals("1", dto.getAgv_system_type())) { - ndcAgvService.sendAgvTwoInstToNDC(dto, null); - } else if (StrUtil.equals("2", dto.getAgv_system_type())) { - ndcAgvService.sendAgvOneInstToNDC(dto); + if(StrUtil.equals(task.getTask_type(),"10")){ + CreateRequest createRequest = new CreateRequest(); + List list = new ArrayList(); + AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuService.class); + Resp resp = new Resp(); + if(StrUtil.equals("1",task.getStorage_task_type())){ + createRequest.setTaskType("tote_inbound"); + //list Describe 入库 + InTaskDescribe inTaskDescribe=new InTaskDescribe(); + inTaskDescribe.setContainerCode(dto.getVehicle_code()); + inTaskDescribe.setFromLocationCode(dto.getStart_point_code()); + inTaskDescribe.setLocationCode(dto.getNext_point_code()); + inTaskDescribe.setContainerType(dto.getVehicle_type()); + + AGVTask agvTask1 = new AGVTask(); + agvTask1.setTaskDescribe(inTaskDescribe); + agvTask1.setTaskCode(dto.getTask_id()); + agvTask1.setTaskPriority(dto.getPriority()); + + list.add(agvTask1); + createRequest.setTasks(list); + resp=acsToLiKuService.create(createRequest); + } else if(StrUtil.equals("2",task.getStorage_task_type())){ + createRequest.setTaskType("tote_outbound"); + //list Describe 出库 + OutTaskDescribe outTaskDescribe = new OutTaskDescribe(); + outTaskDescribe.setContainerCode(dto.getVehicle_code()); + outTaskDescribe.setFromLocationCode(dto.getStart_point_code()); + outTaskDescribe.setToStationCode(new ArrayList(Collections.singleton(dto.getNext_device_code()))); + + AGVTask agvTask = new AGVTask(); + agvTask.setTaskDescribe(outTaskDescribe); + agvTask.setTaskCode(dto.getTask_id()); + agvTask.setTaskPriority(dto.getPriority()); + list.add(agvTask); + createRequest.setTasks(list); + resp=acsToLiKuService.create(createRequest); + }else if(StrUtil.equals("3",task.getStorage_task_type())){ + createRequest.setTaskType("tote_relocation"); + //list Describe 移库 + RelocationTaskDescribe relocationTaskDescribe = new RelocationTaskDescribe(); + relocationTaskDescribe.setContainerCode(dto.getVehicle_code()); + relocationTaskDescribe.setFromLocationCode(dto.getStart_point_code()); + relocationTaskDescribe.setToLocationCode(dto.getNext_point_code()); + + AGVTask agvTask2 = new AGVTask(); + agvTask2.setTaskDescribe(relocationTaskDescribe); + agvTask2.setTaskCode(dto.getTask_id()); + agvTask2.setTaskPriority(dto.getPriority()); + + list.add(agvTask2); + createRequest.setTasks(list); + resp=acsToLiKuService.create(createRequest); + + }else if(StrUtil.equals("4",task.getStorage_task_type())){ + createRequest.setTaskType("tote_carry"); + //list Describe 搬运 + CarryTaskDescribe carryTaskDescribe=new CarryTaskDescribe(); + carryTaskDescribe.setContainerCode(dto.getVehicle_code()); + carryTaskDescribe.setFromLocationCode(dto.getStart_point_code()); + carryTaskDescribe.setToLocationCode(dto.getNext_point_code()); + carryTaskDescribe.setContainerType(dto.getVehicle_type()); + + AGVTask agvTask4 = new AGVTask(); + agvTask4.setTaskDescribe(carryTaskDescribe); + agvTask4.setTaskCode(dto.getTask_id()); + agvTask4.setTaskPriority(dto.getPriority()); + + list.add(agvTask4); + createRequest.setTasks(list); + resp=acsToLiKuService.create(createRequest); + }else if(StrUtil.equals("5",task.getStorage_task_type())){ + createRequest.setTaskType("tote_check"); + //list Describe 盘库 + CheckTaskDescribe checkTaskDescribe=new CheckTaskDescribe(); + checkTaskDescribe.setContainerCode(dto.getVehicle_code()); + checkTaskDescribe.setLocationCode(dto.getNext_point_code()); + checkTaskDescribe.setCheckType("scan"); + AGVTask agvTask3 = new AGVTask(); + agvTask3.setTaskDescribe(checkTaskDescribe); + agvTask3.setTaskCode(dto.getTask_id()); + agvTask3.setTaskPriority(dto.getPriority()); + + list.add(agvTask3); + createRequest.setTasks(list); + resp=acsToLiKuService.create(createRequest); + } + createRequest.setGroupPriority(Integer.parseInt(dto.getPriority())); + if(ObjectUtil.isNotEmpty(resp) && StrUtil.equals(resp.getCode(),"true")){ + dto.setSend_status("1"); + } else { + dto.setSend_status("2"); + } + } else { + if (StrUtil.equals("1", dto.getAgv_system_type())) { + ndcAgvService.sendAgvTwoInstToNDC(dto, null); + } else if (StrUtil.equals("2", dto.getAgv_system_type())) { + ndcAgvService.sendAgvOneInstToNDC(dto); + } + dto.setSend_status("1"); } - dto.setSend_status("1"); } } catch (Exception e) { dto.setSend_status("2"); @@ -935,6 +1048,20 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } if (flag) { + if (StrUtil.equals(entity.getInstruction_type(), "10")) { + CancelRequest cancelRequest = new CancelRequest(); + cancelRequest.setTaskCodes(new ArrayList(Collections.singleton(entity.getInstruction_id()))); + acsToLiKuService.cancel(cancelRequest); + } + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + entity.setUpdate_time(now); + entity.setUpdate_by(currentUsername); + entity.setInstruction_status("3"); + WQLObject wo = WQLObject.getWQLObject("acs_instruction"); + JSONObject json = (JSONObject) JSONObject.toJSON(entity); + wo.update(json); + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); // 如果是无光电的设备 指令完成变更起点、终点状态 JSONObject jo = new JSONObject(); diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/opc/BlockedRunable.java b/wcs/nladmin-system/src/main/java/org/nl/acs/opc/BlockedRunable.java index 7d7ad381..9eb511d1 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/opc/BlockedRunable.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/opc/BlockedRunable.java @@ -18,7 +18,7 @@ public abstract class BlockedRunable implements Runnable { public abstract String getCode(); - public abstract void subRun(); + public abstract void subRun() throws Exception; public void run() { try { diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceExecuteAutoRun.java b/wcs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceExecuteAutoRun.java index 9aaf6e91..bfb40096 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceExecuteAutoRun.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceExecuteAutoRun.java @@ -97,7 +97,7 @@ public class DeviceExecuteAutoRun extends AbstractAutoRunnable { if (!this.runs.keySet().contains(deviceDriver.getDeviceCode())) { BlockedRunable runnable = new BlockedRunable() { @Override - public void subRun() { + public void subRun() throws Exception { deviceDriver.executeAuto(); } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java index 0baa826f..197293a6 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java @@ -19,7 +19,13 @@ import java.util.Map; * @date 2021-03-18 **/ public interface TaskService { - + /** + * 根据起点设备编号查询当前是否有就绪任务 + * + * @param device_code + * @return + */ + TaskDto findByStartCodeAndReady(String device_code); /** * 查询数据分页 * diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index c8cc907f..c263a14f 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -96,7 +96,22 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { List list = arr.toJavaList(TaskDto.class); return list; } + @Override + public TaskDto findByStartCodeAndReady(String device_code) { + Iterator var3 = tasks.iterator(); + while (var3.hasNext()) { + TaskDto task = (TaskDto) var3.next(); + // if (!StrUtil.equals(task.getTask_type(), "5")) { + // continue; + // } + if (StrUtil.equals(task.getStart_device_code(), device_code) + && StrUtil.equals(task.getTask_status(), "0")) { + return task; + } + } + return null; + } @Override public Map queryAll(Map whereJson, Pageable page) { HashMap map = new HashMap<>(); diff --git a/wcs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryRobot.java b/wcs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryRobot.java new file mode 100644 index 00000000..bc2ee441 --- /dev/null +++ b/wcs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryRobot.java @@ -0,0 +1,103 @@ +package org.nl.modules.quartz.task; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device_driver.basedriver.agv.liku_agv.LiKuDeviceDriver; +import org.nl.acs.ext.wms.liKuData.Resp; +import org.nl.acs.ext.wms.liKuData.a.Datas; +import org.nl.acs.ext.wms.liKuData.a.RobotQueryRequest; +import org.nl.acs.ext.wms.liKuData.a.RobotQueryResponse; +import org.nl.acs.ext.wms.liKuData.a.Robots; +import org.nl.acs.ext.wms.service.AcsToLiKuService; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + + +/* + * 查询立库机器⼈编码 + */ +@Slf4j +@Component +public class QueryRobot { + @Autowired + AcsToLiKuService acsToLiKuService; + @Autowired + DeviceAppService deviceAppService; + + public void run() throws Exception { + RobotQueryRequest robotQueryRequest = new RobotQueryRequest(); + HashMap map = new HashMap(); + List list = new ArrayList(); + List devices = deviceAppService.findDevice(DeviceType.agv); + + for (int i = 0; i < devices.size(); i++) { + if (devices.get(i).getDeviceDriver() instanceof LiKuDeviceDriver) { + list.add(devices.get(i).getDevice_code()); + } + } + map.put("robotCodes", list); + robotQueryRequest.setRobotCodes(map); + Resp robotResp = acsToLiKuService.robotQuery(robotQueryRequest); + JSONArray jsonArray = robotResp.getData().getJSONArray("robots"); + List robotsList = jsonArray.toJavaList(Robots.class); + PackageDriver(robotsList); + } + + private void PackageDriver(List robotsList) { + for (Robots robots : robotsList) { + String robotCode = robots.getRobotCode(); + Device device = deviceAppService.findDeviceByCode(robotCode); + if (device != null && device.getDeviceDriver() instanceof LiKuDeviceDriver) { + LiKuDeviceDriver liKuDeviceDriver = (LiKuDeviceDriver) device.getDeviceDriver(); + if (!ObjectUtil.isEmpty(robots.getRobotCode())) { + liKuDeviceDriver.setRobotCode(robots.getRobotCode()); + } + if (!ObjectUtil.isEmpty(robots.getRobotTypeCode())) { + liKuDeviceDriver.setRobotTypeCode(robots.getRobotTypeCode()); + } + liKuDeviceDriver.setPointCode(robots.getPointCode()); + if (!ObjectUtil.isEmpty(robots.getPositionX())) { + liKuDeviceDriver.setPositionX(robots.getPositionX()); + } + if (!ObjectUtil.isEmpty(robots.getPositionY())) { + liKuDeviceDriver.setPositionX(robots.getPositionY()); + } + if (!ObjectUtil.isEmpty(robots.getTheta())) { + liKuDeviceDriver.setTheta(robots.getTheta()); + } + if (!ObjectUtil.isEmpty(robots.getForkHeight())) { + liKuDeviceDriver.setForkHeight(robots.getForkHeight()); + } + if (!ObjectUtil.isEmpty(robots.getForkLength())) { + liKuDeviceDriver.setForkLength(robots.getForkLength()); + } + if (!ObjectUtil.isEmpty(robots.getForkTheta())) { + liKuDeviceDriver.setForkTheta(robots.getForkTheta()); + } + liKuDeviceDriver.setStationCode(liKuDeviceDriver.getStationCode()); + liKuDeviceDriver.setLocationCode(liKuDeviceDriver.getLocationCode()); + if (!ObjectUtil.isEmpty(robots.getState())) { + liKuDeviceDriver.setState(robots.getState()); + } + if (!ObjectUtil.isEmpty(robots.getHardwareState())) { + liKuDeviceDriver.setHardwareState(robots.getHardwareState()); + } + if (!ObjectUtil.isEmpty(robots.getTrays())) { + liKuDeviceDriver.setTrays(robots.getTrays()); + } + } + } + } +} + + + diff --git a/wcs/nladmin-system/src/main/resources/config/application-dev.yml b/wcs/nladmin-system/src/main/resources/config/application-dev.yml index 51dbd157..86682524 100644 --- a/wcs/nladmin-system/src/main/resources/config/application-dev.yml +++ b/wcs/nladmin-system/src/main/resources/config/application-dev.yml @@ -12,12 +12,12 @@ spring: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy # url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_acs_one_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true + # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true username: ${DB_USER:root} # password: ${DB_PWD:P@ssw0rd} - # password: ${DB_PWD:Root.123456} - password: ${DB_PWD:password} + # password: ${DB_PWD:Root.123456} + password: ${DB_PWD:123456} # 初始连接数 initial-size: 5 diff --git a/wcs/nladmin-system/src/main/resources/log/AcsToLk.xml b/wcs/nladmin-system/src/main/resources/log/AcsToLk.xml new file mode 100644 index 00000000..c8c2d049 --- /dev/null +++ b/wcs/nladmin-system/src/main/resources/log/AcsToLk.xml @@ -0,0 +1,33 @@ + + + + + + + + + ${LOG_HOME}/ACS请求立库/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + + + + + + + + + + + diff --git a/wcs/nladmin-system/src/main/resources/log/LkToAcs.xml b/wcs/nladmin-system/src/main/resources/log/LkToAcs.xml new file mode 100644 index 00000000..2df63ce0 --- /dev/null +++ b/wcs/nladmin-system/src/main/resources/log/LkToAcs.xml @@ -0,0 +1,33 @@ + + + + + + + + + ${LOG_HOME}/立库请求ACS/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + + + + + + + + + + + diff --git a/wcs/nladmin-system/src/main/resources/logback-spring.xml b/wcs/nladmin-system/src/main/resources/logback-spring.xml index a176f430..8ef9376b 100644 --- a/wcs/nladmin-system/src/main/resources/logback-spring.xml +++ b/wcs/nladmin-system/src/main/resources/logback-spring.xml @@ -29,7 +29,8 @@ https://juejin.cn/post/6844903775631572999 - + + true diff --git a/wcs/nladmin-ui/src/views/acs/device/config.vue b/wcs/nladmin-ui/src/views/acs/device/config.vue index da62cf5a..068e6356 100644 --- a/wcs/nladmin-ui/src/views/acs/device/config.vue +++ b/wcs/nladmin-ui/src/views/acs/device/config.vue @@ -95,7 +95,7 @@ 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 from '@/views/acs/device/driver/standard_conveyor_control' import standard_conveyor_monitor from '@/views/acs/device/driver/standard_conveyor_monitor' - +import hailiang_hr_ssx_station from '@/views/acs/device/driver/hailiang_hr_ssx_station' 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' @@ -111,6 +111,7 @@ 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 liku_agv from '@/views/acs/device/driver/agv/liku_agv' 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' import hailiang_threestation_smart from '@/views/acs/device/driver/hailiang_one/hailiang_threestation_smart' @@ -149,6 +150,7 @@ export default { hailiang_old_special_full_station, hailiang_old_special_pick_station, hailiang_old_special_pour_station, + hailiang_hr_ssx_station, standard_ordinary_site, standard_inspect_site, standard_autodoor, @@ -172,6 +174,7 @@ export default { standard_photoelectric_inspect_site, agv_ndc_two, agv_ndc_one, + liku_agv, hailiang_packer_station, hailiang_engraving_cache, hailiang_special_pick_station, diff --git a/wcs/nladmin-ui/src/views/acs/device/driver/agv/liku_agv.vue b/wcs/nladmin-ui/src/views/acs/device/driver/agv/liku_agv.vue new file mode 100644 index 00000000..1a3930a0 --- /dev/null +++ b/wcs/nladmin-ui/src/views/acs/device/driver/agv/liku_agv.vue @@ -0,0 +1,103 @@ + + + + + + \ No newline at end of file diff --git a/wcs/nladmin-ui/src/views/acs/device/driver/hailiang_hr_ssx_station.vue b/wcs/nladmin-ui/src/views/acs/device/driver/hailiang_hr_ssx_station.vue new file mode 100644 index 00000000..2fcb0beb --- /dev/null +++ b/wcs/nladmin-ui/src/views/acs/device/driver/hailiang_hr_ssx_station.vue @@ -0,0 +1,489 @@ + + + + + + \ No newline at end of file diff --git a/wcs/nladmin-ui/src/views/acs/task/index.vue b/wcs/nladmin-ui/src/views/acs/task/index.vue index fd810fd1..65752e2c 100644 --- a/wcs/nladmin-ui/src/views/acs/task/index.vue +++ b/wcs/nladmin-ui/src/views/acs/task/index.vue @@ -101,6 +101,22 @@ :value="item.value" /> + + + + +