|
|
|
@ -98,10 +98,17 @@ public class AlarmRuleServiceImpl extends BaseServiceImpl<AlarmRuleMapper, Alarm |
|
|
|
|
|
|
|
private void getIdByThingName(Map<String, Object> params) { |
|
|
|
String thingName = (String) params.get("thingName"); |
|
|
|
if (StringUtils.isBlank(thingName)) { |
|
|
|
String thingId = (String) params.get("thingId"); |
|
|
|
if (StringUtils.isBlank(thingName) && StringUtils.isBlank(thingId)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
paramsToLike(params, "thingName"); |
|
|
|
if (StringUtils.isNotBlank(thingName)) { |
|
|
|
paramsToLike(params, "thingName"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(thingId)) { |
|
|
|
List<Long> thingList = Arrays.stream(thingId.split(",")).map(Long::parseLong).toList(); |
|
|
|
params.put("thingIds", thingList); |
|
|
|
} |
|
|
|
List<AlarmRuleEntityDTO> list = alarmRuleEntityService.getThingNameList(params); |
|
|
|
List<Long> collect = list.stream().map(AlarmRuleEntityDTO::getRuleId).distinct().collect(Collectors.toList()); |
|
|
|
params.put("ids", CollectionUtil.isNotEmpty(collect) ? collect : CollectionUtil.newArrayList(-1L)); |
|
|
|
|