修改告警策略,绑定监测点
This commit is contained in:
@@ -109,7 +109,7 @@ public interface ThsWarnStrategyService extends IService<ThsWarnStrategy> {
|
||||
* @param type
|
||||
* @return List<ThsDeptAlarm>
|
||||
*/
|
||||
StrategyParam.MonitorTree echoMonitor(String org,Integer type);
|
||||
StrategyParam.MonitorTree echoMonitor(String org,Integer type,Integer grade);
|
||||
|
||||
/***
|
||||
* 预警单/告警单删除
|
||||
|
||||
@@ -194,6 +194,7 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
LambdaQueryWrapper<ThsDeptAlarm> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ThsDeptAlarm::getDeptId, param.getDeptId());
|
||||
lambdaQueryWrapper.eq(ThsDeptAlarm::getType, param.getType());
|
||||
lambdaQueryWrapper.eq(ThsDeptAlarm::getGrade, param.getGrade());
|
||||
thsDeptAlarmService.remove(lambdaQueryWrapper);
|
||||
|
||||
//信息添加
|
||||
@@ -210,6 +211,7 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
alarm.setDeptId(deptId);
|
||||
alarm.setType(type);
|
||||
alarm.setAlarmId(s);
|
||||
alarm.setGrade(param.getGrade());
|
||||
alarm.setMonitorId(monitorId);
|
||||
info.add(alarm);
|
||||
}
|
||||
@@ -218,10 +220,11 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public StrategyParam.MonitorTree echoMonitor(String org,Integer type) {
|
||||
public StrategyParam.MonitorTree echoMonitor(String org,Integer type,Integer grade) {
|
||||
List<ThsDeptAlarm> list = thsDeptAlarmService.list(new LambdaQueryWrapper<ThsDeptAlarm>()
|
||||
.eq(ThsDeptAlarm::getDeptId, org)
|
||||
.eq(ThsDeptAlarm::getType, type)
|
||||
.eq(ThsDeptAlarm::getGrade, grade)
|
||||
);
|
||||
StrategyParam.MonitorTree tree=new StrategyParam.MonitorTree();
|
||||
List<String> collect = list.stream().map(ThsDeptAlarm::getAlarmId).distinct().collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user