فهرست منبع

1、开启和关闭输送线接口
2、任务反馈注解

LZH 1 سال پیش
والد
کامیت
6d71687b3c

+ 52 - 0
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/service/BeltLineClientService.java

@@ -0,0 +1,52 @@
+package com.ruoyi.ams.xuankuang.service;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.hard.xuankang.BeltLineClient;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @author Jwk
+ * @version 1.0
+ * @date 2023/6/26 14:44
+ */
+
+public class BeltLineClientService {
+    @Autowired
+    private BeltLineClient beltLineClient;
+
+    //进入时抬升输送线
+    public AjaxResult openTheConveyorLine() {
+        //读输送线机械状态
+        Number station = beltLineClient.readMechanicalState();
+        if (station.intValue() == 1) {
+            return AjaxResult.success();
+        }
+        //读模式
+        Number number = beltLineClient.readMode();
+        //判断模式是否为在线
+        if (number.intValue() == 1) {
+            //写通过请求
+            beltLineClient.writeState(1);
+            //写通过方向
+            beltLineClient.writeDirection(1);
+            //读状态
+            Number number1 = beltLineClient.readState();
+            if (number1.intValue() == 3){
+                return AjaxResult.success();
+            }
+        }
+        return AjaxResult.error();
+    }
+
+    //退出时关闭输送线
+    public AjaxResult closeTheConveyorLine() {
+        //写通过完成
+        beltLineClient.writeState(4);
+        //写通过方向
+        Boolean aBoolean = beltLineClient.writeDirection(2);
+        if (aBoolean) {
+            return AjaxResult.success();
+        }
+        return AjaxResult.error();
+    }
+}

+ 8 - 3
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/service/WcsTaskSubService.java

@@ -208,10 +208,12 @@ public class WcsTaskSubService {
                         return;
                     }
                     wcsTask.setEndTime(new Date());
+                    //越库任务完成后反馈
                     if (wcsTask.getExt2().equals("") && wcsTask.getExt1().startsWith("ASN")){
                         completeTheCallbackYueKu(wcsTask);
                         break;
                     }
+                    //入库完成后反馈
                     if (wcsTask.getExt1().startsWith("ASN")) {
                         // 解锁库位
                         iBaseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
@@ -221,7 +223,7 @@ public class WcsTaskSubService {
                         iWcsTaskService.moveStartingPointToDestination(wcsTask);
                         //  修改入库单收货数量
                         completeTheCallback(wcsTask);
-                    }
+                    }//agv入库完成后反馈,回调wcs卸货完成
                     else if (wcsTask.getLocationTo().equals("100733") && wcsTask.getExt1()==null){
                         // 解锁库位
                         iBaseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
@@ -231,6 +233,7 @@ public class WcsTaskSubService {
                         iWcsTaskService.moveStartingPointToDestination(wcsTask);
                         wcsToWmsApiService.agvCallbackWCSBeforeUnloadingIsCompleted();
                     }
+                    //出库完成后反馈
                     if (wcsTask.getExt1().startsWith("SO")) {
                         // 解锁库位
                         iBaseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
@@ -241,7 +244,8 @@ public class WcsTaskSubService {
                         invLotLocIdService.adjLocationIsEmpty(wcsTask.getLocationFrom(), Constant.WAREHOUSE_ID, "Wcs");
                         //  修改出库单收货数量
                         completeTheCallbackOut(wcsTask);
-                    }else if (wcsTask.getExt1().equals("")){
+                    }//空托任务反馈和移库反馈
+                    else if (wcsTask.getExt1().equals("")){
                         // 解锁库位
                         iBaseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
                                 , Long.parseLong(wcsTask.getLocationTo())
@@ -250,7 +254,8 @@ public class WcsTaskSubService {
                         if (!wcsTask.getExt3().equals("")){
                             invLotLocIdService.adjLocationIsEmpty(wcsTask.getLocationFrom(), Constant.WAREHOUSE_ID, "Wcs");
                         }
-                    }else if (wcsTask.getExt5()!=null){
+                    }//agv出库完成后反馈回调取货完成
+                    else if (wcsTask.getExt5()!=null){
                         // 解锁库位
                         iBaseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
                                 , Long.parseLong(wcsTask.getLocationTo())