manage : fix bug

dev_2.1.0
xueqingkun 1 year ago
parent 0c44ae0b79
commit e59d342b95

@ -83,6 +83,11 @@ public class MedicalRecAnswerExcelDTO {
List<AskPatientAnswer> askPatientAnswerList, List<AskPatientAnswer> askPatientAnswerList,
List<MaterialLibrary> materialLibraryList, List<MaterialLibrary> materialLibraryList,
List<CommonDic> questionTypeDicList){ List<CommonDic> questionTypeDicList){
// 如果视频名称没有后缀,默认添加.mp4后缀
if (StrUtil.isNotEmpty(this.answerVideoName)
&& StrUtil.split(this.answerVideoName,".").size() >1){
answerVideoName = answerVideoName + ".mp4";
}
this.absentCheck(); this.absentCheck();
this.matchQuestion(questionLibraryList); this.matchQuestion(questionLibraryList);
this.matchAskPatientAnswer(askPatientAnswerList); this.matchAskPatientAnswer(askPatientAnswerList);
@ -207,12 +212,13 @@ public class MedicalRecAnswerExcelDTO {
for (CommonDic questionTypeDic : questionTypeDicList) { for (CommonDic questionTypeDic : questionTypeDicList) {
if (this.questionTypeTwo.equals(questionTypeDic.getNameZh())){ if (this.questionTypeTwo.equals(questionTypeDic.getNameZh())){
// todo:再次校验questionTypeOne是否正确
this.dictId = String.valueOf(questionTypeDic.getId()); this.dictId = String.valueOf(questionTypeDic.getId());
this.dictNamePath = questionTypeDic.getNameZhPath(); this.dictNamePath = questionTypeDic.getNameZhPath();
return; return;
} }
} }
errorCodeEnums.add(ErrorCodeEnum.ANSWER_VIDEO_NAME_NOT_FIND); errorCodeEnums.add(ErrorCodeEnum.DICE_NOT_FIND);
} }

@ -40,7 +40,7 @@ public class MaterialLibraryManageServiceImpl implements MaterialLibraryManageSe
// 校验素材名是否已经存在 // 校验素材名是否已经存在
Assert.notEmpty(materialLibraryList, "素材列表不能为空"); Assert.notEmpty(materialLibraryList, "素材列表不能为空");
materialLibraryList.forEach(materialLibrary -> { materialLibraryList.forEach(materialLibrary -> {
Assert.notEmpty(materialLibrary.getMaterialType(), "素材类型不能为空"); Assert.notNull(materialLibrary.getMaterialType(), "素材类型不能为空");
Assert.notEmpty(materialLibrary.getFileResourceId(), "文件资源id不能为空"); Assert.notEmpty(materialLibrary.getFileResourceId(), "文件资源id不能为空");
}); });
@ -94,9 +94,20 @@ public class MaterialLibraryManageServiceImpl implements MaterialLibraryManageSe
Assert.notEmpty(materialLibrary.getId(), "id不能为空"); Assert.notEmpty(materialLibrary.getId(), "id不能为空");
Assert.notEmpty(materialLibrary.getMaterialName(), "素材名不能为空"); Assert.notEmpty(materialLibrary.getMaterialName(), "素材名不能为空");
// 校验是否重名 MaterialLibrary material = materialLibraryService.getById(materialLibrary.getId());
Assert.notNull(material, "素材不存在");
if (!material.getMaterialName().equals(materialLibrary.getMaterialName())){
// 如果素材名发生改变,需要校验素材名是否已经存在
Integer count = materialLibraryService.lambdaQuery().eq(MaterialLibrary::getMaterialName, materialLibrary.getMaterialName()).count(); Integer count = materialLibraryService.lambdaQuery().eq(MaterialLibrary::getMaterialName, materialLibrary.getMaterialName()).count();
Assert.isTrue(count == 0, "素材名已存在"); Assert.isTrue(count == 0, "素材名已存在");
List<String> split = StrUtil.split(material.getMaterialName(), ".");
if (split.size() > 1){
//重新命名文件 添加后缀
materialLibrary.setMaterialName(materialLibrary.getMaterialName() + "." + split.get(split.size()-1));
}
}
return materialLibraryService.updateById(materialLibrary); return materialLibraryService.updateById(materialLibrary);
} }

@ -251,7 +251,7 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
Map<String, String> videoInfoMaps = new HashMap<>(); Map<String, String> videoInfoMaps = new HashMap<>();
if (CollUtil.isNotEmpty(answerResourceIds)){ if (CollUtil.isNotEmpty(answerResourceIds)){
Map<String, String> videoInfoMapsTmp = materialLibraryService.lambdaQuery().in(MaterialLibrary::getFileResourceId, answerResourceIds) Map<String, String> videoInfoMapsTmp = materialLibraryService.lambdaQuery().in(MaterialLibrary::getFileResourceId, answerResourceIds)
.list().stream().collect(Collectors.toMap(MaterialLibrary::getFileResourceId, MaterialLibrary::getMaterialName, (v1,v2) -> v2)); .list().stream().collect(Collectors.toMap(MaterialLibrary::getFileResourceId, MaterialLibrary::getMaterialName, (v1,v2) -> v1));
videoInfoMaps.putAll(videoInfoMapsTmp); videoInfoMaps.putAll(videoInfoMapsTmp);
} }

@ -1,6 +1,6 @@
#服务器端口 #服务器端口
server: server:
port: 8891 port: 8892
servlet: servlet:
context-path: /virtual-patient-manage context-path: /virtual-patient-manage
undertow: undertow:

Loading…
Cancel
Save