大赛管理功能

This commit is contained in:
tiger_zhou 2024-02-29 16:13:42 +08:00
parent 7b36192a9a
commit 902a2e78b1
10 changed files with 935 additions and 372 deletions

View File

@ -34,7 +34,6 @@ public class RaceScoreRuleController {
//2.编辑评分具体的内容
@PostMapping
public void saveBasic(@RequestBody Map<String, String> nameMap, @RequestAttribute AccountVO user) {
this.scoreRuleService.saveBasic(nameMap.get("name"), user);
}

View File

@ -13,6 +13,8 @@ import club.joylink.rtss.vo.race.RacePaper.RacePaperModuleVO.PaperModule;
import club.joylink.rtss.vo.race.RacePaper.RacePaperVO;
import club.joylink.rtss.vo.race.RacePaperPageVO;
import club.joylink.rtss.vo.race.RacePaperQueryVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type;
import club.joylink.rtss.vo.race.RaceSeasonOuterClass.RaceSeason.Group;
import club.joylink.rtss.vo.race.RaceTask.RacePaperModuleTask;
import club.joylink.rtss.vo.race.RaceTask.RacePaperModuleTask.PaperModuleGroup;
@ -288,12 +290,14 @@ public class RacePaperService {
cb.setContent(dto.getContent());
cb.setStandards(dto.getStandards());
cb.setParentId(dto.getParentId());
if (StringUtils.isNotEmpty(dto.getSceneType())) {
cb.setSceneType(Type.valueOf(dto.getSceneType()));
}
if (Objects.nonNull(dto.getSceneId())) {
cb.setSceneId(dto.getSceneId());
}
if (Objects.nonNull(dto.getRuleId())) {
cb.setRuleId(dto.getRuleId());
}
}
cb.setNodeType(nodeType);

File diff suppressed because it is too large Load Diff

View File

@ -5515,6 +5515,10 @@ public final class RaceTask {
int index);
}
/**
* <pre>
*试卷考试显示模块任务单独树形结构显示
* </pre>
*
* Protobuf type {@code race.RacePaperModuleTask}
*/
public static final class RacePaperModuleTask extends
@ -7045,6 +7049,10 @@ public final class RaceTask {
return builder;
}
/**
* <pre>
*试卷考试显示模块任务单独树形结构显示
* </pre>
*
* Protobuf type {@code race.RacePaperModuleTask}
*/
public static final class Builder extends
@ -7740,6 +7748,25 @@ public final class RaceTask {
* @return The nodeType.
*/
club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType getNodeType();
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @return The enum numeric value on the wire for sceneType.
*/
int getSceneTypeValue();
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @return The sceneType.
*/
club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type getSceneType();
}
/**
* Protobuf type {@code race.RaceTaskChildVO}
@ -7760,6 +7787,7 @@ public final class RaceTask {
standards_ = "";
children_ = java.util.Collections.emptyList();
nodeType_ = 0;
sceneType_ = 0;
}
@java.lang.Override
@ -8205,6 +8233,32 @@ public final class RaceTask {
return result == null ? club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType.UNRECOGNIZED : result;
}
public static final int SCENETYPE_FIELD_NUMBER = 11;
private int sceneType_ = 0;
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @return The enum numeric value on the wire for sceneType.
*/
@java.lang.Override public int getSceneTypeValue() {
return sceneType_;
}
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @return The sceneType.
*/
@java.lang.Override public club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type getSceneType() {
club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type result = club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type.forNumber(sceneType_);
return result == null ? club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@ -8249,6 +8303,9 @@ public final class RaceTask {
if (nodeType_ != club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType.MODULE_GROUP.getNumber()) {
output.writeEnum(10, nodeType_);
}
if (sceneType_ != club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type.Unknown.getNumber()) {
output.writeEnum(11, sceneType_);
}
getUnknownFields().writeTo(output);
}
@ -8294,6 +8351,10 @@ public final class RaceTask {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(10, nodeType_);
}
if (sceneType_ != club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type.Unknown.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(11, sceneType_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
@ -8328,6 +8389,7 @@ public final class RaceTask {
if (!getChildrenList()
.equals(other.getChildrenList())) return false;
if (nodeType_ != other.nodeType_) return false;
if (sceneType_ != other.sceneType_) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@ -8365,6 +8427,8 @@ public final class RaceTask {
}
hash = (37 * hash) + NODE_TYPE_FIELD_NUMBER;
hash = (53 * hash) + nodeType_;
hash = (37 * hash) + SCENETYPE_FIELD_NUMBER;
hash = (53 * hash) + sceneType_;
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
@ -8512,6 +8576,7 @@ public final class RaceTask {
}
bitField0_ = (bitField0_ & ~0x00000100);
nodeType_ = 0;
sceneType_ = 0;
return this;
}
@ -8585,6 +8650,9 @@ public final class RaceTask {
if (((from_bitField0_ & 0x00000200) != 0)) {
result.nodeType_ = nodeType_;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.sceneType_ = sceneType_;
}
}
@java.lang.Override
@ -8660,6 +8728,9 @@ public final class RaceTask {
if (other.nodeType_ != 0) {
setNodeTypeValue(other.getNodeTypeValue());
}
if (other.sceneType_ != 0) {
setSceneTypeValue(other.getSceneTypeValue());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
@ -8744,6 +8815,11 @@ public final class RaceTask {
bitField0_ |= 0x00000200;
break;
} // case 80
case 88: {
sceneType_ = input.readEnum();
bitField0_ |= 0x00000400;
break;
} // case 88
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
@ -9637,6 +9713,79 @@ public final class RaceTask {
onChanged();
return this;
}
private int sceneType_ = 0;
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @return The enum numeric value on the wire for sceneType.
*/
@java.lang.Override public int getSceneTypeValue() {
return sceneType_;
}
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @param value The enum numeric value on the wire for sceneType to set.
* @return This builder for chaining.
*/
public Builder setSceneTypeValue(int value) {
sceneType_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @return The sceneType.
*/
@java.lang.Override
public club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type getSceneType() {
club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type result = club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type.forNumber(sceneType_);
return result == null ? club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type.UNRECOGNIZED : result;
}
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @param value The sceneType to set.
* @return This builder for chaining.
*/
public Builder setSceneType(club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000400;
sceneType_ = value.getNumber();
onChanged();
return this;
}
/**
* <pre>
*Local 场景;Link 可能是3D;
* </pre>
*
* <code>.race.RaceScene.Type sceneType = 11;</code>
* @return This builder for chaining.
*/
public Builder clearSceneType() {
bitField0_ = (bitField0_ & ~0x00000400);
sceneType_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
@ -9736,6 +9885,10 @@ public final class RaceTask {
int index);
}
/**
* <pre>
*试卷考试显示模块任务单独树形结构显示通过RaceTaskChildVO的属性node_type 进行区分目前节点是什么类型
* </pre>
*
* Protobuf type {@code race.RacePaperSingleModuleGroupTask}
*/
public static final class RacePaperSingleModuleGroupTask extends
@ -9994,6 +10147,10 @@ public final class RaceTask {
return builder;
}
/**
* <pre>
*试卷考试显示模块任务单独树形结构显示通过RaceTaskChildVO的属性node_type 进行区分目前节点是什么类型
* </pre>
*
* Protobuf type {@code race.RacePaperSingleModuleGroupTask}
*/
public static final class Builder extends
@ -10597,17 +10754,18 @@ public final class RaceTask {
"Group\022\022\n\ngroup_name\030\001 \001(\t\022\'\n\010treeData\030\002 " +
"\003(\0132\025.race.RaceTaskChildVO\022@\n\014module_gro" +
"up\030\003 \003(\0132*.race.RacePaperModuleTask.Pape" +
"rModuleGroup\"\241\002\n\017RaceTaskChildVO\022\n\n\002id\030\001" +
"rModuleGroup\"\312\002\n\017RaceTaskChildVO\022\n\n\002id\030\001" +
" \001(\003\022\014\n\004name\030\002 \001(\t\022\014\n\004desc\030\003 \001(\t\022\017\n\007cont" +
"ent\030\004 \001(\t\022\021\n\tstandards\030\005 \001(\t\022\020\n\010scene_id" +
"\030\006 \001(\003\022\017\n\007rule_id\030\007 \001(\003\022\021\n\tparent_id\030\010 \001" +
"(\003\022\'\n\010children\030\t \003(\0132\025.race.RaceTaskChil" +
"dVO\0226\n\tnode_type\030\n \001(\0162#.race.RaceTaskCh" +
"ildVO.ChildNodeType\"+\n\rChildNodeType\022\020\n\014" +
"MODULE_GROUP\020\000\022\010\n\004TASK\020\001\"`\n\036RacePaperSin" +
"gleModuleGroupTask\022\030\n\020custom_module_id\030\001" +
" \001(\005\022$\n\005child\030\002 \003(\0132\025.race.RaceTaskChild" +
"VOB\033\n\031club.joylink.rtss.vo.raceb\006proto3"
"ildVO.ChildNodeType\022\'\n\tsceneType\030\013 \001(\0162\024" +
".race.RaceScene.Type\"+\n\rChildNodeType\022\020\n" +
"\014MODULE_GROUP\020\000\022\010\n\004TASK\020\001\"`\n\036RacePaperSi" +
"ngleModuleGroupTask\022\030\n\020custom_module_id\030" +
"\001 \001(\005\022$\n\005child\030\002 \003(\0132\025.race.RaceTaskChil" +
"dVOB\033\n\031club.joylink.rtss.vo.raceb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@ -10656,7 +10814,7 @@ public final class RaceTask {
internal_static_race_RaceTaskChildVO_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_race_RaceTaskChildVO_descriptor,
new java.lang.String[] { "Id", "Name", "Desc", "Content", "Standards", "SceneId", "RuleId", "ParentId", "Children", "NodeType", });
new java.lang.String[] { "Id", "Name", "Desc", "Content", "Standards", "SceneId", "RuleId", "ParentId", "Children", "NodeType", "SceneType", });
internal_static_race_RacePaperSingleModuleGroupTask_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_race_RacePaperSingleModuleGroupTask_fieldAccessorTable = new

View File

@ -25,4 +25,5 @@ public class RaceTaskDetailDTO {
private LocalDateTime updateTime;
private String creatorName;
private String updaterName;
private String sceneType;
}

View File

@ -330,6 +330,6 @@
</foreach>
UNION all
select A.id,A.name,A.desc,A.content,A.standards,A.score_rule_id,A.score_rule_id as ruleId,A.parent_id from racetr_task A, task B where A.parent_id = B.id)
select * from task
select A.*,B.type as sceneType from task A left join racetr_scene B on A.scene_id = B.id
</select>
</mapper>

View File

@ -24,48 +24,49 @@ import java.util.Objects;
@Slf4j
@SpringBootTest
public class VoiceDiscriminateTest {
@Autowired
private SimulationManager simulationManager;
@Autowired
private SimulationService simulationService;
@Autowired
private SimulationManager simulationManager;
@Autowired
private VoiceDiscriminateService voiceDiscriminateService;
@Autowired
private SimulationService simulationService;
@Autowired
private ProjectServiceImpl projectService;
@Autowired
private VoiceDiscriminateService voiceDiscriminateService;
@Autowired
private IAuthenticateService iAuthenticateService;
@Autowired
private ProjectServiceImpl projectService;
@Autowired
private IOrgProjectService orgProjectService;
@Autowired
private IAuthenticateService iAuthenticateService;
@Test
public void entityTest() throws InterruptedException {
LoginUserVO loginInfo = new LoginUserVO();
loginInfo.setAccount("15388519623");
loginInfo.setClientId("1");
loginInfo.setPassword("e10adc3949ba59abbe56e057f20f883e");
loginInfo.setProject("DEFAULT");
loginInfo.setSecret("joylink");
String token = iAuthenticateService.loginWithPwd(loginInfo);
LoginUserInfoVO loginUserInfoVO = this.iAuthenticateService.getLoginUserInfoByToken(token);
orgProjectService.signInOrg(124L, loginUserInfoVO);
String simulationId = simulationService.createSimulation(10645L, loginUserInfoVO);
Simulation simulation = simulationManager.getById(simulationId);
voiceDiscriminateService.doAnalysis((club.joylink.rtss.simulation.cbtc.Simulation) simulation, "车站二站办理X0202-X0103_1进路");
Route r = ((club.joylink.rtss.simulation.cbtc.Simulation) simulation).getRepository().getRouteList()
.stream().filter(route -> Objects.equals("X0202-X0103_1", route.getName()))
.findFirst().orElse(null);
assert r != null;
boolean checkLock = true;
do {
if (r.isLock()) {
checkLock = false;
log.info("进路办理结束");
}
} while (checkLock);
}
@Autowired
private IOrgProjectService orgProjectService;
@Test
public void entityTest() throws InterruptedException {
LoginUserVO loginInfo = new LoginUserVO();
loginInfo.setAccount("15388519623");
loginInfo.setClientId("1");
loginInfo.setPassword("e10adc3949ba59abbe56e057f20f883e");
loginInfo.setProject("DEFAULT");
loginInfo.setSecret("joylink");
String token = iAuthenticateService.loginWithPwd(loginInfo);
LoginUserInfoVO loginUserInfoVO = this.iAuthenticateService.getLoginUserInfoByToken(token);
orgProjectService.signInOrg(124L, loginUserInfoVO);
String simulationId = simulationService.createSimulation(10645L, null, loginUserInfoVO);
Simulation simulation = simulationManager.getById(simulationId);
voiceDiscriminateService.doAnalysis((club.joylink.rtss.simulation.cbtc.Simulation) simulation, "车站二站办理X0202-X0103_1进路");
Route r = ((club.joylink.rtss.simulation.cbtc.Simulation) simulation).getRepository().getRouteList()
.stream().filter(route -> Objects.equals("X0202-X0103_1", route.getName()))
.findFirst().orElse(null);
assert r != null;
boolean checkLock = true;
do {
if (r.isLock()) {
checkLock = false;
log.info("进路办理结束");
}
} while (checkLock);
}
}

View File

@ -20,32 +20,32 @@ import java.io.IOException;
@SpringBootTest
public class SimulationVoiceStandTest {
@Autowired
private SimulationService simulationService;
@Autowired
private SimulationManager simulationManager;
@Autowired
private VoiceDiscriminateService voiceDiscriminateService;
@Autowired
private SimulationService simulationService;
@Autowired
private SimulationManager simulationManager;
@Autowired
private VoiceDiscriminateService voiceDiscriminateService;
private LoginUserInfoVO getInfo(){
String testJsonData = "{\"accountVO\":{\"id\":\"8146\",\"account\":\"13992867352\",\"type\":\"2\",\"nickname\":\"13992867352\",\"mobile\":\"13992867352\",\"password\":\"e10adc3949ba59abbe56e057f20f883e\",\"roles\":[\"01\",\"05\"],\"email\":\"\",\"status\":\"1\",\"companyId\":124,\"companyName\":\"默认组织\",\"companyAdmin\":false,\"projectCodes\":[\"BJD\",\"CGY\",\"DEFAULT\",\"DRTS\",\"HEB\",\"HYD_RAILWAY\",\"JJJLM\",\"JXGM\",\"NOLOGO\",\"RICHOR\",\"RICHOR_CXJS\",\"RICHOR_HHCJ\",\"RICHOR_JOINT\",\"RICHOR_YGY\",\"SR_SANDBOX\",\"THAILAND_SANDBOX\",\"WJLS\",\"YJDDZH\",\"ZZWW\",\"ZZWWTEST\"]},\"client\":\"Joylink\",\"project\":\"DEFAULT\",\"token\":\"34a5b6916e60eea26a53c820c644c4e8\",\"projectDeviceLogin\":false,\"wechatLogin\":false,\"topOrgId\":124,\"dispatcherRaceTrainingLogin\":false}\n";
LoginUserInfoVO infoVO = JsonUtils.read(testJsonData,LoginUserInfoVO.class);
Project project = new Project();
project.setName("默认项目");
project.setCode("DEFAULT");
ProjectVO projectVO = new ProjectVO(project);
infoVO.setProjectInfo(projectVO);
return infoVO;
}
private LoginUserInfoVO getInfo() {
String testJsonData = "{\"accountVO\":{\"id\":\"8146\",\"account\":\"13992867352\",\"type\":\"2\",\"nickname\":\"13992867352\",\"mobile\":\"13992867352\",\"password\":\"e10adc3949ba59abbe56e057f20f883e\",\"roles\":[\"01\",\"05\"],\"email\":\"\",\"status\":\"1\",\"companyId\":124,\"companyName\":\"默认组织\",\"companyAdmin\":false,\"projectCodes\":[\"BJD\",\"CGY\",\"DEFAULT\",\"DRTS\",\"HEB\",\"HYD_RAILWAY\",\"JJJLM\",\"JXGM\",\"NOLOGO\",\"RICHOR\",\"RICHOR_CXJS\",\"RICHOR_HHCJ\",\"RICHOR_JOINT\",\"RICHOR_YGY\",\"SR_SANDBOX\",\"THAILAND_SANDBOX\",\"WJLS\",\"YJDDZH\",\"ZZWW\",\"ZZWWTEST\"]},\"client\":\"Joylink\",\"project\":\"DEFAULT\",\"token\":\"34a5b6916e60eea26a53c820c644c4e8\",\"projectDeviceLogin\":false,\"wechatLogin\":false,\"topOrgId\":124,\"dispatcherRaceTrainingLogin\":false}\n";
LoginUserInfoVO infoVO = JsonUtils.read(testJsonData, LoginUserInfoVO.class);
Project project = new Project();
project.setName("默认项目");
project.setCode("DEFAULT");
ProjectVO projectVO = new ProjectVO(project);
infoVO.setProjectInfo(projectVO);
return infoVO;
}
@Test
public void test1(){
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10641L,userInfoVO);
Simulation simulation = (Simulation)this.simulationManager.getById(simKey);
@Test
public void test1() {
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10641L, null, userInfoVO);
Simulation simulation = (Simulation) this.simulationManager.getById(simKey);
// simulation.setVoiceRuleList();
voiceDiscriminateService.doAnalysis(simulation,"办理车站一站上行站台扣车");
}
voiceDiscriminateService.doAnalysis(simulation, "办理车站一站上行站台扣车");
}
}

View File

@ -15,32 +15,32 @@ import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class SimulationVoiceStationAuthorizeTest {
@Autowired
private SimulationService simulationService;
@Autowired
private SimulationManager simulationManager;
@Autowired
private VoiceDiscriminateService voiceDiscriminateService;
@Autowired
private SimulationService simulationService;
@Autowired
private SimulationManager simulationManager;
@Autowired
private VoiceDiscriminateService voiceDiscriminateService;
private LoginUserInfoVO getInfo(){
String testJsonData = "{\"accountVO\":{\"id\":\"8146\",\"account\":\"13992867352\",\"type\":\"2\",\"nickname\":\"13992867352\",\"mobile\":\"13992867352\",\"password\":\"e10adc3949ba59abbe56e057f20f883e\",\"roles\":[\"01\",\"05\"],\"email\":\"\",\"status\":\"1\",\"companyId\":124,\"companyName\":\"默认组织\",\"companyAdmin\":false,\"projectCodes\":[\"BJD\",\"CGY\",\"DEFAULT\",\"DRTS\",\"HEB\",\"HYD_RAILWAY\",\"JJJLM\",\"JXGM\",\"NOLOGO\",\"RICHOR\",\"RICHOR_CXJS\",\"RICHOR_HHCJ\",\"RICHOR_JOINT\",\"RICHOR_YGY\",\"SR_SANDBOX\",\"THAILAND_SANDBOX\",\"WJLS\",\"YJDDZH\",\"ZZWW\",\"ZZWWTEST\"]},\"client\":\"Joylink\",\"project\":\"DEFAULT\",\"token\":\"34a5b6916e60eea26a53c820c644c4e8\",\"projectDeviceLogin\":false,\"wechatLogin\":false,\"topOrgId\":124,\"dispatcherRaceTrainingLogin\":false}\n";
LoginUserInfoVO infoVO = JsonUtils.read(testJsonData,LoginUserInfoVO.class);
Project project = new Project();
project.setName("默认项目");
project.setCode("DEFAULT");
ProjectVO projectVO = new ProjectVO(project);
infoVO.setProjectInfo(projectVO);
return infoVO;
}
private LoginUserInfoVO getInfo() {
String testJsonData = "{\"accountVO\":{\"id\":\"8146\",\"account\":\"13992867352\",\"type\":\"2\",\"nickname\":\"13992867352\",\"mobile\":\"13992867352\",\"password\":\"e10adc3949ba59abbe56e057f20f883e\",\"roles\":[\"01\",\"05\"],\"email\":\"\",\"status\":\"1\",\"companyId\":124,\"companyName\":\"默认组织\",\"companyAdmin\":false,\"projectCodes\":[\"BJD\",\"CGY\",\"DEFAULT\",\"DRTS\",\"HEB\",\"HYD_RAILWAY\",\"JJJLM\",\"JXGM\",\"NOLOGO\",\"RICHOR\",\"RICHOR_CXJS\",\"RICHOR_HHCJ\",\"RICHOR_JOINT\",\"RICHOR_YGY\",\"SR_SANDBOX\",\"THAILAND_SANDBOX\",\"WJLS\",\"YJDDZH\",\"ZZWW\",\"ZZWWTEST\"]},\"client\":\"Joylink\",\"project\":\"DEFAULT\",\"token\":\"34a5b6916e60eea26a53c820c644c4e8\",\"projectDeviceLogin\":false,\"wechatLogin\":false,\"topOrgId\":124,\"dispatcherRaceTrainingLogin\":false}\n";
LoginUserInfoVO infoVO = JsonUtils.read(testJsonData, LoginUserInfoVO.class);
Project project = new Project();
project.setName("默认项目");
project.setCode("DEFAULT");
ProjectVO projectVO = new ProjectVO(project);
infoVO.setProjectInfo(projectVO);
return infoVO;
}
@Test
public void test1(){
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10641L,userInfoVO);
Simulation simulation = (Simulation)this.simulationManager.getById(simKey);
@Test
public void test1() {
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10641L, null, userInfoVO);
Simulation simulation = (Simulation) this.simulationManager.getById(simKey);
// simulation.setVoiceRuleList();
voiceDiscriminateService.doAnalysis(simulation,"处理车站一站权限下放");
}
voiceDiscriminateService.doAnalysis(simulation, "处理车站一站权限下放");
}
}

