|
|
|
@ -101,8 +101,6 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
|
private void assertDefaultAnswer(List<MedicalRecQaVO> qaList) {
|
|
|
|
|
Assert.notEmpty(qaList, "默认问题列表不能为空");
|
|
|
|
|
|
|
|
|
|
qaList.forEach(qa->Assert.notEmpty(qa.getAnswerResourceId(),"默认问题回答视频不能为空"));
|
|
|
|
|
|
|
|
|
|
CommonDic systemDic = commonDicService.lambdaQuery().eq(CommonDic::getGroupCode, "AQT").eq(CommonDic::getCode, "system").one();
|
|
|
|
|
Assert.notNull(systemDic, "未找到系统问题");
|
|
|
|
|
List<CommonDic> chiildCommonDicList = commonDicService.lambdaQuery().eq(CommonDic::getParentId, systemDic.getId()).list();
|
|
|
|
@ -133,7 +131,6 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
|
askPatientAnswer.setLibraryQuestionId(medicalRecQaVO.getLibraryQuestionId());
|
|
|
|
|
askPatientAnswer.setAnswer(medicalRecQaVO.getMedicalRecAnswer());
|
|
|
|
|
askPatientAnswer.setMedicalId(medicalRecId);
|
|
|
|
|
askPatientAnswer.setAnswerResourceId(medicalRecQaVO.getAnswerResourceId());
|
|
|
|
|
askPatientAnswer.setAnswerType(answerType);
|
|
|
|
|
askPatientAnswer.setQuestion(CollUtil.getFirst(medicalRecQaVO.getQuestionList()));
|
|
|
|
|
askPatientAnswer.insert();
|
|
|
|
@ -216,7 +213,6 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
|
AskPatientAnswer existAnswer = existQAMap.remove(medicalRecQaVO.getId());
|
|
|
|
|
// 然后进行更新
|
|
|
|
|
existAnswer.setAnswer(medicalRecQaVO.getMedicalRecAnswer());
|
|
|
|
|
existAnswer.setAnswerResourceId(medicalRecQaVO.getAnswerResourceId());
|
|
|
|
|
existAnswer.setQuestion(CollUtil.getFirst(medicalRecQaVO.getQuestionList()));
|
|
|
|
|
existAnswer.updateById();
|
|
|
|
|
} else {
|
|
|
|
@ -224,7 +220,6 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
|
askPatientAnswer.setLibraryQuestionId(medicalRecQaVO.getLibraryQuestionId());
|
|
|
|
|
askPatientAnswer.setAnswer(medicalRecQaVO.getMedicalRecAnswer());
|
|
|
|
|
askPatientAnswer.setMedicalId(medicalRec.getId());
|
|
|
|
|
askPatientAnswer.setAnswerResourceId(medicalRecQaVO.getAnswerResourceId());
|
|
|
|
|
askPatientAnswer.setQuestion(CollUtil.getFirst(medicalRecQaVO.getQuestionList()));
|
|
|
|
|
if (null == askPatientAnswer.getAnswerType()){
|
|
|
|
|
askPatientAnswer.setAnswerType(1);
|
|
|
|
@ -270,7 +265,6 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
|
if (StrUtil.isNotEmpty(e.getQuestion())){
|
|
|
|
|
medicalRecQaVO.setQuestionList(CollUtil.newArrayList(e.getQuestion()));
|
|
|
|
|
}
|
|
|
|
|
medicalRecQaVO.setAnswerResourceId(e.getAnswerResourceId());
|
|
|
|
|
return medicalRecQaVO;
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
// 开始构建问题
|
|
|
|
@ -284,15 +278,6 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
|
Set<Long> dictIdSet = askTemplateQuestionLibraryList.stream().map(AskTemplateQuestionLibrary::getDictId).collect(Collectors.toSet());
|
|
|
|
|
Map<Long, CommonDic> dictMap = commonDicService.listByIds(dictIdSet).stream().collect(Collectors.toMap(CommonDic::getId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
// 获取视频资源名
|
|
|
|
|
Set<String> answerResourceIds = medicalRecQaList.stream().map(MedicalRecQaVO::getAnswerResourceId).filter(StrUtil::isNotEmpty).collect(Collectors.toSet());
|
|
|
|
|
Map<String, String> videoInfoMaps = new HashMap<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(answerResourceIds)){
|
|
|
|
|
Map<String, String> videoInfoMapsTmp = materialLibraryService.lambdaQuery().in(MaterialLibrary::getFileResourceId, answerResourceIds)
|
|
|
|
|
.list().stream().collect(Collectors.toMap(MaterialLibrary::getFileResourceId, MaterialLibrary::getMaterialName, (v1,v2) -> v1));
|
|
|
|
|
videoInfoMaps.putAll(videoInfoMapsTmp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (MedicalRecQaVO medicalRecQaVO : medicalRecQaList) {
|
|
|
|
|
AskTemplateQuestionLibrary questionLibrary = askQuestionMap.get(medicalRecQaVO.getLibraryQuestionId());
|
|
|
|
@ -312,8 +297,6 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
|
medicalRecQaVO.setDictId(questionLibrary.getDictId());
|
|
|
|
|
// 类目名称
|
|
|
|
|
medicalRecQaVO.setDictNamePath(dictMap.getOrDefault(questionLibrary.getDictId(), new CommonDic()).getNameZhPath());
|
|
|
|
|
// 回答视频
|
|
|
|
|
medicalRecQaVO.setAnswerResourceName(videoInfoMaps.get(medicalRecQaVO.getAnswerResourceId()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|