From 4e237c87a21438b1fc115d344dfb0362747d14bb Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 18 九月 2024 14:19:08 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/controller/NodeController.java |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/NodeController.java b/src/main/java/com/zy/asrs/controller/NodeController.java
index 15baa78..b15b32c 100644
--- a/src/main/java/com/zy/asrs/controller/NodeController.java
+++ b/src/main/java/com/zy/asrs/controller/NodeController.java
@@ -151,10 +151,10 @@
     @RequestMapping(value = "/node/update/auth")
     @ManagerAuth
     public R update(Node node){
-        Node node1 = nodeService.selectByUuid(node.getName());
-        if (!Cools.isEmpty(node1)) {
-            throw new CoolException("璇ョ紪鍙�/鍚嶇О宸插瓨鍦�");
-        }
+//        Node node1 = nodeService.selectByUuid(node.getName());
+//        if (!Cools.isEmpty(node1)) {
+//            throw new CoolException("璇ョ紪鍙�/鍚嶇О宸插瓨鍦�");
+//        }
         if (Cools.isEmpty(node) || null==node.getId()){
             return R.error();
         }
@@ -348,7 +348,7 @@
         EntityWrapper<Node> nodeEntityWrapper = new EntityWrapper<>();
         nodeEntityWrapper.eq("id",param.getValue());
         nodeEntityWrapper.eq("name",param.getName());
-        nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue()));
+//        nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue()));
         Node node = nodeService.selectOne(nodeEntityWrapper);
         String[] string = node.getNamePath().split(",");
         int tno=1; int no=1;
@@ -385,7 +385,7 @@
                         }
 
                     }else {
-                        locNo = param.getName()+"-" +String.format("%02d", r) + String.format("%02d", b) + String.format("%02d", l);
+                        locNo = param.getName()+String.format("%02d", r) + String.format("%02d", b) + String.format("%02d", l);
                     }
 
                     //瀹㈡埛瑕佹眰鏍煎紡浣岮-01-01-01
@@ -416,10 +416,15 @@
                     node1.setRow1(r);
                     node1.setBay1(b);
                     node1.setLev1(l);
-                    if (!nodeService.insert(node1)){
-                        return R.error("鏁版嵁鎻掑叆澶辫触");
+                    try {
+                        if (!nodeService.insert(node1)){
+                            return R.error("鏁版嵁鎻掑叆澶辫触");
+                        }
+                    }catch (Exception e){
+                      throw new CoolException("搴撲綅鍙烽噸澶�");
                     }
 
+
                 }
             }
             if (param.getName().equals("DT-B")){

--
Gitblit v1.9.1