|
|
|
@ -38,23 +38,19 @@ public class AlarmConfigDetailServiceImpl extends BaseServiceImpl<AlarmConfigDet
|
|
|
|
|
@Override |
|
|
|
|
public boolean defaults(AlarmConfigEntity entity) { |
|
|
|
|
List<AlarmConfigDetailEntity> batchs = new ArrayList<>(); |
|
|
|
|
List<Dict> sources = DictCache.getList("alarm_source"); |
|
|
|
|
if(CollectionUtil.isEmpty(sources)){ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
sources.forEach(source->{ |
|
|
|
|
AlarmConstants.ALARAM_SOURCE.forEach(source->{ |
|
|
|
|
// HZ3000告警
|
|
|
|
|
if(AlarmConstants.HZ3000_ALARM.toString().equals(source.getDictValue())){ |
|
|
|
|
AlarmConstants.HZ3000_ALARAM_LIST.forEach(type-> batchs.add(this.superposition(entity,Integer.valueOf(source.getDictValue()),type))); |
|
|
|
|
if(AlarmConstants.HZ3000_ALARM.equals(source)){ |
|
|
|
|
AlarmConstants.HZ3000_ALARAM_LIST.forEach(type-> batchs.add(this.superposition(entity,Integer.valueOf(source),type))); |
|
|
|
|
// 等级告警
|
|
|
|
|
}else if(AlarmConstants.LEVEL_ALARM.toString().equals(source.getDictValue())){ |
|
|
|
|
AlarmConstants.LEVEL_ALARAM.forEach(type-> batchs.add(this.superposition(entity,Integer.valueOf(source.getDictValue()),type))); |
|
|
|
|
}else if(AlarmConstants.LEVEL_ALARM.equals(source)){ |
|
|
|
|
AlarmConstants.LEVEL_ALARAM.forEach(type-> batchs.add(this.superposition(entity,Integer.valueOf(source),type))); |
|
|
|
|
// 条件告警
|
|
|
|
|
}else if(AlarmConstants.CONDITION_ALARM.toString().equals(source.getDictValue())){ |
|
|
|
|
batchs.add(this.superposition(entity, Integer.valueOf(source.getDictValue()),AlarmConstants.CONDITION)); |
|
|
|
|
}else if(AlarmConstants.CONDITION_ALARM.equals(source)){ |
|
|
|
|
batchs.add(this.superposition(entity, source,AlarmConstants.CONDITION)); |
|
|
|
|
// 智能预警
|
|
|
|
|
}else if(AlarmConstants.EARLY_WARNING.toString().equals(source.getDictValue())){ |
|
|
|
|
batchs.add(this.superposition(entity,Integer.valueOf(source.getDictValue()),AlarmConstants.EARLY)); |
|
|
|
|
}else if(AlarmConstants.EARLY_WARNING.equals(source)){ |
|
|
|
|
batchs.add(this.superposition(entity, source,AlarmConstants.EARLY)); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if(CollectionUtil.isEmpty(batchs)){ |
|
|
|
@ -115,6 +111,16 @@ public class AlarmConfigDetailServiceImpl extends BaseServiceImpl<AlarmConfigDet
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量修改 |
|
|
|
|
* @param entitys |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public boolean updateBatch(List<AlarmConfigDetailEntity> entitys) { |
|
|
|
|
return super.saveOrUpdateBatch(entitys); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询告警配置对象 |
|
|
|
|