From 39efc87b3794f957aad73acf3a430b84e3a19b27 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期五, 30 一月 2026 16:32:20 +0800
Subject: [PATCH] Merge branch 'rcs_master' into ctu_conveyor

---
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java |   57 ++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
index bb6ae1c..06c0cf1 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -4,10 +4,7 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.zy.acs.common.constant.RedisConstant;
-import com.zy.acs.common.domain.AgvAction;
-import com.zy.acs.common.domain.AgvActionItem;
-import com.zy.acs.common.domain.AgvProtocol;
-import com.zy.acs.common.domain.BaseResult;
+import com.zy.acs.common.domain.*;
 import com.zy.acs.common.domain.protocol.*;
 import com.zy.acs.common.domain.protocol.action.*;
 import com.zy.acs.common.enums.*;
@@ -895,6 +892,8 @@
             long actionPrepareSts = ActionStsType.PREPARE.val();
 //            JSONObject storeDirection = configService.getVal("storeDirection", JSONObject.class);
             int angleOffsetVal = configService.getVal("mapAngleOffsetVal", Integer.class);
+//            Double defaultShelfDepth = configService.getVal("defaultShelfDepth", Double.class);
+//            defaultShelfDepth = Optional.ofNullable(defaultShelfDepth).orElse((double) 0);
             String agvNo = agvService.getAgvNo(agvId);
 //            if (!agvService.judgeEnable(agvId)) {
 //                throw new CoolException("AGV[" + agvNo + "]褰撳墠涓嶅彲鐢�...");
@@ -1171,7 +1170,7 @@
                                 ActionTypeType.ReadyTakeFromShelvesLoc.desc,    // 鍚嶇О
                                 (double) agvDirectionType.val,    // 灞炴�у��
                                 lastCode.getData(),    // 鍦伴潰鐮�
-                                String.valueOf(oriLoc.getOffset()),   // 鍔ㄤ綔鍙傛暟
+                                JSON.toJSONString(new HeightDepthDto(oriLoc.getOffset())),   // 鍔ㄤ綔鍙傛暟
                                 ActionTypeType.ReadyTakeFromShelvesLoc.val(),    // 鍔ㄤ綔绫诲瀷
                                 actionPrepareSts,    // 鍔ㄤ綔杩涘害
                                 agvId,    // AGV
@@ -1234,7 +1233,7 @@
                                 ActionTypeType.ReadyReleaseToShelvesLoc.desc,    // 鍚嶇О
                                 (double) agvDirectionType.val,    // 灞炴�у��
                                 lastCode.getData(),    // 鍦伴潰鐮�
-                                String.valueOf(destLoc.getOffset()),   // 鍔ㄤ綔鍙傛暟
+                                JSON.toJSONString(new HeightDepthDto(destLoc.getOffset())),   // 鍔ㄤ綔鍙傛暟
                                 ActionTypeType.ReadyReleaseToShelvesLoc.val(),    // 鍔ㄤ綔绫诲瀷
                                 actionPrepareSts,    // 鍔ㄤ綔杩涘害
                                 agvId,    // AGV
@@ -1279,7 +1278,7 @@
                                 ActionTypeType.ReadyTakeFromConveyorSta.desc,    // 鍚嶇О
                                 staWorkDirection,    // 灞炴�у��
                                 lastCode.getData(),    // 鍦伴潰鐮�
-                                String.valueOf(oriSta.getOffset()),   // 鍔ㄤ綔鍙傛暟
+                                JSON.toJSONString(new HeightDepthDto(oriSta.getHeight(), Optional.ofNullable(oriSta.getDepth()).orElse((double) 0))),   // 鍔ㄤ綔鍙傛暟
                                 ActionTypeType.ReadyTakeFromConveyorSta.val(),    // 鍔ㄤ綔绫诲瀷
                                 actionPrepareSts,    // 鍔ㄤ綔杩涘害
                                 agvId,    // AGV
@@ -1362,7 +1361,7 @@
                                 ActionTypeType.ReadyReleaseToConveyorSta.desc,    // 鍚嶇О
                                 staWorkDirection,    // 灞炴�у��
                                 lastCode.getData(),    // 鍦伴潰鐮�
-                                String.valueOf(destSta.getOffset()),   // 鍔ㄤ綔鍙傛暟
+                                JSON.toJSONString(new HeightDepthDto(destSta.getHeight(), Optional.ofNullable(destSta.getDepth()).orElse((double) 0))),   // 鍔ㄤ綔鍙傛暟
                                 ActionTypeType.ReadyReleaseToConveyorSta.val(),    // 鍔ㄤ綔绫诲瀷
                                 actionPrepareSts,    // 鍔ㄤ綔杩涘害
                                 agvId,    // AGV
