From b08837ad4e64348a27e21b2bb621352a523e2b7b Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 20 二月 2025 13:26:04 +0800
Subject: [PATCH] #出入库统计计数

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

diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 47d85bf..1a77b31 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -418,13 +418,13 @@
                             locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                     .eq("loc_no", shallowLoc).eq("loc_sts", "F").eq("whs_type",rowLastnoType.getType().longValue()));
                             if (!Cools.isEmpty(locMast2)) {
-                                locMast = locMast2;
+                                locMast = locMast1;
                                 break;
                             } else {
                                 locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                         .eq("loc_no", shallowLoc).eq("loc_sts", "D").eq("whs_type",rowLastnoType.getType().longValue()));
                                 if (!Cools.isEmpty(locMast2)) {
-                                    locMast = locMast2;
+                                    locMast = locMast1;
                                     break;
                                 }
                             }
@@ -536,7 +536,7 @@
 
 
         // 鐩镐技宸ヤ綔妗f --- 鍚屽ぉ鍚岃鏍肩墿鏂�
-        if (!Cools.isEmpty(matnr) && (staDescId == 1 || staDescId == 11 || staDescId == 111) ) {
+        if (!Cools.isEmpty(matnr) && (staDescId == 1 || staDescId == 11 || staDescId == 111) && !mixture ) {
             //鏌ヨ鐩镐技宸ヤ綔妗f
             List<WrkMast> wrkMasts = wrkMastService.selectWrkMastWrkDetlMatnrBatch(staDescId, matnr, batch,grade, crnNo);
             int nearbay = 0;    //鐩镐技宸ヤ綔妗f 鐩爣搴撲綅鍒�
@@ -567,15 +567,6 @@
                     continue;
                 }
                 for (LocMast locMastGro1 : locMasts) {
-                    if (mixture){ //娣锋枡鍙厑璁告斁 7 12 14
-                        if (locMastGro1.getBay1() != 7 && locMastGro1.getBay1() != 12 && locMastGro1.getBay1() != 14){
-                            continue;
-                        }
-                    }else { //涓嶆贩鏂欎笉鍏佽鏀� 7 12 14
-                        if (locMastGro1.getBay1() == 7 || locMastGro1.getBay1() == 12 || locMastGro1.getBay1() == 14){
-                            continue;
-                        }
-                    }
 
                     if (locMastGro1.getBay1() == 2){ //wcs闂闄愬埗
                         continue;
@@ -630,7 +621,7 @@
         if (Cools.isEmpty(locMast) && crnNo != 0) {
             List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
                     .eq("bay1", nearRow)
-                    .eq("loc_sts", "O").eq("whs_type",rowLastnoType.getType().longValue())
+                    .in("loc_sts", "O","X").eq("whs_type",rowLastnoType.getType().longValue())
                     .eq("crn_no",7)
                     .eq("loc_type1",locTypeDto.getLocType1())
                     .orderBy("lev1",true).orderBy("row1",false));//鏈�娴呭簱浣�
@@ -674,6 +665,15 @@
                         continue;
                     }
                     for (LocMast locMastGro1 : locMasts1) {
+                        if (mixture){ //娣锋枡鍙厑璁告斁 7 12 14
+                            if (locMastGro1.getBay1() != 7 && locMastGro1.getBay1() != 12 && locMastGro1.getBay1() != 14){
+                                continue;
+                            }
+                        }else { //涓嶆贩鏂欎笉鍏佽鏀� 7 12 14
+                            if (locMastGro1.getBay1() == 7 || locMastGro1.getBay1() == 12 || locMastGro1.getBay1() == 14){
+                                continue;
+                            }
+                        }
                         if (locMastGro1.getLocSts().equals("F")){
                             LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_No", locMastGro1.getLocNo()));
                             if (!locDetl.getMatnr().equals(matnr) || !locDetl.getBatch().equals(batch)){

--
Gitblit v1.9.1