|
@@ -380,17 +380,18 @@ public class ProjectAlarmRuleObjRelServiceImpl extends ServiceImpl<ProjectAlarmR
|
|
List<EquipItem> records = groupManagementService.getEquipList(queryEquipDTO);
|
|
List<EquipItem> records = groupManagementService.getEquipList(queryEquipDTO);
|
|
//查询项目下所有已绑定的报警对象
|
|
//查询项目下所有已绑定的报警对象
|
|
List<String> projectAlarmRuleIdList = projectAlarmRuleService.queryAlarmRule(queryRuleObjRelDTO);
|
|
List<String> projectAlarmRuleIdList = projectAlarmRuleService.queryAlarmRule(queryRuleObjRelDTO);
|
|
- QueryWrapper<ProjectAlarmRuleObjRel> queryWrapper = new QueryWrapper<>();
|
|
|
|
- queryWrapper.eq(ProjectAlarmRuleObjRel.PROP_PROJECT_ID, projectId);
|
|
|
|
- if (projectAlarmRuleIdList.size() > 0)
|
|
|
|
|
|
+ Map<String, ProjectAlarmRuleObjRel> partitionMap = new HashMap<>();
|
|
|
|
+ if (projectAlarmRuleIdList.size() > 0){
|
|
|
|
+ QueryWrapper<ProjectAlarmRuleObjRel> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(ProjectAlarmRuleObjRel.PROP_PROJECT_ID, projectId);
|
|
queryWrapper.in(ProjectAlarmRuleObjRel.PROP_PROJECT_ALARM_RULE_ID, projectAlarmRuleIdList);
|
|
queryWrapper.in(ProjectAlarmRuleObjRel.PROP_PROJECT_ALARM_RULE_ID, projectAlarmRuleIdList);
|
|
- queryWrapper.eq(ProjectAlarmRuleObjRel.PROP_VALID, ValidEnum.TRUE.getType());
|
|
|
|
- //新增项目报警,要把屏蔽的查出来
|
|
|
|
- if (StringUtils.isBlank(queryRuleObjRelDTO.getProjectAlarmRuleId()))
|
|
|
|
- queryWrapper.eq(ProjectAlarmRuleObjRel.PROP_OPEN, 1);
|
|
|
|
- List<ProjectAlarmRuleObjRel> list = list(queryWrapper);
|
|
|
|
- Map<String, ProjectAlarmRuleObjRel> partitionMap = list.stream().collect(Collectors.toMap(ProjectAlarmRuleObjRel::getObjId, equip -> equip, (k1, k2) -> k1));
|
|
|
|
-
|
|
|
|
|
|
+ queryWrapper.eq(ProjectAlarmRuleObjRel.PROP_VALID, ValidEnum.TRUE.getType());
|
|
|
|
+ //新增项目报警,要把屏蔽的查出来
|
|
|
|
+ if (StringUtils.isBlank(queryRuleObjRelDTO.getProjectAlarmRuleId()))
|
|
|
|
+ queryWrapper.eq(ProjectAlarmRuleObjRel.PROP_OPEN, 1);
|
|
|
|
+ List<ProjectAlarmRuleObjRel> list = list(queryWrapper);
|
|
|
|
+ partitionMap = list.stream().collect(Collectors.toMap(ProjectAlarmRuleObjRel::getObjId, equip -> equip, (k1, k2) -> k1));
|
|
|
|
+ }
|
|
//筛选未绑定的报警对象
|
|
//筛选未绑定的报警对象
|
|
for (EquipItem record : records) {
|
|
for (EquipItem record : records) {
|
|
String id = record.getId();
|
|
String id = record.getId();
|
|
@@ -403,6 +404,13 @@ public class ProjectAlarmRuleObjRelServiceImpl extends ServiceImpl<ProjectAlarmR
|
|
resultList.add(projectAlarmRuleObjRelVO);
|
|
resultList.add(projectAlarmRuleObjRelVO);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //去掉已屏蔽的对象
|
|
|
|
+ Iterator<ProjectAlarmRuleObjRel> iterator = resultList.iterator();
|
|
|
|
+ while (iterator.hasNext()) {
|
|
|
|
+ ProjectAlarmRuleObjRel next = iterator.next();
|
|
|
|
+ if (next.getOpen() == 0)
|
|
|
|
+ iterator.remove();
|
|
|
|
+ }
|
|
return ConvertProjectAlarmRuleObjRelTool.INSTANCE.convert2List(resultList);
|
|
return ConvertProjectAlarmRuleObjRelTool.INSTANCE.convert2List(resultList);
|
|
}
|
|
}
|
|
|
|
|