diff --git a/src/main/java/club/joylink/rtss/constants/BusinessConsts.java b/src/main/java/club/joylink/rtss/constants/BusinessConsts.java index 8fa1e82d2..f4d7ead9e 100644 --- a/src/main/java/club/joylink/rtss/constants/BusinessConsts.java +++ b/src/main/java/club/joylink/rtss/constants/BusinessConsts.java @@ -599,6 +599,11 @@ public interface BusinessConsts { * 道岔计轴区段 */ String Type04 = "04"; + + /** + * 岔心 + */ + String Type05 = "05"; } } diff --git a/src/main/java/club/joylink/rtss/services/DraftMapService.java b/src/main/java/club/joylink/rtss/services/DraftMapService.java index 0f8b0be9e..7358f0613 100644 --- a/src/main/java/club/joylink/rtss/services/DraftMapService.java +++ b/src/main/java/club/joylink/rtss/services/DraftMapService.java @@ -287,6 +287,7 @@ public class DraftMapService implements IDraftMapService { List sectionList = graphDataNewVO.getSectionList(); for (MapSectionNewVO section : sectionList) { if (Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type04) || + Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type05) || (!section.isReentryTrack() && !section.isTransferTrack())) { section.setReentryTrack(false); section.setReentryTrackName(null); @@ -295,7 +296,8 @@ public class DraftMapService implements IDraftMapService { section.setDestinationCodePoint(null); } if (Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type01) || - Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type04)) { + Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type04) || + Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type05)) { section.setParentCode(null); } } diff --git a/src/main/java/club/joylink/rtss/services/completition/CompetitionUserLikeManager.java b/src/main/java/club/joylink/rtss/services/completition/CompetitionUserLikeManager.java index 64f91c6f8..99e2a2294 100644 --- a/src/main/java/club/joylink/rtss/services/completition/CompetitionUserLikeManager.java +++ b/src/main/java/club/joylink/rtss/services/completition/CompetitionUserLikeManager.java @@ -35,10 +35,8 @@ public class CompetitionUserLikeManager extends CustomCommandLineRunner { */ private final Map>> userLikesMap = new HashMap<>(); - - @Override - public void execute() { + public void run(String... args) throws Exception { log.debug("点赞数据pull任务启动"); super.executeContinuously(() -> { List likes = mocksLikesDAO.selectByExampleWithBLOBs(null); @@ -56,7 +54,7 @@ public class CompetitionUserLikeManager extends CustomCommandLineRunner { @Scheduled(fixedRate = 1 * 60 * 1000) public void save() { if (super.storable()){ - log.debug("push点赞数据,旧剩余推送次数{}",super.remainTimes); + log.debug("push点赞数据"); List list = new ArrayList<>(); userLikesMap.forEach((p, map) -> { map.forEach((id, ids) -> { @@ -109,4 +107,6 @@ public class CompetitionUserLikeManager extends CustomCommandLineRunner { vo.setUserLikes(userLikes); return vo; } + + } diff --git a/src/main/java/club/joylink/rtss/services/completition/CustomCommandLineRunner.java b/src/main/java/club/joylink/rtss/services/completition/CustomCommandLineRunner.java index aca5cf085..3fc6fdbc7 100644 --- a/src/main/java/club/joylink/rtss/services/completition/CustomCommandLineRunner.java +++ b/src/main/java/club/joylink/rtss/services/completition/CustomCommandLineRunner.java @@ -14,15 +14,8 @@ public abstract class CustomCommandLineRunner implements CommandLineRunner { @Getter - private volatile boolean available = false; + private boolean available = false; protected final AtomicBoolean change = new AtomicBoolean(false); - protected byte remainTimes = 100; - @Override - public void run(String... args) throws Exception { - execute(); - } - - public abstract void execute(); /** * 连续间断执行 @@ -66,17 +59,6 @@ public abstract class CustomCommandLineRunner implements CommandLineRunner { } protected boolean storable() { - if (available) { - if (change.getAndSet(false)) { - remainTimes = 100; - return true; - } else { - if (remainTimes != 0) { - remainTimes--; - return true; - } - } - } - return false; + return available && change.getAndSet(false); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapElement.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapElement.java index 4c1381c43..3c0ea71c8 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapElement.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapElement.java @@ -55,6 +55,8 @@ public abstract class MapElement { DIRECTION_ROD, /** 接触网 */ CATENARY, + /**应答器*/ + RESPONDER } /** 设备唯一编号 */ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Responder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Responder.java new file mode 100644 index 000000000..bfa047196 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Responder.java @@ -0,0 +1,43 @@ +package club.joylink.rtss.simulation.cbtc.data.map; + +import lombok.Getter; +import lombok.Setter; + +/** + * 区段 + */ +@Getter +@Setter +public class Responder extends MapNamedElement { + + public Responder(String code, String name) { + super(code, name, DeviceType.RESPONDER); + + } + + // ------------------固有属性/关联关系--------------------- + + /** + * 所属设备集中站 + */ + private Station deviceStation; + + + // ------------------状态属性--------------------- + + + @Override + public void reset() { + + } + + + public enum ResponderType { + /** 固定应答器*/ + FB, + /** 可变应答器*/ + VB, + /**填充应答器*/ + IB + } +} diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapGraphDataNewVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapGraphDataNewVO.java index fa2b634d4..4e0063658 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapGraphDataNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapGraphDataNewVO.java @@ -154,6 +154,9 @@ public class MapGraphDataNewVO { @ApiModelProperty(value = "方向杆") private List directionRodList; + @ApiModelProperty(value = "应答器") + private List responderList; + public MapGraphDataNewVO() { this.bigScreenConfig = new BigScreenConfig(); this.generateConfig = new MapCiGenerateConfig(); @@ -186,6 +189,7 @@ public class MapGraphDataNewVO { this.splitStationList = new ArrayList<>(); this.arrowList = new ArrayList<>(); this.directionRodList = new ArrayList<>(); + this.responderList = new ArrayList<>(); } public static MapGraphDataNewVO parse(String graphData) { diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapResponderVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapResponderVO.java new file mode 100644 index 000000000..286f879db --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapResponderVO.java @@ -0,0 +1,61 @@ +package club.joylink.rtss.vo.client.map.newmap; + +import club.joylink.rtss.simulation.cbtc.data.map.Responder; +import club.joylink.rtss.vo.client.Point; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@ApiModel(value="应答器草稿数据") +@NoArgsConstructor +@Getter +@Setter +@EqualsAndHashCode +public class MapResponderVO { + + /**编码*/ + @NotBlank(message="编码不能为空") + private String code; + + /**名称*/ + @NotNull(message="名称不能为Null") + private String name; + + /** 类型*/ + @ApiModelProperty(value = "区段类型") + @NotNull(message="区段类型不能为Null") + private Responder.ResponderType type; + + /**区段偏移*/ + private float offset; + + /** 坐标*/ + @NotNull(message="坐标不能为Null") + private Point position; + + /**应答器旋转*/ + @ApiModelProperty(value = "应答器旋转") + @NotNull(message="应答器旋转角度不能为Null") + private Integer rotate; + + /**文字偏移*/ + @NotNull(message="文字偏移坐标不能为Null") + private Point textOffset; + /**文字旋转*/ + @NotNull(message="文字旋转不能为Null") + private Integer textRotate; + + /**关联集中站 编号*/ + @NotNull(message="关联集中站不能为Null") + private String stationCode; + + /**关联区段 编号*/ + @NotNull(message="关联区段不能为Null") + private String sectionCode; +} diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapSectionNewVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapSectionNewVO.java index 1bdb66831..bc3ed755a 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapSectionNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapSectionNewVO.java @@ -149,7 +149,7 @@ public class MapSectionNewVO { private String parentCode; /** - * 区段类型:物理区段01/逻辑区段02/道岔物理区段03/道岔计轴区段04 + * 区段类型:物理区段01/逻辑区段02/道岔物理区段03/道岔计轴区段04/岔心05 */ @ApiModelProperty(value = "区段类型") @NotNull(message="区段类型不能为Null") @@ -171,6 +171,11 @@ public class MapSectionNewVO { */ @ApiModelProperty(value = "道岔计轴区段关联道岔区段列表") List relevanceSectionList; + /** + * 岔心关联道岔区段列表 + */ + @ApiModelProperty(value = "岔心关联道岔区段列表") + List relateSectionList; /** * 是否站台轨