【删除多余代码】
This commit is contained in:
parent
e865770a4b
commit
2ba34056dc
@ -35,12 +35,9 @@ import club.joylink.rtss.vo.map.MapVO;
|
|||||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -207,22 +204,6 @@ public class SimulationV1Controller {
|
|||||||
return this.groupSimulationService.operate(group, type, param, user);
|
return this.groupSimulationService.operate(group, type, param, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送会话消息(语音输入)操作
|
|
||||||
* 由于文件不能进行json格式化,先将文件处理后再执行操作信息
|
|
||||||
* 电话模式下:必须存在id
|
|
||||||
*/
|
|
||||||
@PostMapping(value = {"/{group}/operate/Conversation_Phone_Audio", "/{group}/operate/Conversation_Chat_Audio"})
|
|
||||||
public Object operateFile(HttpServletRequest request, @PathVariable @NotBlank String group, MultipartFile file
|
|
||||||
, String id, @RequestAttribute AccountVO user) {
|
|
||||||
String uri = request.getRequestURI();
|
|
||||||
String type = uri.substring(uri.lastIndexOf("/") + 1);
|
|
||||||
if ("Conversation_Phone_Audio".equals(type) && StringUtils.isEmpty(id)) {
|
|
||||||
throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception("会话ID不能为空");
|
|
||||||
}
|
|
||||||
return this.groupSimulationService.operateFile(group, type, file, id, user);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仿真指令
|
* 仿真指令
|
||||||
*/
|
*/
|
||||||
|
@ -24,7 +24,6 @@ import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
|||||||
import club.joylink.rtss.vo.client.simulationv1.*;
|
import club.joylink.rtss.vo.client.simulationv1.*;
|
||||||
import club.joylink.rtss.vo.map.MapVO;
|
import club.joylink.rtss.vo.map.MapVO;
|
||||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
@ -80,11 +79,6 @@ public interface GroupSimulationService {
|
|||||||
*/
|
*/
|
||||||
Object operate(String group, String type, Map<String, Object> param, AccountVO user);
|
Object operate(String group, String type, Map<String, Object> param, AccountVO user);
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件操作请求
|
|
||||||
*/
|
|
||||||
Object operateFile(String group, String type, MultipartFile file, String id, AccountVO user);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据计划时间获取此时间点可以加载的最大列车数量
|
* 根据计划时间获取此时间点可以加载的最大列车数量
|
||||||
*/
|
*/
|
||||||
|
@ -75,7 +75,6 @@ import org.springframework.context.ApplicationContext;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -446,14 +445,6 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
|||||||
return this.atsOperationDispatcher.dispatch(simulation, user, type, param);
|
return this.atsOperationDispatcher.dispatch(simulation, user, type, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object operateFile(String group, String type, MultipartFile file, String id, AccountVO user) {
|
|
||||||
Simulation simulation = this.groupSimulationCache.getSimulationByGroup(group);
|
|
||||||
Map<String, Object> params = conversationManagerService.parseAudioInfo(file);
|
|
||||||
params.put("id", id);
|
|
||||||
return this.atsOperationDispatcher.dispatch(simulation, user, type, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getGivenTimeCouldLoadedTrainNumber(String group, LocalTime time) {
|
public int getGivenTimeCouldLoadedTrainNumber(String group, LocalTime time) {
|
||||||
Simulation simulation = this.groupSimulationCache.getSimulationByGroup(group);
|
Simulation simulation = this.groupSimulationCache.getSimulationByGroup(group);
|
||||||
|
@ -413,19 +413,6 @@ public class ConversationManagerService {
|
|||||||
sendChatMessage(simulation.getId(), simulation.getSimulationUserIds(), conversationMessage);
|
sendChatMessage(simulation.getId(), simulation.getSimulationUserIds(), conversationMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 解析语音文件信息
|
|
||||||
*/
|
|
||||||
public Map<String, Object> parseAudioInfo(MultipartFile file) {
|
|
||||||
VoiceRecognitionResult recognitionResult = iVoiceService.voiceRecognition(file, "");
|
|
||||||
String upperCaseResult = recognitionResult.getResult().toUpperCase();
|
|
||||||
String handledContent = simulationVoiceHandler.handle(upperCaseResult);
|
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
|
||||||
resultMap.put("audioPath", recognitionResult.getFilePath());
|
|
||||||
resultMap.put("content", handledContent);
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendChatMessage(String simulationId, Set<String> userIds, ConversationMessage conversationMessage) {
|
private void sendChatMessage(String simulationId, Set<String> userIds, ConversationMessage conversationMessage) {
|
||||||
SocketMessageVO<ConversationMessageVO> chatMessage =
|
SocketMessageVO<ConversationMessageVO> chatMessage =
|
||||||
SocketMessageFactory.build(WebSocketMessageType.Simulation_Conversation_Operation, simulationId, new ConversationMessageVO(conversationMessage));
|
SocketMessageFactory.build(WebSocketMessageType.Simulation_Conversation_Operation, simulationId, new ConversationMessageVO(conversationMessage));
|
||||||
|
Loading…
Reference in New Issue
Block a user