Browse Source

维保计算添加日志信息

miaolijing 2 years ago
parent
commit
31d927ceec

+ 5 - 1
src/main/java/com/persagy/apm/diagnose/maintenance/service/impl/ProjectDataRecordServiceImpl.java

@@ -417,10 +417,12 @@ public class ProjectDataRecordServiceImpl implements IProjectDataRecordService {
             if (CollectionUtils.isEmpty(projectAlarmRules)) {
                 return new AsyncResult<>("【监测维保数据计算线程】当前项目:" + projectDTO.getProjectId() + "未设置设备维保报警规则");
             }
+            log.info("项目编码{}报警规则条数{}",projectDTO.getProjectId(),projectAlarmRules.size());
             Set<String> objIdAndIndicatorId = getObjIdAndInfoCodeFromRules(projectAlarmRules);
             if (CollectionUtils.isEmpty(objIdAndIndicatorId)) {
                 return new AsyncResult<>("【监测维保数据计算线程】当前项目:" + projectDTO.getProjectId() + "报警规则未关联对象");
             }
+            log.info("项目编码{}报警规则条数{}关联设备对象个数{}",projectDTO.getProjectId(),projectAlarmRules.size(),objIdAndIndicatorId.size());
             //Map<objId_monitorIndicatorId, Date>
             Map<String, Date> objId_indicatorIdAndComputeTime = getObjId_IndicatorIdAndComputeTIme(projectDTO.getProjectId());
             //循环计算
@@ -435,6 +437,7 @@ public class ProjectDataRecordServiceImpl implements IProjectDataRecordService {
                 if (CollectionUtils.isEmpty(objIdList) || CollectionUtils.isEmpty(infoCodeList)) {
                     continue;
                 }
+                log.info("项目编码{}报警编码{}",alarmRuleDTO.getProjectId(),alarmRuleDTO.getAlarmItemCode());
                 for (String objId : objIdList) {
                     List<AlarmCondition> alarmConditionList = energyAlarmService.getProjectAlarmCondition(projectDTO, objId, enumAlarmItem.getCode());
                     if (CollectionUtils.isEmpty(alarmConditionList)) {
@@ -450,7 +453,7 @@ public class ProjectDataRecordServiceImpl implements IProjectDataRecordService {
                             }
                         }
                     }
-
+                    log.info("项目编码{}报警编码{}设备编码{}",alarmRuleDTO.getProjectId(),alarmRuleDTO.getAlarmItemCode(),objId);
                     for (String infoCode : infoCodeList) {
                         EnumMaintenanceIndicatorType indicatorType = EnumMaintenanceIndicatorType.getEnumMaintenanceDataType(infoCode);
                         if (indicatorType == null) {
@@ -474,6 +477,7 @@ public class ProjectDataRecordServiceImpl implements IProjectDataRecordService {
                         if (lastComputeTime == null) {
                             lastComputeTime = DateUtils.addDays(todayDate, -1);
                         }
+                        log.info("项目编码{}报警编码{}设备编码{}点位编码{}计算日期{}",alarmRuleDTO.getProjectId(),alarmRuleDTO.getAlarmItemCode(),objId,infoCode,lastComputeTime);
                         Date computeTime;
                         if (indicatorType == EnumMaintenanceIndicatorType.ACCCOT_DayAvg) {//冷却塔
                             //冷却塔 日均 数据计算