|
@@ -11,9 +11,7 @@ import com.diagbot.dto.GetAllDeptAndDisInfoDTO;
|
|
|
import com.diagbot.dto.GetModuleDetailInfoDTO;
|
|
|
import com.diagbot.dto.GetModuleInfoOneDTO;
|
|
|
import com.diagbot.dto.GetModuleTypeDTO;
|
|
|
-import com.diagbot.dto.GetQuestionInfoDTO;
|
|
|
import com.diagbot.dto.GetQuestiongAndModuleRelationsDTO;
|
|
|
-import com.diagbot.dto.ModuleInfoDTO;
|
|
|
import com.diagbot.dto.ModuleInfoListDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.DictionaryInfo;
|
|
@@ -22,6 +20,7 @@ import com.diagbot.entity.ModuleInfo;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.ModuleInfoTypeEnum;
|
|
|
+import com.diagbot.enums.ModuleTypeEnum;
|
|
|
import com.diagbot.enums.QuestionTypeEnum;
|
|
|
import com.diagbot.service.impl.ModuleInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
@@ -38,7 +37,6 @@ import com.diagbot.vo.GetModuleInfoOneVO;
|
|
|
import com.diagbot.vo.GetModuleInfoVO;
|
|
|
import com.diagbot.vo.GetModuleTypeVO;
|
|
|
import com.diagbot.vo.GetQuestiongAndModuleRelationsVO;
|
|
|
-import com.diagbot.vo.ModuleGetQuestionInfoVO;
|
|
|
import com.diagbot.vo.UpdateModuleInfoVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -166,99 +164,6 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
return moduleDetailFacade.saveOrUpdateInfos(addModuleInfoVO, updateModuleInfoVO.getId());
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取标签池信息
|
|
|
- *
|
|
|
- * @param moduleGetQuestionInfoVO
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<GetQuestionInfoDTO> getQuestionInfos(ModuleGetQuestionInfoVO moduleGetQuestionInfoVO) {
|
|
|
- List<GetQuestionInfoDTO> getQuestionInfoDTOS = new ArrayList<>();
|
|
|
- GetQuestionInfoDTO getQuestionInfoDTO = new GetQuestionInfoDTO();
|
|
|
- //如果是辅检,调用aipt-获取概念信息
|
|
|
- if(moduleGetQuestionInfoVO.getType().intValue() == QuestionTypeEnum.Pacs.getKey()){
|
|
|
- getQuestionInfoDTOS = new ArrayList<>();
|
|
|
- ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
|
|
|
- conceptTypeVO.setType(2);
|
|
|
- RespDTO<List<ConceptBaseDTO>> conceptBaseDTOS = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
|
|
|
- RespDTOUtil.respNGDeal(conceptBaseDTOS,"获取辅检标签失败");
|
|
|
- if(ListUtil.isNotEmpty(moduleGetQuestionInfoVO.getNoIds())){
|
|
|
- Iterator<ConceptBaseDTO> conceptBaseDTOIterator = conceptBaseDTOS.data.iterator();
|
|
|
- while (conceptBaseDTOIterator.hasNext()){
|
|
|
- for (Long notId : moduleGetQuestionInfoVO.getNoIds()) {
|
|
|
- if(conceptBaseDTOIterator.next().getConceptId().intValue() == notId.intValue()){
|
|
|
- conceptBaseDTOIterator.remove();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- for (ConceptBaseDTO conceptBaseDTO : conceptBaseDTOS.data) {
|
|
|
- getQuestionInfoDTO = new GetQuestionInfoDTO();
|
|
|
- getQuestionInfoDTO.setId(conceptBaseDTO.getConceptId());
|
|
|
- getQuestionInfoDTO.setTagName(conceptBaseDTO.getName());
|
|
|
- getQuestionInfoDTOS.add(getQuestionInfoDTO);
|
|
|
- }
|
|
|
- }else {//返回除辅检以外的questionInfo信息
|
|
|
- getQuestionInfoDTOS = new ArrayList<>();
|
|
|
- getQuestionInfoDTOS = questionFacade.moduleGetQuestiongInfoByName(moduleGetQuestionInfoVO);
|
|
|
- }
|
|
|
-
|
|
|
- return getQuestionInfoDTOS;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取子模板
|
|
|
- *
|
|
|
- * @param getModuleInfoVO
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<ModuleInfoDTO> getModuleInfo(GetModuleInfoVO getModuleInfoVO) {
|
|
|
- //获取模板信息
|
|
|
- QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- if (getModuleInfoVO.getModuleType() != null) {
|
|
|
- moduleInfoQueryWrapper.eq("module_type", getModuleInfoVO.getModuleType());
|
|
|
- }
|
|
|
- if(getModuleInfoVO.getType() != null) {
|
|
|
- moduleInfoQueryWrapper.eq("type", getModuleInfoVO.getType());
|
|
|
- }
|
|
|
- if(ListUtil.isNotEmpty(getModuleInfoVO.getNoIds())){
|
|
|
- moduleInfoQueryWrapper.notIn("id", getModuleInfoVO.getNoIds());
|
|
|
- }
|
|
|
- if(getModuleInfoVO.getRelationId() != null) {
|
|
|
- moduleInfoQueryWrapper.eq("relation_id", getModuleInfoVO.getRelationId());
|
|
|
- }
|
|
|
- List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
|
|
|
- List<Long> moduleIdList = moduleInfoList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
|
|
- //获取模板明细信息
|
|
|
- QueryWrapper<ModuleDetail> moduleDetailQueryWrapper = new QueryWrapper<>();
|
|
|
- moduleDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("module_id", moduleIdList);
|
|
|
- List<ModuleDetail> moduleDetailList = moduleDetailFacade.list(moduleDetailQueryWrapper);
|
|
|
- //将模板明细根据模板id放入map
|
|
|
- Map<Long, List<ModuleDetail>> moduleDetailMap = new HashMap<>();
|
|
|
- List<ModuleDetail> allModuleDetials = null;
|
|
|
- for (ModuleInfo moduleInfo : moduleInfoList) {
|
|
|
- allModuleDetials = new ArrayList<>();
|
|
|
- for (ModuleDetail moduleDetail : moduleDetailList) {
|
|
|
- if (moduleInfo.getId().longValue() == moduleDetail.getModuleId().longValue()) {
|
|
|
- allModuleDetials.add(moduleDetail);
|
|
|
- }
|
|
|
- }
|
|
|
- moduleDetailMap.put(moduleInfo.getId(), allModuleDetials);
|
|
|
- }
|
|
|
- //给ModuleInfoDTO设值
|
|
|
- List<ModuleInfoDTO> moduleInfoDTOList = new ArrayList<>();
|
|
|
- ModuleInfoDTO moduleInfoDTO = null;
|
|
|
- for (ModuleInfo moduleInfo : moduleInfoList) {
|
|
|
- moduleInfoDTO = new ModuleInfoDTO();
|
|
|
- moduleInfoDTO.setId(moduleInfo.getId());
|
|
|
- moduleInfoDTO.setName(moduleInfo.getName());
|
|
|
- moduleInfoDTO.setModuleDetails(moduleDetailMap.get(moduleInfoDTO.getId()));
|
|
|
- moduleInfoDTOList.add(moduleInfoDTO);
|
|
|
- }
|
|
|
- return moduleInfoDTOList;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 模板维护页面获取模板列表
|
|
@@ -271,15 +176,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
IPage<ModuleInfoListDTO> moduleInfoDTOIPage = this.getModuleInfoListByType(getModuleInfoVO);
|
|
|
List<String> ids = new ArrayList<>();
|
|
|
List<Long> deptId = new ArrayList<>();
|
|
|
- List<Long> disId = new ArrayList<>();
|
|
|
for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
|
|
|
ids.add(moduleInfoListDTO.getModifier());
|
|
|
if(moduleInfoListDTO.getModuleType().intValue() == 1){
|
|
|
deptId.add(moduleInfoListDTO.getRelationId());
|
|
|
}
|
|
|
- if(moduleInfoListDTO.getModuleType().intValue() == 2){
|
|
|
- disId.add(moduleInfoListDTO.getRelationId());
|
|
|
- }
|
|
|
}
|
|
|
//获取科室名称
|
|
|
ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
|
|
@@ -287,25 +188,6 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
|
|
|
RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
|
|
|
Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
|
|
|
- //获取疾病名称
|
|
|
- conceptTypeVO = new ConceptTypeVO();
|
|
|
- conceptTypeVO.setType(3);
|
|
|
- RespDTO<List<ConceptBaseDTO>> disInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
|
|
|
- RespDTOUtil.respNGDeal(disInfoList,"获取疾病信息失败");
|
|
|
- Map<Long, ConceptBaseDTO> disInfoMap = disInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
|
|
|
- /*QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("id", disId);
|
|
|
- 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())
|
|
|
- .eq("group_type", 4)
|
|
|
- .eq("return_type", 1)
|
|
|
- .orderByDesc("order_no");
|
|
|
- List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
|
|
|
- Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal,dictionaryInfo -> dictionaryInfo));
|
|
|
if(ListUtil.isNotEmpty(moduleInfoDTOIPage.getRecords())){
|
|
|
//获取用户信息
|
|
|
RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
|
|
@@ -313,9 +195,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
//将用户信息放入实体
|
|
|
for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
|
|
|
moduleInfoListDTO.setUserName(respDTO.data.get(moduleInfoListDTO.getModifier()));
|
|
|
- if(dictionaryInfoMap.get(moduleInfoListDTO.getType()) != null ){
|
|
|
- moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(moduleInfoListDTO.getType()).getName());
|
|
|
- }
|
|
|
+ moduleInfoListDTO.setAscriptionName(ModuleTypeEnum.getName(Integer.parseInt(moduleInfoListDTO.getType())));
|
|
|
if(moduleInfoListDTO.getModuleType().intValue() == 1){//根据科室
|
|
|
if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是科室通用子模板
|
|
|
if(null != deptInfoMap.get(moduleInfoListDTO.getRelationId())){
|
|
@@ -325,15 +205,6 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
|
|
|
}
|
|
|
}
|
|
|
- if(moduleInfoListDTO.getModuleType().intValue() == 2){//根据疾病
|
|
|
- if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是疾病通用子模板
|
|
|
- if(null != disInfoMap.get(moduleInfoListDTO.getRelationId())){
|
|
|
- moduleInfoListDTO.setRelationName(disInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
|
|
|
- }
|
|
|
- }else {
|
|
|
- moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
|
|
|
- }
|
|
|
- }
|
|
|
moduleInfoListDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(moduleInfoListDTO.getModuleType().intValue()));
|
|
|
}
|
|
|
}
|