diff --git a/src/main/java/club/joylink/rtss/services/mapFunction/RtsMapFunctionServiceImpl.java b/src/main/java/club/joylink/rtss/services/mapFunction/RtsMapFunctionServiceImpl.java index 84bc242a8..9170791c6 100644 --- a/src/main/java/club/joylink/rtss/services/mapFunction/RtsMapFunctionServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/mapFunction/RtsMapFunctionServiceImpl.java @@ -431,9 +431,12 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService { if (StringUtils.hasText(defaultClientType)) { String deviceCode = defaultMember != null ? defaultMember.getDeviceCode() : null; Optional defaultClientOptional = clientVOList.stream() - .filter(c -> Objects.equals(c.getType(), defaultClientType) - && (StringUtils.isEmpty(deviceCode) || Objects.equals(deviceCode, c.getDeviceCode()) - )).findFirst(); + .filter(c -> Objects.equals(c.getType(), defaultClientType) && Objects.equals(deviceCode, c.getDeviceCode())) + .findFirst(); + // 没有找到默认获取一个 + if (defaultClientOptional.isEmpty()) { + defaultClientOptional = clientVOList.stream().filter(c -> Objects.equals(c.getType(), defaultClientType)).findFirst(); + } if (defaultClientOptional.isEmpty()) { msgList.add(String.format("地图[名:%s]设备[%s]不存在客户端类型[%s]", mapDetail.getName(), deviceCode, defaultClientType)); } else {