From b67bd85fbe51486dcacf5a5e3b308e4a0f3e2e43 Mon Sep 17 00:00:00 2001
From: liuhaonan <konodioda2333@vip.qq.com>
Date: 星期日, 24 四月 2022 18:35:42 +0800
Subject: [PATCH] bug修复
---
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 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 0d0d1f8..2a58f9c 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
@@ -2,11 +2,13 @@
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ArrayUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
import com.sandu.common.domain.CommonPage;
import com.sandu.common.domain.ResponseVO;
import com.sandu.common.object.BaseConditionVO;
import com.sandu.common.util.ResponseUtil;
+import com.sandu.common.util.SpringContextHolder;
import com.sandu.ximon.admin.dto.DeviceStatus;
import com.sandu.ximon.admin.param.PoleBindParam;
import com.sandu.ximon.admin.param.PoleBindingParam;
@@ -23,6 +25,7 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
+import java.sql.Wrapper;
import java.util.List;
/**
@@ -118,9 +121,15 @@
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鐔欒
switch (param.getDeviceType()) {
case 0:
+ Pole pole = poleService.getById(poleId);
+ if (pole != null) {
+ pole.setPoleName(param.getDeviceName());
+ pole.setDeviceCode(param.getDeviceCode());
+ poleService.updateById(pole);
+ }
break;
case 1:
break;
@@ -142,6 +151,8 @@
break;
case 9:
break;
+ case 10:
+ break;
default:
break;
}
@@ -156,12 +167,17 @@
* 鐏潌缁戝畾璁惧
*/
@PostMapping("/unBind/{poleId}")
- public ResponseVO<Object> unBindPole(@PathVariable Long poleId, @RequestBody @Validated PoleBindingParam param) {
+ public ResponseVO<Object> unBindPole(@PathVariable Long poleId, @RequestBody 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鐔欒
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;
@@ -183,6 +199,8 @@
break;
case 9:
break;
+ case 10:
+ break;
default:
break;
}
--
Gitblit v1.9.3