@@ -1635,14 +1634,22 @@
                         agvAction.add(new AgvActionItem<>(ReadyTakeFromShelvesLoc.class)
                                 .setVal(action.getVal().intValue())
                                 .setQrCode(action.getCode())
-                                .bodySync(body -> body.setHeight((short) Double.parseDouble(action.getParams())))
+                                .bodySync((body) -> {
+                                    HeightDepthDto heightDepthDto = JSON.parseObject(action.getParams(), HeightDepthDto.class);
+                                    body.setHeight(heightDepthDto.getHeight());
+                                    body.setDepth(heightDepthDto.getDepth());
+                                })
                         );
                         break;
                     case ReadyTakeFromConveyorSta:
                         agvAction.add(new AgvActionItem<>(ReadyTakeFromConveyorSta.class)
                                 .setVal(action.getVal().intValue())
                                 .setQrCode(action.getCode())
-                                .bodySync(body -> body.setHeight((short) Double.parseDouble(action.getParams())))
+                                .bodySync((body) -> {
+                                    HeightDepthDto heightDepthDto = JSON.parseObject(action.getParams(), HeightDepthDto.class);
+                                    body.setHeight(heightDepthDto.getHeight());
+                                    body.setDepth(heightDepthDto.getDepth());
+                                })
                         );
                         break;
                     case ReadyTakeFromAgvSite:
@@ -1656,21 +1663,22 @@
                         agvAction.add(new AgvActionItem<>(ReadyReleaseToShelvesLoc.class)
                                 .setVal(action.getVal().intValue())
                                 .setQrCode(action.getCode())
-                                .bodySync(body -> body.setHeight((short) Double.parseDouble(action.getParams())))
-                        );
-                        break;
-                    case LoadPlatformLift:
-                        agvAction.add(new AgvActionItem<>(LoadPlatformLift.class)
-                                .setVal(action.getVal().intValue())
-                                .setQrCode(action.getCode())
-                                .bodySync(body -> body.setHeight((short) Double.parseDouble(action.getParams())))
+                                .bodySync((body) -> {
+                                    HeightDepthDto heightDepthDto = JSON.parseObject(action.getParams(), HeightDepthDto.class);
+                                    body.setHeight(heightDepthDto.getHeight());
+                                    body.setDepth(heightDepthDto.getDepth());
+                                })
                         );
                         break;
                     case ReadyReleaseToConveyorSta:
                         agvAction.add(new AgvActionItem<>(ReadyReleaseToConveyorSta.class)
                                 .setVal(action.getVal().intValue())
                                 .setQrCode(action.getCode())
-                                .bodySync(body -> body.setHeight((short) Double.parseDouble(action.getParams())))
+                                .bodySync((body) -> {
+                                    HeightDepthDto heightDepthDto = JSON.parseObject(action.getParams(), HeightDepthDto.class);
+                                    body.setHeight(heightDepthDto.getHeight());
+                                    body.setDepth(heightDepthDto.getDepth());
+                                })
                         );
                         break;
                     case ReadyReleaseToAgvSite:
@@ -1678,6 +1686,13 @@
                                 .setVal(action.getVal().intValue())
                                 .setQrCode(action.getCode())
                                 .bodySync(body -> body.setDepth((short) Double.parseDouble(action.getParams())))
+                        );
+                        break;
+                    case LoadPlatformLift:
+                        agvAction.add(new AgvActionItem<>(LoadPlatformLift.class)
+                                .setVal(action.getVal().intValue())
+                                .setQrCode(action.getCode())
+                                .bodySync(body -> body.setHeight((short) Double.parseDouble(action.getParams())))
                         );
                         break;
                     case FinishPath:
@@ -1854,7 +1869,7 @@
                                 // load from sta
                                 sta = staService.getById(currTask.getOriSta());
                                 // reserve to be waiting
-                                if (!staReserveService.waitingStaReserve(sta, currTask, 1, StaReserveType.OUT)) {
+                                if (!staReserveService.waitingStaReserve(sta, currTask, currSeg, 1, StaReserveType.OUT)) {
                                     break;
                                 }
                                 // convey plc valid
@@ -1870,7 +1885,7 @@
                                 // place to sta
                                 sta = staService.getById(currTask.getDestSta());
                                 // reserve to be waiting
-                                if (!staReserveService.waitingStaReserve(sta, currTask, 1, StaReserveType.IN)) {
+                                if (!staReserveService.waitingStaReserve(sta, currTask, currSeg, 1, StaReserveType.IN)) {
                                     break;
                                 }
                                 // convey plc valid

--
Gitblit v1.9.1