From 84403b5ebe123b200f4bfba5848dd8307d99e8d2 Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期二, 10 六月 2025 17:20:58 +0800
Subject: [PATCH] 实时推送添加状态对应关系

---
 src/main/java/com/whyc/webSocket/RealTimeSocket.java |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/whyc/webSocket/RealTimeSocket.java b/src/main/java/com/whyc/webSocket/RealTimeSocket.java
index 040de90..e7307e4 100644
--- a/src/main/java/com/whyc/webSocket/RealTimeSocket.java
+++ b/src/main/java/com/whyc/webSocket/RealTimeSocket.java
@@ -1,6 +1,7 @@
 package com.whyc.webSocket;
 
 import com.whyc.config.WebSocketConfig;
+import com.whyc.constant.BattStateEnum;
 import com.whyc.constant.DevStateEnum;
 import com.whyc.constant.FailReasonEnum;
 import com.whyc.constant.StopReasonEnum;
@@ -204,6 +205,7 @@
             BattRtstate battRtstate = battRtstateService.getBattRealInfo(realDto.getBattgroupId());
             if (battRtstate != null) {
                 topDto.setBattState(battRtstate.getBattState());
+                topDto.setBattStateName(BattStateEnum.getValue(battRtstate.getBattState()));
                 topDto.setVbusVol(battRtstate.getVbusVol());
                 topDto.setOnlineVol(battRtstate.getOnlineVol());
                 topDto.setRecordtime(ThreadLocalUtil.format(battRtstate.getRecDatetime(),1));
@@ -232,6 +234,7 @@
             DeviceState deviceState = deviceStateService.getDevRealInfo(realDto.getDevId());
             if (deviceState != null) {
                 topDto.setDevState(deviceState.getDevWorkstate());
+                topDto.setDevStateName(DevStateEnum.getValue(deviceState.getDevWorkstate()));
                 if (deviceState.getDevWorkstate() == DevStateEnum.DEVSTATE_2.getStateId()) {//鏍稿鏀剧數
                     topDto.setCaptestGroupvol(deviceState.getDevCaptestGroupvol());
                     topDto.setCaptestCurr(deviceState.getDevCaptestCurr());
@@ -260,10 +263,12 @@
                 //瀹炴椂鑾峰彇鐢垫簮淇℃伅(鏄惁瀛樺湪鐢垫簮鍛婅淇℃伅)
                 //PwrdevAcdcdata pwrdevAcdcdata = pwrdevAcdcdataService.getPwrRealInfo(realDto.getPowerId());
                 topDto.setPwrState((pwrALmNum > 0 ? 1 : 0));
+                topDto.setPwrStateName((pwrALmNum > 0 ? "鐢垫簮寮傚父" : "鐢垫簮姝e父"));
 
                 Integer allALmNum = battALmNum + devALmNum + pwrALmNum;
                 topDto.setAllALmNum(allALmNum);
                 topDto.setSystemState((allALmNum > 0 ? 1 : 0));
+                topDto.setSystemStateName((allALmNum > 0 ? "绯荤粺寮傚父" : "绯荤粺姝e父"));
             }
             return new Response().setII(1, true, topDto, "瀹炴椂椤甸潰澶撮儴鏁版嵁鎺ㄩ��");
         } catch (Exception e) {

--
Gitblit v1.9.1