From 0cf7b6106614bab7e2054652043e32aeca06640f Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 24 四月 2023 16:42:54 +0800
Subject: [PATCH] 库位地图

---
 src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
index 9a1ea8f..6294b1e 100644
--- a/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -136,4 +136,48 @@
         return 1;
     }
 
+    @Override
+    public LocMast findNearloc(String locNo) {
+        int row = getRow(locNo);
+        LocMast locMast = null;
+        if (row>19) {
+            List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo);
+            if (!Cools.isEmpty(groupOuterLoc)) {
+                locMast = this.baseMapper.selectAvailableNearLocDesc(groupOuterLoc);
+            }
+
+        }else {
+            List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo);
+            if (!Cools.isEmpty(groupOuterLoc)) {
+                locMast = this.baseMapper.selectAvailableNearLocAsc(groupOuterLoc);
+            }
+        }
+        return locMast;
+    }
+
+    /**
+     * 閫氳繃搴撲綅鍙疯幏鍙� 鎺�
+     */
+    public static int getRow(String locNo) {
+        if (!Cools.isEmpty(locNo)) {
+            return Integer.parseInt(locNo.substring(0, 2));
+        }
+        throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+    }
+
+    @Override
+    public List<LocMast> selectAllPeakLoc() {
+        return this.baseMapper.selectAllPeakLoc();
+    }
+
+    @Override
+    public Boolean checkAllLocEmpty(List<String> groupOuterLoc) {
+        List<LocMast> result = this.baseMapper.selectAllLocNotEmpty(groupOuterLoc);
+        return result.size() <= 0;
+    }
+
+    @Override
+    public List<LocMast> selectLocByLev(Integer lev) {
+        return this.baseMapper.selectLocByLev(lev);
+    }
 }

--
Gitblit v1.9.1