调整
This commit is contained in:
parent
e1c168a82e
commit
c561e51a17
@ -22,7 +22,9 @@ import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Section.SectionType
|
|||||||
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Turnout;
|
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Turnout;
|
||||||
import club.joylink.xiannccda.service.AlertInfoService;
|
import club.joylink.xiannccda.service.AlertInfoService;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.protobuf.MessageOrBuilder;
|
import com.google.protobuf.MessageOrBuilder;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -82,18 +84,18 @@ public class AxleLedInterlockTask implements AlertMonitoringTask {
|
|||||||
Integer lineIdInt = Integer.parseInt(lineId);
|
Integer lineIdInt = Integer.parseInt(lineId);
|
||||||
//收集联锁下的所有所有区段设备
|
//收集联锁下的所有所有区段设备
|
||||||
List<TrackOccupiedStatus> resultList = this.collectorLedWarDevices(findWarnAlertType, lineId, detail.getDevices());
|
List<TrackOccupiedStatus> resultList = this.collectorLedWarDevices(findWarnAlertType, lineId, detail.getDevices());
|
||||||
|
List<String> occupidedDeviceList = resultList.stream().filter(d -> d.occupied).map(d -> d.deviceCode).toList();
|
||||||
if (resultList.stream().anyMatch(d -> d.occupied)) {
|
if (resultList.stream().anyMatch(d -> d.occupied)) {
|
||||||
log.info("线路[{}] 联锁区[{}] 需要加载设备数量[{}] 实际加载数量[{}] 区段被占用情况[{}]", lineId, rtuIdJoinStr, deviceCount, resultList.size(),
|
String occupedDevices = Joiner.on(StringPool.COMMA).join(occupidedDeviceList);
|
||||||
resultList.stream().filter(d -> d.occupied).map(d -> d.deviceCode).collect(Collectors.joining(",")));
|
log.info("线路[{}] 联锁区[{}] 需要加载设备数量[{}] 实际加载数量[{}] 区段被占用情况[{}]", lineId, rtuIdJoinStr, deviceCount, resultList.size(), occupedDevices);
|
||||||
}
|
}
|
||||||
int occupidedSzie = (int) resultList.stream().filter(d -> d.occupied).count();
|
int occupidedSzie = occupidedDeviceList.size();
|
||||||
String customName = String.format("%s-%s", findWarnAlertType.name(), detail.getAreaConfigId());
|
String customName = String.format("%s-%s", findWarnAlertType.name(), detail.getAreaConfigId());
|
||||||
if (occupidedSzie >= deviceCount) {
|
if (occupidedSzie >= deviceCount) {
|
||||||
//联锁报警
|
//联锁报警
|
||||||
if (alertDataSource.putAlterDevice(lineIdInt, customName, warnAlertType.name())) {
|
if (alertDataSource.putAlterDevice(lineIdInt, customName, warnAlertType.name())) {
|
||||||
NccAlertInfo alertInfoMost = this.alertInfoService.createAlert2(detail.getAreaConfigId(), warnAlertType, lineIdInt, LocalDateTime.now(), detail.getAreaConfigName(), null,
|
NccAlertInfo alertInfoMost = this.alertInfoService.createAlert2(detail.getAreaConfigId(), warnAlertType, lineIdInt, LocalDateTime.now(),
|
||||||
AlertDeviceType.DEVICE_TYPE_TRACK,
|
detail.getAreaConfigName(), null, AlertDeviceType.DEVICE_TYPE_TRACK, false);
|
||||||
false);
|
|
||||||
alertManager.emit(alertInfoMost);
|
alertManager.emit(alertInfoMost);
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
Loading…
Reference in New Issue
Block a user