From b0f679bdaa1b5483d7abb4e8524a5fd8f43ab525 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期二, 26 十二月 2023 15:14:15 +0800
Subject: [PATCH] #

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/WorkController.java                 |   25 +++++++++++++++++++++++++
 zy-asrs-common/src/main/java/com/zy/asrs/common/wms/mapper/BasDevpMapper.java            |    2 ++
 zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/BasDevpServiceImpl.java |    5 +++++
 zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/BasDevpService.java          |    6 ++++++
 zy-asrs-common/src/main/resources/mapper/wms/BasDevpMapper.xml                           |   11 +++++++++++
 5 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/mapper/BasDevpMapper.java b/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/mapper/BasDevpMapper.java
index 79abd32..897d769 100644
--- a/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/mapper/BasDevpMapper.java
+++ b/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/mapper/BasDevpMapper.java
@@ -14,4 +14,6 @@
 
     List<Integer> getAvailableInSite(@Param("typeNo") Integer typeNo);
 
+    List<Integer> getAvailableOutSite(@Param("typeNo") Integer typeNo);
+
 }
diff --git a/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/BasDevpService.java b/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/BasDevpService.java
index f2ed685..30db70e 100644
--- a/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/BasDevpService.java
+++ b/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/BasDevpService.java
@@ -13,4 +13,10 @@
      */
     List<Integer> getAvailableInSite();
 
+    /**
+     * 鍑哄簱绔�
+     * @return
+     */
+    List<Integer> getAvailableOutSite(Integer typeNo);
+
 }
diff --git a/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/BasDevpServiceImpl.java b/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/BasDevpServiceImpl.java
index 4c38b0f..4f22146 100644
--- a/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/BasDevpServiceImpl.java
+++ b/zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/BasDevpServiceImpl.java
@@ -16,4 +16,9 @@
         return this.baseMapper.getAvailableInSite(1);
     }
 
+    @Override
+    public List<Integer> getAvailableOutSite(Integer typeNo) {
+        return this.baseMapper.getAvailableOutSite(typeNo);
+    }
+
 }
diff --git a/zy-asrs-common/src/main/resources/mapper/wms/BasDevpMapper.xml b/zy-asrs-common/src/main/resources/mapper/wms/BasDevpMapper.xml
index 1968052..740c036 100644
--- a/zy-asrs-common/src/main/resources/mapper/wms/BasDevpMapper.xml
+++ b/zy-asrs-common/src/main/resources/mapper/wms/BasDevpMapper.xml
@@ -13,4 +13,15 @@
         group by abd.dev_no
     </select>
 
+    <select id="getAvailableOutSite" resultType="java.lang.Integer">
+        select
+            abd.dev_no
+        from asr_bas_devp abd
+                 left join asr_sta_desc asd on abd.dev_no = asd.stn_no
+        where 1=1
+          and asd.type_no = #{typeNo}
+        -- and abd.out_enable = 'Y'
+        group by abd.dev_no
+    </select>
+
 </mapper>
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/WorkController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/WorkController.java
index ccdb541..9be10c3 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/WorkController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/WorkController.java
@@ -10,6 +10,11 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * 宸ヤ綔娴佹帴鍙f帶鍒跺櫒
  * Created by vincent on 2020/6/10
@@ -30,5 +35,25 @@
         return R.ok().add(basDevpService.getAvailableInSite());
     }
 
+    @RequestMapping("/available/take/site")
+    @ManagerAuth()
+    public R availableTakeSite(){
+        List<Map<String, Object>> result = new ArrayList<>();
+        List<Integer> outSite = basDevpService.getAvailableOutSite(101);
+        for (Integer siteId : outSite) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("siteId", siteId);
+            map.put("desc", siteId + "锛堝叏鏉垮嚭搴撳彛锛�");
+            result.add(map);
+        }
+        List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103);
+        for (Integer siteId : pickOutSite) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("siteId", siteId);
+            map.put("desc", siteId + "锛堟嫞鏂欏嚭搴撳彛锛�");
+            result.add(map);
+        }
+        return R.ok().add(result);
+    }
 
 }

--
Gitblit v1.9.1