| | |
| | | }).collect(Collectors.toList()).stream().mapToDouble(Double::doubleValue).sum()); |
| | | log.info("culValue:" + culValue); |
| | | |
| | | |
| | | // 生成预警信息 |
| | | AlarmMessageRespDTO alarmMessage = new AlarmMessageRespDTO(); |
| | | alarmMessage.setConfigId(configItem.getId()); |
| | |
| | | alarmMessage.setAlarmTime(predictTime); |
| | | log.info("对比累计值是否超限"); |
| | | StringBuilder content = new StringBuilder(); |
| | | content.append(configItem.getTitle().replace("预警", "")); |
| | | if (configItem.getCulUpper() != null && culValue.compareTo(configItem.getCulUpper()) > 0) { |
| | | content.append("即将超出累计值上限"); |
| | | alarmMessage.setAlarmType(CommonConstant.EXCEEDING_UPPER_LIMIT); |
| | |
| | | alarmList.add(alarmMessage); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | log.info("对比预测值是否超限"); |
| | | int toIndex = result.size(); |
| | |
| | | alarmMessage.setContent(content.toString()); |
| | | mcsApi.createAlarmMessage(alarmMessage); |
| | | alarmList.add(alarmMessage); |
| | | break; |
| | | } |
| | | } |
| | | } |