From be51c67ce88a3b1fe0aee057f55883cb57b58be5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 07 四月 2021 09:40:05 +0800
Subject: [PATCH] #

---
 src/main/java/zy/cloud/wms/manager/controller/PriorController.java |   51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 50 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..52cda01 100644
--- a/src/main/java/zy/cloud/wms/manager/controller/PriorController.java
+++ b/src/main/java/zy/cloud/wms/manager/controller/PriorController.java
@@ -13,7 +13,9 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 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.service.MatService;
+import zy.cloud.wms.manager.service.NodeService;
 import zy.cloud.wms.manager.service.PriorService;
 
 import java.util.*;
@@ -23,6 +25,27 @@
 
     @Autowired
     private PriorService priorService;
+    @Autowired
+    private MatService matService;
+    @Autowired
+    private NodeService nodeService;
+
+    /**
+     * 瀹夊叏搴撳瓨璀﹀憡鍒嗛〉
+     * @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 +83,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());
@@ -75,6 +111,19 @@
         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());
         priorService.updateById(prior);

--
Gitblit v1.9.1