From f78a9e03ae3f455a85dfd4d8a258dc0fbbb9e694 Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期三, 20 四月 2022 15:39:36 +0800
Subject: [PATCH] fix

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java
index e6ae5f0..a211079 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java
@@ -35,9 +35,10 @@
 //        }
         LambdaQueryWrapper<PoleBinding> eq = Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId);
         List<PoleBinding> list = list(eq);
-        if (list.size() != 0){
+        if (list.size() != 0) {
             for (PoleBinding poleBinding : list) {
-                if (poleBinding.getDeviceType().equals(deviceType)) {
+                //鍏呯數妗╃殑缁戝畾鏄綉缁滆姹傛槸甯﹁繃鏉ョ殑鐏潌淇℃伅锛岃鍏佽鐩存帴淇敼
+                if (poleBinding.getDeviceType().equals(deviceType) && deviceType != 2) {
                     throw new BusinessException("璇ョ伅鏉嗗凡缁戝畾杩囩浉鍚岀被鍨嬭澶�");
                 }
             }
@@ -52,7 +53,11 @@
             poleBinding.setDeviceCode(param.getDeviceCode());
             return save(poleBinding);
         } else {
-            throw new BusinessException("璇ヨ澶囧凡缁戝畾杩�");
+            one.setPoleId(poleId);
+            one.setDeviceType(param.getDeviceType());
+            one.setDeviceName(param.getDeviceName());
+            one.setDeviceCode(param.getDeviceCode());
+            return updateById(one);
         }
     }
 

--
Gitblit v1.9.3