仿真背景保存添加车站的新字段;IBP盘加新按钮类型;IBP盘按按钮接口修改;添加接口查询车站下的区段和地图下的区段

This commit is contained in:
joylink_zhangsai 2021-02-23 09:50:42 +08:00
parent 74c5ba1a2e
commit 70e60808ac
9 changed files with 162 additions and 12 deletions

View File

@ -11,10 +11,7 @@ import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.*; import club.joylink.rtss.vo.client.*;
import club.joylink.rtss.vo.client.local.LocalDataVO; import club.joylink.rtss.vo.client.local.LocalDataVO;
import club.joylink.rtss.vo.client.map.*; import club.joylink.rtss.vo.client.map.*;
import club.joylink.rtss.vo.client.map.newmap.MapGraphDataNewVO; import club.joylink.rtss.vo.client.map.newmap.*;
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.validGroup.MapInfoSortCheck; import club.joylink.rtss.vo.client.validGroup.MapInfoSortCheck;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -251,6 +248,12 @@ public class MapController {
return this.iMapService.getStationHasPsdStands(id, stationCode); return this.iMapService.getStationHasPsdStands(id, stationCode);
} }
@ApiOperation("获取地图车站下的区段")
@GetMapping("/{id}/station/{stationCode}/sections")
public List<MapSectionNewVO> querySectionsUnderTheStation(@PathVariable Long id, @PathVariable String stationCode){
return this.iMapService.querySectionsUnderTheStation(id, stationCode);
}
@ApiOperation(value = "获取地图站台关联的屏蔽门") @ApiOperation(value = "获取地图站台关联的屏蔽门")
@GetMapping("/{id}/stand/{standCode}/psd") @GetMapping("/{id}/stand/{standCode}/psd")
public List<MapPSDVO> getStandPsds(@PathVariable Long id, public List<MapPSDVO> getStandPsds(@PathVariable Long id,
@ -287,4 +290,10 @@ public class MapController {
public List<MapStationNewVO> getAllStations() { public List<MapStationNewVO> getAllStations() {
return iMapService.getAllStations(); return iMapService.getAllStations();
} }
@ApiOperation("查询地图下所有区段")
@GetMapping("/{id}/sections")
public List<MapSectionNewVO> querySectionsUnderMap(@PathVariable Long id) {
return iMapService.querySectionsUnderMap(id);
}
} }

View File

@ -276,8 +276,8 @@ public class SimulationV1Controller {
@ApiOperation("按下IBP盘按钮") @ApiOperation("按下IBP盘按钮")
@PutMapping("/{group}/ibp/{button}") @PutMapping("/{group}/ibp/{button}")
public void pressIbpButton(@PathVariable String group, String stationCode, @PathVariable VirtualRealityIbp.Button button) { public void pressIbpButton(@PathVariable String group, String stationCode, @PathVariable VirtualRealityIbp.ButtonType button, String buttonCode) {
iVirtualRealityIBPService.pressTheButton(group, stationCode, button); iVirtualRealityIBPService.pressTheButton(group, stationCode, button, buttonCode);
} }
@ApiOperation("查询报警列表") @ApiOperation("查询报警列表")

View File

@ -8,6 +8,7 @@ import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.*; import club.joylink.rtss.vo.client.map.*;
import club.joylink.rtss.vo.client.map.newmap.MapPSDVO; 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.MapStationNewVO;
import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO; import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO;
@ -281,4 +282,14 @@ public interface IMapService {
* 获取所有车站 * 获取所有车站
*/ */
List<MapStationNewVO> getAllStations(); List<MapStationNewVO> getAllStations();
/**
* 查询地图/车站下的区段
*/
List<MapSectionNewVO> querySectionsUnderTheStation(Long id, String stationCode);
/**
* 查询地图下的所有区段
*/
List<MapSectionNewVO> querySectionsUnderMap(Long id);
} }

View File

@ -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的状态数据 * 收集并发送IBP的状态数据

View File

@ -23,6 +23,7 @@ import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.*; import club.joylink.rtss.vo.client.map.*;
import club.joylink.rtss.vo.client.map.newmap.MapPSDVO; 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.MapStationNewVO;
import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO; import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO;
import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO; 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()); .map(MapVO::findSortedAllStationListNew).flatMap(Collection::stream).collect(Collectors.toList());
} }
@Override
public List<MapSectionNewVO> 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<MapSectionNewVO> querySectionsUnderMap(Long id) {
MapVO mapDetail = getMapDetail(id);
return mapDetail.getGraphDataNew().getSectionList();
}
/** /**
* 该版本的地图数据是否存在 * 该版本的地图数据是否存在
*/ */

View File

@ -55,7 +55,7 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService {
} }
@Override @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(group);
Objects.requireNonNull(button); Objects.requireNonNull(button);
@ -109,6 +109,9 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService {
case SXYS: case SXYS:
ibp.setSxys(!ibp.isSxys()); ibp.setSxys(!ibp.isSxys());
break; break;
case PRERESET:
ciApiService.axlePreReset(simulation, buttonCode);
break;
} }
} }

View File

@ -178,7 +178,81 @@ public class WechatPayService {
// System.out.println(decryptToString(associated_data.getBytes(), nonce.getBytes(), ciphertext)); // System.out.println(decryptToString(associated_data.getBytes(), nonce.getBytes(), ciphertext));
WechatPayService service = new WechatPayService(); 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();
} }
/** /**

View File

@ -1,17 +1,21 @@
package club.joylink.rtss.simulation.cbtc.data.storage.device; 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.Simulation;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; 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.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.map.Station;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer; import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer; 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.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import java.time.LocalTime;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
@Getter @Getter
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@ -49,6 +53,18 @@ public class StorageStation extends StorageDevice {
*/ */
private Integer validDuration; 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) { public StorageStation(String code) {
super(code); super(code);
} }
@ -75,6 +91,18 @@ public class StorageStation extends StorageDevice {
if (station.getValidDuration() != null) { if (station.getValidDuration() != null) {
storageStation.setValidDuration(station.getValidDuration()); 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; return storageStation;
} }
@ -92,5 +120,11 @@ public class StorageStation extends StorageDevice {
} }
station.setApply2TheControlMode(apply2TheControlMode); station.setApply2TheControlMode(apply2TheControlMode);
station.setValidDuration(validDuration); 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)));
} }
} }

View File

@ -44,7 +44,7 @@ public class VirtualRealityIbp {
this.xxys = false; this.xxys = false;
} }
public enum Button{ public enum ButtonType {
//------------------ 信号 ------------------ //------------------ 信号 ------------------
/** 下行扣车 */ /** 下行扣车 */
XXKC, XXKC,
@ -70,5 +70,9 @@ public class VirtualRealityIbp {
SXKM, SXKM,
/** 上行钥匙 */ /** 上行钥匙 */
SXYS, SXYS,
//------------------ 区段 ------------------
/** 预复位 */
PRERESET,
} }
} }