实训修改,教学成绩导出学号修改
This commit is contained in:
parent
e3a44e76f4
commit
09298761bf
@ -185,7 +185,7 @@ public interface GeneratorNew {
|
|||||||
* @param string
|
* @param string
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean containPlaceholder(String string) {
|
default boolean containPlaceholder(String string) {
|
||||||
if (StringUtils.hasText(string)) {
|
if (StringUtils.hasText(string)) {
|
||||||
return Pattern.matches(".*\\{\\d+}.*", string);
|
return Pattern.matches(".*\\{\\d+}.*", string);
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ public interface GeneratorNew {
|
|||||||
* @param mapDevice
|
* @param mapDevice
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String replacePlaceholder(String str, Map<String, OperatePlaceholderVO> placeholderVOMap, MapElement mapDevice, Object mapButton, MapVO map) {
|
default String replacePlaceholder(String str, Map<String, OperatePlaceholderVO> placeholderVOMap, MapElement mapDevice, Object mapButton, MapVO map) {
|
||||||
Pattern pattern = Pattern.compile(".*?(\\{(\\d+)}).*?");
|
Pattern pattern = Pattern.compile(".*?(\\{(\\d+)}).*?");
|
||||||
Matcher matcher = pattern.matcher(str);
|
Matcher matcher = pattern.matcher(str);
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
|
@ -1,35 +1,89 @@
|
|||||||
package club.joylink.rtss.services.training.generatornew.base;
|
package club.joylink.rtss.services.training.generatornew.base;
|
||||||
|
|
||||||
|
import club.joylink.rtss.constants.BusinessConsts;
|
||||||
|
import club.joylink.rtss.services.training.constant.TrainingConsts;
|
||||||
import club.joylink.rtss.services.training.data.GenerateConfig;
|
import club.joylink.rtss.services.training.data.GenerateConfig;
|
||||||
import club.joylink.rtss.services.training.generatornew.GeneratorNew;
|
import club.joylink.rtss.services.training.generatornew.GeneratorNew;
|
||||||
import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew;
|
import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew;
|
||||||
|
import club.joylink.rtss.simulation.cbtc.ATP.ground.TempSpeedLimitService;
|
||||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||||
|
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||||
|
import club.joylink.rtss.simulation.cbtc.data.storage.StorageSimulation;
|
||||||
|
import club.joylink.rtss.vo.client.map.MapTempSpeedLimitVO;
|
||||||
|
import club.joylink.rtss.vo.client.map.newmap.MapAutomaticRouteButtonVO;
|
||||||
|
import club.joylink.rtss.vo.client.map.newmap.MapCycleButtonVO;
|
||||||
|
import club.joylink.rtss.vo.client.map.newmap.MapTotalGuideLockButtonVO;
|
||||||
|
import club.joylink.rtss.vo.client.map.newmap.MapTurnBackStrategyVO;
|
||||||
|
import club.joylink.rtss.vo.client.training.TrainingStepVO;
|
||||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||||
|
import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO;
|
||||||
|
import club.joylink.rtss.vo.client.training.definition.OperateStepVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@GeneratorSelectorNew(operateObject = Operation.Object.WholeLineTempSpeedLimit)
|
@GeneratorSelectorNew(operateObject = Operation.Object.LimitControl)
|
||||||
public class SpeedLimitGeneratorNew implements GeneratorNew {
|
public class SpeedLimitGeneratorNew implements GeneratorNew {
|
||||||
|
|
||||||
private final static int LIMIT_SPEED = 30;
|
private final static int LIMIT_SPEED = 30;
|
||||||
|
@Autowired
|
||||||
|
private TempSpeedLimitService tempSpeedLimitService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TrainingNewVO> generate(GenerateConfig config, Simulation simulation, OperateDefinitionVO operateDefinitionVO) {
|
public List<TrainingNewVO> generate(GenerateConfig config, Simulation simulation, OperateDefinitionVO operateDefinitionVO) {
|
||||||
List<TrainingNewVO> trainingVOList = new ArrayList<>();
|
List<TrainingNewVO> trainingVOList = new ArrayList<>();
|
||||||
//TODO
|
simulation.getRepository().getSectionList().forEach(section -> tempSpeedLimitService.setSectionLimitSpeed(simulation, section, LIMIT_SPEED));
|
||||||
// simulation.getRepository().getSectionList()
|
switch (Operation.Type.valueOf(operateDefinitionVO.getOperateType())) {
|
||||||
// tempLimitSpeedList.forEach(tempLimitSpeed -> {
|
case Cancel_All_Limit_Speed: // 取消全线临时限速
|
||||||
// switch (Operation.Type.valueOf (operateDefinitionVO.getOperateType())) {
|
List<MapTempSpeedLimitVO> tempSpeedLimitList = simulation.getBuildParams().getMap().getGraphDataNew().getTempSpeedLimitList();
|
||||||
// case Cancel_Whole_Line_Temp_Speed_Limit: // 取消全线临时限速
|
tempSpeedLimitList.forEach(mapTempSpeedLimitVO -> {
|
||||||
// trainingVOList.add(cancelWholeLineTempSpeedLimit(tempLimitSpeed, config, simulation, operateDefinitionVO));
|
trainingVOList.add(this.build(config, simulation,null,mapTempSpeedLimitVO, operateDefinitionVO));
|
||||||
// break;
|
simulation.reset();
|
||||||
// }
|
});
|
||||||
// });
|
break;
|
||||||
|
}
|
||||||
return trainingVOList;
|
return trainingVOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TrainingNewVO build(GenerateConfig config, Simulation simulation, MapElement nullableDevice, Object mapButton, OperateDefinitionVO operateDefinitionVO) {
|
||||||
|
|
||||||
|
// 实训基本信息
|
||||||
|
TrainingNewVO trainingVO = new TrainingNewVO(config, operateDefinitionVO);
|
||||||
|
// 设置每一步操作的设备
|
||||||
|
List<OperateStepVO> stepList = operateDefinitionVO.getStepVOList();
|
||||||
|
stepList.get(0).setDeviceCode(((MapTempSpeedLimitVO) mapButton).getCode());
|
||||||
|
Map<String, OperatePlaceholderVO> placeholderVOMap = operateDefinitionVO.getPlaceholderVOMap();
|
||||||
|
// 设置定位
|
||||||
|
trainingVO.setLocateDeviceCode(((MapTempSpeedLimitVO) mapButton).getCode());
|
||||||
|
// 替换占位符
|
||||||
|
if (containPlaceholder(trainingVO.getName())) {
|
||||||
|
trainingVO.setName(replacePlaceholder(trainingVO.getName(), placeholderVOMap, nullableDevice, mapButton, simulation.getBuildParams().getMap()));
|
||||||
|
}
|
||||||
|
if (containPlaceholder(trainingVO.getRemarks())) {
|
||||||
|
trainingVO.setRemarks(replacePlaceholder(trainingVO.getRemarks(), placeholderVOMap, nullableDevice, mapButton, simulation.getBuildParams().getMap()));
|
||||||
|
}
|
||||||
|
// 添加步骤
|
||||||
|
List<TrainingStepVO> steps = new ArrayList<>(stepList.size());
|
||||||
|
stepList.forEach(operateStepVO -> {
|
||||||
|
TrainingStepVO stepVO = new TrainingStepVO(operateStepVO);
|
||||||
|
if (containPlaceholder(stepVO.getTip())) {
|
||||||
|
stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, nullableDevice, mapButton, simulation.getBuildParams().getMap()));
|
||||||
|
}
|
||||||
|
if (containPlaceholder(stepVO.getVal())) {
|
||||||
|
stepVO.setVal(replacePlaceholder(stepVO.getVal(), placeholderVOMap, nullableDevice, mapButton, simulation.getBuildParams().getMap()));
|
||||||
|
}
|
||||||
|
steps.add(stepVO);
|
||||||
|
});
|
||||||
|
trainingVO.setSteps(steps);
|
||||||
|
trainingVO.setScenes(new StorageSimulation(simulation, false));
|
||||||
|
return trainingVO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package club.joylink.rtss.services.training.generatornew.base;
|
package club.joylink.rtss.services.training.generatornew.base;
|
||||||
|
|
||||||
|
import club.joylink.rtss.constants.BusinessConsts;
|
||||||
import club.joylink.rtss.services.training.data.GenerateConfig;
|
import club.joylink.rtss.services.training.data.GenerateConfig;
|
||||||
import club.joylink.rtss.services.training.generatornew.GeneratorNew;
|
import club.joylink.rtss.services.training.generatornew.GeneratorNew;
|
||||||
import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew;
|
import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew;
|
||||||
@ -76,7 +77,8 @@ public class StationGeneratorNew implements GeneratorNew {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Station_CIArea_Close_AllSignal:
|
case Station_CIArea_Close_AllSignal:
|
||||||
station.setControlMode(Station.ControlMode.Center);
|
if(!station.isInterlock())continue;
|
||||||
|
station.getDeviceStation().setControlMode(Station.ControlMode.Center);
|
||||||
// simulation.getRepository().getSignalList().stream()
|
// simulation.getRepository().getSignalList().stream()
|
||||||
// .filter(s -> Objects.equals(station.getCode(), s.getInterlockStation().getCode()))
|
// .filter(s -> Objects.equals(station.getCode(), s.getInterlockStation().getCode()))
|
||||||
// .forEach(signal -> {
|
// .forEach(signal -> {
|
||||||
@ -86,7 +88,13 @@ public class StationGeneratorNew implements GeneratorNew {
|
|||||||
// });
|
// });
|
||||||
break;
|
break;
|
||||||
case Station_Close_AllSignal:
|
case Station_Close_AllSignal:
|
||||||
|
if (BusinessConsts.MapPrd.PrdType.Type01.equals(config.getPrdType())) {
|
||||||
|
if(station.isCentralized()) {
|
||||||
station.setControlMode(Station.ControlMode.Local);
|
station.setControlMode(Station.ControlMode.Local);
|
||||||
|
}else{
|
||||||
|
station.getDeviceStation().setControlMode(Station.ControlMode.Local);
|
||||||
|
}
|
||||||
|
}
|
||||||
// simulation.getRepository().getSignalList().stream()
|
// simulation.getRepository().getSignalList().stream()
|
||||||
// .filter(s -> Objects.equals(station.getCode(), s.getDeviceStation().getCode()))
|
// .filter(s -> Objects.equals(station.getCode(), s.getDeviceStation().getCode()))
|
||||||
// .forEach(signal -> {
|
// .forEach(signal -> {
|
||||||
@ -99,7 +107,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
|||||||
if(!station.isTurnBack()) {
|
if(!station.isTurnBack()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
station.setControlMode(Station.ControlMode.Center);
|
station.getDeviceStation().setControlMode(Station.ControlMode.Center);
|
||||||
if(operateDefinitionVO.turnBackStrategyButton()){
|
if(operateDefinitionVO.turnBackStrategyButton()){
|
||||||
simulation.getBuildParams().getMap().getGraphDataNew().getTbStrategyList()
|
simulation.getBuildParams().getMap().getGraphDataNew().getTbStrategyList()
|
||||||
.stream().filter(turnBackStrategyO -> turnBackStrategyO.getStationCode().equals(station.getCode()))
|
.stream().filter(turnBackStrategyO -> turnBackStrategyO.getStationCode().equals(station.getCode()))
|
||||||
@ -115,7 +123,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
station.setControlMode(Station.ControlMode.Local);
|
station.setControlMode(Station.ControlMode.Local);
|
||||||
station.setRestartTime(LocalTime.now());
|
station.setRestartTime(LocalTime.of(2,0));
|
||||||
List<Section> sections = simulation.getRepository().getSectionList();
|
List<Section> sections = simulation.getRepository().getSectionList();
|
||||||
sections.stream().filter(section -> Objects.equals(section.getDeviceStation(), station)).forEach(section -> section.setFaultLock(true));
|
sections.stream().filter(section -> Objects.equals(section.getDeviceStation(), station)).forEach(section -> section.setFaultLock(true));
|
||||||
break;
|
break;
|
||||||
@ -203,6 +211,16 @@ public class StationGeneratorNew implements GeneratorNew {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
case Station_Set_Or_Cancel_Force_Physical_Signal:
|
||||||
|
if(!station.isInterlock())continue;
|
||||||
|
if (BusinessConsts.MapPrd.PrdType.Type01.equals(config.getPrdType())) {
|
||||||
|
if(station.isCentralized()) {
|
||||||
|
station.setControlMode(Station.ControlMode.Local);
|
||||||
|
}else{
|
||||||
|
station.getDeviceStation().setControlMode(Station.ControlMode.Local);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// 其他操作,不生成
|
// 其他操作,不生成
|
||||||
continue;
|
continue;
|
||||||
|
@ -395,7 +395,7 @@ public class Operation {
|
|||||||
/** 集中站 */
|
/** 集中站 */
|
||||||
Station,
|
Station,
|
||||||
/**全线临时限速*/
|
/**全线临时限速*/
|
||||||
WholeLineTempSpeedLimit
|
LimitControl
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@OperateHandler
|
@OperateHandler
|
||||||
@ -170,7 +171,10 @@ public class StandOperateHandler {
|
|||||||
* 区间列车数量限制
|
* 区间列车数量限制
|
||||||
*/
|
*/
|
||||||
@OperateHandlerMapping(type = Operation.Type.Stand_Set_Hold_Train_Auto)
|
@OperateHandlerMapping(type = Operation.Type.Stand_Set_Hold_Train_Auto)
|
||||||
public void setHoldTrainAuto(Simulation simulation, String standCode, int limit) {
|
public void setHoldTrainAuto(Simulation simulation, String standCode, Integer limit) {
|
||||||
|
if (Objects.isNull(limit)) {
|
||||||
|
limit = 0;
|
||||||
|
}
|
||||||
atsStandService.setAutoHoldTrainLimit(simulation, standCode, limit);
|
atsStandService.setAutoHoldTrainLimit(simulation, standCode, limit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ public class StationOperateHandler {
|
|||||||
@OperateHandlerMapping(type = Operation.Type.Station_Close_AllSignal)
|
@OperateHandlerMapping(type = Operation.Type.Station_Close_AllSignal)
|
||||||
public void closeAllSignal(Simulation simulation, String stationCode){
|
public void closeAllSignal(Simulation simulation, String stationCode){
|
||||||
SimulationDataRepository repository = simulation.getRepository();
|
SimulationDataRepository repository = simulation.getRepository();
|
||||||
repository.getSignalList().stream().filter(s -> Objects.equals(stationCode,s.getDeviceStation().getCode())).forEach(signal -> ciApiService.blockadeSignal(simulation, signal.getCode()));
|
repository.getSignalList().stream().filter(s -> Objects.equals(stationCode,s.getStation().getCode())).forEach(signal -> ciApiService.blockadeSignal(simulation, signal.getCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**关区信号*/
|
/**关区信号*/
|
||||||
|
@ -517,9 +517,14 @@ public class CiApiServiceImpl implements CiApiService {
|
|||||||
station = station.getDeviceStation();
|
station = station.getDeviceStation();
|
||||||
}
|
}
|
||||||
Station deviceStation = station;
|
Station deviceStation = station;
|
||||||
if (Objects.nonNull(deviceStation.getRestartTime()) && deviceStation.getRestartTime().plusMinutes(8).isBefore(LocalTime.now())) {
|
if (Objects.nonNull(deviceStation.getRestartTime())
|
||||||
|
&& deviceStation.getRestartTime().isBefore(LocalTime.now())
|
||||||
|
&& ((Simulation.FunctionalType.LESSON.equals(simulation.getBuildParams().getFunctionalType())
|
||||||
|
||Simulation.FunctionalType.EXAM.equals(simulation.getBuildParams().getFunctionalType()))
|
||||||
|
?true: deviceStation.getRestartTime().plusMinutes(8).isAfter(LocalTime.now()))) {
|
||||||
List<Section> sections = simulation.getRepository().getSectionList();
|
List<Section> sections = simulation.getRepository().getSectionList();
|
||||||
sections.stream().filter(section -> Objects.equals(section.getDeviceStation(), deviceStation)).forEach(Section::faultUnlock);
|
sections.stream().filter(section -> Objects.equals(section.getDeviceStation(), deviceStation)).forEach(Section::faultUnlock);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
throw BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.exception("无效操作或连锁机重启过8分钟需手动解锁");
|
throw BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.exception("无效操作或连锁机重启过8分钟需手动解锁");
|
||||||
}
|
}
|
||||||
|
@ -866,6 +866,14 @@ public class MapDeviceBuilder {
|
|||||||
} else {
|
} else {
|
||||||
signal.setDeviceStation(deviceStation);
|
signal.setDeviceStation(deviceStation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 所属车站
|
||||||
|
// Station station = (Station) elementMap.get(signalVO.getBelongStationCode());
|
||||||
|
// if (Objects.isNull(station)) {
|
||||||
|
// errMsgList.add(String.format("信号机[%s(%s)]未设置所属车站或所属车站不存在", signal.getName(), signal.getCode()));
|
||||||
|
// } else {
|
||||||
|
// signal.setStation(station);
|
||||||
|
// }
|
||||||
// 所属联锁站
|
// 所属联锁站
|
||||||
Station interlockStation = ((Station) elementMap.get(signalVO.getInterlockStationCode()));
|
Station interlockStation = ((Station) elementMap.get(signalVO.getInterlockStationCode()));
|
||||||
if (Objects.isNull(interlockStation)) {
|
if (Objects.isNull(interlockStation)) {
|
||||||
|
@ -35,6 +35,11 @@ public class Signal extends MayOutOfOrderDevice {
|
|||||||
*/
|
*/
|
||||||
private Station deviceStation;
|
private Station deviceStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属车站
|
||||||
|
*/
|
||||||
|
private Station station;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联锁站
|
* 联锁站
|
||||||
*/
|
*/
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package club.joylink.rtss.vo.client.student;
|
package club.joylink.rtss.vo.client.student;
|
||||||
|
|
||||||
|
import club.joylink.rtss.services.OrgUserService;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@ApiModel(value = "导出学生信息")
|
@ApiModel(value = "导出学生信息")
|
||||||
@Getter
|
@Getter
|
||||||
@ -27,4 +30,12 @@ public class ExportStudentInfo {
|
|||||||
public ExportStudentInfo() {
|
public ExportStudentInfo() {
|
||||||
this.scores = new ArrayList<>();
|
this.scores = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getStudentID() {
|
||||||
|
if(Objects.nonNull(studentID)){
|
||||||
|
return studentID.substring(0,studentID.indexOf(OrgUserService.companyCodePrefix));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user