From eb96c6e4e3e1bc7c2ba72979d4178663c1482c75 Mon Sep 17 00:00:00 2001 From: Junjie <xjj@123> Date: 星期四, 19 六月 2025 14:33:28 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 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 072defd..689f02c 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -14,6 +14,7 @@ import com.zy.asrs.service.*; import com.zy.asrs.utils.Utils; import com.zy.asrs.utils.VersionUtils; +import com.zy.common.constant.RedisConstantType; import com.zy.common.model.LocTypeDto; import com.zy.common.model.MatDto; import com.zy.common.model.SearchLocParam; @@ -22,6 +23,7 @@ import com.zy.common.utils.CollectionUtils; import com.zy.common.utils.HttpHandler; import com.zy.common.utils.News; +import com.zy.common.utils.RedisUtil; import com.zy.core.CrnThread; import com.zy.core.DevpThread; import com.zy.core.cache.MessageQueue; @@ -95,6 +97,8 @@ private WrkMastLogService wrkMastLogService; @Autowired private ConfigService configService; + @Autowired + private RedisUtil redisUtil; @Value("${wms.url}") private String wmsUrl; @@ -656,8 +660,15 @@ continue; } + Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK); + if (object != null) { + continue; + } + List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() - .eq("crn_no", crn.getId())); + .eq("crn_no", crn.getId()) + .notIn("wrk_sts", 5, 14, 15) + ); if (!wrkMasts.isEmpty()) { continue; } @@ -677,10 +688,16 @@ crnCommand.setDestinationPosX((short) 0); // 鐩爣搴撲綅鎺� crnCommand.setDestinationPosY((short) 0); // 鐩爣搴撲綅鍒� crnCommand.setDestinationPosZ((short) 0); // 鐩爣搴撲綅灞� - if (!MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(4, crnCommand))) { + if (!MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(2, crnCommand))) { News.error("鍫嗗灈鏈虹Щ鍔ㄥ懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand)); } crnThread.setBackHpFlag(true); + redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 60); + try { + Thread.sleep(500); + } catch (Exception e) { + e.printStackTrace(); + } } } } -- Gitblit v1.9.1