|
|
|
@ -98,7 +98,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
.eq(AskPatientAnswer::getLibraryQuestionId, library.getId()).last("limit 1").one();
|
|
|
|
|
// 如果没有找到回答,去默认回答里面看看有没有
|
|
|
|
|
if (ObjectUtil.isEmpty(askPatientAnswer)) {
|
|
|
|
|
log.info("{}:病历配置的回答为空,尝试回答默认答案", rasaResult);
|
|
|
|
|
log.info("{}:病历配置的回答:{}:为空,尝试回答默认答案", rasaResult, askPatientAnswer.getId());
|
|
|
|
|
// 首先看看default里面是不是存在,如果存在,就从default里面去找
|
|
|
|
|
if (CollUtil.isNotEmpty(library.getDefaultAnswer())) {
|
|
|
|
|
String resText = library.getDefaultAnswer().get(RandomUtil.randomInt(0, library.getDefaultAnswer().size()));
|
|
|
|
@ -120,10 +120,10 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (CollUtil.isEmpty(askPatientAnswer.getAnswer())) {
|
|
|
|
|
log.info("{}:病历配置的回答不为空,但在获取的时候,答案为空,尝试回复默认语句", rasaResult);
|
|
|
|
|
log.info("{}:病历配置的回答:{}:为空不为空,但在获取的时候,答案为空,尝试回复默认语句", rasaResult, askPatientAnswer.getId());
|
|
|
|
|
if (CollUtil.isNotEmpty(library.getDefaultAnswer())) {
|
|
|
|
|
String resText = library.getDefaultAnswer().get(RandomUtil.randomInt(0, library.getDefaultAnswer().size()));
|
|
|
|
|
log.info("{}:病历配置的回答不为空,但在获取的时候,答案为空,开始回复默认语句,默认语句内容:{}", rasaResult, resText);
|
|
|
|
|
log.info("{}:病历配置的回答:{}:为空不为空不为空,但在获取的时候,答案为空,开始回复默认语句,默认语句内容:{}", rasaResult, askPatientAnswer.getId(), resText);
|
|
|
|
|
HumanUtil.textDriven(resText, roomId);
|
|
|
|
|
// 保存记录
|
|
|
|
|
DiagnosisQaRecord record = new DiagnosisQaRecord();
|
|
|
|
@ -136,13 +136,13 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
record.setCreateUserId(UserUtil.getUser().getId());
|
|
|
|
|
record.insert();
|
|
|
|
|
} else {
|
|
|
|
|
log.info("{}:病历配置的回答不为空,但在获取的时候,答案为空,但是获取默认语句也为空,那么回复未识别语句", rasaResult);
|
|
|
|
|
log.info("{}:病历配置的回答:{}:为空不为空,但在获取的时候,答案为空,但是获取默认语句也为空,那么回复未识别语句", rasaResult, askPatientAnswer.getId());
|
|
|
|
|
HumanUtil.textDriven("您好,我没有听懂您说什么", roomId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
String resText = askPatientAnswer.getAnswer().get(RandomUtil.randomInt(0, askPatientAnswer.getAnswer().size()));
|
|
|
|
|
log.info("{}:找到了病历配置的回答语句,回答内容:{}", rasaResult, resText);
|
|
|
|
|
log.info("{}:找到了病历配置的回答语句:{},回答内容:{}", rasaResult, askPatientAnswer.getId(), resText);
|
|
|
|
|
HumanUtil.textDriven(resText, roomId);
|
|
|
|
|
// 保存记录
|
|
|
|
|
DiagnosisQaRecord record = new DiagnosisQaRecord();
|
|
|
|
|