View File

@ -25,52 +25,53 @@ import java.util.concurrent.TimeUnit;
@SpringBootTest
public class SimulationVoiceSwitchTest {
@Autowired
private SimulationService simulationService;
@Autowired
private SimulationManager simulationManager;
@Autowired
private VoiceDiscriminateService voiceDiscriminateService;
@Autowired
@Qualifier("voiceDiscriminateExecutor")
private TaskExecutor voiceDiscriminateExecutor;
@Autowired
private SimulationService simulationService;
@Autowired
private SimulationManager simulationManager;
@Autowired
private VoiceDiscriminateService voiceDiscriminateService;
@Autowired
@Qualifier("voiceDiscriminateExecutor")
private TaskExecutor voiceDiscriminateExecutor;
private LoginUserInfoVO getInfo(){
String testJsonData = "{\"accountVO\":{\"id\":\"8146\",\"account\":\"13992867352\",\"type\":\"2\",\"nickname\":\"13992867352\",\"mobile\":\"13992867352\",\"password\":\"e10adc3949ba59abbe56e057f20f883e\",\"roles\":[\"01\",\"05\"],\"email\":\"\",\"status\":\"1\",\"companyId\":124,\"companyName\":\"默认组织\",\"companyAdmin\":false,\"projectCodes\":[\"BJD\",\"CGY\",\"DEFAULT\",\"DRTS\",\"HEB\",\"HYD_RAILWAY\",\"JJJLM\",\"JXGM\",\"NOLOGO\",\"RICHOR\",\"RICHOR_CXJS\",\"RICHOR_HHCJ\",\"RICHOR_JOINT\",\"RICHOR_YGY\",\"SR_SANDBOX\",\"THAILAND_SANDBOX\",\"WJLS\",\"YJDDZH\",\"ZZWW\",\"ZZWWTEST\"]},\"client\":\"Joylink\",\"project\":\"DEFAULT\",\"token\":\"34a5b6916e60eea26a53c820c644c4e8\",\"projectDeviceLogin\":false,\"wechatLogin\":false,\"topOrgId\":124,\"dispatcherRaceTrainingLogin\":false}\n";
LoginUserInfoVO infoVO = JsonUtils.read(testJsonData,LoginUserInfoVO.class);
Project project = new Project();
project.setName("默认项目");
project.setCode("DEFAULT");
ProjectVO projectVO = new ProjectVO(project);
infoVO.setProjectInfo(projectVO);
return infoVO;
}
private LoginUserInfoVO getInfo() {
String testJsonData = "{\"accountVO\":{\"id\":\"8146\",\"account\":\"13992867352\",\"type\":\"2\",\"nickname\":\"13992867352\",\"mobile\":\"13992867352\",\"password\":\"e10adc3949ba59abbe56e057f20f883e\",\"roles\":[\"01\",\"05\"],\"email\":\"\",\"status\":\"1\",\"companyId\":124,\"companyName\":\"默认组织\",\"companyAdmin\":false,\"projectCodes\":[\"BJD\",\"CGY\",\"DEFAULT\",\"DRTS\",\"HEB\",\"HYD_RAILWAY\",\"JJJLM\",\"JXGM\",\"NOLOGO\",\"RICHOR\",\"RICHOR_CXJS\",\"RICHOR_HHCJ\",\"RICHOR_JOINT\",\"RICHOR_YGY\",\"SR_SANDBOX\",\"THAILAND_SANDBOX\",\"WJLS\",\"YJDDZH\",\"ZZWW\",\"ZZWWTEST\"]},\"client\":\"Joylink\",\"project\":\"DEFAULT\",\"token\":\"34a5b6916e60eea26a53c820c644c4e8\",\"projectDeviceLogin\":false,\"wechatLogin\":false,\"topOrgId\":124,\"dispatcherRaceTrainingLogin\":false}\n";
LoginUserInfoVO infoVO = JsonUtils.read(testJsonData, LoginUserInfoVO.class);
Project project = new Project();
project.setName("默认项目");
project.setCode("DEFAULT");
ProjectVO projectVO = new ProjectVO(project);
infoVO.setProjectInfo(projectVO);
return infoVO;
}
@Test
public void testSource() throws InterruptedException {
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10641L,userInfoVO);
Simulation simulation = (Simulation)this.simulationManager.getById(simKey);
@Test
public void testSource() throws InterruptedException {
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10641L, null, userInfoVO);
Simulation simulation = (Simulation) this.simulationManager.getById(simKey);
// simulation.setVoiceRuleList();
voiceDiscriminateService.doAnalysis(simulation,"办理道岔w0101定位123123");
ThreadPoolTaskExecutor poolTaskExecutor = (ThreadPoolTaskExecutor) this.voiceDiscriminateExecutor;
while(poolTaskExecutor.getActiveCount() > 0){
TimeUnit.SECONDS.sleep(5);
}
voiceDiscriminateService.doAnalysis(simulation, "办理道岔w0101定位123123");
ThreadPoolTaskExecutor poolTaskExecutor = (ThreadPoolTaskExecutor) this.voiceDiscriminateExecutor;
while (poolTaskExecutor.getActiveCount() > 0) {
TimeUnit.SECONDS.sleep(5);
}
@Test
public void testSwitchFan() throws InterruptedException {
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10641L,userInfoVO);
Simulation simulation = (Simulation)this.simulationManager.getById(simKey);
}
voiceDiscriminateService.doAnalysis(simulation,"办理道岔w0101反位123123");
ThreadPoolTaskExecutor poolTaskExecutor = (ThreadPoolTaskExecutor) this.voiceDiscriminateExecutor;
while(poolTaskExecutor.getActiveCount() > 0){
TimeUnit.SECONDS.sleep(5);
}
@Test
public void testSwitchFan() throws InterruptedException {
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10641L, null, userInfoVO);
Simulation simulation = (Simulation) this.simulationManager.getById(simKey);
voiceDiscriminateService.doAnalysis(simulation, "办理道岔w0101反位123123");
ThreadPoolTaskExecutor poolTaskExecutor = (ThreadPoolTaskExecutor) this.voiceDiscriminateExecutor;
while (poolTaskExecutor.getActiveCount() > 0) {
TimeUnit.SECONDS.sleep(5);
}
}
}