From 3e82c6026e76eeba916208cbe9e4a1411c04982e Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期三, 07 六月 2023 17:09:50 +0800
Subject: [PATCH] #

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

diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 38c15a0..964c038 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -112,6 +112,7 @@
         int start;
         int end;
         Integer matType = null;//鐗╂枡绫诲瀷
+        Integer crnNo  = 0;
         //鏍规嵁鍏ュ簱绔欙紝鍐冲畾鎼滅储鎸囧畾鍫嗗灈鏈�
         ArrayList<Integer> crnNos = new ArrayList<>();
         //鏍规嵁鍏ュ簱绔欙紝鎵惧埌搴撲綅缁勬渶鍐呬晶鎺�
@@ -131,6 +132,7 @@
                 rows.add(7);
                 rows.add(8);
                 rows.add(14);
+                crnNo = 1;
                 break;
             case 203://203鍏ュ簱绔�
                 whsType = 2;
@@ -146,6 +148,7 @@
                 rows.add(14);
                 rows.add(15);
                 rows.add(21);
+                crnNo = 3;
                 break;
             default:
                 throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
@@ -164,6 +167,24 @@
         if (locMast != null) {
             //鎵惧埌搴撲綅锛岃繑鍥瀌to
             sign=true;
+        }
+
+        //3鍙峰彲浠ュ叆搴撳墠蹇呴』鎵撳紑鎺у埗
+        if (!Cools.isEmpty(matNos) && crnNo==3) {
+            for (String matNo : matNos) {
+                Mat mat = matService.selectByMatnr(matNo);
+                if (matType == null) {
+                    matType = mat.getMatType();
+                }
+                if (!matType.equals(mat.getMatType())) {
+                    throw new CoolException("娣锋斁鐗╂枡绫诲瀷涓嶄竴鑷�");
+                }
+            }
+
+            if (matNos.size() > 1 && matType == 1) {
+                //鐗╂枡涓哄崟鍝佺被鍨嬶紝涓旂墿鏂欑绫昏秴杩�1(瀹為檯涓洪珮棰戞贩鏀�)锛屽垯绂佹鍏ュ簱
+                throw new CoolException("鐗╂枡绫诲瀷鍜屽疄闄呯绫讳笉涓�鑷�");
+            }
         }
 
         if (!sign && matType != null) {
@@ -223,23 +244,6 @@
         }
 
         if (sign){
-            //3鍙峰彲浠ュ叆搴撳墠蹇呴』鎵撳紑鎺у埗
-            if (!Cools.isEmpty(matNos) && locMast.getCrnNo()==3) {
-                for (String matNo : matNos) {
-                    Mat mat = matService.selectByMatnr(matNo);
-                    if (matType == null) {
-                        matType = mat.getMatType();
-                    }
-                    if (!matType.equals(mat.getMatType())) {
-                        throw new CoolException("娣锋斁鐗╂枡绫诲瀷涓嶄竴鑷�");
-                    }
-                }
-
-                if (matNos.size() > 1 && matType == 1) {
-                    //鐗╂枡涓哄崟鍝佺被鍨嬶紝涓旂墿鏂欑绫昏秴杩�1(瀹為檯涓洪珮棰戞贩鏀�)锛屽垯绂佹鍏ュ簱
-                    throw new CoolException("鐗╂枡绫诲瀷鍜屽疄闄呯绫讳笉涓�鑷�");
-                }
-            }
             return getLocNoFinalStep(staDescId, sourceStaNo, locMast);//杩斿洖dto
         }
         //----------------2023.06.02鍏煎浠g爜end---------------------

--
Gitblit v1.9.1