Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
walker-sheng 2021-04-29 15:30:11 +08:00
commit e17503d902
13 changed files with 61 additions and 26 deletions

View File

@ -1,5 +1,7 @@
package club.joylink.rtss.constants; package club.joylink.rtss.constants;
import com.huawei.sis.bean.request.GetTokenRequest;
/** /**
* 项目 * 项目
*/ */
@ -28,6 +30,8 @@ public enum Project {
BJD, BJD,
/** 成都工业职业技术学院 */ /** 成都工业职业技术学院 */
CGY, CGY,
/** 微机联锁 */
WJLS,
; ;
public static boolean isDefault(Project project) { public static boolean isDefault(Project project) {
@ -35,6 +39,6 @@ public enum Project {
} }
public static boolean isLoginWithCreateSimulation(Project project) { public static boolean isLoginWithCreateSimulation(Project project) {
return Project.DRTS.equals(project) || Project.BJD.equals(project); return Project.DRTS.equals(project) || Project.BJD.equals(project) || Project.WJLS.equals(project);
} }
} }

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.controller.voice; package club.joylink.rtss.controller.voice;
import club.joylink.rtss.services.IVoiceService; import club.joylink.rtss.services.IVoiceService;
import club.joylink.rtss.simulation.cbtc.conversation.SimulationVoiceHandler;
import club.joylink.rtss.vo.client.VoiceRecognitionResult; import club.joylink.rtss.vo.client.VoiceRecognitionResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -21,10 +22,16 @@ public class VoiceController {
@Qualifier("HuaWeiVoiceService") @Qualifier("HuaWeiVoiceService")
private IVoiceService iVoiceService; private IVoiceService iVoiceService;
@Autowired
private SimulationVoiceHandler simulationVoiceHandler;
@ApiOperation("语音识别") @ApiOperation("语音识别")
@PostMapping("recognition") @PostMapping("recognition")
public VoiceRecognitionResult voiceRecognition(MultipartFile file) { public VoiceRecognitionResult voiceRecognition(MultipartFile file) {
return this.iVoiceService.voiceRecognition(file, ""); VoiceRecognitionResult result = this.iVoiceService.voiceRecognition(file, "");
result.setResult(simulationVoiceHandler.handle(result.getResult()));
return result;
} }
} }

View File

@ -239,9 +239,9 @@ public class AuthenticateService implements IAuthenticateService {
} }
Project project = loginUserInfo.getProject(); Project project = loginUserInfo.getProject();
if (Project.isLoginWithCreateSimulation(project)) { // 行调竞赛实训系统登录 if (Project.isLoginWithCreateSimulation(project)) { // 行调竞赛实训系统登录
Simulation simulation = this.projectSimulationService String group = this.projectSimulationService
.createCenterSimulation(loginUserInfo, project); .createCenterSimulation(loginUserInfo, project);
loginUserInfo.setGroup(simulation.getGroup()); loginUserInfo.setGroup(group);
} }
} }
// 保存登陆信息 // 保存登陆信息

View File

@ -362,9 +362,9 @@ public class CompetitionPracticalService implements ICompetitionPracticalService
@Override @Override
public String createSimulationAndLoadCompetition(Long id, LoginUserInfoVO userInfo) { public String createSimulationAndLoadCompetition(Long id, LoginUserInfoVO userInfo) {
Simulation simulation = projectSimulationService.createCenterSimulation(userInfo, Project.DRTS); String group = projectSimulationService.createCenterSimulation(userInfo, Project.DRTS);
loadCompetition(simulation.getGroup(), id, userInfo); loadCompetition(group, id, userInfo);
return simulation.getGroup(); return group;
} }
@Override @Override

View File

@ -90,7 +90,7 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService {
} }
} }
DraftMapRouteExample deleteExample = new DraftMapRouteExample(); DraftMapRouteExample deleteExample = new DraftMapRouteExample();
example.createCriteria() deleteExample.createCriteria()
.andMapIdEqualTo(id) .andMapIdEqualTo(id)
.andCodeEqualTo(code); .andCodeEqualTo(code);
this.draftMapRouteDAO.deleteByExample(deleteExample); this.draftMapRouteDAO.deleteByExample(deleteExample);

