This commit is contained in:
tiger_zhou 2023-05-08 17:26:06 +08:00
commit fdb53063b7
4 changed files with 20 additions and 10 deletions

View File

@ -32,6 +32,7 @@ import club.joylink.rtss.simulation.cbtc.training2.Training2;
import club.joylink.rtss.simulation.vo.SimulationInfoVO;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.fault.FaultRuleVO;
import club.joylink.rtss.vo.client.mapFunction.MapFunctionVO;
import club.joylink.rtss.vo.conversation.ConversationGroupVO;
import club.joylink.rtss.vo.permission.PermissionSubjectTypeEnum;
import club.joylink.rtss.vo.project.ProjectVO;
@ -87,7 +88,7 @@ public class Simulation extends club.joylink.rtss.simulation.Simulation<Simulati
/**
* 功能id
*/
private Long mapFunctionId;
private MapFunctionVO mapFunctionVO;
/**
* 数据仓库
@ -297,7 +298,6 @@ public class Simulation extends club.joylink.rtss.simulation.Simulation<Simulati
/**
* 初始化群组信息
* @param map 群组信息Map
*/
public void initDefaultConversationGroupMap() {
SimulationBuildParams buildParams = this.getBuildParams();
@ -805,6 +805,10 @@ public class Simulation extends club.joylink.rtss.simulation.Simulation<Simulati
return this.querySimulationMemberByUserId(uid);
}
public Long getMapFunctionId() {
return mapFunctionVO == null ? null : mapFunctionVO.getId();
}
public interface JobName {
String script = "Script";
String checkLpf = "checkLpf";

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.simulation.cbtc.data.vo.SimulationVO;
import club.joylink.rtss.simulation.cbtc.vo.SimulationWorkParamVO;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.mapFunction.MapFunctionVO;
import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam;
import lombok.NonNull;
@ -14,7 +15,7 @@ public interface SimulationService {
/**
* 创建仿真
*/
String createSimulation(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO,Map<String,Boolean> createUserType);
String createSimulation(long mapId, MapFunctionVO mapFunctionVO, @NonNull LoginUserInfoVO loginUserInfoVO, Map<String, Boolean> createUserType);
String createSimulation(Long mapFunctionId, LoginUserInfoVO loginInfo);
@ -60,7 +61,7 @@ public interface SimulationService {
*/
void monitor(String simulationId, AccountVO user);
Simulation createSimulationPojo(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO,Map<String,Boolean> createUserType);
Simulation createSimulationPojo(long mapId, MapFunctionVO mapFunctionVO, @NonNull LoginUserInfoVO loginUserInfoVO, Map<String, Boolean> createUserType);
/**
* 后台创建仿真

View File

@ -76,8 +76,8 @@ public class SimulationServiceImpl implements SimulationService {
@Override
public String createSimulation(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO,Map<String,Boolean> createUserType) {
return createSimulationPojo(mapId, mapFunctionId, workParamVO, loginUserInfoVO, createUserType).getId();
public String createSimulation(long mapId, MapFunctionVO mapFunctionVO, @NonNull LoginUserInfoVO loginUserInfoVO, Map<String, Boolean> createUserType) {
return createSimulationPojo(mapId,mapFunctionVO, loginUserInfoVO, createUserType).getId();
}
//只获取所有与该功能相关的权限信息
@ -229,7 +229,7 @@ public class SimulationServiceImpl implements SimulationService {
oldSimulationOptional.ifPresent(simulation -> simulationManager.destroy(simulation.getId()));
}
return createSimulation(mapId, mapFunctionId, workParamVO, loginInfo,createUserType);
return createSimulation(mapId, mapFunctionVO, loginInfo,createUserType);
}
@Override
@ -313,7 +313,8 @@ public class SimulationServiceImpl implements SimulationService {
}
@Override
public Simulation createSimulationPojo(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO, Map<String,Boolean> createUserType) {
public Simulation createSimulationPojo(long mapId, MapFunctionVO mapFunctionVO, @NonNull LoginUserInfoVO loginUserInfoVO, Map<String, Boolean> createUserType) {
SimulationWorkParamVO workParamVO = mapFunctionVO.getParamVO();
//获取仿真工作服务
SimulationWorkService initService = simulationWorkServiceManager.getWorkService(workParamVO.getType());
@ -325,7 +326,7 @@ public class SimulationServiceImpl implements SimulationService {
List<VoiceDiscriminateRule> ruleList = this.discriminateRule.findRuleByMapId(mapId);
simulation.setVoiceRuleList(ruleList);
simulation.setMapFunctionId(mapFunctionId);
simulation.setMapFunctionVO(mapFunctionVO);
simulation.setCreateUserType(createUserType);
LoginUserInfoVO loginUserInfo = simulation.getBuildParams().getLoginUserInfo();
if (Objects.nonNull(loginUserInfo)) {
@ -372,7 +373,7 @@ public class SimulationServiceImpl implements SimulationService {
oldSimulationOptional.ifPresent(simulation -> simulationManager.destroy(simulation.getId()));
}
return createSimulationPojo(mapId, mapFunctionId, workParamVO, loginInfo, createUserType);
return createSimulationPojo(mapId, mapFunctionVO, loginInfo, createUserType);
}
@Override

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import club.joylink.rtss.simulation.cbtc.vo.SimulationWorkParamVO;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.mapFunction.MapFunctionVO;
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
import club.joylink.rtss.vo.map.MapVO;
import lombok.Builder;
@ -59,6 +60,8 @@ public class SimulationVO {
private Map<String, String> linkSwitchMap;
private MapFunctionVO mapFunctionVO;
public static SimulationVO buildBasicInfo(Simulation simulation) {
MapVO map = simulation.getBuildParams().getMap();
MapVO mapVO = new MapVO();
@ -103,6 +106,7 @@ public class SimulationVO {
.delTime(simulation.getDelBaseTime())
.paramVO(workParamVO)
.linkSwitchMap(linkSwitchMap)
.mapFunctionVO(simulation.getMapFunctionVO())
.build();
}