From 2611d27616bdbea6331f75a0147bd67c95f2eb0e Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 04 十一月 2022 13:56:34 +0800
Subject: [PATCH] changes

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java |   10 +++++-----
 ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java  |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java
index 675a20b..eee4acf 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java
@@ -223,7 +223,7 @@
         if (!permissionConfig.check(MenuEnum.UNBIND.getCode())) {
             return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
         }
-        boolean result = poleService.unBindPole(poleId, param.getDeviceCode(),param.getDeviceType());
+        boolean result = poleService.unBindPole(poleId, param.getDeviceCode(), param.getDeviceType());
         if (result) {
             //璁惧绫诲瀷锛�0璺伅锛�1led灞忓箷锛�2鍏呯數妗╋紝3澶ф皵鐩戞祴锛�4姘磋川鐩戞祴锛�5ip闊虫煴锛�6lcd骞垮憡鏈猴紝7鎽勫儚澶达紝8鏉嗕綋鍊炬祴锛�9涓�閿晳鍔�, 10鐔欒, 11鍐滆��
             switch (param.getDeviceType().toString()) {
@@ -397,7 +397,7 @@
             throw new BusinessException("鎾斁鏃堕棿闇�澶т簬闆朵笖灏忎簬86400000 !");
         }
         VnnoxResult vnnoxResult = poleService.pushAirDataToNova(param);
-        if (vnnoxResult == null && vnnoxResult.getSuccess() != null && vnnoxResult.getSuccess().size() != 0) {
+        if (vnnoxResult != null && vnnoxResult.getSuccess() != null && !vnnoxResult.getSuccess().isEmpty()) {
             return ResponseUtil.success("鎺ㄩ�佹垚鍔�");
         } else {
             return ResponseUtil.fail("鎺ㄩ�佸け璐�");
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 9d4f0cd..75b370e 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
@@ -103,7 +103,7 @@
         }
 
 
-        LambdaQueryWrapper<PoleBinding> eq = Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId);
+        LambdaQueryWrapper<PoleBinding> eq = Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceType, param.getDeviceType()).eq(PoleBinding::getPoleId, poleId);
         List<PoleBinding> list = list(eq);
         if (list.size() != 0) {
             for (PoleBinding poleBinding : list) {
@@ -114,7 +114,8 @@
             }
         }
 
-        PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, param.getDeviceCode()));
+        PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, param.getDeviceCode())
+                .eq(PoleBinding::getDeviceType, param.getDeviceType()));
         if (one == null) {
             //鍏呯數妗╀繚瀛樼粦瀹氬叧绯婚渶瑕佸厛鍒ゆ柇鏄笉鏄纭殑鐏潌
             if (deviceType == 2) {
@@ -191,13 +192,12 @@
     }
 
 
-
     /**
      * 鐏潌瑙g粦璁惧锛屽垹闄よ澶囧墠闇�瑕佽В缁�
      *
      * @param deviceCode
      */
-    public boolean unBindPole(Long poleId, String deviceCode,Integer deviceType) {
+    public boolean unBindPole(Long poleId, String deviceCode, Integer deviceType) {
         if (deviceCode == null) {
             throw new BusinessException("璁惧缂栧彿涓嶈兘涓虹┖");
         }
@@ -243,7 +243,7 @@
     }
 
     public PoleBinding getPoleIdByMac(String deviceCode) {
-        return getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode).eq(PoleBinding::getDeviceType,0));
+        return getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode).eq(PoleBinding::getDeviceType, 0));
     }
 
 

--
Gitblit v1.9.3