|
@@ -290,22 +290,27 @@ public class AlarmEngineMsgHandler {
|
|
|
AlarmCondition alarmCondition = new AlarmCondition();
|
|
|
alarmCondition.setId(alarmConfigItem.getId());
|
|
|
List<String> infoCodes = new ArrayList<>();
|
|
|
- if (alarmConfigItem.getCondition() == null) {
|
|
|
+ com.persagy.apm.energyalarmstarter.alarmdata.model.dto.AlarmCondition condition = alarmConfigItem.getCondition();
|
|
|
+ if (condition == null) {
|
|
|
return null;
|
|
|
}
|
|
|
- for (String infoCode : alarmConfigItem.getCondition().getInfoCode()) {
|
|
|
+ for (String infoCode : condition.getInfoCode()) {
|
|
|
infoCodes.add(infoCode.replaceAll(alarmConfigItem.getObjId()+"_",""));
|
|
|
}
|
|
|
alarmCondition.setInfoCodes(infoCodes);
|
|
|
- alarmCondition.setConfigs(alarmConfigItem.getCondition().getConfigs());
|
|
|
- alarmCondition.setTriggerBackend(alarmConfigItem.getCondition().getTrigger().replaceAll(alarmConfigItem.getObjId()+"_",""));
|
|
|
- alarmCondition.setTriggerUphold(alarmConfigItem.getCondition().getTriggerUphold()/60);
|
|
|
+ alarmCondition.setConfigs(condition.getConfigs());
|
|
|
+ alarmCondition.setTriggerBackend(condition.getTrigger().replaceAll(alarmConfigItem.getObjId()+"_",""));
|
|
|
+ if (condition.getTriggerUphold() != null) {
|
|
|
+ alarmCondition.setTriggerUphold(condition.getTriggerUphold()/60);
|
|
|
+ }
|
|
|
alarmCondition.setAlarmLevel(alarmConfigItem.getLevel());
|
|
|
- alarmCondition.setEndUphold(alarmConfigItem.getCondition().getEndUphold()/60);
|
|
|
+ if (condition.getEndUphold() != null) {
|
|
|
+ alarmCondition.setEndUphold(condition.getEndUphold()/60);
|
|
|
+ }
|
|
|
//alarmCondition.setTriggerRules(alarmDmpCondition.getRules());
|
|
|
- alarmCondition.setEndBackend(alarmConfigItem.getCondition().getEnd().replaceAll(alarmConfigItem.getObjId()+"_",""));
|
|
|
+ alarmCondition.setEndBackend(condition.getEnd().replaceAll(alarmConfigItem.getObjId()+"_",""));
|
|
|
// alarmCondition.setEndRules(null);
|
|
|
- String effectTime = alarmConfigItem.getCondition().getEffectTime();
|
|
|
+ String effectTime = condition.getEffectTime();
|
|
|
if (StringUtils.isNotBlank(effectTime)) {
|
|
|
JSONObject effectTimeObj = JSONObject.parseObject(effectTime);
|
|
|
alarmCondition.setEffectTimeType(effectTimeObj.getString("type"));
|