| | |
| | | /** |
| | | * 温度实时 |
| | | * */ |
| | | @Scheduled(fixedRate = 4000,initialDelay = 2000) |
| | | //@Scheduled(fixedRate = 4000,initialDelay = 2000) |
| | | public void startRecordAndCheck(){ |
| | | List<BattCamera> ipInfoList = HikTempUtil.cameraInfoList; |
| | | List<PageParam> tempParmList = paramService.getTempParmList(); |
| | |
| | | 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(); |
| | |
| | | //温度告警判断 |
| | | //查询温度告警表,如果存在 |
| | | BattStationTempAlarm alarmInDB = alarmService.getByBattGroupId(battGroupId); |
| | | if(alarmInDB != null){ |
| | | if(alarmInDB != null){ // TODO 校验温度点位和逻辑,很重要!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| | | //如果存在,同时当前温度大于2级,则更新温度和告警等级 |
| | | if(battStationTemp.getMaxTemp()>=level2AlarmTemp){ |
| | | //温度相同,查看下告警等级是否一样 |
| | |
| | | }else{ |
| | | alarm.setLevel(2); |
| | | } |
| | | //添加最高温度点位 |
| | | alarm.setMaxTempPoint(battStationTemp.getMaxTempPoint()); |
| | | alarmService.add(alarm); |
| | | } |
| | | |
| | |
| | | String msg = response.getMsg(); |
| | | // TODO 报错日志记录 |
| | | } |
| | | }); |
| | | //}); |
| | | } |
| | | |
| | | } |