Browse Source

修改更新集团报警的bug

lixing 2 years ago
parent
commit
96c68529a0

+ 3 - 2
src/main/java/com/persagy/apm/alarmservice/group/alarmrule/service/impl/GroupAlarmRuleServiceImpl.java

@@ -213,8 +213,9 @@ public class GroupAlarmRuleServiceImpl extends ServiceImpl<GroupAlarmRuleMapper,
         updateById(groupAlarmRule);
         //获得报警规则
         UpdateAlarmConditionDTO alarmCondition = updateGroupAlarmRuleDTO.getAlarmCondition();
-        Map<String, Object> conditionMap = alarmConditionService.frontend2Backend(alarmCondition.getFrontend());
-        alarmConditionService.updateAlarmCondition(conditionMap, alarmCondition);
+        alarmConditionService.updateAlarmCondition(alarmCondition);
+//        Map<String, Object> conditionMap = alarmConditionService.frontend2Backend(alarmCondition.getFrontend());
+//        alarmConditionService.updateAlarmCondition(conditionMap, alarmCondition);
         // 勿删,后续可能启用 lixing
 //        //删除中台设备的报警条件
 //        String condition = updateGroupAlarmRuleDTO.getCondition();

+ 1 - 1
src/main/java/com/persagy/apm/alarmservice/project/alarmcondition/service/IAlarmConditionService.java

@@ -84,7 +84,7 @@ public interface IAlarmConditionService  {
 
     Map<String, Object> frontend2Backend(List<List<CalculateMethodDTO>> frontend);
 
-    void updateAlarmCondition(Map<String, Object> conditionMap, UpdateAlarmConditionDTO alarmCondition);
+//    void updateAlarmCondition(Map<String, Object> conditionMap, UpdateAlarmConditionDTO alarmCondition);
 
     /**
      * 查询所有的报警条件

+ 13 - 13
src/main/java/com/persagy/apm/alarmservice/project/alarmcondition/service/impl/AlarmConditionServiceImpl.java

@@ -285,19 +285,19 @@ public class AlarmConditionServiceImpl extends ServiceImpl<AlarmConditionMapper,
         return operator;
     }
 
-    @Override
-    public void updateAlarmCondition(Map<String, Object> conditionMap, UpdateAlarmConditionDTO condition) {
-        AlarmCondition alarmCondition = new AlarmCondition();
-        alarmCondition.setInfoCodes((List<String>) conditionMap.get("infoCode"));
-        alarmCondition.setTriggerFrontend(condition.getFrontend());
-        alarmCondition.setTriggerBackend((String) conditionMap.get("backend"));
-        alarmCondition.setTriggerUphold(condition.getTriggerUphold());
-        alarmCondition.setAlarmLevel(condition.getAlarmLevel());
-        alarmCondition.setTriggerRules((List<String>) conditionMap.get("displayFormula"));
-        alarmCondition.setEndBackend("!(" + conditionMap.get("backend") + ")");
-        alarmCondition.setId(condition.getId());
-        updateAndSendMsg2MQ(alarmCondition);
-    }
+//    @Override
+//    public void updateAlarmCondition(Map<String, Object> conditionMap, UpdateAlarmConditionDTO condition) {
+//        AlarmCondition alarmCondition = new AlarmCondition();
+//        alarmCondition.setInfoCodes((List<String>) conditionMap.get("infoCode"));
+//        alarmCondition.setTriggerFrontend(condition.getFrontend());
+//        alarmCondition.setTriggerBackend((String) conditionMap.get("backend"));
+//        alarmCondition.setTriggerUphold(condition.getTriggerUphold());
+//        alarmCondition.setAlarmLevel(condition.getAlarmLevel());
+//        alarmCondition.setTriggerRules((List<String>) conditionMap.get("displayFormula"));
+//        alarmCondition.setEndBackend("!(" + conditionMap.get("backend") + ")");
+//        alarmCondition.setId(condition.getId());
+//        updateAndSendMsg2MQ(alarmCondition);
+//    }
 
     /**
      * 更新报警条件并发送更新消息