whycxzp
2025-04-02 1ff909849a2bde88e00ed8f21c33c2cd184d6448
先去除实时温度的定时获取,便于调试
1个文件已修改
10 ■■■■■ 已修改文件
src/main/java/com/whyc/schedule/BattStationTempScheduleService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/schedule/BattStationTempScheduleService.java
@@ -49,7 +49,7 @@
    /**
     * 温度实时
     * */
    @Scheduled(fixedRate = 4000,initialDelay = 2000)
    //@Scheduled(fixedRate = 4000,initialDelay = 2000)
    public void startRecordAndCheck(){
        List<BattCamera> ipInfoList = HikTempUtil.cameraInfoList;
        List<PageParam> tempParmList = paramService.getTempParmList();
@@ -57,7 +57,7 @@
        Integer level1AlarmTemp = tempParmList.get(1).getValue();
        for (int i = 0; i < ipInfoList.size(); i++) {
            BattCamera cameraInfo = ipInfoList.get(i);
            ThreadPoolExecutorFactory.getPoolExecutor().execute(()-> {
            //ThreadPoolExecutorFactory.getPoolExecutor().execute(()-> {
                String ip = cameraInfo.getCameraIp();
                String cameraId = cameraInfo.getCameraId();
                Integer battGroupId = cameraInfo.getBattGroupId();
@@ -113,7 +113,7 @@
                    //温度告警判断
                    //查询温度告警表,如果存在
                    BattStationTempAlarm alarmInDB = alarmService.getByBattGroupId(battGroupId);
                    if(alarmInDB != null){
                    if(alarmInDB != null){ // TODO 校验温度点位和逻辑,很重要!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                        //如果存在,同时当前温度大于2级,则更新温度和告警等级
                        if(battStationTemp.getMaxTemp()>=level2AlarmTemp){
                            //温度相同,查看下告警等级是否一样
@@ -166,6 +166,8 @@
                        }else{
                            alarm.setLevel(2);
                        }
                        //添加最高温度点位
                        alarm.setMaxTempPoint(battStationTemp.getMaxTempPoint());
                        alarmService.add(alarm);
                    }
@@ -173,7 +175,7 @@
                    String msg = response.getMsg();
                    // TODO 报错日志记录
                }
            });
            //});
        }
    }