代码调整

This commit is contained in:
tiger_zhou 2023-11-03 11:00:40 +08:00
parent 516db05a37
commit 72b1ef0056

View File

@ -67,9 +67,6 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
}
}
private void removeTrainRecordOnly(TrainRecord.Builder trainRecord) {
this.trainRecordMap.remove(trainRecord.getTrainId());
}
@Override
public String getName() {
@ -125,31 +122,18 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
//车辆停靠超时,车辆停靠没关门没开门
this.alert(platformBuild, AlertType.PLATFORM_DOOR_CANNOT_OPEN, PLATFORM_IS_OPEN, isUpWay, record);
}
/*if (!isOpen && !isClose && platformBuild.getTrainberth() && this.timeOver(platformBuild.getReceiveTime(), guardConfig.getCanNotOpenTimes())) {
//车辆停靠超时,车辆停靠没关门没开门
this.alert(platformBuild, AlertType.PLATFORM_DOOR_CANNOT_OPEN, PLATFORM_IS_OPEN, isUpWay, record);
} else if (isOpen && this.timeOver(platformBuild.getReceiveTime(), (int) stayTimeSecond + guardConfig.getCanNotCloseTimes())) {
//车辆停靠只开门 超过等待时间+阈值时间
this.alert(platformBuild, AlertType.PLATFORM_DOOR_CANNOT_CLOSE, PLATFORM_IS_CLOSE, isUpWay, record);
} else if (!isOpen && platformBuild.getPsdOpen()) {
alertManager.putAlterDevice(platformBuild.getLineId(), PLATFORM_IS_OPEN, platformBuild.getId());
} else if (isOpen && Objects.equals(false, platformBuild.getPsdOpen())) {
//开门后在阈值内关门
alertManager.putAlterDevice(platformBuild.getLineId(), PLATFORM_IS_CLOSE, platformBuild.getId());
}*/
}
private void alert(Platform.Builder platformBuild, AlertType alertType, String customName, boolean isUpWay, TrainRecord.Builder record) {
int lineId = platformBuild.getLineId();
boolean alertAdd = alertManager.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);*/
if (alertAdd) {
log.info("列车开关门是否已经报警检测,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}], 告警类型[{}] 告警名称[{}]",
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId(), isUpWay, platformBuild.getId(), platformBuild.getReceiveTime(), alertType,
customName);
if (log.isDebugEnabled()) {
log.info("列车开关门是否已经报警检测,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}], 告警类型[{}] 告警名称[{}]",
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId(), isUpWay, platformBuild.getId(), platformBuild.getReceiveTime(), alertType,
customName);
}
LayoutGraphicsProto.Platform platform = LineGraphicDataRepository.getDeviceByCode(lineId, platformBuild.getId(), LayoutGraphicsProto.Platform.class);
String openClose = alertType == AlertType.PLATFORM_DOOR_CANNOT_CLOSE ? "关闭" : "打开";
String wayType = isUpWay ? "上行" : "下行";