修改询问时间的识别
This commit is contained in:
parent
d16bbeeee0
commit
fa4f07af7c
@ -253,9 +253,9 @@ public class ChineseDateTimeUtils {
|
||||
List<Integer> dayOfMonth,
|
||||
Boolean isBetween){
|
||||
int index = c.indexOf(key);
|
||||
if(index >= 0){
|
||||
/*if(index >= 0){
|
||||
c = c.substring(index + key.length());
|
||||
}
|
||||
}*/
|
||||
int i = checkDayOfMonth(localDateTime, ChineseToAlaboUtils.getLong(c.substring(0, index)).intValue());
|
||||
if(!dayOfMonth.contains(i)){
|
||||
dayOfMonth.add(i);
|
||||
|
||||
@ -38,6 +38,10 @@ public class BaseSession {
|
||||
* 用户id
|
||||
*/
|
||||
protected Long userId = 0L;
|
||||
/**
|
||||
* 机器人ID
|
||||
*/
|
||||
protected Long robotId = 0L;
|
||||
/***
|
||||
* 当前使用的BoxId,如果未绑定,那么就是0
|
||||
*/
|
||||
|
||||
@ -86,7 +86,7 @@ public abstract class ActionCommand {
|
||||
sb.setLength(0);
|
||||
}else{
|
||||
try{
|
||||
Thread.sleep(50);
|
||||
Thread.sleep(10);
|
||||
}catch(Exception e){
|
||||
log.info("等信息信息休息异常{}", e);
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ public class UserConfigActionCommand extends ActionCommand implements IActionCo
|
||||
log.info("和用户配置相关的UserConfig Action:{}", action.getAsk());
|
||||
|
||||
SystemTalkBindUserRequest request = new SystemTalkBindUserRequest();
|
||||
request.setUserId(baseSession.getUserId());
|
||||
request.setUserId(baseSession.getRobotId());
|
||||
request.setSystemTalkId(action.getSystemTalkAnswerConfigEntity().getId());
|
||||
request.setAskCommon(action.getActionCommand());
|
||||
return systemTalkBindUserService.selectSystemTalkBindUserByRequest(request).defaultIfEmpty(new SystemTalkBindUserEntity())
|
||||
|
||||
@ -414,27 +414,28 @@ public enum ActionPartSpeechEnum implements IChinesePartSpeech{
|
||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||
List<DeviceUserBindEntity> includs,
|
||||
List<SystemTalkAnswerConfigEntity> commands){
|
||||
if(TIME.getCode().equals(actions.getLastCode())){
|
||||
//上个是时间词,可能后面数字也是时间词
|
||||
|
||||
actions.setLastCode(ActionPartSpeechEnum.t.getCode());
|
||||
//actions.setLastKey();
|
||||
return t.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs, commands);
|
||||
}else{
|
||||
SystemTalkAnswerConfigEntity entity = getSystemTalkWithKey(key, keyGroup, action.getNoTimeAsk());
|
||||
if(entity != null){
|
||||
if(!entity.getAnswerType().equals(AskTypeEnum.COMMAND_N.getCode())){
|
||||
systemTalkAnswerConfigEntities.add(entity);
|
||||
actions.setA(1);
|
||||
}else{
|
||||
log.info("COMMAND_N自定义指令");
|
||||
}
|
||||
|
||||
}else {
|
||||
action.setStatus(key);
|
||||
SystemTalkAnswerConfigEntity entity = getSystemTalkWithKey(key, keyGroup, action.getNoTimeAsk());
|
||||
if(entity != null){
|
||||
if(!entity.getAnswerType().equals(AskTypeEnum.COMMAND_N.getCode())){
|
||||
systemTalkAnswerConfigEntities.add(entity);
|
||||
actions.setA(1);
|
||||
}else{
|
||||
log.info("COMMAND_N自定义指令");
|
||||
}
|
||||
return action;
|
||||
|
||||
}else {
|
||||
if(TIME.getCode().equals(actions.getLastCode())){
|
||||
//上个是时间词,可能后面数字也是时间词
|
||||
|
||||
actions.setLastCode(ActionPartSpeechEnum.t.getCode());
|
||||
//actions.setLastKey();
|
||||
return t.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs, commands);
|
||||
}
|
||||
action.setStatus(key);
|
||||
}
|
||||
return action;
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@ -81,6 +81,7 @@ public class DeviceController {
|
||||
.flatMap(actions -> {
|
||||
BaseSession session = new BaseSession();
|
||||
session.setUserId(userTalkRequst.getId());
|
||||
session.setRobotId(0L);
|
||||
session.setNickName(userTalkRequst.getNickName());
|
||||
session.setRoleId(DeviceCodeEnum.BOX.getName());
|
||||
session.setRequestId(userTalkRequst.getTimeTemp());
|
||||
|
||||
@ -102,6 +102,7 @@ public class BoxWebSocketHandler implements WebSocketHandler {
|
||||
boxSession.setCustomerIP(ip);
|
||||
boxSession.setSession(session);
|
||||
boxSession.setUserId(userId);
|
||||
boxSession.setRobotId(userId);
|
||||
boxSession.setLogId(headers.get(LogMdcConfiguration.PRINT_LOG_ID).get(0));
|
||||
|
||||
log.info("登录成功SN:{}", sn);
|
||||
|
||||
@ -78,6 +78,7 @@ public class CustomerWebSocketHandler implements WebSocketHandler {
|
||||
userSession.setUserId(userId);
|
||||
userSession.setSession(session);
|
||||
userSession.setCustomerIP(ip);
|
||||
userSession.setRobotId(userId);
|
||||
userSession.setSessionType(YesNo.YES.getCode());
|
||||
userSession.setLogId(headers.get(LogMdcConfiguration.PRINT_LOG_ID).get(0));
|
||||
log.info("用户成功userId:{}", userId);
|
||||
|
||||
@ -348,7 +348,7 @@ public class BaseWebSocketService implements IActionSendMessage {
|
||||
if(baseSession.getLanguage().equals(LanguageEnum.ENGLISH.getCode())){
|
||||
boxMessageResp.setText(aliYunTranslateService.ChineseToEnglish(boxMessageResp.getText()));
|
||||
}
|
||||
return audioService.getAudio20231117Url(boxMessageResp.getText(),
|
||||
return audioService.getAudioUrl(boxMessageResp.getText(),
|
||||
StringUtils.isNotEmpty(baseSession.getTtsId()) ? baseSession.getTtsId() : "scl"
|
||||
).map(s ->{
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ tts:
|
||||
#max:
|
||||
# text: 30 #当发送给前端文字超过改值时,分批发送给前端
|
||||
suanfa: true #nacos控制变化
|
||||
url: http://192.168.8.211:18000/run/predict #http://47.110.40.30:18000/run/predict # #算法语音合成
|
||||
url: http://47.110.40.30:18000/run/predict #http://192.168.8.211:18000/run/predict #http://47.110.40.30:18000/run/predict # #算法语音合成
|
||||
lac:
|
||||
#type: suanfa #nacos控制变化
|
||||
huburl: http://192.168.8.175:8866/predict/lac
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user