目标策划:保存规则
This commit is contained in:
parent
4ef4152ee9
commit
bf8df33dba
@ -356,7 +356,7 @@ public class UtilServiceImpl implements UtilService {
|
|||||||
queryWrapper.eq("target_id", targetId);
|
queryWrapper.eq("target_id", targetId);
|
||||||
queryWrapper.ne("warn_level", "999");
|
queryWrapper.ne("warn_level", "999");
|
||||||
List<Monitor> monitorList = monitorMapper.selectList(queryWrapper);
|
List<Monitor> monitorList = monitorMapper.selectList(queryWrapper);
|
||||||
Map<String, Monitor> map = monitorList.stream().collect(Collectors.toMap(Monitor::getXShow, vo -> vo));
|
Map<String, List<Monitor>> map = monitorList.stream().collect(Collectors.groupingBy(Monitor::getXShow));
|
||||||
|
|
||||||
List<Rule> ruleList = ruleMapper.selectList(new QueryWrapper<Rule>().eq("target_id", targetId));
|
List<Rule> ruleList = ruleMapper.selectList(new QueryWrapper<Rule>().eq("target_id", targetId));
|
||||||
if ("delete".equals(type) && ruleList.isEmpty()) {
|
if ("delete".equals(type) && ruleList.isEmpty()) {
|
||||||
@ -375,8 +375,8 @@ public class UtilServiceImpl implements UtilService {
|
|||||||
|
|
||||||
List<Monitor> saveMonitorList = new ArrayList<>();
|
List<Monitor> saveMonitorList = new ArrayList<>();
|
||||||
for (TargetData targetData : targetDataList) {
|
for (TargetData targetData : targetDataList) {
|
||||||
Monitor tmp = map.get(targetData.getXShow());
|
List<Monitor> tmp = map.get(targetData.getXShow());
|
||||||
if (tmp == null) {
|
if (tmp == null || tmp.isEmpty()) {
|
||||||
if ("delete".equals(type)) {
|
if ("delete".equals(type)) {
|
||||||
Monitor monitor = getInitMonitor(targetData, target, addRule);
|
Monitor monitor = getInitMonitor(targetData, target, addRule);
|
||||||
monitor.setWarnLevel(998);
|
monitor.setWarnLevel(998);
|
||||||
|
Loading…
Reference in New Issue
Block a user