调整列车报点设备名称变更及删除无用的注释

This commit is contained in:
tiger_zhou 2023-12-28 17:12:40 +08:00
parent 0d72772687
commit 85f76ca4b0
2 changed files with 8 additions and 49 deletions

View File

@ -3,6 +3,8 @@ package club.joylink.xiannccda.ats.message.line3.rep;
import club.joylink.xiannccda.ats.message.MessageResponse;
import club.joylink.xiannccda.ats.message.line3.DateTimeUtil;
import club.joylink.xiannccda.ats.message.line3.MessageCons;
import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage;
import club.joylink.xiannccda.ats.message.line3.device.DeviceType;
import club.joylink.xiannccda.ats.message.line3.rep.TrainIndicationInitResponse.TrainCell;
import club.joylink.xiannccda.dto.protos.DeviceStatusProto;
import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo;
@ -161,8 +163,9 @@ public class TrainRecordResponse extends MessageResponse {
if (this.getSideId() != null) {
builder.setSideId(this.getSideId());
}
;
builder.setTrackName(StringUtils.defaultString(this.trackName, ""));
String deviceName = DeviceNameChangerManage.findMatch(DeviceType.DEVICE_TYPE_TRACK, builder.getTrackName());
builder.setTrackName(deviceName);
if (this.getRecordType() != null) {
builder.setRecordType(this.getRecordType());
}

View File

@ -10,17 +10,14 @@ import club.joylink.xiannccda.ats.message.collect.DeviceDataRepository;
import club.joylink.xiannccda.ats.message.collect.DeviceDataRepository.DataTypeEnum;
import club.joylink.xiannccda.ats.message.collect.datasource.DeviceStatusData;
import club.joylink.xiannccda.ats.message.collect.datasource.InUsedScheduleData;
import club.joylink.xiannccda.ats.message.collect.datasource.InterLockData;
import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage;
import club.joylink.xiannccda.ats.message.line3.device.DeviceType;
import club.joylink.xiannccda.ats.message.line3.rep.TrainRecordResponse.DirectionEnum;
import club.joylink.xiannccda.dto.protos.AlertConstProto.AlertType;
import club.joylink.xiannccda.dto.protos.DeviceStatusProto;
import club.joylink.xiannccda.dto.protos.DeviceStatusProto.Platform;
import club.joylink.xiannccda.dto.protos.DeviceStatusProto.Track;
import club.joylink.xiannccda.dto.protos.GuardConfigProto.GuardConfig;
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto;
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Section;
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Station;
import club.joylink.xiannccda.dto.protos.TrainProto.TrainRecord;
import club.joylink.xiannccda.dto.protos.TrainProto.TrainRecord.Builder;
@ -28,14 +25,11 @@ import club.joylink.xiannccda.dto.protos.TrainShedule.Plan;
import club.joylink.xiannccda.service.AlertInfoService;
import club.joylink.xiannccda.service.config.DeviceGuardConfigService;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.google.common.base.Strings;
import com.google.protobuf.GeneratedMessageV3;
import com.google.protobuf.MessageOrBuilder;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -90,8 +84,8 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
private Platform.Builder parsePlatform(TrainRecord.Builder record, boolean isUpWay) {
String newTrackName = DeviceNameChangerManage.findMatch(DeviceType.DEVICE_TYPE_TRACK, record.getTrackName());
Optional<LayoutGraphicsProto.Platform> layoutPlatformOpt = LineGraphicDataRepository.findLayoutPlatformFromSection(record.getLineId(), newTrackName);
// String newTrackName = DeviceNameChangerManage.findMatch(DeviceType.DEVICE_TYPE_TRACK, record.getTrackName());
Optional<LayoutGraphicsProto.Platform> layoutPlatformOpt = LineGraphicDataRepository.findLayoutPlatformFromSection(record.getLineId(), record.getTrackName());
String platformCode = layoutPlatformOpt.map(LayoutGraphicsProto.Platform::getCode).orElse(null);
if (StringUtils.isEmpty(platformCode)) {
return null;
@ -139,8 +133,7 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
private void alert(Platform.Builder platformBuild, AlertType alertType, String customName, boolean isUpWay, TrainRecord.Builder record) {
int lineId = platformBuild.getLineId();
boolean alertAdd = alertDataSource.putAlterDevice(lineId, customName, platformBuild.getId());
if (alertAdd) {
if (alertDataSource.putAlterDevice(lineId, customName, platformBuild.getId())) {
log.info("列车开关门是否已经报警检测,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}], 告警类型[{}] 告警名称[{}]",
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId(), isUpWay, platformBuild.getId(), platformBuild.getReceiveTime(), alertType,
customName);
@ -174,23 +167,7 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
return false;
}
return true;
/*if (isOpen && isClose && Objects.equals(false, platformBuild.getTrainberth())) {
if (log.isDebugEnabled()) {
log.info(
"列车开关过屏蔽门车辆离站,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}] 是否靠站[{}]",
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId()
, isUpWay, platformBuild.getId(), platformBuild.getReceiveTime(), platformBuild.getTrainberth());
}
this.removeTrainRecord(record);
}
if (isOpen && isClose) {
if (log.isDebugEnabled()) {
log.info(
"列车开关过屏蔽门只是等待,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}] ",
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId(), isUpWay, platformBuild.getId(), platformBuild.getReceiveTime());
}
this.removeTrainRecord(record);
}*/
}
@Override
@ -222,27 +199,6 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
if (handler) {
this.handle(record, isUpWay, platformBuild, isOpen, isClose, planBuild);
}
/* if (isOpen && isClose && Objects.equals(false, platformBuild.getTrainberth())) {
if (log.isDebugEnabled()) {
log.info(
"列车开关过屏蔽门车辆离站,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}] 是否靠站[{}]",
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId()
, isUpWay, platformBuild.getId(), platformBuild.getReceiveTime(), platformBuild.getTrainberth());
}
this.removeTrainRecord(record);
continue;
}
if (isOpen && isClose) {
if (log.isDebugEnabled()) {
log.info(
"列车开关过屏蔽门只是等待,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}] ",
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId(), isUpWay, platformBuild.getId(), platformBuild.getReceiveTime());
}
this.removeTrainRecord(record);
continue;
}
this.handle(record, isUpWay, platformBuild, isOpen, isClose, planBuild);*/
}
}
}