View File

@ -14,5 +14,5 @@ public interface ProjectSimulationService {
* @param project * @param project
* @return * @return
*/ */
Simulation createCenterSimulation(LoginUserInfoVO loginUserInfo, Project project); String createCenterSimulation(LoginUserInfoVO loginUserInfo, Project project);
} }

View File

@ -7,6 +7,7 @@ import club.joylink.rtss.constants.Project;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.IMapService; import club.joylink.rtss.services.IMapService;
import club.joylink.rtss.services.IUserPermissionService; import club.joylink.rtss.services.IUserPermissionService;
import club.joylink.rtss.simulation.rt.RtSimulationService;
import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO; import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.map.MapVO; import club.joylink.rtss.vo.client.map.MapVO;
@ -36,8 +37,11 @@ public class ProjectSimulationServiceImpl implements ProjectSimulationService {
@Autowired @Autowired
private GroupSimulationService groupSimulationService; private GroupSimulationService groupSimulationService;
@Autowired
private RtSimulationService rtSimulationService;
@Override @Override
public Simulation createCenterSimulation(LoginUserInfoVO loginUserInfo, Project project) { public String createCenterSimulation(LoginUserInfoVO loginUserInfo, Project project) {
UserVO userVO = loginUserInfo.getUserVO(); UserVO userVO = loginUserInfo.getUserVO();
// 查询用户综合演练配置 // 查询用户综合演练配置
@ -62,12 +66,15 @@ public class ProjectSimulationServiceImpl implements ProjectSimulationService {
BusinessExceptionAssertEnum.SIMULATION_PERMISSION_NOT_AVAILABLE BusinessExceptionAssertEnum.SIMULATION_PERMISSION_NOT_AVAILABLE
.assertNotTrue(CollectionUtils.isEmpty(collect), "用户仿真权限当前时间不可用"); .assertNotTrue(CollectionUtils.isEmpty(collect), "用户仿真权限当前时间不可用");
} }
if (Project.WJLS.equals(project)) {
return rtSimulationService.create(loginUserInfo.getUserVO(), mapId, MapPrdTypeEnum.LOCAL).getId();
}
// 构建仿真 // 构建仿真
Simulation simulation = this.groupSimulationService.create(loginUserInfo, mapId, Simulation simulation = this.groupSimulationService.create(loginUserInfo, mapId,
MapPrdTypeEnum.CENTER, Simulation.FunctionalType.SIMULATION); MapPrdTypeEnum.CENTER, Simulation.FunctionalType.SIMULATION);
RunAsPlanParam param = new RunAsPlanParam(LocalTime.now(), null); RunAsPlanParam param = new RunAsPlanParam(LocalTime.now(), null);
this.groupSimulationService.runAsPlan(simulation.getGroup(), param); this.groupSimulationService.runAsPlan(simulation.getGroup(), param);
return simulation; return simulation.getGroup();
} }
} }

View File

