|
|
|
@ -92,6 +92,20 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
if (ObjectUtil.isEmpty(library)) {
|
|
|
|
|
HumanUtil.textDriven("您好,我没有听懂您说什么", roomId);
|
|
|
|
|
} else {
|
|
|
|
|
// 首先看看default里面是不是存在,如果存在,就从default里面去找
|
|
|
|
|
if (CollUtil.isNotEmpty(library.getDefaultAnswer())) {
|
|
|
|
|
String resText = library.getDefaultAnswer().get(RandomUtil.randomInt(0, library.getDefaultAnswer().size()));
|
|
|
|
|
HumanUtil.textDriven(resText, roomId);
|
|
|
|
|
// 保存记录
|
|
|
|
|
DiagnosisQaRecord record = new DiagnosisQaRecord();
|
|
|
|
|
record.setProcessId(talkReqVO.getProcessId());
|
|
|
|
|
// 注意,这里如果有默认回答,回答的结果是默认结果ID
|
|
|
|
|
record.setQuestionAnswerId(library.getId());
|
|
|
|
|
record.setQuestion(talkReqVO.getText());
|
|
|
|
|
record.setAnswer(resText);
|
|
|
|
|
record.setCreateUserId(UserUtil.getUser().getId());
|
|
|
|
|
record.insert();
|
|
|
|
|
}
|
|
|
|
|
AskPatientAnswer askPatientAnswer = askPatientAnswerService.lambdaQuery().eq(AskPatientAnswer::getPatientId, process.getPatientId())
|
|
|
|
|
.eq(AskPatientAnswer::getLibraryQuestionId, library.getId()).last("limit 1").one();
|
|
|
|
|
if (ObjectUtil.isEmpty(askPatientAnswer) || CollUtil.isEmpty(askPatientAnswer.getAnswer())) {
|
|
|
|
|