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