@ -36,11 +36,11 @@ public class SimulationVoiceHandler {
// replacementList.add(new Replacement("(八)", "8")); // replacementList.add(new Replacement("(八)", "8"));
// replacementList.add(new Replacement("(九)", "9")); // replacementList.add(new Replacement("(九)", "9"));
//------------- 专业词汇 -------------- //------------- 专业词汇 --------------
replacementList.add(new Replacement("(行吊|情调|神雕|性交|心跳|香蕉|星标|平调)", "行调")); replacementList.add(new Replacement("(行吊|情调|神雕|性交|心跳|香蕉|星标|平调|新调)", "行调"));
replacementList.add(new Replacement("(茼蒿)", "通号")); replacementList.add(new Replacement("(茼蒿)", "通号"));
replacementList.add(new Replacement("", "")); replacementList.add(new Replacement("", ""));
replacementList.add(new Replacement("自动折法", "自动折返")); replacementList.add(new Replacement("自动折法", "自动折返"));
replacementList.add(new Replacement("(倒插|刀叉|倒茶|倒叉|到插|倒闸|到察|到厂|道碴)", "道岔")); replacementList.add(new Replacement("(倒插|刀叉|倒茶|倒叉|到插|倒闸|到察|到厂|道碴|到差)", "道岔"));
replacementList.add(new Replacement("(师表|手表|时表)", "失表")); replacementList.add(new Replacement("(师表|手表|时表)", "失表"));
replacementList.add(new Replacement("攻作组", "工作组")); replacementList.add(new Replacement("攻作组", "工作组"));
replacementList.add(new Replacement("军事表", "均失表")); replacementList.add(new Replacement("军事表", "均失表"));
@ -51,7 +51,7 @@ public class SimulationVoiceHandler {
replacementList.add(new Replacement("(客栈)", "各站")); replacementList.add(new Replacement("(客栈)", "各站"));
replacementList.add(new Replacement("(正线队长发送)", "正线队长复诵")); replacementList.add(new Replacement("(正线队长发送)", "正线队长复诵"));
replacementList.add(new Replacement("(电影)", "点名")); replacementList.add(new Replacement("(电影)", "点名"));
replacementList.add(new Replacement("(代理|代练)", "待令")); replacementList.add(new Replacement("(代理|代练|待定|待命)", "待令"));
replacementList.add(new Replacement("(伤心)", "上行")); replacementList.add(new Replacement("(伤心)", "上行"));
replacementList.add(new Replacement("(调制)", "调至")); replacementList.add(new Replacement("(调制)", "调至"));
replacementList.add(new Replacement("(时代丽|时代绿)", "首待令")); replacementList.add(new Replacement("(时代丽|时代绿)", "首待令"));
@ -64,17 +64,17 @@ public class SimulationVoiceHandler {
replacementList.add(new Replacement("(程序你)", "准许你")); replacementList.add(new Replacement("(程序你)", "准许你"));
replacementList.add(new Replacement("(车法)", "折返")); replacementList.add(new Replacement("(车法)", "折返"));
replacementList.add(new Replacement("(拉萍|拉婷)", "拉停")); replacementList.add(new Replacement("(拉萍|拉婷)", "拉停"));
replacementList.add(new Replacement("(带领)", "待令"));
replacementList.add(new Replacement("(站街)", "站级")); replacementList.add(new Replacement("(站街)", "站级"));
replacementList.add(new Replacement("(羡慕)", "线路")); replacementList.add(new Replacement("(羡慕)", "线路"));
replacementList.add(new Replacement("(功率标|功率表|公里表|公历表|公斤标|公立标)", "公里标")); replacementList.add(new Replacement("(功率标|功率表|公里表|公历表|公斤标|公立标)", "公里标"));
replacementList.add(new Replacement("(赚钱折法|赚钱折返)", "站前折返")); replacementList.add(new Replacement("(赚钱折法|赚钱折返)", "站前折返"));
replacementList.add(new Replacement("(权限各次)", "全线各次")); replacementList.add(new Replacement("(权限各次)", "全线各次"));
replacementList.add(new Replacement("(庭院)", "停运")); replacementList.add(new Replacement("(庭院)", "停运"));
replacementList.add(new Replacement("(请客|青稞|青客|轻客|轻课|青涩|听课|停课|听,可|听可)", "清客")); replacementList.add(new Replacement("(请客|青稞|青客|轻客|轻课|青涩|听课|停课|听,可|听可|顷刻)", "清客"));
replacementList.add(new Replacement("(会断|会短|回断)", "回段")); replacementList.add(new Replacement("(会断|会短|回断)", "回段"));
replacementList.add(new Replacement("(清朝|请朝|请钞)", "请抄")); replacementList.add(new Replacement("(清朝|请朝|请钞)", "请抄"));
replacementList.add(new Replacement("(首领处所)", "受令处所")); replacementList.add(new Replacement("(请超链|请超龄)", "请抄令"));
replacementList.add(new Replacement("(首领处所|手令处所)", "受令处所"));
replacementList.add(new Replacement("安全保护", "安全防护")); replacementList.add(new Replacement("安全保护", "安全防护"));
replacementList.add(new Replacement("(手摇质|说杨智|受邀至)", "手摇至")); replacementList.add(new Replacement("(手摇质|说杨智|受邀至)", "手摇至"));
replacementList.add(new Replacement("(反胃|软位)", "反位")); replacementList.add(new Replacement("(反胃|软位)", "反位"));
@ -85,9 +85,10 @@ public class SimulationVoiceHandler {
replacementList.add(new Replacement("故障回复", "故障恢复")); replacementList.add(new Replacement("故障回复", "故障恢复"));
replacementList.add(new Replacement("(出入断线|出路段线)", "出入段线")); replacementList.add(new Replacement("(出入断线|出路段线)", "出入段线"));
replacementList.add(new Replacement("(控子权|控质权|放置权|矿质权|空置权)", "控制权")); replacementList.add(new Replacement("(控子权|控质权|放置权|矿质权|空置权)", "控制权"));
replacementList.add(new Replacement("(手机号)", "手信号")); replacementList.add(new Replacement("(手机号|首信号)", "手信号"));
replacementList.add(new Replacement("(鼓掌|部长)", "故障")); replacementList.add(new Replacement("(鼓掌|部长)", "故障"));
replacementList.add(new Replacement("(向凤)", "下放")); replacementList.add(new Replacement("(向凤)", "下放"));
replacementList.add(new Replacement("(占线|占先)", "站线"));
//------------- 设备相关 -------------- //------------- 设备相关 --------------
replacementList.add(new Replacement("(宇花祭|玉花祭|雨化寨|氯化钙|绿化带|优化钙)", "鱼化寨")); replacementList.add(new Replacement("(宇花祭|玉花祭|雨化寨|氯化钙|绿化带|优化钙)", "鱼化寨"));
replacementList.add(new Replacement("(保税局)", "保税区")); replacementList.add(new Replacement("(保税局)", "保税区"));

View File

@ -1,6 +1,8 @@
package club.joylink.rtss.simulation.rt.CIL; package club.joylink.rtss.simulation.rt.CIL;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
import club.joylink.rtss.simulation.rt.CIL.bo.*; import club.joylink.rtss.simulation.rt.CIL.bo.*;
import club.joylink.rtss.simulation.rt.RtSimulation; import club.joylink.rtss.simulation.rt.RtSimulation;
import club.joylink.rtss.simulation.rt.repo.*; import club.joylink.rtss.simulation.rt.repo.*;
@ -159,7 +161,8 @@ public class CilRouteLogicService {
//关闭信号 //关闭信号
cilSignalLogicService.update2ForbiddenAspect(simulation, signalId); cilSignalLogicService.update2ForbiddenAspect(simulation, signalId);
//设置延时解锁 //设置延时解锁
cilSignal.initDelayTime(); CommonSignal commonSignal = cilRepository.getCommonRepository().getSignalById(signalId);
cilSignal.initDelayTime(commonSignal);
cilRoute.setDelayUnlocking(true); cilRoute.setDelayUnlocking(true);
} }
} }
@ -213,11 +216,15 @@ public class CilRouteLogicService {
cilSignal.setRouteId(cilRoute.getId()); cilSignal.setRouteId(cilRoute.getId());
} }
// 开始办理 // 开始办理
cilRoute.startSetting(rtSimulation.getSystemTime()); noCheckSetRoute(rtSimulation, cilRepository, cilRoute);
cilRepository.addSupervisedRoute(cilRoute);
return true; return true;
} }
private void noCheckSetRoute(RtSimulation simulation, CilRepository cilRepository, CilRoute cilRoute) {
cilRoute.startSetting(simulation.getSystemTime());
cilRepository.addSupervisedRoute(cilRoute);
}
/** /**
* 为办理进路初始化相关状态 * 为办理进路初始化相关状态
*/ */
@ -384,7 +391,7 @@ public class CilRouteLogicService {
CilSignal cilSignal = cilRepository.getSignalById(subCommonRoute.getStart().getId()); CilSignal cilSignal = cilRepository.getSignalById(subCommonRoute.getStart().getId());
if (cilSignal.getSignalAspect() != mra.getSignalAspect()) { if (cilSignal.getSignalAspect() != mra.getSignalAspect()) {
if (!cilRepository.isSupervised(subCilRoute.getId())) { if (!cilRepository.isSupervised(subCilRoute.getId())) {
setRoute(rtSimulation, subCilRoute.getId()); noCheckSetRoute(rtSimulation, cilRepository, subCilRoute);
if (i == 0) { if (i == 0) {
cilRepository.removeSupervisedRoute(cilRoute.getId()); cilRepository.removeSupervisedRoute(cilRoute.getId());
} }

View File

@ -183,4 +183,6 @@ public class CilRepository extends SimulationRepository {
} }
return list; return list;
} }
} }

