diff --git a/src/main/java/club/joylink/rtss/controller/publish/MapController.java b/src/main/java/club/joylink/rtss/controller/publish/MapController.java index 51cb6bafa..64009d08a 100644 --- a/src/main/java/club/joylink/rtss/controller/publish/MapController.java +++ b/src/main/java/club/joylink/rtss/controller/publish/MapController.java @@ -11,10 +11,7 @@ import club.joylink.rtss.vo.UserVO; import club.joylink.rtss.vo.client.*; import club.joylink.rtss.vo.client.local.LocalDataVO; import club.joylink.rtss.vo.client.map.*; -import club.joylink.rtss.vo.client.map.newmap.MapGraphDataNewVO; -import club.joylink.rtss.vo.client.map.newmap.MapPSDVO; -import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO; -import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO; +import club.joylink.rtss.vo.client.map.newmap.*; import club.joylink.rtss.vo.client.validGroup.MapInfoSortCheck; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -251,6 +248,12 @@ public class MapController { return this.iMapService.getStationHasPsdStands(id, stationCode); } + @ApiOperation("获取地图车站下的区段") + @GetMapping("/{id}/station/{stationCode}/sections") + public List querySectionsUnderTheStation(@PathVariable Long id, @PathVariable String stationCode){ + return this.iMapService.querySectionsUnderTheStation(id, stationCode); + } + @ApiOperation(value = "获取地图站台关联的屏蔽门") @GetMapping("/{id}/stand/{standCode}/psd") public List getStandPsds(@PathVariable Long id, @@ -287,4 +290,10 @@ public class MapController { public List getAllStations() { return iMapService.getAllStations(); } + + @ApiOperation("查询地图下所有区段") + @GetMapping("/{id}/sections") + public List querySectionsUnderMap(@PathVariable Long id) { + return iMapService.querySectionsUnderMap(id); + } } diff --git a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java index 3129c1a61..d78321009 100644 --- a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java +++ b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java @@ -276,8 +276,8 @@ public class SimulationV1Controller { @ApiOperation("按下IBP盘按钮") @PutMapping("/{group}/ibp/{button}") - public void pressIbpButton(@PathVariable String group, String stationCode, @PathVariable VirtualRealityIbp.Button button) { - iVirtualRealityIBPService.pressTheButton(group, stationCode, button); + public void pressIbpButton(@PathVariable String group, String stationCode, @PathVariable VirtualRealityIbp.ButtonType button, String buttonCode) { + iVirtualRealityIBPService.pressTheButton(group, stationCode, button, buttonCode); } @ApiOperation("查询报警列表") diff --git a/src/main/java/club/joylink/rtss/services/IMapService.java b/src/main/java/club/joylink/rtss/services/IMapService.java index c801dba73..4549e4d82 100644 --- a/src/main/java/club/joylink/rtss/services/IMapService.java +++ b/src/main/java/club/joylink/rtss/services/IMapService.java @@ -8,6 +8,7 @@ import club.joylink.rtss.vo.client.PageQueryVO; import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.map.*; import club.joylink.rtss.vo.client.map.newmap.MapPSDVO; +import club.joylink.rtss.vo.client.map.newmap.MapSectionNewVO; import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO; import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO; @@ -281,4 +282,14 @@ public interface IMapService { * 获取所有车站 */ List getAllStations(); + + /** + * 查询地图/车站下的区段 + */ + List querySectionsUnderTheStation(Long id, String stationCode); + + /** + * 查询地图下的所有区段 + */ + List querySectionsUnderMap(Long id); } diff --git a/src/main/java/club/joylink/rtss/services/IVirtualRealityIbpService.java b/src/main/java/club/joylink/rtss/services/IVirtualRealityIbpService.java index a8d469bff..fe7797398 100644 --- a/src/main/java/club/joylink/rtss/services/IVirtualRealityIbpService.java +++ b/src/main/java/club/joylink/rtss/services/IVirtualRealityIbpService.java @@ -15,8 +15,9 @@ public interface IVirtualRealityIbpService { /** * 按下按钮 + * @param buttonCode 区分统一类型按钮,目前只是宁波一的区段按钮 */ - void pressTheButton(String group, String stationCode, VirtualRealityIbp.Button button); + void pressTheButton(String group, String stationCode, VirtualRealityIbp.ButtonType button, String buttonCode); /** * 收集并发送IBP的状态数据 diff --git a/src/main/java/club/joylink/rtss/services/MapService.java b/src/main/java/club/joylink/rtss/services/MapService.java index 4e038e094..c2c14a9b7 100644 --- a/src/main/java/club/joylink/rtss/services/MapService.java +++ b/src/main/java/club/joylink/rtss/services/MapService.java @@ -23,6 +23,7 @@ import club.joylink.rtss.vo.client.PageQueryVO; import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.map.*; import club.joylink.rtss.vo.client.map.newmap.MapPSDVO; +import club.joylink.rtss.vo.client.map.newmap.MapSectionNewVO; import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO; import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO; import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO; @@ -839,6 +840,19 @@ public class MapService implements IMapService { .map(MapVO::findSortedAllStationListNew).flatMap(Collection::stream).collect(Collectors.toList()); } + @Override + public List querySectionsUnderTheStation(Long id, String stationCode) { + MapVO mapDetail = getMapDetail(id); + return mapDetail.getGraphDataNew().getSectionList().stream() + .filter(section -> Objects.equals(section.getBelongStation(), stationCode)).collect(Collectors.toList()); + } + + @Override + public List querySectionsUnderMap(Long id) { + MapVO mapDetail = getMapDetail(id); + return mapDetail.getGraphDataNew().getSectionList(); + } + /** * 该版本的地图数据是否存在 */ diff --git a/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java b/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java index c3be33172..7e6e65a2e 100644 --- a/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java +++ b/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java @@ -55,7 +55,7 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { } @Override - public void pressTheButton(String group, String stationCode, VirtualRealityIbp.Button button) { + public void pressTheButton(String group, String stationCode, VirtualRealityIbp.ButtonType button, String buttonCode) { Objects.requireNonNull(group); Objects.requireNonNull(button); @@ -109,6 +109,9 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { case SXYS: ibp.setSxys(!ibp.isSxys()); break; + case PRERESET: + ciApiService.axlePreReset(simulation, buttonCode); + break; } } diff --git a/src/main/java/club/joylink/rtss/services/pay/wechat/WechatPayService.java b/src/main/java/club/joylink/rtss/services/pay/wechat/WechatPayService.java index 4cf4c5485..36d2e463b 100644 --- a/src/main/java/club/joylink/rtss/services/pay/wechat/WechatPayService.java +++ b/src/main/java/club/joylink/rtss/services/pay/wechat/WechatPayService.java @@ -178,7 +178,81 @@ public class WechatPayService { // System.out.println(decryptToString(associated_data.getBytes(), nonce.getBytes(), ciphertext)); WechatPayService service = new WechatPayService(); - service.queryOrder("2021012900013"); + new Thread(() -> { + try { + service.queryOrder("2021012900013"); + System.out.println("Thread_" + 1); + for (; ; ) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + new Thread(() -> { + try { + service.queryOrder("2021012900013"); + System.out.println("Thread_" + 2); + for (; ; ) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + new Thread(() -> { + try { + service.queryOrder("2021012900013"); + System.out.println("Thread_" + 3); + for (; ; ) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + new Thread(() -> { + try { + service.queryOrder("2021012900013"); + System.out.println("Thread_" + 4); + for (; ; ) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + new Thread(() -> { + try { + service.queryOrder("2021012900013"); + System.out.println("Thread_" + 5); + for (; ; ) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); } /** diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/device/StorageStation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/device/StorageStation.java index e9dc9ea8b..b247ab032 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/device/StorageStation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/device/StorageStation.java @@ -1,17 +1,21 @@ package club.joylink.rtss.simulation.cbtc.data.storage.device; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.map.MapElement; import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer; import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import java.time.LocalTime; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicInteger; + @Getter @Setter @NoArgsConstructor @@ -49,6 +53,18 @@ public class StorageStation extends StorageDevice { */ private Integer validDuration; + private Boolean interlockMachineStarting; + + private LocalTime restartTime; + + private String controller; + + private Boolean emergencyController; + + private String controlApplicant; + + private Integer preResetValidDuration; + public StorageStation(String code) { super(code); } @@ -75,6 +91,18 @@ public class StorageStation extends StorageDevice { if (station.getValidDuration() != null) { storageStation.setValidDuration(station.getValidDuration()); } + if (station.isInterlockMachineStarting()) { + storageStation.setInterlockMachineStarting(station.isInterlockMachineStarting()); + } + storageStation.setRestartTime(station.getRestartTime()); + storageStation.setController(station.getControllerId()); + if (station.isEmergencyController()) { + storageStation.setEmergencyController(station.isEmergencyController()); + } + storageStation.setControlApplicant(station.getControlApplicantId()); + if (station.getPreResetValidDuration() != null && station.getPreResetValidDuration().get() != 0) { + storageStation.setPreResetValidDuration(station.getPreResetValidDuration().get()); + } return storageStation; } @@ -92,5 +120,11 @@ public class StorageStation extends StorageDevice { } station.setApply2TheControlMode(apply2TheControlMode); station.setValidDuration(validDuration); + station.setInterlockMachineStarting(interlockMachineStarting != null ? interlockMachineStarting : false); + station.setRestartTime(restartTime); + station.setController(controller != null ? simulation.getSimulationMemberById(controller) : null); + station.setEmergencyController(emergencyController != null ? emergencyController : false); + station.setControlApplicant(controlApplicant != null ? simulation.getSimulationMemberById(controlApplicant) : null); + station.setPreResetValidDuration(new AtomicInteger(Objects.requireNonNullElse(preResetValidDuration, 0))); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityIbp.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityIbp.java index c1bb91ad8..00c6d6a48 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityIbp.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityIbp.java @@ -44,7 +44,7 @@ public class VirtualRealityIbp { this.xxys = false; } - public enum Button{ + public enum ButtonType { //------------------ 信号 ------------------ /** 下行扣车 */ XXKC, @@ -70,5 +70,9 @@ public class VirtualRealityIbp { SXKM, /** 上行钥匙 */ SXYS, + + //------------------ 区段 ------------------ + /** 预复位 */ + PRERESET, } }