From 1e973308e8b5eb72aa44da2e60f0264813b07427 Mon Sep 17 00:00:00 2001 From: liu Date: Thu, 6 Jun 2024 18:42:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E7=AD=94=E6=B5=81?= =?UTF-8?q?=E7=A8=8B,=E5=88=87=E6=8D=A2=E4=B8=BA=E5=9C=A8=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/pojo/vo/MedicalRecQaVO.java | 9 --------- .../impl/MedicalRecManageServiceImpl.java | 17 ----------------- 2 files changed, 26 deletions(-) diff --git a/virtual-patient-manage/src/main/java/com/supervision/manage/pojo/vo/MedicalRecQaVO.java b/virtual-patient-manage/src/main/java/com/supervision/manage/pojo/vo/MedicalRecQaVO.java index b2a7b2bc..ca25b42f 100644 --- a/virtual-patient-manage/src/main/java/com/supervision/manage/pojo/vo/MedicalRecQaVO.java +++ b/virtual-patient-manage/src/main/java/com/supervision/manage/pojo/vo/MedicalRecQaVO.java @@ -27,15 +27,6 @@ public class MedicalRecQaVO { @Schema(description = "问题类目,新增更新时不需要") private String dictNamePath; - @Schema(description = "默认回答,新增更新时不需要") - private String defaultAnswer; - - @Schema(description = "回答的资源id,新增更新时需要") - private String answerResourceId; - - @Schema(description = "回答的资源视频名,新增更新时需要") - private String answerResourceName; - @Schema(description = "针对病例的特定回答,新增更新时必填") private String medicalRecAnswer; diff --git a/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/MedicalRecManageServiceImpl.java b/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/MedicalRecManageServiceImpl.java index ce7825ee..2f913b6d 100644 --- a/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/MedicalRecManageServiceImpl.java +++ b/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/MedicalRecManageServiceImpl.java @@ -101,8 +101,6 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService { private void assertDefaultAnswer(List 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 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 dictIdSet = askTemplateQuestionLibraryList.stream().map(AskTemplateQuestionLibrary::getDictId).collect(Collectors.toSet()); Map dictMap = commonDicService.listByIds(dictIdSet).stream().collect(Collectors.toMap(CommonDic::getId, Function.identity())); - // 获取视频资源名 - Set answerResourceIds = medicalRecQaList.stream().map(MedicalRecQaVO::getAnswerResourceId).filter(StrUtil::isNotEmpty).collect(Collectors.toSet()); - Map videoInfoMaps = new HashMap<>(); - if (CollUtil.isNotEmpty(answerResourceIds)){ - Map 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())); } } }