Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java
This commit is contained in:
commit
b706a19245
@ -9,4 +9,8 @@ public interface AlertDetail {
|
||||
Integer getAlertTipId();
|
||||
|
||||
String getInfo();
|
||||
|
||||
String getDeviceInfo();
|
||||
|
||||
String getReason();
|
||||
}
|
||||
|
@ -34,4 +34,12 @@ public class NccAlertInfo<D extends AlertDetail> implements AlertInfo {
|
||||
public Integer getAlertTipId() {
|
||||
return detail == null ? null : detail.getAlertTipId();
|
||||
}
|
||||
|
||||
public String getDeviceInfo() {
|
||||
return detail == null ? "" : detail.getDeviceInfo();
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return detail == null ? "" : detail.getReason();
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,16 @@ public class Xian3TrainDelayAlert implements AlertDetail {
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeviceInfo() {
|
||||
return "道岔P0110";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReason() {
|
||||
return "道岔P0110失表";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getAlertTipId() {
|
||||
return alertTipId;
|
||||
|
@ -61,7 +61,7 @@ public class LineGraphicDataRepository {
|
||||
* @param sectionName 区段名称
|
||||
* @return 公里标
|
||||
*/
|
||||
public static List<Long> getSectionDefaultKmCodeList(int lineId, String sectionName) {
|
||||
public static List<Long> getKilometerCodeList(int lineId, String sectionName) {
|
||||
Map<String, Map<String, Builder>> lineDataMap = lineGraphMap.get(lineId);
|
||||
if (CollectionUtils.isNotEmpty(lineDataMap)) {
|
||||
Map<String, Builder> sectionMap = lineDataMap.get(DeviceType.Section.name());
|
||||
@ -71,6 +71,14 @@ public class LineGraphicDataRepository {
|
||||
return builder.getConvertKilometerList();
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Builder> turnoutMap = lineDataMap.get(DeviceType.Turnout.name());
|
||||
for (Builder v : turnoutMap.values()) {
|
||||
DeviceInfoProto.Turnout.Builder builder = (DeviceInfoProto.Turnout.Builder) v;
|
||||
if (Objects.equals(builder.getCode(), sectionName)) {
|
||||
return builder.getConvertKilometerList();
|
||||
}
|
||||
}
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class LineNetTrainInitConvertor extends DeviceStatusConvertor {
|
||||
// 获取到当前区段公里标
|
||||
if (DeviceType.DEVICE_TYPE_TRACK.equals(trainCell.getDevType())) {
|
||||
List<Long> kmCodeList =
|
||||
LineGraphicDataRepository.getSectionDefaultKmCodeList(
|
||||
LineGraphicDataRepository.getKilometerCodeList(
|
||||
response.getLineId(), trainCell.getDevName());
|
||||
if (CollectionUtils.isNotEmpty(kmCodeList)) {
|
||||
offset.setShow(true); // 是否显示
|
||||
|
@ -45,7 +45,7 @@ public class LineNetTrainRecordConvertor extends DeviceStatusConvertor {
|
||||
offset.setShow(false);
|
||||
// 获取到当前区段公里标
|
||||
List<Long> kmCodeList =
|
||||
LineGraphicDataRepository.getSectionDefaultKmCodeList(
|
||||
LineGraphicDataRepository.getKilometerCodeList(
|
||||
response.getLineId(), response.getTrackName());
|
||||
if (CollectionUtils.isNotEmpty(kmCodeList)) {
|
||||
offset.setShow(true); // 如果公里标存在则
|
||||
@ -58,6 +58,8 @@ public class LineNetTrainRecordConvertor extends DeviceStatusConvertor {
|
||||
kilometer = kmCodeList.get(0);
|
||||
}
|
||||
offset.setKilometerCode(kilometer);
|
||||
} else {
|
||||
log.warn(String.format("设备%s没有公里标信息", response.getTrackName()));
|
||||
}
|
||||
buildList.add(offset);
|
||||
}
|
||||
|
@ -17,9 +17,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 列车信息移除时,线网信息处理
|
||||
*/
|
||||
/** 列车信息移除时,线网信息处理 */
|
||||
@Slf4j
|
||||
public class LineNetTrainRemoveConvertor extends DeviceStatusConvertor {
|
||||
|
||||
@ -50,7 +48,7 @@ public class LineNetTrainRemoveConvertor extends DeviceStatusConvertor {
|
||||
// 获取到当前区段公里标
|
||||
if (DeviceType.DEVICE_TYPE_TRACK.equals(response.getDevType())) {
|
||||
List<Long> kmCodeList =
|
||||
LineGraphicDataRepository.getSectionDefaultKmCodeList(
|
||||
LineGraphicDataRepository.getKilometerCodeList(
|
||||
response.getLineId(), response.getDevName());
|
||||
if (CollectionUtils.isNotEmpty(kmCodeList)) {
|
||||
offset.setKilometerCode(kmCodeList.get(0));
|
||||
|
@ -48,7 +48,7 @@ public class LineNetTrainUpdateConvertor extends DeviceStatusConvertor {
|
||||
// 获取到当前区段公里标
|
||||
if (DeviceType.DEVICE_TYPE_TRACK.equals(response.getDevType())) {
|
||||
List<Long> kmCodeList =
|
||||
LineGraphicDataRepository.getSectionDefaultKmCodeList(
|
||||
LineGraphicDataRepository.getKilometerCodeList(
|
||||
response.getLineId(), response.getDevName());
|
||||
if (CollectionUtils.isNotEmpty(kmCodeList)) {
|
||||
offset.setShow(true); // 是否显示
|
||||
|
@ -54,6 +54,13 @@ public class AlertTipController {
|
||||
alertTipService.saveOrUpdate(saveDTO);
|
||||
}
|
||||
|
||||
@SecurityRequirement(name = "jwt")
|
||||
@Operation(summary = "根据id查询数据")
|
||||
@GetMapping("/id/{id}")
|
||||
public AlertTip getById(@PathVariable int id) {
|
||||
return alertTipRepository.getById(id);
|
||||
}
|
||||
|
||||
@SecurityRequirement(name = "jwt")
|
||||
@Operation(summary = "分页查询报警提示信息")
|
||||
@ApiResponse(description = "报警提示信息分页")
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -87,7 +87,9 @@ public class NccAlertMessageServer implements IMessageServer {
|
||||
.setId(alertInfo.getId())
|
||||
.setLevel(alertInfo.getLevel())
|
||||
.setAlertTime(alertInfo.getAlertTime().toString())
|
||||
.setInfo(alertInfo.getInfo());
|
||||
.setInfo(alertInfo.getInfo())
|
||||
.setDeviceInfo(alertInfo.getDeviceInfo())
|
||||
.setReason(alertInfo.getReason());
|
||||
Integer alertTipId = alertInfo.getAlertTipId();
|
||||
if (alertTipId != null) {
|
||||
builder.setAlertTipId(alertTipId);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 874a6fe4fafcda375e7479e7da0d67d1061ab2f1
|
||||
Subproject commit 2b1cf46a4bece01bce4b3269e4fcf094f8117492
|
Loading…
Reference in New Issue
Block a user