线网图列车定位前做设备名称转换

This commit is contained in:
weizhihong 2023-07-19 14:36:06 +08:00
parent 56456614af
commit 03f9fb4807
2 changed files with 7 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import club.joylink.xiannccda.ats.cache.LineGraphicDataRepository;
import club.joylink.xiannccda.ats.message.collect.DeviceStatusDataOperate;
import club.joylink.xiannccda.ats.message.collect.DeviceStatusDataRepository;
import club.joylink.xiannccda.ats.message.collect.datasource.DeviceStatusData;
import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage;
import club.joylink.xiannccda.ats.message.line3.device.DeviceType;
import club.joylink.xiannccda.dto.protos.WsMessageProto;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@ -54,8 +55,11 @@ public abstract class LineNetTrainComMethod {
if (!DeviceType.DEVICE_TYPE_TRACK.equals(type) && !DeviceType.DEVICE_TYPE_SWITCH.equals(type)) {
return;
}
// 转换成程序中的名称
String convertName = DeviceNameChangerManage.findMatch(type, deviceName);
// 获取到当前区段公里标
List<Long> kmList = LineGraphicDataRepository.getKilometerCodeList(obj.getLineId(), deviceName);
List<Long> kmList =
LineGraphicDataRepository.getKilometerCodeList(obj.getLineId(), convertName);
if (CollectionUtils.isNotEmpty(kmList)) {
long kilometer;
if (obj.getDir() == 1) { // 下行取大值
@ -67,7 +71,7 @@ public abstract class LineNetTrainComMethod {
}
obj.setKilometerCode(kilometer);
} else {
log.warn(String.format("设备%s没有公里标信息", deviceName));
log.warn(String.format("设备%s没有公里标信息", convertName));
}
}
}

@ -1 +1 @@
Subproject commit eb0ad6e4305642b6619f5e97d1498ad5dc5a6d42
Subproject commit 90b6f4600e531c496d849163653acb80c6e933ea