Browse Source

从报警中台获取报警信息集团编码设置

miaolijing 2 years ago
parent
commit
5b1ef28f55

+ 4 - 3
src/main/java/com/persagy/apm/diagnose/service/EnergyAlarmServiceImpl.java

@@ -192,12 +192,13 @@ public class EnergyAlarmServiceImpl {
             for (String code:alarmItemCodeList) {
                 AlarmRuleDTO alarmRuleDTO = AlarmRuleDTO.builder().build();
                 alarmRuleDTO.setProjectId(projectDTO.getProjectId());
-                alarmRuleDTO.setGroupCode(projectDTO.getGroupCode());
+                alarmRuleDTO.setGroupCode(SaasContext.getContextGroupCode());
                 alarmRuleDTO.setPd("asdasdasda");
                 alarmRuleDTO.setUserId("test");
                 alarmRuleDTO.setAlarmItemCode(code);
+                log.error("集团编码{}项目编码{}报警Code编码{}查询报警规则入参{}",projectDTO.getGroupCode(),projectDTO.getProjectId(),code,alarmRuleDTO);
                 AlarmResult<JSONObject> result = alarmServiceClient.queryProjectAlarmRules(alarmRuleDTO);
-                log.error("集团编码{}项目编码{}报警Code编码{}查询报警规则信息返回信息{}",projectDTO.getGroupCode(),projectDTO.getProjectId(),code,result);
+                log.error("集团编码{}项目编码{}报警Code编码{}查询报警规则返回{}",projectDTO.getGroupCode(),projectDTO.getProjectId(),code,result);
                 List<AlarmRuleDTO> alarmRuleDTOList =  AlarmResultUtil.getRecords(result, AlarmRuleDTO.class);
                 allAlarmRuleDTOList.addAll(alarmRuleDTOList);
             }
@@ -228,7 +229,7 @@ public class EnergyAlarmServiceImpl {
         selDTO.setObjId(objId);
         selDTO.setItemCode(itemCode);
         selDTO.setProjectId(projectDTO.getProjectId());
-        selDTO.setGroupCode(projectDTO.getGroupCode());
+        selDTO.setGroupCode(SaasContext.getContextGroupCode());
         selDTO.setPd("asdasdasda");
         selDTO.setUserId("test");
         AlarmResult<JSONObject> result = alarmServiceClient.queryByObjAndItemCode(selDTO);