From 14ce780fb9977acad2b6dabf9033635b076f590b Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期六, 07 五月 2022 14:49:12 +0800
Subject: [PATCH] Changes

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java |   49 +++++++++++++++++++++++++++++++++++++------------
 1 files changed, 37 insertions(+), 12 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 b060adc..4db242a 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
@@ -7,6 +7,7 @@
 import com.sandu.common.domain.CommonPage;
 import com.sandu.common.domain.ResponseVO;
 import com.sandu.common.object.BaseConditionVO;
+import com.sandu.common.security.annotation.AnonymousAccess;
 import com.sandu.common.util.ResponseUtil;
 import com.sandu.ximon.admin.dto.DeviceStatus;
 import com.sandu.ximon.admin.param.PoleBindParam;
@@ -24,7 +25,6 @@
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import java.sql.Wrapper;
 import java.util.List;
 
 /**
@@ -87,6 +87,7 @@
     /**
      * 鍦ㄧ嚎鏁伴噺
      */
+    @AnonymousAccess
     @GetMapping("/online")
     public ResponseVO<Object> online() {
         return ResponseUtil.success(poleService.poleCount());
@@ -120,11 +121,11 @@
     public ResponseVO<Object> bindPole(@PathVariable Long poleId, @RequestBody @Validated PoleBindingParam param) {
         boolean result = poleService.bindPole(poleId, param);
         if (result) {
-            //璁惧绫诲瀷锛�0璺伅锛�1led灞忓箷锛�2鍏呯數妗╋紝3澶ф皵鐩戞祴锛�4姘磋川鐩戞祴锛�5ip闊虫煴锛�6lcd骞垮憡鏈猴紝7鎽勫儚澶达紝8鏉嗕綋鍊炬祴锛�9涓�閿晳鍔�
+            //璁惧绫诲瀷锛�0璺伅锛�1nove锛�2鍏呯數妗╋紝3澶ф皵鐩戞祴锛�4姘磋川鐩戞祴锛�5ip闊虫煴锛�6lcd骞垮憡鏈猴紝7鎽勫儚澶达紝8鏉嗕綋鍊炬祴锛�9涓�閿晳鍔�, 10鐔欒, 11鍐滆��
             switch (param.getDeviceType()) {
                 case 0:
                     Pole pole = poleService.getById(poleId);
-                    if (!pole.getDeviceCode().equals(param.getDeviceCode())) {
+                    if (pole != null) {
                         pole.setPoleName(param.getDeviceName());
                         pole.setDeviceCode(param.getDeviceCode());
                         poleService.updateById(pole);
@@ -150,6 +151,10 @@
                     break;
                 case 9:
                     break;
+                case 10:
+                    break;
+                case 11:
+                    break;
                 default:
                     break;
             }
@@ -167,9 +172,14 @@
     public ResponseVO<Object> unBindPole(@PathVariable Long poleId, @RequestBody @Validated PoleBindingParam param) {
         boolean result = poleService.unBindPole(poleId, param.getDeviceCode());
         if (result) {
-            //璁惧绫诲瀷锛�0璺伅锛�1led灞忓箷锛�2鍏呯數妗╋紝3澶ф皵鐩戞祴锛�4姘磋川鐩戞祴锛�5ip闊虫煴锛�6lcd骞垮憡鏈猴紝7鎽勫儚澶达紝8鏉嗕綋鍊炬祴锛�9涓�閿晳鍔�
+            //璁惧绫诲瀷锛�0璺伅锛�1led灞忓箷锛�2鍏呯數妗╋紝3澶ф皵鐩戞祴锛�4姘磋川鐩戞祴锛�5ip闊虫煴锛�6lcd骞垮憡鏈猴紝7鎽勫儚澶达紝8鏉嗕綋鍊炬祴锛�9涓�閿晳鍔�, 10鐔欒, 11鍐滆��
             switch (param.getDeviceType()) {
                 case 0:
+                    //鍒犻櫎鐏潌鐨刣evicescode
+                    Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, poleId));
+                    if (pole != null) {
+                        poleService.updateDeviceCode(pole.getId());
+                    }
                     break;
                 case 1:
                     break;
@@ -190,6 +200,10 @@
                 case 8:
                     break;
                 case 9:
+                    break;
+                case 10:
+                    break;
+                case 11:
                     break;
                 default:
                     break;
@@ -229,24 +243,35 @@
     public ResponseVO<Object> getOwnerPole(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword
             , @PathVariable Long cilentId) {
         List<Pole> results = poleService.getOwnerPole(baseConditionVO, keyword, cilentId);
-//        CommonPage commonPage = CommonPage.restPage(results);
-//        int size = results.size();
-//        commonPage.setTotal((long) size);
-//        commonPage.setTotalPage(size / baseConditionVO.getPageSize() + 1);
-//        if (size % baseConditionVO.getPageSize() == 0) {
-//            commonPage.setTotalPage(size / baseConditionVO.getPageSize());
-//        }
-//        return ResponseUtil.success(commonPage);
         return ResponseUtil.success(results);
     }
 
     /**
      * 鏌ョ湅鐏潌缁戝畾鐨勮澶�
      */
+    @AnonymousAccess
     @PostMapping("/getPoleBindDevice/{poleId}")
     public ResponseVO<Object> getPoleBindDevice(@PathVariable Long poleId) {
         return ResponseUtil.success(poleService.getBindByPoleId(poleId));
     }
 
 
+    /**
+     * 鎺ㄩ�佸ぇ姘旇澶囧埌璇虹摝
+     */
+    @AnonymousAccess
+    @GetMapping("/pushAidDataToNova/{poleId}")
+    public ResponseVO<Object> pushAirDataToNova(@PathVariable Long poleId) {
+        return ResponseUtil.success(poleService.pushAirDataToNova(poleId));
+    }
+
+    /**
+     * 鎺ㄩ�佸ぇ姘旇澶囧埌鐔欒
+     */
+    @AnonymousAccess
+    @GetMapping("/pushAirDataToXiXun/{poleId}")
+    public ResponseVO<Object> pushAirDataToXiXun(@PathVariable Long poleId) {
+        return ResponseUtil.success(poleService.pushAirDataToXiXun(poleId));
+    }
+
 }

--
Gitblit v1.9.3