From 0245612378ff186c1957952acf182a1d2e9b88d2 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期五, 04 八月 2023 08:59:21 +0800
Subject: [PATCH] #组托过滤同库位

---
 src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
index 523522b..603fc03 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -1,6 +1,7 @@
 package com.zy.asrs.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.core.common.BaseRes;
@@ -169,6 +170,10 @@
         for (StockOutParam.LocDetl locDetl : param.getLocDetls()) {
             //鑾峰彇鍚屼竴搴撲綅缁勭殑澶栦晶搴撲綅鍙�
             List<String> groupOuterSingleLoc = Utils.getGroupOuterSingleLoc(locDetl.getLocNo());
+            if (Utils.getBay(locDetl.getLocNo())>=21){
+                groupOuterSingleLoc = Utils.getGroupOuterSingleLocLowFrequency(locDetl.getLocNo());
+            }
+
             for (String locNo : groupOuterSingleLoc) {
                 //姣忎釜搴撲綅鐨勫簱浣嶆槑缁�
                 if(locs.contains(locNo)) continue;
@@ -574,7 +579,7 @@
                         if (Cools.isEmpty(mat)) {
                             throw new CoolException(locDetl.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�");
                         }
-                        int zpallet = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", locDetl.getZpallet()));
+                        int zpallet = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", locDetl.getZpallet()).ne("loc_no",locDetl.getLocNo()));
                         if (zpallet>0) {
                             throw new CoolException(locDetl.getZpallet() + "鍏ュ簱閫氱煡妗d腑宸插瓨鍦�");
                         }
@@ -1437,6 +1442,8 @@
         if (!wrkMastRes || !locMastRes) {
             throw new CoolException("淇濆瓨鏁版嵁澶辫触");
         }
+        WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()));
+        waitPakinService.delete(new EntityWrapper<>(waitPakin));
     }
 
     @Override

--
Gitblit v1.9.1