From 4f2b7db1184798a55046f04e17d5540b4a7e19f4 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期三, 29 四月 2026 11:12:10 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/CommonService.java | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 677c40d..4b1c90e 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -409,7 +409,7 @@
}
/**
- * 褰撳洖婧愬簱浣嶄笉鍦ㄦ湰宸烽亾鏃讹紝鍑哄簱鑷�1070閲嶆柊妫�绱㈠贩閬撴牴鎹�1锛�2宸烽亾涔嬮棿鍒嗛厤锛�3锛�4宸烽亾鍏ㄥ眬鍒嗛厤瑙勫垯
+ * 褰撳洖婧愬簱浣嶄笉鍦ㄦ湰宸烽亾鏃讹紝閲嶆柊妫�绱㈠贩閬撴牴鎹�1锛�2宸烽亾涔嬮棿鍒嗛厤锛�3锛�4宸烽亾鍏ㄥ眬鍒嗛厤瑙勫垯
*/
@Transactional
public StartupDto getLocNoRunV2(Integer whsType, Integer staDescId, Integer sourceStaNo, WrkMast wrkMast, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
@@ -420,10 +420,20 @@
detl = wrkDetl.get(0);
}
String matnr = detl == null ? null : detl.getMatnr();
- int[] candidates = wrkMast.getCrnNo() != null && wrkMast.getCrnNo() < 3 ? new int[]{1, 2} : new int[]{1, 2, 3, 4};
+ Integer sourceCrnNo = null;
+ if (!Cools.isEmpty(wrkMast.getLocNo())) {
+ LocMast sourceLoc = locMastService.selectById(wrkMast.getLocNo());
+ if (!Cools.isEmpty(sourceLoc) && sourceLoc.getCrnNo() != null) {
+ sourceCrnNo = sourceLoc.getCrnNo();
+ }
+ }
+ int[] candidates = sourceCrnNo != null && sourceCrnNo < 5 ? new int[]{1, 2} : new int[]{1, 2, 3, 4};
Integer chosenCrnNo = null;
Integer chosenCount = null;
for (int candidate : candidates) {
+ if (sourceCrnNo != null && candidate == sourceCrnNo) {
+ continue;
+ }
//鍒ゆ柇璇ュ贩閬撴槸鍚﹀瓨鍦ㄧ┖浣�
LocMast candidateLoc = locMastService.selectOne(new EntityWrapper<LocMast>()
.eq("crn_no", candidate)
@@ -457,6 +467,9 @@
.eq("whs_type", 1)
.orderBy("lev1,bay1"));
}
+ if (!Cools.isEmpty(locMast) && sourceCrnNo != null && sourceCrnNo.equals(locMast.getCrnNo())) {
+ locMast = null;
+ }
if (Cools.isEmpty(locMast)) {
List<LocMast> anyLocs = locMastService.selectList(new EntityWrapper<LocMast>()
.eq("loc_sts", "O")
@@ -469,6 +482,9 @@
if (anyLoc == null || anyLoc.getCrnNo() == null) {
continue;
}
+ if (sourceCrnNo != null && sourceCrnNo.equals(anyLoc.getCrnNo())) {
+ continue;
+ }
if (!basCrnpService.checkSiteError(anyLoc.getCrnNo(), true)) {
continue;
}
--
Gitblit v1.9.1