| | |
| | | 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; |
| | |
| | | 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)); |
| | |
| | | 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()); |
| | |
| | | //实时获取电源信息(是否存在电源告警信息) |
| | | //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) { |