删除一些无用的东西
This commit is contained in:
parent
db606a2745
commit
6ac172edbd
@ -1,39 +0,0 @@
|
|||||||
package club.joylink.rtss.controller;
|
|
||||||
|
|
||||||
import club.joylink.rtss.services.IVoiceCommandService;
|
|
||||||
import club.joylink.rtss.simulation.cbtc.command.VoiceCommandBO;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 语音指令接口
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/voiceCommand")
|
|
||||||
public class VoiceCommandController {
|
|
||||||
@Autowired
|
|
||||||
private IVoiceCommandService iVoiceCommandService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加语音指令
|
|
||||||
* @param command
|
|
||||||
*/
|
|
||||||
@PostMapping("")
|
|
||||||
public void create(VoiceCommandBO command) {
|
|
||||||
iVoiceCommandService.create(command);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有语音指令
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("")
|
|
||||||
public List<VoiceCommandBO> getAll() {
|
|
||||||
return iVoiceCommandService.getAll();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
package club.joylink.rtss.services;
|
|
||||||
|
|
||||||
import club.joylink.rtss.simulation.cbtc.command.VoiceCommandBO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface IVoiceCommandService {
|
|
||||||
/**
|
|
||||||
* 添加语音指令
|
|
||||||
*/
|
|
||||||
void create(VoiceCommandBO command);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所有语音指令
|
|
||||||
*/
|
|
||||||
List<VoiceCommandBO> getAll();
|
|
||||||
}
|
|
@ -226,7 +226,7 @@ public class SysUserService implements ISysUserService {
|
|||||||
// return PageVO.convert(page);
|
// return PageVO.convert(page);
|
||||||
SysAccountExample example = new SysAccountExample();
|
SysAccountExample example = new SysAccountExample();
|
||||||
SysAccountExample.Criteria criteria = example.createCriteria();
|
SysAccountExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andStatusEqualTo(StatusEnum.Valid.getCode());
|
// criteria.andStatusEqualTo(StatusEnum.Valid.getCode());
|
||||||
if (queryVO.getId() != null) {
|
if (queryVO.getId() != null) {
|
||||||
criteria.andIdEqualTo(queryVO.getId());
|
criteria.andIdEqualTo(queryVO.getId());
|
||||||
}
|
}
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
package club.joylink.rtss.services;
|
|
||||||
|
|
||||||
import club.joylink.rtss.simulation.cbtc.command.CommandBO;
|
|
||||||
import club.joylink.rtss.simulation.cbtc.command.VoiceCommandBO;
|
|
||||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
|
||||||
import club.joylink.rtss.dao.VoiceCommandDAO;
|
|
||||||
import club.joylink.rtss.entity.VoiceCommandWithBLOBs;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class VoiceCommandService implements IVoiceCommandService {
|
|
||||||
@Autowired
|
|
||||||
private VoiceCommandDAO voiceCommandDAO;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void create(VoiceCommandBO command) {
|
|
||||||
Long mapId = 41L; //西安三
|
|
||||||
|
|
||||||
String pattern = "^([0-9]{3})车.*(RM)模式.*引导信号.$";
|
|
||||||
VoiceCommandBO.Type type = VoiceCommandBO.Type.Main_Body;
|
|
||||||
|
|
||||||
// Map<Integer, VoiceCommandBO.KeyWord> keyWordTypeMap = null;
|
|
||||||
Map<Integer, VoiceCommandBO.KeyWord> keyWordTypeMap = new HashMap<>();
|
|
||||||
// keyWordTypeMap.put(0, VoiceCommandBO.KeyWord.Train_Group);
|
|
||||||
keyWordTypeMap.put(1, VoiceCommandBO.KeyWord.Train_Group);
|
|
||||||
keyWordTypeMap.put(2, VoiceCommandBO.KeyWord.Drive_Mode);
|
|
||||||
// keyWordTypeMap.put(3, VoiceCommandBO.KeyWord.Train_Group);
|
|
||||||
// keyWordTypeMap.put(4, VoiceCommandBO.KeyWord.Train_Group);
|
|
||||||
|
|
||||||
Integer deviceKeyWordIndex = 1;
|
|
||||||
|
|
||||||
String reply = "%s车司机以%s模式凭引导信号行驶,司机收到";
|
|
||||||
// String reply = null;
|
|
||||||
List<Integer> replyParamIndexes = Arrays.asList(1,2);
|
|
||||||
// List<Integer> replyParamIndexes = null;
|
|
||||||
|
|
||||||
CommandBO.CommandType commandType = CommandBO.CommandType.Drive_Through_The_Guide_Signal;
|
|
||||||
|
|
||||||
List<Integer> commandParamIndexes = new ArrayList<>();
|
|
||||||
|
|
||||||
List<SimulationMember.Type> fromType = Collections.singletonList(SimulationMember.Type.DISPATCHER);
|
|
||||||
List<SimulationMember.Type> targetType = Collections.singletonList(SimulationMember.Type.DRIVER);
|
|
||||||
|
|
||||||
VoiceCommandBO voiceCommandBO = new VoiceCommandBO(mapId, pattern, type, fromType,
|
|
||||||
targetType, keyWordTypeMap, deviceKeyWordIndex, reply, replyParamIndexes,
|
|
||||||
commandType, commandParamIndexes);
|
|
||||||
VoiceCommandWithBLOBs voiceCommand = voiceCommandBO.buildDB();
|
|
||||||
voiceCommandDAO.insert(voiceCommand);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<VoiceCommandBO> getAll() {
|
|
||||||
List<VoiceCommandWithBLOBs> voiceCommands = voiceCommandDAO.selectByExampleWithBLOBs(null);
|
|
||||||
return VoiceCommandBO.convert(voiceCommands);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -6,7 +6,6 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
|||||||
import club.joylink.rtss.simulation.cbtc.ATS.data.SimulationLog;
|
import club.joylink.rtss.simulation.cbtc.ATS.data.SimulationLog;
|
||||||
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcRepository;
|
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcRepository;
|
||||||
import club.joylink.rtss.simulation.cbtc.build.SimulationBuildParams;
|
import club.joylink.rtss.simulation.cbtc.build.SimulationBuildParams;
|
||||||
|
|
||||||
import club.joylink.rtss.simulation.cbtc.command.VoiceCommandBO;
|
import club.joylink.rtss.simulation.cbtc.command.VoiceCommandBO;
|
||||||
import club.joylink.rtss.simulation.cbtc.competition.CompetitionBO;
|
import club.joylink.rtss.simulation.cbtc.competition.CompetitionBO;
|
||||||
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
||||||
@ -68,7 +67,7 @@ public class Simulation extends club.joylink.rtss.simulation.Simulation<Simulati
|
|||||||
/**
|
/**
|
||||||
* 仿真创建所使用的权限类型及主体
|
* 仿真创建所使用的权限类型及主体
|
||||||
* key = 权限类型+"-" + 权限主体id
|
* key = 权限类型+"-" + 权限主体id
|
||||||
* {@link PermissionSubjectTypeEnum.org or PermissionSubjectTypeEnum.project}
|
* {@link PermissionSubjectTypeEnum#org or PermissionSubjectTypeEnum.project}
|
||||||
*/
|
*/
|
||||||
private Map<String,Boolean> createUserType;
|
private Map<String,Boolean> createUserType;
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user