trim
This commit is contained in:
parent
8558b0f951
commit
6f0ef7bd3d
|
@ -93,7 +93,7 @@ public class AutoCollectJobs {
|
|||
}
|
||||
resultList.stream()
|
||||
.filter(item -> {
|
||||
String gatewaySn = MapUtil.getStr(item, "identifier");
|
||||
String gatewaySn = StringUtils.trim(MapUtil.getStr(item, "identifier"));
|
||||
String gatewayIdentifier = this.equipmentIPProperties.put(gatewaySn);
|
||||
if (Objects.nonNull(ModbusTCPController.nettyServer.getGroup()
|
||||
.get(gatewayIdentifier))) {
|
||||
|
@ -103,7 +103,7 @@ public class AutoCollectJobs {
|
|||
log.warn("Gateway {} is disconnected and does not collect data", gatewaySn);
|
||||
return false;
|
||||
})
|
||||
.collect(Collectors.groupingBy(item -> MapUtil.getStr(item, "deviceId")))
|
||||
.collect(Collectors.groupingBy(item -> StringUtils.trim(MapUtil.getStr(item, "deviceId"))))
|
||||
.forEach((deviceId, commandList) -> {
|
||||
Map<String, List<Map<String, Object>>> refTypeCommandListMap = commandList.stream()
|
||||
.collect(Collectors.groupingBy(item -> MapUtil.getStr(item, "refType")));
|
||||
|
@ -114,15 +114,15 @@ public class AutoCollectJobs {
|
|||
if (ObjectUtils.isNotEmpty(deviceCommandList)) {
|
||||
List<ModbusCommandDto> collectCommondList = deviceCommandList.stream()
|
||||
.map(item -> {
|
||||
String identifier = MapUtil.getStr(item, "identifier");
|
||||
String identifier = StringUtils.trim(MapUtil.getStr(item, "identifier"));
|
||||
return ModbusCommandDto.builder()
|
||||
.command(MapUtil.getStr(item, "command"))
|
||||
.command(StringUtils.trim(MapUtil.getStr(item, "command")))
|
||||
.identifier(identifier)
|
||||
.length(MapUtil.getInt(item, "messageLength"))
|
||||
.type(CommandTypeComparable.CommandType.COLLECTION)
|
||||
.key(StringUtils.joinWith("/", identifier,
|
||||
MapUtil.getStr(item, "deviceId"),
|
||||
MapUtil.getStr(item, "commandId"),
|
||||
StringUtils.trim(MapUtil.getStr(item, "deviceId")),
|
||||
StringUtils.trim(MapUtil.getStr(item, "commandId")),
|
||||
timestamp))
|
||||
.build();
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue