From 35b68d05c92ae1eab2e409529a070a217ba492ae Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期一, 25 四月 2022 09:53:23 +0800
Subject: [PATCH] fix 客户列表bug修复
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
index 27d1be0..5e8e708 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -33,6 +33,7 @@
import com.sandu.ximon.admin.vo.PoleBindVO;
import com.sandu.ximon.dao.bo.*;
import com.sandu.ximon.dao.domain.*;
+import com.sandu.ximon.dao.mapper.MonitorMapper;
import com.sandu.ximon.dao.mapper.PoleMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -57,11 +58,13 @@
private final PoleBindingService poleBindingService;
private final PoleGroupRelationService groupRelationService;
private final ClientService clientService;
+ private final PoleMapper poleMapper;
public boolean addPole(PoleParam param) {
Pole pole = new Pole();
BeanUtils.copyProperties(param, pole);
pole.setPoleCode(generatePoleCode());
+ pole.setDeviceType(-1);
return save(pole);
}
@@ -819,9 +822,12 @@
public Pole getPoleByMac(Long poleId) {
Pole one = getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, poleId));
ArrayList<String> macs = new ArrayList<>();
+
macs.add(one.getDeviceCode());
List<DeviceStatus> deviceStatuses = listStatusByDeviceCode(macs);
- if (deviceStatuses.get(0).getStatus() == 0) {
+ if (one.getDeviceCode() == null || one.getDeviceType() == null || one.getDeviceType() == -1) {
+ one.setOnLineState("铏氭嫙鐏潌");
+ } else if (deviceStatuses.get(0).getStatus() == 0) {
one.setOnLineState("绂荤嚎");
} else if (deviceStatuses.get(0).getStatus() == 1) {
one.setOnLineState("鍦ㄧ嚎");
@@ -845,4 +851,9 @@
// return energy;
// }
+
+ public boolean updateDeviceCode(Long poleId) {
+ return poleMapper.updateDeviceCode(poleId);
+ }
+
}
\ No newline at end of file
--
Gitblit v1.9.3