|
@@ -2,8 +2,13 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.diagbot.client.UserServiceClient;
|
|
import com.diagbot.dto.GetQuestionInfoDTO;
|
|
import com.diagbot.dto.GetQuestionInfoDTO;
|
|
import com.diagbot.dto.ModuleInfoDTO;
|
|
import com.diagbot.dto.ModuleInfoDTO;
|
|
|
|
+import com.diagbot.dto.ModuleInfoListDTO;
|
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
|
+import com.diagbot.entity.DictionaryInfo;
|
|
import com.diagbot.entity.ModuleDetail;
|
|
import com.diagbot.entity.ModuleDetail;
|
|
import com.diagbot.entity.ModuleInfo;
|
|
import com.diagbot.entity.ModuleInfo;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
@@ -41,6 +46,10 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
ModuleDetailFacade moduleDetailFacade;
|
|
ModuleDetailFacade moduleDetailFacade;
|
|
@Autowired
|
|
@Autowired
|
|
QuestionFacade questionFacade;
|
|
QuestionFacade questionFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ UserServiceClient userServiceClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ DictionaryFacade dictionaryFacade;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据id删除标签模板
|
|
* 根据id删除标签模板
|
|
@@ -173,4 +182,42 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
}
|
|
}
|
|
return moduleInfoDTOList;
|
|
return moduleInfoDTOList;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 模板维护页面获取模板列表
|
|
|
|
+ *
|
|
|
|
+ * @param getModuleInfoVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public IPage<ModuleInfoListDTO> getModuleInfoList(GetModuleInfoVO getModuleInfoVO){
|
|
|
|
+ //获取模板信息
|
|
|
|
+ IPage<ModuleInfoListDTO> moduleInfoDTOIPage = this.getModuleInfoListByType(getModuleInfoVO);
|
|
|
|
+ List<String> ids = new ArrayList<>();
|
|
|
|
+ for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
|
|
|
|
+ ids.add(moduleInfoListDTO.getModifier());
|
|
|
|
+ }
|
|
|
|
+ //获取模板类型名称
|
|
|
|
+ QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+ //获取用户信息
|
|
|
|
+ RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
|
|
|
|
+ if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
|
+ "获取用户信息失败");
|
|
|
|
+ }
|
|
|
|
+ //将用户信息放入实体
|
|
|
|
+ for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
|
|
|
|
+ moduleInfoListDTO.setUserName(respDTO.data.get(moduleInfoListDTO.getModifier()));
|
|
|
|
+ moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(String.valueOf(moduleInfoListDTO.getType().intValue())).getName());
|
|
|
|
+ }
|
|
|
|
+ return moduleInfoDTOIPage;
|
|
|
|
+ }
|
|
}
|
|
}
|