From 444aaced36d4d3e9c32815b436dcfaff3226094d Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 13 八月 2025 14:53:57 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index 1c42cd3..a61bcc8 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -62,7 +62,6 @@
  */
 @Slf4j
 @Service("mainService")
-@Transactional
 public class MainServiceImpl {
 
     public static final long COMMAND_TIMEOUT = 5 * 1000;
@@ -743,6 +742,12 @@
 //                continue;
 //            }
 
+            //鍫嗗灈鏈哄洖鍘熺偣浠诲姟涓�
+            Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK);
+            if (object != null) {
+                continue;
+            }
+
             // 鍙湁褰撳爢鍨涙満绌洪棽 骞朵笖 鏃犱换鍔℃椂鎵嶇户缁墽琛�
             if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO
                     && crnProtocol.getLoaded() == 0 && crnProtocol.getForkPos() == 0) {
@@ -842,7 +847,7 @@
                     News.error("鍫嗗灈鏈虹Щ鍔ㄥ懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand));
                 }
                 crnThread.setBackHpFlag(true);
-                redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 60);
+                redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 10);
                 try {
                     Thread.sleep(500);
                 } catch (Exception e) {
@@ -914,7 +919,7 @@
                     News.error("鍫嗗灈鏈虹Щ鍔ㄥ懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand));
                 }
                 crnThread.setBackHpFlag(true);
-                redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 60);
+                redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 10);
                 try {
                     Thread.sleep(500);
                 } catch (Exception e) {
@@ -1891,9 +1896,13 @@
                         if (jsonObject.getInteger("code").equals(200)) {
                             StartupDto dto = jsonObject.getObject("data", StartupDto.class);
 
+                            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
+                                    .eq("loc_no", dto.getLocNo()));
+
                             // 鏇存柊绔欑偣淇℃伅 涓� 涓嬪彂plc鍛戒护
                             staProtocol.setWorkNo(dto.getWorkNo().shortValue());
                             staProtocol.setStaNo(dto.getStaNo().shortValue());
+                            staProtocol.setPalletSize(locMast.getLocType2());
                             devpThread.setPakMk(staProtocol.getSiteId(), false);
                             boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                             if (!result) {
@@ -2001,7 +2010,7 @@
                     wrkMast1.setIoType(3); // 鍏ュ嚭搴撶姸鎬侊細3.绔欏埌绔�
                     wrkMast1.setIoPri(13D); // 浼樺厛绾�
                     wrkMast1.setSourceStaNo(emptyInSta.getStaNo());
-                    wrkMast1.setStaNo(1007);
+                    wrkMast1.setStaNo(1004);
                     wrkMast1.setBarcode(barcode);
                     // 鎿嶄綔浜哄憳鏁版嵁
                     wrkMast1.setAppeTime(new Date());
@@ -2014,6 +2023,7 @@
                     // 鏇存柊绔欑偣淇℃伅 涓� 涓嬪彂plc鍛戒护
                     staProtocol.setWorkNo((short) workNo);
                     staProtocol.setStaNo((short) 2003);
+                    staProtocol.setPalletSize((short) 1);
                     devpThread.setPakMk(staProtocol.getSiteId(), false);
                     boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                     if (!result) {

--
Gitblit v1.9.1