View File

@ -2,12 +2,14 @@ package club.joylink.rtss.simulation.rt.CIL.bo;
import club.joylink.rtss.simulation.rt.CIL.CilLogicService; import club.joylink.rtss.simulation.rt.CIL.CilLogicService;
import club.joylink.rtss.simulation.rt.SRD.bo.SrSignal; import club.joylink.rtss.simulation.rt.SRD.bo.SrSignal;
import club.joylink.rtss.simulation.rt.repo.CommonSignal;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
public class CilSignal extends CilDevice { public class CilSignal extends CilDevice {
public static final int DEFAULT_DELAY_TIME = 180 * 1000; //进路延时解锁默认时长 public static final int DEFAULT_DELAY_TIME = 180 * 1000; //进路延时解锁默认时长
public static final int SHUNTING_DELAY_TIME = 30 * 1000; //调车信号机延时解锁时长
public static final int DEFAULT_GUIDE_TIME = 15 * 1000; //引导信号有效时长 public static final int DEFAULT_GUIDE_TIME = 15 * 1000; //引导信号有效时长
int signalAspect = SrSignal.H; //当前显示的信号 int signalAspect = SrSignal.H; //当前显示的信号
@ -120,8 +122,12 @@ public class CilSignal extends CilDevice {
this.fl = false; this.fl = false;
} }
public void initDelayTime() { public void initDelayTime(CommonSignal commonSignal) {
this.delayTime = DEFAULT_DELAY_TIME; if (commonSignal.isShunting()) {
this.delayTime = SHUNTING_DELAY_TIME;
} else {
this.delayTime = DEFAULT_DELAY_TIME;
}
} }
public void updateDelayTime() { public void updateDelayTime() {

View File

@ -20,11 +20,12 @@ public class RtSimulation extends Simulation<RtSimulationUser, RtSimulationMembe
SimulationIdGenerator idGenerator; SimulationIdGenerator idGenerator;
public RtSimulation(String id, RtSimulationUser creator) { public RtSimulation(String id, RtSimulationUser creator, MapPrdTypeEnum prdTypeEnum) {
super(id); super(id);
this.idGenerator = new SimulationIdGenerator(); this.idGenerator = new SimulationIdGenerator();
this.creator = creator; this.creator = creator;
this.addSimulationUser(creator); this.addSimulationUser(creator);
this.prdType = prdTypeEnum;
} }
public LocalDateTime convertToSystemTime(LocalDateTime dateTime) { public LocalDateTime convertToSystemTime(LocalDateTime dateTime) {

View File

@ -38,7 +38,7 @@ public class RtSimulationService {
Objects.requireNonNull(mapId); Objects.requireNonNull(mapId);
MapVO mapVO = this.mapService.getMapDetail(mapId); MapVO mapVO = this.mapService.getMapDetail(mapId);
RtSimulationUser creator = new RtSimulationUser(userVO.getId().toString()); RtSimulationUser creator = new RtSimulationUser(userVO.getId().toString());
RtSimulation rtSimulation = new RtSimulation(SimulationIdGenerator.buildId(), creator); RtSimulation rtSimulation = new RtSimulation(SimulationIdGenerator.buildId(), creator, prdTypeEnum);
this.simulationManager.save(rtSimulation); this.simulationManager.save(rtSimulation);
try { try {
rtSimulation.mapVO = mapVO; rtSimulation.mapVO = mapVO;