From 3aaa2f73d832be9f277e3bad798896d061c85516 Mon Sep 17 00:00:00 2001
From: Administrator <56479841@QQ.COM>
Date: 星期二, 12 十二月 2023 13:04:12 +0800
Subject: [PATCH] #20231212-1304

---
 src/main/java/com/zy/common/service/CommonService.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 24ea988..c78ded9 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -106,7 +106,7 @@
      * @param matNos      鐗╂枡鍙烽泦鍚�
      * @return locNo 妫�绱㈠埌鐨勫簱浣嶅彿
      */
-    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto) {
+    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, Integer matTypeIn) {
         int start;
         int end;
         Integer matType = null;//鐗╂枡绫诲瀷
@@ -176,6 +176,11 @@
                 }
                 if (!matType.equals(mat.getMatType())) {
                     throw new CoolException("娣锋斁鐗╂枡绫诲瀷涓嶄竴鑷�");
+                }
+            }
+            if (!Cools.isEmpty(matTypeIn)) {
+                if (!matTypeIn.equals(0)) {
+                    matType = matTypeIn;
                 }
             }
 
@@ -291,6 +296,7 @@
             List<String> groupLoc = Utils.getGroupLoc(wrkMast.getLocNo());
             //闅忔満鍙敤鍫嗗灈鏈哄彿
             Integer randomCrnNo = Utils.getRandomCrnNo(crnNos, locTypeDto.getLocType1());
+            Collections.shuffle(crnNos);
             for (Integer crnNo : crnNos) {
                 List<LocMast> locMasts = locMastService.findEmptyLocMastByLocNos(locTypeDto.getLocType1(), groupLoc, crnNo);
                 for (LocMast locMast0 : locMasts) {

--
Gitblit v1.9.1