代码调整

This commit is contained in:
tiger_zhou 2023-12-21 10:27:56 +08:00
parent 8a05537555
commit 3ac9997460
2 changed files with 6 additions and 3 deletions

View File

@ -141,6 +141,7 @@ public class DeviceStatusData extends AbstractData {
b.setIpSingleSwitchStusLocked(false);
b.setIpSingleSwitchStusCbtcOccupied(false);
b.setIpSingleSwitchStusCiOccupied(false);
b.setIpSingleSwitchStusJammed(false);
}
}
}

View File

@ -22,6 +22,7 @@ import com.google.protobuf.GeneratedMessageV3;
import com.google.protobuf.GeneratedMessageV3.Builder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@ -61,17 +62,18 @@ public class BuleDisplayMonitoringTask implements AlertMonitoringTask {
private Map<String, GeneratedMessageV3.Builder> findRtuDeviceSource(String lineIdStr) {
DeviceStatusData deviceStatusData = DeviceDataRepository.findDataSouce(lineIdStr, DataTypeEnum.DEVICE);
if (deviceStatusData.getAllDeviceMap().isEmpty()) {
return null;
return Collections.emptyMap();
}
Map<String, GeneratedMessageV3.Builder> builderMap = deviceStatusData.getAllDeviceMap().get(Rtu.getDescriptor().getName());
if (builderMap.isEmpty()) {
return null;
if (CollectionUtils.isEmpty(builderMap)) {
return Collections.emptyMap();
}
return builderMap;
}
private List<RtuWarnVO> findRtuBuild(Map<String, GeneratedMessageV3.Builder> builderMap) {
List<RtuWarnVO> collectRtuList = Lists.newArrayList();
for (Builder value : builderMap.values()) {
if (value instanceof DeviceStatusProto.Rtu.Builder rtu) {
Station station = findAllStation(rtu.getLineId(), rtu.getId());