|
@@ -177,8 +177,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
//获取模板信息
|
|
|
QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- if (getModuleInfoVO.getType() != null) {
|
|
|
- moduleInfoQueryWrapper.eq("type", getModuleInfoVO.getType());
|
|
|
+ if (getModuleInfoVO.getModuleType() != null) {
|
|
|
+ moduleInfoQueryWrapper.eq("module_type", getModuleInfoVO.getModuleType());
|
|
|
}
|
|
|
if(ListUtil.isNotEmpty(getModuleInfoVO.getNoIds())){
|
|
|
moduleInfoQueryWrapper.notIn("id", getModuleInfoVO.getNoIds());
|
|
@@ -330,21 +330,49 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
*/
|
|
|
public GetModuleInfoOneDTO getModuleInfoOne(GetModuleInfoOneVO getModuleInfoOneVO) {
|
|
|
GetModuleInfoOneDTO getModuleInfoOneDTO = new GetModuleInfoOneDTO();
|
|
|
+ List<Long> deptId = new ArrayList<>();
|
|
|
+ List<Long> disId = new ArrayList<>();
|
|
|
//获取模板信息
|
|
|
QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("id", getModuleInfoOneVO.getModuleId());
|
|
|
ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper);
|
|
|
//获取模板类型名称
|
|
|
+ if(moduleInfo.getModuleType().intValue() == 1){
|
|
|
+ deptId.add(moduleInfo.getRelationId());
|
|
|
+ }
|
|
|
+ if(moduleInfo.getModuleType().intValue() == 2){
|
|
|
+ disId.add(moduleInfo.getRelationId());
|
|
|
+ }
|
|
|
+ //获取科室名称
|
|
|
+ QueryWrapper<DeptInfo> deptInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ deptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("id", deptId);
|
|
|
+ List<DeptInfo> deptInfoList = deptInfoFacade.list(deptInfoQueryWrapper);
|
|
|
+ Map<Long, DeptInfo> deptInfoMap = deptInfoList.stream().collect(Collectors.toMap(DeptInfo::getId,deptInfo -> deptInfo));
|
|
|
+ //获取疾病名称
|
|
|
+ QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("id", deptId);
|
|
|
+ List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
+ Map<Long, QuestionInfo> questionInfoMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId,questionInfo -> questionInfo));
|
|
|
+ //获取模板类型
|
|
|
QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("group_type", 4)
|
|
|
+ .eq("return_type", 1)
|
|
|
+ .orderByDesc("order_no");
|
|
|
List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
|
|
|
- Map<String, DictionaryInfo> dictionaryInfoMap = new HashMap<>();
|
|
|
- for (DictionaryInfo dictionaryInfo : dictionaryInfoList) {
|
|
|
- dictionaryInfoMap.put(dictionaryInfo.getVal(), dictionaryInfo);
|
|
|
- }
|
|
|
+ Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal,dictionaryInfo -> dictionaryInfo));
|
|
|
BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
|
|
|
getModuleInfoOneDTO.setAscriptionName(dictionaryInfoMap.get(String.valueOf(moduleInfo.getType())).getName());
|
|
|
+ getModuleInfoOneDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(getModuleInfoOneDTO.getModuleType().intValue()));
|
|
|
+ if(getModuleInfoOneDTO.getModuleType().intValue() == 1){
|
|
|
+ getModuleInfoOneDTO.setRelationName(deptInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
|
|
|
+ }
|
|
|
+ if(getModuleInfoOneDTO.getModuleType().intValue() == 2){
|
|
|
+ getModuleInfoOneDTO.setRelationName(questionInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
|
|
|
+ }
|
|
|
return getModuleInfoOneDTO;
|
|
|
}
|
|
|
|