【实训场景编制时,控制权不做自动转换】
This commit is contained in:
parent
daadb7ccee
commit
4faff6bb77
@ -469,6 +469,8 @@ public class Training2Service {
|
|||||||
if (!StringUtils.isEmpty(bgSceneJson)) {
|
if (!StringUtils.isEmpty(bgSceneJson)) {
|
||||||
groupSimulationService.loadScenes(simulation.getId(), bgSceneJson);
|
groupSimulationService.loadScenes(simulation.getId(), bgSceneJson);
|
||||||
}
|
}
|
||||||
|
Training2 training2 = new Training2(draftTraining2, simulation);
|
||||||
|
simulation.setTraining2(training2);
|
||||||
// 如果存在会话信息,需要给前端发送
|
// 如果存在会话信息,需要给前端发送
|
||||||
sendSimulationConversation(simulation);
|
sendSimulationConversation(simulation);
|
||||||
}
|
}
|
||||||
|
@ -504,7 +504,10 @@ public class SimulationRobotService {
|
|||||||
if (simulation.getScript() != null && simulation.getScript().isBgSet()) {
|
if (simulation.getScript() != null && simulation.getScript().isBgSet()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 实训场景模式,处于编制状态的实训,不做自动转换处理
|
||||||
|
if (simulation.getTraining2() != null && simulation.getTraining2().isScene() && !simulation.getTraining2().isRunning()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Map<SimulationMember, List<Station>> collect = simulation.getRepository().getStationList().stream()
|
Map<SimulationMember, List<Station>> collect = simulation.getRepository().getStationList().stream()
|
||||||
.filter(station -> station.getApplicant() != null).collect(Collectors.groupingBy(Station::getApplicant));
|
.filter(station -> station.getApplicant() != null).collect(Collectors.groupingBy(Station::getApplicant));
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@ public class Training2 {
|
|||||||
*/
|
*/
|
||||||
private Map<String, IndexAlgorithmService> indexAlgorithmMap;
|
private Map<String, IndexAlgorithmService> indexAlgorithmMap;
|
||||||
|
|
||||||
|
|
||||||
public Training2(DraftTraining2WithBLOBs draftTraining2, Simulation simulation) {
|
public Training2(DraftTraining2WithBLOBs draftTraining2, Simulation simulation) {
|
||||||
this.id = draftTraining2.getId();
|
this.id = draftTraining2.getId();
|
||||||
this.mapId = draftTraining2.getMapId();
|
this.mapId = draftTraining2.getMapId();
|
||||||
@ -117,7 +118,9 @@ public class Training2 {
|
|||||||
if (!StringUtils.isEmpty(draftTraining2.getPlayerIdJson())) {
|
if (!StringUtils.isEmpty(draftTraining2.getPlayerIdJson())) {
|
||||||
this.playerIds = JsonUtils.readCollection(draftTraining2.getPlayerIdJson(), List.class, String.class);
|
this.playerIds = JsonUtils.readCollection(draftTraining2.getPlayerIdJson(), List.class, String.class);
|
||||||
}
|
}
|
||||||
labels = JsonUtils.readCollection(draftTraining2.getLabelJson(), List.class, String.class);
|
if (!StringUtils.isEmpty(draftTraining2.getLabelJson())) {
|
||||||
|
labels = JsonUtils.readCollection(draftTraining2.getLabelJson(), List.class, String.class);
|
||||||
|
}
|
||||||
if (!StringUtils.isEmpty(draftTraining2.getOperaJson())) {
|
if (!StringUtils.isEmpty(draftTraining2.getOperaJson())) {
|
||||||
List<Operation2VO> operation2VOS = JsonUtils.readCollection(draftTraining2.getOperaJson(), List.class, Operation2VO.class);
|
List<Operation2VO> operation2VOS = JsonUtils.readCollection(draftTraining2.getOperaJson(), List.class, Operation2VO.class);
|
||||||
operations = operation2VOS.stream().map(vo -> vo.convert2BO(simulation)).collect(Collectors.toList());
|
operations = operation2VOS.stream().map(vo -> vo.convert2BO(simulation)).collect(Collectors.toList());
|
||||||
@ -222,6 +225,13 @@ public class Training2 {
|
|||||||
return !this.started || this.finish;
|
return !this.started || this.finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否场景
|
||||||
|
*/
|
||||||
|
public boolean isScene() {
|
||||||
|
return Type.SCENE.equals(this.type);
|
||||||
|
}
|
||||||
|
|
||||||
private void resetStepAndIndex() {
|
private void resetStepAndIndex() {
|
||||||
if (this.steps != null) {
|
if (this.steps != null) {
|
||||||
this.steps.forEach(Step2::reset);
|
this.steps.forEach(Step2::reset);
|
||||||
|
Loading…
Reference in New Issue
Block a user