From 28239b573a4be5e7678de8c65279153a7b17b760 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期日, 18 六月 2023 16:47:49 +0800
Subject: [PATCH] #库位地图添加虚拟库位

---
 src/main/java/com/zy/asrs/controller/NodeController.java |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/NodeController.java b/src/main/java/com/zy/asrs/controller/NodeController.java
index 918c71c..81a8d29 100644
--- a/src/main/java/com/zy/asrs/controller/NodeController.java
+++ b/src/main/java/com/zy/asrs/controller/NodeController.java
@@ -345,7 +345,7 @@
     }
 
     @RequestMapping(value = "/node/init/auth")
-    @ManagerAuth(memo = "鍒濆鍖栧簱浣�")
+    @ManagerAuth(memo = "骞冲簱搴撲綅鍒濆鍖�")
     @Transactional
     public R init(NodeInitPatam param) {
         List<Node> list = new ArrayList<>();
@@ -355,15 +355,49 @@
         nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue()));
         Node node = nodeService.selectOne(nodeEntityWrapper);
         String[] string = node.getNamePath().split(",");
-        for (int r=param.getStartRow(); r<=param.getEndRow(); r++){
-            for (int b=param.getStartBay(); b<=param.getEndBay(); b++) {
+        int tno=1; int no=1;
+        for (int b=param.getStartBay(); b<=param.getEndBay(); b++) {
+            for (int r=param.getStartRow(); r<=param.getEndRow(); r++){
                 for (int l=param.getStartLev(); l<=param.getEndLev(); l++) {
                     // 鑾峰彇搴撲綅鍙�
                     String locNo;
 
-                        locNo = param.getName()+"-" +String.format("%02d", r) + String.format("%02d", b) + String.format("%02d", l);
+                    if (param.getName().equals("DT-B")){
+                        if (b == 2 || b ==4 || b == 7){
+                            if (l == 1){
+                                locNo = param.getName()+"T-" +String.format("%02d", tno) + String.format("%02d", r) + String.format("%02d", l);
+                            }else {
+                                locNo = null;
+                            }
 
 
+                        }else {
+                            locNo = param.getName()+"-" +String.format("%02d", no) + String.format("%02d", r) + String.format("%02d", l);
+
+                        }
+                    }else if (param.getName().equals("DT-C") || param.getName().equals("DT-D")){
+                        if (b == 3 || b ==6 || b == 9 || b == 12 || b == 15 || b == 17 || b == 20 || b == 23){
+                            if (l == 1){
+                                locNo = param.getName()+"T-" +String.format("%02d", tno) + String.format("%02d", r) + String.format("%02d", l);
+                            }else {
+                                locNo = null;
+                            }
+
+                        }else {
+                            locNo = param.getName()+"-" +String.format("%02d", no) + String.format("%02d", r) + String.format("%02d", l);
+
+                        }
+
+                    }else {
+                        locNo = param.getName()+"-" +String.format("%02d", b) + String.format("%02d", r) + String.format("%02d", l);
+                    }
+
+
+
+
+                    if (locNo == null){
+                        continue;
+                    }
 
                     Date now =  new Date();
                     Node node1 = new Node();
@@ -389,6 +423,22 @@
 
                 }
             }
+            if (param.getName().equals("DT-B")){
+                if (b == 2 || b ==4 || b == 7){
+                    tno++;
+                }else {
+                    no++;
+                }
+            }else if (param.getName().equals("DT-C") || param.getName().equals("DT-D")){
+                if (b == 3 || b ==6 || b == 9 || b == 12 || b == 15 || b == 17 || b == 20 || b == 23){
+                    tno++;
+                }else {
+                    no++;
+                }
+
+            }
+
+
         }
 //
 //        nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue()));

--
Gitblit v1.9.1