Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
cbdb41ac0d
@ -536,6 +536,13 @@ public class ExamService implements IExamService{
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ExamDefinition> findEntities(Long lessonId) {
|
||||||
|
ExamDefinitionExample example = new ExamDefinitionExample();
|
||||||
|
example.createCriteria().andLessonIdEqualTo(lessonId);
|
||||||
|
return examDefinitionDAO.selectByExample(example);
|
||||||
|
}
|
||||||
|
|
||||||
private List<ExamDefinition> findEntityByLessonIdList(ArrayList<Long> lessonIdList) {
|
private List<ExamDefinition> findEntityByLessonIdList(ArrayList<Long> lessonIdList) {
|
||||||
ExamDefinitionExample example = new ExamDefinitionExample();
|
ExamDefinitionExample example = new ExamDefinitionExample();
|
||||||
example.createCriteria().andLessonIdIn(lessonIdList);
|
example.createCriteria().andLessonIdIn(lessonIdList);
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
package club.joylink.rtss.services;
|
package club.joylink.rtss.services;
|
||||||
|
|
||||||
|
import club.joylink.rtss.entity.ExamDefinition;
|
||||||
import club.joylink.rtss.vo.UserVO;
|
import club.joylink.rtss.vo.UserVO;
|
||||||
import club.joylink.rtss.vo.client.*;
|
import club.joylink.rtss.vo.client.ExamDefinitionQueryVO;
|
||||||
|
import club.joylink.rtss.vo.client.ExamDefinitionVO;
|
||||||
|
import club.joylink.rtss.vo.client.ExamsLessonVO;
|
||||||
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -26,14 +30,11 @@ public interface IExamService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询课程所属产品下有实训的实训类型
|
* 查询课程所属产品下有实训的实训类型
|
||||||
* @param lessonId
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
List<String> queryTrainingTypes(Long lessonId);
|
List<String> queryTrainingTypes(Long lessonId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询试题定义的详细信息
|
* 查询试题定义的详细信息
|
||||||
* @param examId
|
|
||||||
*/
|
*/
|
||||||
ExamDefinitionVO queryExamInfo(Long examId);
|
ExamDefinitionVO queryExamInfo(Long examId);
|
||||||
|
|
||||||
@ -59,32 +60,28 @@ public interface IExamService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据课程和实训类型查询实训数量
|
* 根据课程和实训类型查询实训数量
|
||||||
* @param lessonId
|
|
||||||
* @param trainingType
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
Long queryTrainingNum(Long lessonId, String trainingType, String operateType);
|
Long queryTrainingNum(Long lessonId, String trainingType, String operateType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 试题上线
|
* 试题上线
|
||||||
* @param id
|
|
||||||
* @param userVO
|
|
||||||
*/
|
*/
|
||||||
void onLine(Long id, UserVO userVO);
|
void onLine(Long id, UserVO userVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 试题下线
|
* 试题下线
|
||||||
* @param id
|
|
||||||
* @param userVO
|
|
||||||
*/
|
*/
|
||||||
void offLine(Long id, UserVO userVO);
|
void offLine(Long id, UserVO userVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新试题
|
* 更新试题
|
||||||
* @param id
|
|
||||||
* @param examDefinitionVO
|
|
||||||
*/
|
*/
|
||||||
void update(Long id, ExamDefinitionVO examDefinitionVO);
|
void update(Long id, ExamDefinitionVO examDefinitionVO);
|
||||||
|
|
||||||
void copy(Map<Long, Long> lessonRelationMap, UserVO user);
|
void copy(Map<Long, Long> lessonRelationMap, UserVO user);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据课程id查询考试
|
||||||
|
*/
|
||||||
|
List<ExamDefinition> findEntities(Long lessonId);
|
||||||
}
|
}
|
||||||
|
@ -619,7 +619,7 @@ public class LessonService implements ILessonService {
|
|||||||
if (Objects.nonNull(existedDefaultLesson)) {
|
if (Objects.nonNull(existedDefaultLesson)) {
|
||||||
lesson.setId(existedDefaultLesson.getId());
|
lesson.setId(existedDefaultLesson.getId());
|
||||||
lessonDAO.updateByPrimaryKey(lesson);
|
lessonDAO.updateByPrimaryKey(lesson);
|
||||||
//存在默认课程删除旧版本、章节、考试及关联实训数据
|
//存在默认课程删除旧版本、章节、章节关联的实训
|
||||||
LsLessonVersionExample versionExample = new LsLessonVersionExample();
|
LsLessonVersionExample versionExample = new LsLessonVersionExample();
|
||||||
versionExample.createCriteria().andLessonIdEqualTo(existedDefaultLesson.getId());
|
versionExample.createCriteria().andLessonIdEqualTo(existedDefaultLesson.getId());
|
||||||
lessonVersionDAO.deleteByExample(versionExample);
|
lessonVersionDAO.deleteByExample(versionExample);
|
||||||
@ -632,21 +632,21 @@ public class LessonService implements ILessonService {
|
|||||||
chapterExample.createCriteria().andLessonIdEqualTo(existedDefaultLesson.getId());
|
chapterExample.createCriteria().andLessonIdEqualTo(existedDefaultLesson.getId());
|
||||||
lessonChapterDAO.deleteByExample(chapterExample);
|
lessonChapterDAO.deleteByExample(chapterExample);
|
||||||
|
|
||||||
ExamDefinitionExample examDefinitionExample = new ExamDefinitionExample();
|
// ExamDefinitionExample examDefinitionExample = new ExamDefinitionExample();
|
||||||
examDefinitionExample.createCriteria().andLessonIdEqualTo(existedDefaultLesson.getId());
|
// examDefinitionExample.createCriteria().andLessonIdEqualTo(existedDefaultLesson.getId());
|
||||||
List<ExamDefinition> examDefinitions = examDefinitionDAO.selectByExample(examDefinitionExample);
|
// List<ExamDefinition> examDefinitions = examDefinitionDAO.selectByExample(examDefinitionExample);
|
||||||
if (!CollectionUtils.isEmpty(examDefinitions)) {
|
// if (!CollectionUtils.isEmpty(examDefinitions)) {
|
||||||
List<Long> list = examDefinitions.stream().map(ExamDefinition::getId).collect(Collectors.toList());
|
// List<Long> list = examDefinitions.stream().map(ExamDefinition::getId).collect(Collectors.toList());
|
||||||
ExamDefinitionRulesExample rulesExample = new ExamDefinitionRulesExample();
|
// ExamDefinitionRulesExample rulesExample = new ExamDefinitionRulesExample();
|
||||||
rulesExample.createCriteria().andExamIdIn(list);
|
// rulesExample.createCriteria().andExamIdIn(list);
|
||||||
definitionRulesDAO.deleteByExample(rulesExample);
|
// definitionRulesDAO.deleteByExample(rulesExample);
|
||||||
examDefinitionDAO.deleteByExample(examDefinitionExample);
|
// examDefinitionDAO.deleteByExample(examDefinitionExample);
|
||||||
}
|
// }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
lessonDAO.insert(lesson);
|
lessonDAO.insert(lesson);
|
||||||
}
|
}
|
||||||
//版本0.0
|
//课程版本0.0
|
||||||
LsLessonVersion lessonVersion = new LsLessonVersion();
|
LsLessonVersion lessonVersion = new LsLessonVersion();
|
||||||
lessonVersion.setLessonId(lesson.getId());
|
lessonVersion.setLessonId(lesson.getId());
|
||||||
lessonVersion.setCreatorId(lesson.getCreatorId());
|
lessonVersion.setCreatorId(lesson.getCreatorId());
|
||||||
@ -654,6 +654,7 @@ public class LessonService implements ILessonService {
|
|||||||
lessonVersion.setVersion(BusinessConsts.Lesson.Version.originalVersion);
|
lessonVersion.setVersion(BusinessConsts.Lesson.Version.originalVersion);
|
||||||
lessonVersionDAO.insert(lessonVersion);
|
lessonVersionDAO.insert(lessonVersion);
|
||||||
|
|
||||||
|
//生成课程的章节
|
||||||
List<Training> examTrainings = new ArrayList<>(20);
|
List<Training> examTrainings = new ArrayList<>(20);
|
||||||
int orderNum = 1;
|
int orderNum = 1;
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
@ -687,6 +688,8 @@ public class LessonService implements ILessonService {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
List<ExamDefinition> exams = iExamService.findEntities(lesson.getId());
|
||||||
|
if (CollectionUtils.isEmpty(exams)) {
|
||||||
//试卷定义
|
//试卷定义
|
||||||
if (CollectionUtils.isEmpty(examTrainings)) {
|
if (CollectionUtils.isEmpty(examTrainings)) {
|
||||||
return;
|
return;
|
||||||
@ -714,7 +717,6 @@ public class LessonService implements ILessonService {
|
|||||||
examRules.setOperateType(training.getOperateType());
|
examRules.setOperateType(training.getOperateType());
|
||||||
definitionRulesDAO.insert(examRules);
|
definitionRulesDAO.insert(examRules);
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
examDefinition.setFullPoint(100);
|
examDefinition.setFullPoint(100);
|
||||||
examDefinition.setPassingPoint(60);
|
examDefinition.setPassingPoint(60);
|
||||||
@ -732,4 +734,5 @@ public class LessonService implements ILessonService {
|
|||||||
} while (i++ < 20);
|
} while (i++ < 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,8 +279,15 @@ public class AtsStationService {
|
|||||||
* @param station
|
* @param station
|
||||||
*/
|
*/
|
||||||
public void surrenderControl(Simulation simulation, SimulationMember member, Station station) {
|
public void surrenderControl(Simulation simulation, SimulationMember member, Station station) {
|
||||||
Station controlModeStation = station.getControlModeStation();
|
Station deviceStation;
|
||||||
controlModeStation.surrenderControl();
|
if (station.isCentralized()) {
|
||||||
|
deviceStation = station;
|
||||||
|
} else {
|
||||||
|
deviceStation = station.getDeviceStation();
|
||||||
|
}
|
||||||
|
SimulationDataRepository repository = simulation.getRepository();
|
||||||
|
Set<Station> stations = repository.getStationsByDeviceStations(deviceStation);
|
||||||
|
stations.forEach(Station::surrenderControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -291,13 +298,18 @@ public class AtsStationService {
|
|||||||
* @param station
|
* @param station
|
||||||
*/
|
*/
|
||||||
public void receiveControl(Simulation simulation, SimulationMember member, Station station) {
|
public void receiveControl(Simulation simulation, SimulationMember member, Station station) {
|
||||||
Station controlModeStation = station.getControlModeStation();
|
Station deviceStation;
|
||||||
|
if (station.isCentralized()) {
|
||||||
|
deviceStation = station;
|
||||||
|
} else {
|
||||||
|
deviceStation = station.getDeviceStation();
|
||||||
|
}
|
||||||
|
SimulationDataRepository repository = simulation.getRepository();
|
||||||
|
Set<Station> stations = repository.getStationsByDeviceStations(deviceStation);
|
||||||
if (member.isDispatcher()) {
|
if (member.isDispatcher()) {
|
||||||
// 行调
|
stations.forEach(Station::occControl);
|
||||||
controlModeStation.occControl();
|
|
||||||
} else if (member.isStationSupervisor()) {
|
} else if (member.isStationSupervisor()) {
|
||||||
// 车站
|
stations.forEach(Station::localControl);
|
||||||
controlModeStation.localControl();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,9 +23,6 @@ public class MapDeviceBuilder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验并构建设备数据
|
* 校验并构建设备数据
|
||||||
*
|
|
||||||
* @param graphData
|
|
||||||
* @param mapDataBuildResult
|
|
||||||
*/
|
*/
|
||||||
static void checkAndBuildMapDeviceData(MapGraphDataNewVO graphData, SimulationBuilder.SimulationDeviceBuildResult mapDataBuildResult) {
|
static void checkAndBuildMapDeviceData(MapGraphDataNewVO graphData, SimulationBuilder.SimulationDeviceBuildResult mapDataBuildResult) {
|
||||||
Map<String, MapElement> elementMap = mapDataBuildResult.getDeviceMap();
|
Map<String, MapElement> elementMap = mapDataBuildResult.getDeviceMap();
|
||||||
@ -41,65 +38,7 @@ public class MapDeviceBuilder {
|
|||||||
elementMap.put(zc.getCode(), zc);
|
elementMap.put(zc.getCode(), zc);
|
||||||
});
|
});
|
||||||
// 车站
|
// 车站
|
||||||
List<MapStationNewVO> stationList = graphData.getStationList();
|
buildStation(graphData, elementMap, errMsgList);
|
||||||
stationList.forEach(stationVO -> {
|
|
||||||
Station station = new Station(stationVO.getCode(), stationVO.getName());
|
|
||||||
if (Objects.nonNull(elementMap.get(station.getCode()))) {
|
|
||||||
errMsgList.add(String.format("编码为[%s]的车站不唯一", station.getCode()));
|
|
||||||
}
|
|
||||||
elementMap.put(station.getCode(), station);
|
|
||||||
station.setCentralized(stationVO.isCentralized());
|
|
||||||
if (station.isCentralized()) {
|
|
||||||
ZC zc = (ZC) elementMap.get(stationVO.getZcCode());
|
|
||||||
if (Objects.isNull(zc)) {
|
|
||||||
errMsgList.add(String.format("车站[%s(%s)]未关联ZC或ZC不存在,请在ZC设备处选择管理的集中站列表", station.getName(), station.getCode()));
|
|
||||||
} else {
|
|
||||||
station.setZc(zc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Objects.isNull(stationVO.getKmRange())) {
|
|
||||||
errMsgList.add(String.format("车站[%s(%s)]未设置距离", stationVO.getName(), stationVO.getCode()));
|
|
||||||
} else {
|
|
||||||
station.setKmPostVal(stationVO.getKmRange());
|
|
||||||
}
|
|
||||||
if (Objects.isNull(stationVO.getSn())) {
|
|
||||||
errMsgList.add(String.format("车站[%s(%s)]序号未设置", stationVO.getName(), stationVO.getCode()));
|
|
||||||
} else {
|
|
||||||
station.setSn(stationVO.getSn());
|
|
||||||
}
|
|
||||||
station.setInterlock(stationVO.isCiStation());
|
|
||||||
station.setHasControlMode(stationVO.isCreateControlMode());
|
|
||||||
station.setDepot(stationVO.isDepot());
|
|
||||||
station.setRoutingStationList(stationVO.getRoutingStationList());
|
|
||||||
station.setTurnBack(stationVO.isReentry());
|
|
||||||
station.setSmallRouting(stationVO.isSmallRouting());
|
|
||||||
if (station.isDepot() && station.isTurnBack()) {
|
|
||||||
errMsgList.add(String.format("车站[%s(%s)]不能既是停车场,又是折返车站",
|
|
||||||
stationVO.getName(), stationVO.getCode()));
|
|
||||||
}
|
|
||||||
if (station.isHasControlMode()) { // 有控制模式,初始化为中控
|
|
||||||
station.setControlMode(Station.ControlMode.Center);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 设备集中站下的车站关联ZC
|
|
||||||
stationList.forEach(stationVO -> {
|
|
||||||
Station station = (Station) elementMap.get(stationVO.getCode());
|
|
||||||
if (station.isCentralized()) { // 如果是设备集中站
|
|
||||||
List<String> stationCodeList = stationVO.getChargeStationCodeList();
|
|
||||||
if (!CollectionUtils.isEmpty(stationCodeList)) {
|
|
||||||
stationCodeList.forEach(code -> {
|
|
||||||
Station normal = (Station) elementMap.get(code);
|
|
||||||
if (Objects.isNull(normal)) {
|
|
||||||
errMsgList.add(String.format("设备集中站车站[%s(%s)]管理车站数据异常:编码为[%s]的车站不存在",
|
|
||||||
station.getName(), station.getCode(), code));
|
|
||||||
} else {
|
|
||||||
normal.setDeviceStation(station);
|
|
||||||
normal.setZc(station.getZc());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 区段
|
// 区段
|
||||||
List<MapSectionNewVO> sectionList = graphData.getSectionList();
|
List<MapSectionNewVO> sectionList = graphData.getSectionList();
|
||||||
Map<String, Section> desCodeSectionMap = new HashMap<>();
|
Map<String, Section> desCodeSectionMap = new HashMap<>();
|
||||||
@ -930,6 +869,72 @@ public class MapDeviceBuilder {
|
|||||||
buildCatenary(graphData, elementMap, errMsgList, mapDataBuildResult.getCatenaryMap());
|
buildCatenary(graphData, elementMap, errMsgList, mapDataBuildResult.getCatenaryMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建车站数据
|
||||||
|
*/
|
||||||
|
private static void buildStation(MapGraphDataNewVO graphData, Map<String, MapElement> elementMap, List<String> errMsgList) {
|
||||||
|
// 车站
|
||||||
|
List<MapStationNewVO> stationList = graphData.getStationList();
|
||||||
|
stationList.forEach(stationVO -> {
|
||||||
|
Station station = new Station(stationVO.getCode(), stationVO.getName());
|
||||||
|
if (Objects.nonNull(elementMap.get(station.getCode()))) {
|
||||||
|
errMsgList.add(String.format("编码为[%s]的车站不唯一", station.getCode()));
|
||||||
|
}
|
||||||
|
elementMap.put(station.getCode(), station);
|
||||||
|
station.setCentralized(stationVO.isCentralized());
|
||||||
|
if (station.isCentralized()) {
|
||||||
|
ZC zc = (ZC) elementMap.get(stationVO.getZcCode());
|
||||||
|
if (Objects.isNull(zc)) {
|
||||||
|
errMsgList.add(String.format("车站[%s(%s)]未关联ZC或ZC不存在,请在ZC设备处选择管理的集中站列表", station.getName(), station.getCode()));
|
||||||
|
} else {
|
||||||
|
station.setZc(zc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Objects.isNull(stationVO.getKmRange())) {
|
||||||
|
errMsgList.add(String.format("车站[%s(%s)]未设置距离", stationVO.getName(), stationVO.getCode()));
|
||||||
|
} else {
|
||||||
|
station.setKmPostVal(stationVO.getKmRange());
|
||||||
|
}
|
||||||
|
if (Objects.isNull(stationVO.getSn())) {
|
||||||
|
errMsgList.add(String.format("车站[%s(%s)]序号未设置", stationVO.getName(), stationVO.getCode()));
|
||||||
|
} else {
|
||||||
|
station.setSn(stationVO.getSn());
|
||||||
|
}
|
||||||
|
station.setInterlock(stationVO.isCiStation());
|
||||||
|
station.setHasControlMode(stationVO.isCreateControlMode());
|
||||||
|
station.setDepot(stationVO.isDepot());
|
||||||
|
station.setRoutingStationList(stationVO.getRoutingStationList());
|
||||||
|
station.setTurnBack(stationVO.isReentry());
|
||||||
|
station.setSmallRouting(stationVO.isSmallRouting());
|
||||||
|
if (station.isDepot() && station.isTurnBack()) {
|
||||||
|
errMsgList.add(String.format("车站[%s(%s)]不能既是停车场,又是折返车站",
|
||||||
|
stationVO.getName(), stationVO.getCode()));
|
||||||
|
}
|
||||||
|
if (station.isHasControlMode()) { // 有控制模式,初始化为中控
|
||||||
|
station.setControlMode(Station.ControlMode.Center);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 设备集中站下的车站关联ZC,联锁站下的车站关联联锁站
|
||||||
|
stationList.forEach(stationVO -> {
|
||||||
|
Station station = (Station) elementMap.get(stationVO.getCode());
|
||||||
|
if (station.isCentralized()) { // 如果是设备集中站
|
||||||
|
List<String> stationCodeList = stationVO.getChargeStationCodeList();
|
||||||
|
if (!CollectionUtils.isEmpty(stationCodeList)) {
|
||||||
|
stationCodeList.forEach(code -> {
|
||||||
|
Station normal = (Station) elementMap.get(code);
|
||||||
|
if (Objects.isNull(normal)) {
|
||||||
|
errMsgList.add(String.format("设备集中站车站[%s(%s)]管理车站数据异常:编码为[%s]的车站不存在",
|
||||||
|
station.getName(), station.getCode(), code));
|
||||||
|
} else {
|
||||||
|
normal.setDeviceStation(station);
|
||||||
|
normal.setZc(station.getZc());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建接触网数据
|
* 构建接触网数据
|
||||||
*/
|
*/
|
||||||
|
@ -373,14 +373,6 @@ public class Station extends MapNamedElement {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Station getControlModeStation() {
|
|
||||||
if (Objects.nonNull(this.hasControlMode)) {
|
|
||||||
return this;
|
|
||||||
} else {
|
|
||||||
return this.deviceStation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否中控
|
* 是否中控
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package club.joylink.rtss.vo.client.map.newmap;
|
package club.joylink.rtss.vo.client.map.newmap;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import club.joylink.rtss.vo.client.Point;
|
import club.joylink.rtss.vo.client.Point;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -155,7 +155,7 @@ public class MapStationNewVO {
|
|||||||
private boolean centralized;
|
private boolean centralized;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否连锁站
|
* 是否联锁站
|
||||||
*/
|
*/
|
||||||
private boolean ciStation;
|
private boolean ciStation;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user