whyclxw
2025-06-10 84403b5ebe123b200f4bfba5848dd8307d99e8d2
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 ? "电源异常" : "电源正常"));
                Integer allALmNum = battALmNum + devALmNum + pwrALmNum;
                topDto.setAllALmNum(allALmNum);
                topDto.setSystemState((allALmNum > 0 ? 1 : 0));
                topDto.setSystemStateName((allALmNum > 0 ? "系统异常" : "系统正常"));
            }
            return new Response().setII(1, true, topDto, "实时页面头部数据推送");
        } catch (Exception e) {