From 5fed73b214029d6ba70cbba2033446ef0d573030 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 21 Jul 2023 14:15:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=B4=E6=8A=A4=E5=8F=8A=E6=9F=A5=E8=AF=A2=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=EF=BC=9B=E4=BF=AE=E6=94=B9=E6=8A=A5=E8=AD=A6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=AD=E7=9B=B8=E5=85=B3=E8=AE=BE=E5=A4=87=E7=9A=84?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiannccda/alert/AlertDetailFactory.java | 38 +- .../ats/cache/LineGraphicDataRepository.java | 110 +++-- .../dto/protos/LayoutGraphicsProto.java | 441 +++++++----------- .../xiannccda/service/AlertMockService.java | 6 +- 4 files changed, 279 insertions(+), 316 deletions(-) diff --git a/src/main/java/club/joylink/xiannccda/alert/AlertDetailFactory.java b/src/main/java/club/joylink/xiannccda/alert/AlertDetailFactory.java index b8d96db..d1f3e20 100644 --- a/src/main/java/club/joylink/xiannccda/alert/AlertDetailFactory.java +++ b/src/main/java/club/joylink/xiannccda/alert/AlertDetailFactory.java @@ -1,5 +1,6 @@ package club.joylink.xiannccda.alert; +import club.joylink.xiannccda.ats.cache.LineGraphicDataRepository; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Platform; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Station; import club.joylink.xiannccda.entity.AlertTip; @@ -30,17 +31,18 @@ public class AlertDetailFactory { BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue( messageOrBuilder instanceof Station); Station rtu = (Station) messageOrBuilder; - AlertTipLocationType locationType = AlertTipLocationType.getByLineIdAndRtuId(lineId, - Short.parseShort(rtu.getCode())); + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(rtu.getConcentrationStations(), + "参数错误:非集中站"); LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(AlertTip.class) .eq(AlertTip::getAlertType, alertType) - .eq(AlertTip::getLocationType, locationType); + .eq(AlertTip::getLocationType, rtu.getCode()); AlertTip alertTip = alertTipRepository.getOne(queryWrapper); alertTipId = alertTip == null ? null : alertTip.getId(); - info = String.format("[%s号线]%s蓝显", lineId, locationType.getDesc()); + String interlockName = getInterlockName(rtu); + info = String.format("[%s号线][%s]蓝显", lineId, interlockName); } case TRAIN_DELAY -> { - return null; + throw BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.exception("尚未实现"); } case PLATFORM_DOOR_WITHOUT_LOCKED_SIGNAL -> { BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue( @@ -50,7 +52,8 @@ public class AlertDetailFactory { .eq(AlertTip::getAlertType, alertType); AlertTip alertTip = alertTipRepository.getOne(queryWrapper); alertTipId = alertTip == null ? null : alertTip.getId(); - info = String.format("[%s号线]%s站台门无关闭且锁紧信号", lineId, platform.getCode()); + String platformDesc = getPlatformDesc(lineId, platform); + info = String.format("[%s号线]%s站台门无关闭且锁紧信号", lineId, platformDesc); } case PLATFORM_DOOR_CANNOT_OPEN -> { BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue( @@ -60,7 +63,8 @@ public class AlertDetailFactory { .eq(AlertTip::getAlertType, alertType); AlertTip alertTip = alertTipRepository.getOne(queryWrapper); alertTipId = alertTip == null ? null : alertTip.getId(); - info = String.format("[%s号线]%s站台门无法打开", lineId, platform.getCode()); + String platformDesc = getPlatformDesc(lineId, platform); + info = String.format("[%s号线]%s站台门无法打开", lineId, platformDesc); } case PLATFORM_DOOR_CANNOT_CLOSE -> { BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue( @@ -70,10 +74,28 @@ public class AlertDetailFactory { .eq(AlertTip::getAlertType, alertType); AlertTip alertTip = alertTipRepository.getOne(queryWrapper); alertTipId = alertTip == null ? null : alertTip.getId(); - info = String.format("[%s号线]%s站台门无法关闭", lineId, platform.getCode()); + String platformDesc = getPlatformDesc(lineId, platform); + info = String.format("[%s号线]%s站台门无法关闭", lineId, platformDesc); } default -> throw new IllegalStateException("Unexpected value: " + alertType); } return new AlertDetailImpl(alertType, now, alertTipId, info, mock); } + + private String getPlatformDesc(short lineId, Platform platform) { + Station station = LineGraphicDataRepository.getDeviceByCode(lineId, + platform.getRefStation(), Station.class); + return String.format("[%s][%s行站台]", station.getName(), platform.getUp() ? "上" : "下"); + } + + /** + * 获取集中站的联锁区描述。 + * 例如,鱼化寨站的联锁区叫“鱼化寨联锁区” + */ + private String getInterlockName(Station rtu) { + int index = rtu.getName().length() - 1; + char c = rtu.getName().charAt(index); + String interlockName = c == '站' ? rtu.getName().substring(0, index) : rtu.getName(); + return interlockName + "联锁区"; + } } diff --git a/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java b/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java index 3572c1d..a674aba 100644 --- a/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java +++ b/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java @@ -2,14 +2,17 @@ package club.joylink.xiannccda.ats.cache; import club.joylink.xiannccda.dto.protos.DeviceInfoProto; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto; +import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.CommonInfo; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.RelatedRef.DeviceType; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.RtssGraphicStorage; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Section; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Section.SectionType; import club.joylink.xiannccda.entity.PublishedGi; +import club.joylink.xiannccda.exception.BusinessExceptionAssertEnum; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.google.common.collect.HashBasedTable; +import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.GeneratedMessageV3.Builder; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.MessageOrBuilder; @@ -18,29 +21,39 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; import java.util.stream.Stream; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -/** 发布时缓存在内存中的线路数据 */ +/** + * 发布时缓存在内存中的线路数据 + */ @Slf4j public class LineGraphicDataRepository { - /** 线路数据信息 */ + /** + * 线路数据信息 + */ private static final Map>> lineGraphMap = new ConcurrentHashMap<>(); - /** 线路各坐标系转换关系 */ + /** + * 线路各坐标系转换关系 + */ private static final Map> lineCoordinateMain = new HashMap<>(); - /** 线路-设备code-设备 */ + /** + * 线路-设备code-设备 + */ private static final HashBasedTable line_code_table = HashBasedTable.create(); - /** 线路-设备。由于现在许多设备code都是"",使用line_code_table会覆盖,临时加此map,后续删除 */ - private static final HashMap> line_map = new HashMap<>(); + + /** + * 线路-设备id-设备 + */ + private static final HashBasedTable line_id_table = HashBasedTable.create(); /** * 缓存线路数据信息 @@ -75,7 +88,7 @@ public class LineGraphicDataRepository { /** * 获取线路上区段名为【sectionName】的公里标 * - * @param lineId 线路ID + * @param lineId 线路ID * @param sectionName 区段名称 * @return 公里标 */ @@ -101,43 +114,56 @@ public class LineGraphicDataRepository { return List.of(); } - /** 删除线路绘图数据 */ + /** + * 删除线路绘图数据 + */ public static void removeLineGraph(Integer id) { lineGraphMap.remove(id); } - public static T getDevice(short lineId, String code, Class cls) { - return (T) line_code_table.get(lineId, code); + public static T getDeviceByCode(short lineId, String code, Class cls) { + MessageOrBuilder mob = line_code_table.get(lineId, code); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(mob, + String.format("线路[%s]code[%s]", lineId, code)); + return (T) mob; + } + + public static T getDeviceById(short lineId, String id, Class cls) { + MessageOrBuilder mob = line_id_table.get(lineId, id); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(mob, + String.format("线路[%s]id[%s]", lineId, id)); + return (T) mob; } public static Stream getDevices(short lineId, Class cls) { - return line_map.get(lineId).stream() + return line_code_table.row(lineId).values().stream() .filter(builder -> cls.isAssignableFrom(builder.getClass())) .map(builder -> (T) builder); - // return line_code_table.row(lineId).values().stream() - // .filter(builder -> cls.isAssignableFrom(builder.getClass())) - // .map(builder -> (T) builder); } private static void fillLineCodeTable(Integer lineId, RtssGraphicStorage storage) { Short shortLineId = lineId.shortValue(); - List list = - storage.getAllFields().entrySet().stream() - .filter(entry -> entry.getKey().isRepeated()) - .flatMap(entry -> ((List) entry.getValue()).stream()) - .collect(Collectors.toList()); - line_map.put(shortLineId, list); - // storage.getAllFields().forEach((fd, value) -> { - // if (fd.isRepeated()) { - // List list = (List) value; - // for (MessageOrBuilder builder : list) { - // FieldDescriptor fieldDescriptor = - // builder.getDescriptorForType().findFieldByName("code"); - // String code = (String) builder.getField(fieldDescriptor); - // line_code_table.put(shortLineId, code, builder); - // } - // } - // }); + FieldDescriptor idField = CommonInfo.getDescriptor().findFieldByName("id"); + storage.getAllFields().forEach((fd, value) -> { + if (fd.isRepeated()) { + List list = (List) value; + for (MessageOrBuilder builder : list) { + FieldDescriptor codeField = + builder.getDescriptorForType().findFieldByName("code"); + String code = (String) builder.getField(codeField); + line_code_table.put(shortLineId, code, builder); + + FieldDescriptor commonField = + builder.getDescriptorForType().findFieldByName("common"); + if (commonField == null) { + continue; + } + MessageOrBuilder common = (MessageOrBuilder)builder.getField(commonField); + String id = (String) common.getField(idField); + line_code_table.put(shortLineId, id, builder); + } + } + }); } /** @@ -188,7 +214,7 @@ public class LineGraphicDataRepository { /** * 构建道岔信息 * - * @param lineId 线路ID + * @param lineId 线路ID * @param dataMap 缓存数据 * @param storage 地图构建数据 */ @@ -239,7 +265,7 @@ public class LineGraphicDataRepository { /** * 设置公里标 * - * @param lineId 线路ID + * @param lineId 线路ID * @param dataMap 缓存数据 * @param storage 地图构建数据 */ @@ -290,7 +316,7 @@ public class LineGraphicDataRepository { /** * 初始化坐标转换对象 * - * @param lineId 线路ID + * @param lineId 线路ID * @param dataMap 设备集合 * @param storage 地图信息 */ @@ -424,7 +450,9 @@ public class LineGraphicDataRepository { }); } - /** 坐标系枚举 */ + /** + * 坐标系枚举 + */ @Getter private enum CoordinateEnum { MAIN_LINE("MAIN_LINE", List.of("YDK", "ZDK", "XDK", "SDK")), @@ -469,7 +497,9 @@ public class LineGraphicDataRepository { } } - /** 坐标转换对象 */ + /** + * 坐标转换对象 + */ @Getter private static class CoordinateConvertor { @@ -484,8 +514,8 @@ public class LineGraphicDataRepository { /** * 生成坐标转换对象 * - * @param configSystem 原配置坐标系信息 - * @param convertorSystem 转换坐标系类型 + * @param configSystem 原配置坐标系信息 + * @param convertorSystem 转换坐标系类型 * @param convertorCoordinate 转换坐标 * @return 转换对象 */ @@ -537,7 +567,7 @@ public class LineGraphicDataRepository { * 将出入库公里标转换为正线标 * * @param basisKilometer 出入库基准公里标 - * @param targetType 目标坐标系 + * @param targetType 目标坐标系 * @return 正线公里标数字 */ public long convertorKilometer(KilometerSystem basisKilometer, CoordinateEnum targetType) { diff --git a/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java b/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java index 68367d3..78a65b7 100644 --- a/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java +++ b/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java @@ -16926,27 +16926,7 @@ public final class LayoutGraphicsProto { /** *
-     *上下行--upLink表示上行,downLink表示下行
-     * 
- * - * string upAndDown = 5; - * @return The upAndDown. - */ - java.lang.String getUpAndDown(); - /** - *
-     *上下行--upLink表示上行,downLink表示下行
-     * 
- * - * string upAndDown = 5; - * @return The bytes for upAndDown. - */ - com.google.protobuf.ByteString - getUpAndDownBytes(); - - /** - *
-     *关联的车站
+     *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
      * 
* * string refStation = 6; @@ -16955,7 +16935,7 @@ public final class LayoutGraphicsProto { java.lang.String getRefStation(); /** *
-     *关联的车站
+     *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
      * 
* * string refStation = 6; @@ -16963,6 +16943,16 @@ public final class LayoutGraphicsProto { */ com.google.protobuf.ByteString getRefStationBytes(); + + /** + *
+     *上下行--true表示上行,false表示下行
+     * 
+ * + * bool up = 7; + * @return The up. + */ + boolean getUp(); } /** * Protobuf type {@code graphicData.Platform} @@ -16979,7 +16969,6 @@ public final class LayoutGraphicsProto { private Platform() { code_ = ""; direction_ = ""; - upAndDown_ = ""; refStation_ = ""; } @@ -17130,59 +17119,12 @@ public final class LayoutGraphicsProto { } } - public static final int UPANDDOWN_FIELD_NUMBER = 5; - @SuppressWarnings("serial") - private volatile java.lang.Object upAndDown_ = ""; - /** - *
-     *上下行--upLink表示上行,downLink表示下行
-     * 
- * - * string upAndDown = 5; - * @return The upAndDown. - */ - @java.lang.Override - public java.lang.String getUpAndDown() { - java.lang.Object ref = upAndDown_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - upAndDown_ = s; - return s; - } - } - /** - *
-     *上下行--upLink表示上行,downLink表示下行
-     * 
- * - * string upAndDown = 5; - * @return The bytes for upAndDown. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUpAndDownBytes() { - java.lang.Object ref = upAndDown_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - upAndDown_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - public static final int REFSTATION_FIELD_NUMBER = 6; @SuppressWarnings("serial") private volatile java.lang.Object refStation_ = ""; /** *
-     *关联的车站
+     *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
      * 
* * string refStation = 6; @@ -17203,7 +17145,7 @@ public final class LayoutGraphicsProto { } /** *
-     *关联的车站
+     *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
      * 
* * string refStation = 6; @@ -17224,6 +17166,21 @@ public final class LayoutGraphicsProto { } } + public static final int UP_FIELD_NUMBER = 7; + private boolean up_ = false; + /** + *
+     *上下行--true表示上行,false表示下行
+     * 
+ * + * bool up = 7; + * @return The up. + */ + @java.lang.Override + public boolean getUp() { + return up_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -17250,12 +17207,12 @@ public final class LayoutGraphicsProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(direction_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, direction_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upAndDown_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, upAndDown_); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refStation_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, refStation_); } + if (up_ != false) { + output.writeBool(7, up_); + } getUnknownFields().writeTo(output); } @@ -17279,12 +17236,13 @@ public final class LayoutGraphicsProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(direction_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, direction_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upAndDown_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, upAndDown_); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refStation_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, refStation_); } + if (up_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, up_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -17311,10 +17269,10 @@ public final class LayoutGraphicsProto { != other.getHasdoor()) return false; if (!getDirection() .equals(other.getDirection())) return false; - if (!getUpAndDown() - .equals(other.getUpAndDown())) return false; if (!getRefStation() .equals(other.getRefStation())) return false; + if (getUp() + != other.getUp()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -17337,10 +17295,11 @@ public final class LayoutGraphicsProto { getHasdoor()); hash = (37 * hash) + DIRECTION_FIELD_NUMBER; hash = (53 * hash) + getDirection().hashCode(); - hash = (37 * hash) + UPANDDOWN_FIELD_NUMBER; - hash = (53 * hash) + getUpAndDown().hashCode(); hash = (37 * hash) + REFSTATION_FIELD_NUMBER; hash = (53 * hash) + getRefStation().hashCode(); + hash = (37 * hash) + UP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUp()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -17480,8 +17439,8 @@ public final class LayoutGraphicsProto { code_ = ""; hasdoor_ = false; direction_ = ""; - upAndDown_ = ""; refStation_ = ""; + up_ = false; return this; } @@ -17530,10 +17489,10 @@ public final class LayoutGraphicsProto { result.direction_ = direction_; } if (((from_bitField0_ & 0x00000010) != 0)) { - result.upAndDown_ = upAndDown_; + result.refStation_ = refStation_; } if (((from_bitField0_ & 0x00000020) != 0)) { - result.refStation_ = refStation_; + result.up_ = up_; } } @@ -17565,15 +17524,13 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000008; onChanged(); } - if (!other.getUpAndDown().isEmpty()) { - upAndDown_ = other.upAndDown_; + if (!other.getRefStation().isEmpty()) { + refStation_ = other.refStation_; bitField0_ |= 0x00000010; onChanged(); } - if (!other.getRefStation().isEmpty()) { - refStation_ = other.refStation_; - bitField0_ |= 0x00000020; - onChanged(); + if (other.getUp() != false) { + setUp(other.getUp()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -17623,16 +17580,16 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000008; break; } // case 34 - case 42: { - upAndDown_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; - break; - } // case 42 case 50: { refStation_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000010; break; } // case 50 + case 56: { + up_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 56 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -17977,102 +17934,10 @@ public final class LayoutGraphicsProto { return this; } - private java.lang.Object upAndDown_ = ""; - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @return The upAndDown. - */ - public java.lang.String getUpAndDown() { - java.lang.Object ref = upAndDown_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - upAndDown_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @return The bytes for upAndDown. - */ - public com.google.protobuf.ByteString - getUpAndDownBytes() { - java.lang.Object ref = upAndDown_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - upAndDown_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @param value The upAndDown to set. - * @return This builder for chaining. - */ - public Builder setUpAndDown( - java.lang.String value) { - if (value == null) { throw new NullPointerException(); } - upAndDown_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @return This builder for chaining. - */ - public Builder clearUpAndDown() { - upAndDown_ = getDefaultInstance().getUpAndDown(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @param value The bytes for upAndDown to set. - * @return This builder for chaining. - */ - public Builder setUpAndDownBytes( - com.google.protobuf.ByteString value) { - if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - upAndDown_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - private java.lang.Object refStation_ = ""; /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18092,7 +17957,7 @@ public final class LayoutGraphicsProto { } /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18113,7 +17978,7 @@ public final class LayoutGraphicsProto { } /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18124,13 +17989,13 @@ public final class LayoutGraphicsProto { java.lang.String value) { if (value == null) { throw new NullPointerException(); } refStation_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000010; onChanged(); return this; } /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18138,13 +18003,13 @@ public final class LayoutGraphicsProto { */ public Builder clearRefStation() { refStation_ = getDefaultInstance().getRefStation(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18156,10 +18021,54 @@ public final class LayoutGraphicsProto { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); refStation_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean up_ ; + /** + *
+       *上下行--true表示上行,false表示下行
+       * 
+ * + * bool up = 7; + * @return The up. + */ + @java.lang.Override + public boolean getUp() { + return up_; + } + /** + *
+       *上下行--true表示上行,false表示下行
+       * 
+ * + * bool up = 7; + * @param value The up to set. + * @return This builder for chaining. + */ + public Builder setUp(boolean value) { + + up_ = value; bitField0_ |= 0x00000020; onChanged(); return this; } + /** + *
+       *上下行--true表示上行,false表示下行
+       * 
+ * + * bool up = 7; + * @return This builder for chaining. + */ + public Builder clearUp() { + bitField0_ = (bitField0_ & ~0x00000020); + up_ = false; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -40831,78 +40740,78 @@ public final class LayoutGraphicsProto { "\n\007Polygon\022\'\n\006common\030\001 \001(\0132\027.graphicData." + "CommonInfo\022\014\n\004code\030\002 \001(\t\022\021\n\tlineWidth\030\003 " + "\001(\005\022\021\n\tlineColor\030\004 \001(\t\022\"\n\006points\030\005 \003(\0132\022" + - ".graphicData.Point\"\214\001\n\010Platform\022\'\n\006commo" + + ".graphicData.Point\"\205\001\n\010Platform\022\'\n\006commo" + "n\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code" + "\030\002 \001(\t\022\017\n\007hasdoor\030\003 \001(\010\022\021\n\tdirection\030\004 \001" + - "(\t\022\021\n\tupAndDown\030\005 \001(\t\022\022\n\nrefStation\030\006 \001(" + - "\t\"\270\001\n\007Station\022\'\n\006common\030\001 \001(\0132\027.graphicD" + - "ata.CommonInfo\022\014\n\004code\030\002 \001(\t\022\022\n\nhasContr" + - "ol\030\003 \001(\010\022\035\n\025concentrationStations\030\004 \001(\010\022" + - "5\n\017kilometerSystem\030\006 \001(\0132\034.graphicData.K" + - "ilometerSystem\022\014\n\004name\030\007 \001(\t\"k\n\013StationL" + - "ine\022\'\n\006common\030\001 \001(\0132\027.graphicData.Common" + - "Info\022\014\n\004code\030\002 \001(\t\022\023\n\013hasTransfer\030\003 \001(\010\022" + - "\020\n\010hideName\030\004 \001(\010\"Y\n\013TrainWindow\022\'\n\006comm" + - "on\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004cod" + - "e\030\002 \001(\t\022\023\n\013refDeviceId\030\003 \003(\t\"\256\001\n\014AxleCou" + - "nting\022\'\n\006common\030\001 \001(\0132\027.graphicData.Comm" + - "onInfo\022\014\n\004code\030\002 \001(\t\0225\n\017kilometerSystem\030" + - "\003 \001(\0132\034.graphicData.KilometerSystem\0220\n\017a" + - "xleCountingRef\030\004 \003(\0132\027.graphicData.Relat" + - "edRef\">\n\005Train\022\'\n\006common\030\001 \001(\0132\027.graphic" + - "Data.CommonInfo\022\014\n\004code\030\002 \001(\t\"B\n\tTrainLi" + - "ne\022\'\n\006common\030\001 \001(\0132\027.graphicData.CommonI" + - "nfo\022\014\n\004code\030\002 \001(\t\"@\n\007IscsFan\022\'\n\006common\030\001" + - " \001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 " + - "\001(\t\"\333\002\n\007Turnout\022\'\n\006common\030\001 \001(\0132\027.graphi" + - "cData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006pointA" + - "\030\006 \003(\0132\022.graphicData.Point\022\"\n\006pointB\030\007 \003" + - "(\0132\022.graphicData.Point\022\"\n\006pointC\030\010 \003(\0132\022" + - ".graphicData.Point\022&\n\005paRef\030\t \001(\0132\027.grap" + - "hicData.RelatedRef\022&\n\005pbRef\030\n \001(\0132\027.grap" + - "hicData.RelatedRef\022&\n\005pcRef\030\013 \001(\0132\027.grap" + - "hicData.RelatedRef\0225\n\017kilometerSystem\030\r " + - "\003(\0132\034.graphicData.KilometerSystem\">\n\017Kil" + - "ometerSystem\022\021\n\tkilometer\030\001 \001(\003\022\030\n\020coord" + - "inateSystem\030\002 \001(\t\"\206\001\n\006Signal\022\'\n\006common\030\001" + - " \001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 " + - "\001(\t\022\016\n\006mirror\030\003 \001(\010\0225\n\017kilometerSystem\030\006" + - " \001(\0132\034.graphicData.KilometerSystem\"\340\001\n\007R" + - "unLine\022\'\n\006common\030\001 \001(\0132\027.graphicData.Com" + - "monInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022." + - "graphicData.Point\022\021\n\tnameColor\030\004 \001(\t\022\023\n\013" + - "nameBgColor\030\005 \001(\t\022\022\n\ncontainSta\030\010 \003(\t\022\025\n" + - "\rlinkPathLines\030\t \003(\t\022\016\n\006lineId\030\n \001(\t\022\027\n\017" + - "dashPointIndexs\030\013 \003(\005\"\337\002\n\007Section\022\'\n\006com" + - "mon\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004co" + - "de\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.P" + - "oint\022&\n\005paRef\030\004 \001(\0132\027.graphicData.Relate" + - "dRef\022&\n\005pbRef\030\005 \001(\0132\027.graphicData.Relate" + - "dRef\0225\n\013sectionType\030\006 \001(\0162 .graphicData." + - "Section.SectionType\022\025\n\raxleCountings\030\007 \003" + - "(\t\022\020\n\010children\030\010 \003(\t\022\027\n\017destinationCode\030" + - "\t \001(\t\"0\n\013SectionType\022\014\n\010Physical\020\000\022\023\n\017Tu" + - "rnoutPhysical\020\002\"i\n\014LogicSection\022\'\n\006commo" + - "n\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code" + - "\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.Poi" + - "nt\"V\n\016KilometerPoint\022!\n\005point\030\001 \001(\0132\022.gr" + - "aphicData.Point\022\021\n\tkilometer\030\002 \001(\003\022\016\n\006st" + - "Name\030\003 \001(\t\"\277\001\n\010PathLine\022\'\n\006common\030\001 \001(\0132" + - "\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\"" + - "\n\006points\030\003 \003(\0132\022.graphicData.Point\022\014\n\004is" + - "Up\030\004 \001(\010\0224\n\017kilometerPoints\030\005 \003(\0132\033.grap" + - "hicData.KilometerPoint\022\024\n\014isKmIncrease\030\006" + - " \001(\010\"\366\001\n\nRelatedRef\0226\n\ndeviceType\030\001 \001(\0162" + - "\".graphicData.RelatedRef.DeviceType\022\n\n\002i" + - "d\030\002 \001(\t\0226\n\ndevicePort\030\003 \001(\0162\".graphicDat" + - "a.RelatedRef.DevicePort\"I\n\nDeviceType\022\013\n" + - "\007Section\020\000\022\013\n\007Turnout\020\001\022\017\n\013TrainWindow\020\002" + - "\022\020\n\014AxleCounting\020\003\"!\n\nDevicePort\022\005\n\001A\020\000\022" + - "\005\n\001B\020\001\022\005\n\001C\020\002\"Y\n\tSeparator\022\'\n\006common\030\001 \001" + + "(\t\022\022\n\nrefStation\030\006 \001(\t\022\n\n\002up\030\007 \001(\010\"\270\001\n\007S" + + "tation\022\'\n\006common\030\001 \001(\0132\027.graphicData.Com" + + "monInfo\022\014\n\004code\030\002 \001(\t\022\022\n\nhasControl\030\003 \001(" + + "\010\022\035\n\025concentrationStations\030\004 \001(\010\0225\n\017kilo" + + "meterSystem\030\006 \001(\0132\034.graphicData.Kilomete" + + "rSystem\022\014\n\004name\030\007 \001(\t\"k\n\013StationLine\022\'\n\006" + + "common\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n" + + "\004code\030\002 \001(\t\022\023\n\013hasTransfer\030\003 \001(\010\022\020\n\010hide" + + "Name\030\004 \001(\010\"Y\n\013TrainWindow\022\'\n\006common\030\001 \001(" + + "\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t" + + "\022\023\n\013refDeviceId\030\003 \003(\t\"\256\001\n\014AxleCounting\022\'" + + "\n\006common\030\001 \001(\0132\027.graphicData.CommonInfo\022" + + "\014\n\004code\030\002 \001(\t\0225\n\017kilometerSystem\030\003 \001(\0132\034" + + ".graphicData.KilometerSystem\0220\n\017axleCoun" + + "tingRef\030\004 \003(\0132\027.graphicData.RelatedRef\">" + + "\n\005Train\022\'\n\006common\030\001 \001(\0132\027.graphicData.Co" + + "mmonInfo\022\014\n\004code\030\002 \001(\t\"B\n\tTrainLine\022\'\n\006c" + + "ommon\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004" + + "code\030\002 \001(\t\"@\n\007IscsFan\022\'\n\006common\030\001 \001(\0132\027." + + "graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\"\333\002\n" + + "\007Turnout\022\'\n\006common\030\001 \001(\0132\027.graphicData.C" + + "ommonInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006pointA\030\006 \003(\0132" + + "\022.graphicData.Point\022\"\n\006pointB\030\007 \003(\0132\022.gr" + + "aphicData.Point\022\"\n\006pointC\030\010 \003(\0132\022.graphi" + + "cData.Point\022&\n\005paRef\030\t \001(\0132\027.graphicData" + + ".RelatedRef\022&\n\005pbRef\030\n \001(\0132\027.graphicData" + + ".RelatedRef\022&\n\005pcRef\030\013 \001(\0132\027.graphicData" + + ".RelatedRef\0225\n\017kilometerSystem\030\r \003(\0132\034.g" + + "raphicData.KilometerSystem\">\n\017KilometerS" + + "ystem\022\021\n\tkilometer\030\001 \001(\003\022\030\n\020coordinateSy" + + "stem\030\002 \001(\t\"\206\001\n\006Signal\022\'\n\006common\030\001 \001(\0132\027." + + "graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\016\n\006" + + "mirror\030\003 \001(\010\0225\n\017kilometerSystem\030\006 \001(\0132\034." + + "graphicData.KilometerSystem\"\340\001\n\007RunLine\022" + + "\'\n\006common\030\001 \001(\0132\027.graphicData.CommonInfo" + + "\022\014\n\004code\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphic" + + "Data.Point\022\021\n\tnameColor\030\004 \001(\t\022\023\n\013nameBgC" + + "olor\030\005 \001(\t\022\022\n\ncontainSta\030\010 \003(\t\022\025\n\rlinkPa" + + "thLines\030\t \003(\t\022\016\n\006lineId\030\n \001(\t\022\027\n\017dashPoi" + + "ntIndexs\030\013 \003(\005\"\337\002\n\007Section\022\'\n\006common\030\001 \001" + "(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(" + - "\t\022\025\n\rseparatorType\030\003 \001(\tB8\n!club.joylink" + - ".xiannccda.dto.protosB\023LayoutGraphicsPro" + - "tob\006proto3" + "\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.Point\022&\n" + + "\005paRef\030\004 \001(\0132\027.graphicData.RelatedRef\022&\n" + + "\005pbRef\030\005 \001(\0132\027.graphicData.RelatedRef\0225\n" + + "\013sectionType\030\006 \001(\0162 .graphicData.Section" + + ".SectionType\022\025\n\raxleCountings\030\007 \003(\t\022\020\n\010c" + + "hildren\030\010 \003(\t\022\027\n\017destinationCode\030\t \001(\t\"0" + + "\n\013SectionType\022\014\n\010Physical\020\000\022\023\n\017TurnoutPh" + + "ysical\020\002\"i\n\014LogicSection\022\'\n\006common\030\001 \001(\013" + + "2\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022" + + "\"\n\006points\030\003 \003(\0132\022.graphicData.Point\"V\n\016K" + + "ilometerPoint\022!\n\005point\030\001 \001(\0132\022.graphicDa" + + "ta.Point\022\021\n\tkilometer\030\002 \001(\003\022\016\n\006stName\030\003 " + + "\001(\t\"\277\001\n\010PathLine\022\'\n\006common\030\001 \001(\0132\027.graph" + + "icData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006point" + + "s\030\003 \003(\0132\022.graphicData.Point\022\014\n\004isUp\030\004 \001(" + + "\010\0224\n\017kilometerPoints\030\005 \003(\0132\033.graphicData" + + ".KilometerPoint\022\024\n\014isKmIncrease\030\006 \001(\010\"\366\001" + + "\n\nRelatedRef\0226\n\ndeviceType\030\001 \001(\0162\".graph" + + "icData.RelatedRef.DeviceType\022\n\n\002id\030\002 \001(\t" + + "\0226\n\ndevicePort\030\003 \001(\0162\".graphicData.Relat" + + "edRef.DevicePort\"I\n\nDeviceType\022\013\n\007Sectio" + + "n\020\000\022\013\n\007Turnout\020\001\022\017\n\013TrainWindow\020\002\022\020\n\014Axl" + + "eCounting\020\003\"!\n\nDevicePort\022\005\n\001A\020\000\022\005\n\001B\020\001\022" + + "\005\n\001C\020\002\"Y\n\tSeparator\022\'\n\006common\030\001 \001(\0132\027.gr" + + "aphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\025\n\rse" + + "paratorType\030\003 \001(\tB8\n!club.joylink.xiannc" + + "cda.dto.protosB\023LayoutGraphicsProtob\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -40967,7 +40876,7 @@ public final class LayoutGraphicsProto { internal_static_graphicData_Platform_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_graphicData_Platform_descriptor, - new java.lang.String[] { "Common", "Code", "Hasdoor", "Direction", "UpAndDown", "RefStation", }); + new java.lang.String[] { "Common", "Code", "Hasdoor", "Direction", "RefStation", "Up", }); internal_static_graphicData_Station_descriptor = getDescriptor().getMessageTypes().get(10); internal_static_graphicData_Station_fieldAccessorTable = new diff --git a/src/main/java/club/joylink/xiannccda/service/AlertMockService.java b/src/main/java/club/joylink/xiannccda/service/AlertMockService.java index 38fa659..fe070fc 100644 --- a/src/main/java/club/joylink/xiannccda/service/AlertMockService.java +++ b/src/main/java/club/joylink/xiannccda/service/AlertMockService.java @@ -34,11 +34,13 @@ public class AlertMockService { switch (alertType) { case BLUE_DISPLAY -> { Stream stream = LineGraphicDataRepository.getDevices(lineId, Station.class); - messageOrBuilder = stream.findFirst() + messageOrBuilder = stream + .filter(Station::getConcentrationStations) + .findFirst() .orElseThrow(BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL::exception); } case TRAIN_DELAY -> { - throw BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.exception(); + throw BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.exception("尚未实现"); } case PLATFORM_DOOR_WITHOUT_LOCKED_SIGNAL, PLATFORM_DOOR_CANNOT_OPEN, PLATFORM_DOOR_CANNOT_CLOSE -> { Stream stream = LineGraphicDataRepository.getDevices(lineId, Platform.class);