From 5698756677e5e28553e2455e6714147387196608 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期六, 17 八月 2024 11:20:27 +0800
Subject: [PATCH] #

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java
index 1312609..3c9330c 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java
@@ -6,6 +6,7 @@
 import com.zy.asrs.wms.asrs.entity.*;
 import com.zy.asrs.wms.asrs.entity.enums.LocStsType;
 import com.zy.asrs.wms.asrs.entity.enums.LocTypeHeightType;
+import com.zy.asrs.wms.asrs.entity.enums.ShelvesRuleType;
 import com.zy.asrs.wms.asrs.mapper.ViewLocDetlMapper;
 import com.zy.asrs.wms.asrs.mapper.ViewTaskDetlMapper;
 import com.zy.asrs.wms.asrs.service.*;
@@ -80,7 +81,7 @@
     }
 
     //鑾峰彇鎺ㄨ崘搴撲綅(婊℃墭鐩�)
-    public List<Loc> getSuggestLoc(Long taskType, Long matId, String batch, Integer locTypeHeight, List<Integer> laneRowList) {
+    public List<Loc> getSuggestLoc(Long taskType, Long matId, String batch, Integer locTypeHeight, List<Integer> laneRowList, Integer currentLev) {
         //婊℃墭鐩�
         List<Loc> locs = new ArrayList<>();
         LocTypeHeightType locTypeHeightType = LocTypeHeightType.get(locTypeHeight);
@@ -114,6 +115,10 @@
                 queryWrapper.in(Loc::getRow1, laneRowList);
             }
 
+            if (currentLev != null) {
+                queryWrapper.eq(Loc::getLev1, currentLev);
+            }
+
             List<Loc> list = locService.list(queryWrapper);
             if (!list.isEmpty()) {
                 locs.addAll(list);
@@ -123,7 +128,7 @@
     }
 
     //鑾峰彇鍏ㄥ眬搴撲綅(瀹屾暣宸烽亾)
-    public List<Loc> getGlobalLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList) {
+    public List<Loc> getGlobalLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList, Integer currentLev) {
         List<Loc> locs = new ArrayList<>();
         LocTypeHeightType locTypeHeightType = LocTypeHeightType.get(locTypeHeight);
         if (locTypeHeightType == null) {
@@ -140,6 +145,10 @@
 
         if (laneRowList != null && !laneRowList.isEmpty()) {
             queryWrapper.in(Loc::getRow1, laneRowList);
+        }
+
+        if (currentLev != null) {
+            queryWrapper.eq(Loc::getLev1, currentLev);
         }
 
         List<Loc> list = locService.list(queryWrapper);
@@ -280,7 +289,7 @@
     }
 
     //鑾峰彇鎺ㄨ崘搴撲綅(绌烘墭鐩�)
-    public List<Loc> getSuggestEmptyLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList) {
+    public List<Loc> getSuggestEmptyLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList, Integer currentLev) {
         List<Loc> locs = new ArrayList<>();
         //绌烘墭鐩�
         List<SuggestLocRule> suggestLocRules = suggestLocRuleService.list(new LambdaQueryWrapper<SuggestLocRule>().eq(SuggestLocRule::getLocType, 0));
@@ -298,6 +307,10 @@
                 queryWrapper.in(Loc::getRow1, laneRowList);
             }
 
+            if (currentLev != null) {
+                queryWrapper.eq(Loc::getLev1, currentLev);
+            }
+
             List<Loc> list = locService.list(queryWrapper);
             if (!list.isEmpty()) {
                 locs.addAll(list);
@@ -307,7 +320,7 @@
     }
 
     //鑾峰彇鍏ㄥ眬搴撲綅(瀹屾暣宸烽亾)
-    public List<Loc> getGlobalEmptyLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList) {
+    public List<Loc> getGlobalEmptyLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList, Integer currentLev) {
         List<Loc> locs = new ArrayList<>();
         LocTypeHeightType locTypeHeightType = LocTypeHeightType.get(locTypeHeight);
         if (locTypeHeightType == null) {
@@ -326,6 +339,10 @@
             queryWrapper.in(Loc::getRow1, laneRowList);
         }
 
+        if (currentLev != null) {
+            queryWrapper.eq(Loc::getLev1, currentLev);
+        }
+
         List<Loc> list = locService.list(queryWrapper);
         if (!list.isEmpty()) {
             locs.addAll(list);

--
Gitblit v1.9.1