From e4ea838c20e94dff4fdbb4f82b542a8b5790fa9d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 18 六月 2021 09:22:06 +0800
Subject: [PATCH] # 库存跳转上报erp

---
 src/main/java/zy/cloud/wms/manager/controller/PriorController.java |   68 +++++++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 1 deletions(-)

diff --git a/src/main/java/zy/cloud/wms/manager/controller/PriorController.java b/src/main/java/zy/cloud/wms/manager/controller/PriorController.java
index bd1cb73..9c363c6 100644
--- a/src/main/java/zy/cloud/wms/manager/controller/PriorController.java
+++ b/src/main/java/zy/cloud/wms/manager/controller/PriorController.java
@@ -12,8 +12,12 @@
 import com.core.common.R;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import zy.cloud.wms.common.service.asrs.AsrsService;
 import zy.cloud.wms.common.web.BaseController;
-import zy.cloud.wms.manager.entity.Prior;
+import zy.cloud.wms.manager.entity.*;
+import zy.cloud.wms.manager.entity.param.StockTransferParam;
+import zy.cloud.wms.manager.service.MatService;
+import zy.cloud.wms.manager.service.NodeService;
 import zy.cloud.wms.manager.service.PriorService;
 
 import java.util.*;
@@ -23,6 +27,29 @@
 
     @Autowired
     private PriorService priorService;
+    @Autowired
+    private MatService matService;
+    @Autowired
+    private NodeService nodeService;
+    @Autowired
+    private AsrsService asrsService;
+
+    /**
+     * 瀹夊叏搴撳瓨璀﹀憡鍒嗛〉
+     * @param curr
+     * @param limit
+     * @param param
+     * @return
+     */
+    @RequestMapping(value = "/safeSto/list/auth")
+    @ManagerAuth
+    public R safeStoList(@RequestParam(defaultValue = "1")Integer curr,
+                  @RequestParam(defaultValue = "10")Integer limit,
+                  @RequestParam Map<String, Object> param){
+        return R.ok(priorService.getSafeQtyPage(toPage(curr, limit, param, SafeStoDo.class)));
+    }
+
+    /***************************************************/
 
     @RequestMapping(value = "/prior/{id}/auth")
     @ManagerAuth
@@ -60,6 +87,19 @@
     @RequestMapping(value = "/prior/add/auth")
     @ManagerAuth
     public R add(Prior prior) {
+        if (prior.getMatId() != null) {
+            Mat mat = matService.selectById(prior.getMatId());
+            if (mat != null) {
+                prior.setMatnr(mat.getMatnr());
+                prior.setMaktx(mat.getMaktx());
+            }
+        }
+        if (prior.getNodeId() != null) {
+            Node node = nodeService.selectById(prior.getNodeId());
+            if (node != null) {
+                prior.setNodeName(node.getName());
+            }
+        }
         prior.setCreateBy(getUserId());
         prior.setCreateTime(new Date());
         prior.setUpdateBy(getUserId());
@@ -74,6 +114,19 @@
     public R update(Prior prior){
         if (Cools.isEmpty(prior) || null==prior.getId()){
             return R.error();
+        }
+        if (prior.getMatId() != null) {
+            Mat mat = matService.selectById(prior.getMatId());
+            if (mat != null) {
+                prior.setMatnr(mat.getMatnr());
+                prior.setMaktx(mat.getMaktx());
+            }
+        }
+        if (prior.getNodeId() != null) {
+            Node node = nodeService.selectById(prior.getNodeId());
+            if (node != null) {
+                prior.setNodeName(node.getName());
+            }
         }
         prior.setUpdateBy(getUserId());
         prior.setUpdateTime(new Date());
@@ -131,4 +184,17 @@
         return R.ok();
     }
 
+    @RequestMapping(value = "/available/take/site")
+    @ManagerAuth
+    public R takeSite() {
+        Object response = asrsService.takeSite().getData();
+        return R.ok(response);
+    }
+
+    @RequestMapping(value = "/get/asrsLocDetl")
+    @ManagerAuth
+    public R getLocDetl(String matnr) {
+        Object response = asrsService.getAsrsLocDetl(matnr).getData();
+        return R.ok(response);
+    }
 }

--
Gitblit v1.9.1