|
|
|
@ -73,7 +73,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
// 根据processId找到对应的病人
|
|
|
|
|
Process process = Optional.ofNullable(processService.getById(talkReqVO.getProcessId())).orElseThrow(() -> new BusinessException("未找到诊疗进程"));
|
|
|
|
|
// 调用rasa获取文字内容
|
|
|
|
|
String rasaResult = RasaUtil.talkRasa(talkReqVO.getText(), UserUtil.getUser().getId(), process.getPatientId());
|
|
|
|
|
String rasaResult = RasaUtil.talkRasa(talkReqVO.getText(), UserUtil.getUser().getId());
|
|
|
|
|
// 如果rasa没有识别出来,则返回默认值
|
|
|
|
|
if (StrUtil.isBlank(rasaResult)) {
|
|
|
|
|
// 这里调用京东数字人接口首先根据token获取房间号
|
|
|
|
@ -103,7 +103,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
HumanUtil.textDriven("您好,我没有听懂您说什么", roomId);
|
|
|
|
|
saveQaRecord(talkReqVO.getProcessId(), "default", null, talkReqVO.getText(), null, "您好,我没有听懂您说什么");
|
|
|
|
|
} else {
|
|
|
|
|
AskPatientAnswer askPatientAnswer = askPatientAnswerService.lambdaQuery().eq(AskPatientAnswer::getPatientId, process.getPatientId())
|
|
|
|
|
AskPatientAnswer askPatientAnswer = askPatientAnswerService.lambdaQuery().eq(AskPatientAnswer::getMedicalId, process.getMedicalRecId())
|
|
|
|
|
.eq(AskPatientAnswer::getLibraryQuestionId, library.getId()).last("limit 1").one();
|
|
|
|
|
// 如果没有找到回答,去默认回答里面看看有没有
|
|
|
|
|
if (ObjectUtil.isEmpty(askPatientAnswer)) {
|
|
|
|
@ -200,7 +200,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
// 根据processId找到对应的病人
|
|
|
|
|
Process process = Optional.ofNullable(processService.getById(talkReqVO.getProcessId())).orElseThrow(() -> new BusinessException("未找到诊疗进程"));
|
|
|
|
|
// 调用rasa获取文字内容
|
|
|
|
|
String rasaResult = RasaUtil.talkRasa(talkReqVO.getText(), UserUtil.getUser().getId(), process.getPatientId());
|
|
|
|
|
String rasaResult = RasaUtil.talkRasa(talkReqVO.getText(), UserUtil.getUser().getId());
|
|
|
|
|
log.info("rasa的回复是:{}", rasaResult);
|
|
|
|
|
TalkResultResVO talkResultResVO = new TalkResultResVO();
|
|
|
|
|
// 如果rasa没有识别出来,则返回默认值
|
|
|
|
@ -229,7 +229,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
talkResultResVO.setVideoUrl(videoUrl + defaultNoMatchId);
|
|
|
|
|
saveQaRecord(talkReqVO.getProcessId(), "default", null, talkReqVO.getText(), null, "您好,我没有听懂您说什么");
|
|
|
|
|
} else {
|
|
|
|
|
AskPatientAnswer askPatientAnswer = askPatientAnswerService.lambdaQuery().eq(AskPatientAnswer::getPatientId, process.getPatientId())
|
|
|
|
|
AskPatientAnswer askPatientAnswer = askPatientAnswerService.lambdaQuery().eq(AskPatientAnswer::getMedicalId, process.getMedicalRecId())
|
|
|
|
|
.eq(AskPatientAnswer::getLibraryQuestionId, library.getId()).last("limit 1").one();
|
|
|
|
|
// 如果没有找到回答,去默认回答里面看看有没有
|
|
|
|
|
if (ObjectUtil.isEmpty(askPatientAnswer)) {
|
|
|
|
|