lxw
2023-12-18 72bf6da7c81d4da621552a3fc68a0eb87e417be0
websocket推送加nowTime,recordTime
1个文件已修改
17 ■■■■■ 已修改文件
src/main/java/com/whyc/service/CKPowerDevSignalService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/CKPowerDevSignalService.java
@@ -9,9 +9,11 @@
import com.whyc.pojo.db_ckpwrdev_data_rt.CKPowerDevSignal;
import com.whyc.pojo.db_ckpwrdev_data_rt.CKPowerDevSignalSet;
import com.whyc.util.CommonUtil;
import com.whyc.util.DateUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -41,11 +43,11 @@
    //头部开关统计
    public Response getSwitchReal(){
        Map<String,Integer> map=new HashMap<>();
        map.put("onSwitch",0);
        map.put("offSwitch",0);
        //map.put("alarmSwitch",0);
        //map.put("runSwitch",0);
        Map<String,String> map=new HashMap<>();
        map.put("onSwitch","0");
        map.put("offSwitch","0");
        map.put("nowTime",DateUtil.format_YYYY_MM_DD_HH_MM_SS(new Date()));
        map.put("recordTime",DateUtil.format_YYYY_MM_DD_HH_MM_SS(new Date()));
        QueryWrapper<CKPowerDevSignal> query = Wrappers.query();
        query.last(" limit 1");
        CKPowerDevSignal switchReal=mapper.selectOne(query);
@@ -135,11 +137,12 @@
            }else{
                onSwitch+= CommonUtil.getIntToBinary(switchReal.getDc2Switch4TripFake());
            }
            map.put("recordTime", DateUtil.format_YYYY_MM_DD_HH_MM_SS(switchReal.getRecordTime()));
        }
        map.put("onSwitch",onSwitch);
        map.put("onSwitch",String.valueOf(onSwitch));
        //获取总的启用断路器开关数
        int swtichAll=breakerInfMapper.getSwtichAll();
        map.put("offSwitch",swtichAll-onSwitch);
        map.put("offSwitch",String.valueOf(swtichAll-onSwitch));
        return new Response().set(1,map);
    }
}