|
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.client.UserServiceClient;
|
|
|
+import com.diagbot.dto.DeptDTO;
|
|
|
+import com.diagbot.dto.DisDTO;
|
|
|
+import com.diagbot.dto.GetAllDeptAndDisInfoDTO;
|
|
|
import com.diagbot.dto.GetModuleDetailInfoDTO;
|
|
|
import com.diagbot.dto.GetModuleInfoOneDTO;
|
|
|
import com.diagbot.dto.GetModuleTypeDTO;
|
|
@@ -13,6 +16,7 @@ import com.diagbot.dto.ModuleInfoListDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.DeptInfo;
|
|
|
import com.diagbot.entity.DictionaryInfo;
|
|
|
+import com.diagbot.entity.DisType;
|
|
|
import com.diagbot.entity.ModuleDetail;
|
|
|
import com.diagbot.entity.ModuleInfo;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
@@ -63,6 +67,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
DictionaryFacade dictionaryFacade;
|
|
|
@Autowired
|
|
|
DeptInfoFacade deptInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ DisTypeFacade disTypeFacade;
|
|
|
|
|
|
/**
|
|
|
* 根据id删除标签模板
|
|
@@ -407,4 +413,34 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
}
|
|
|
return getModuleTypeDTOS;
|
|
|
}
|
|
|
+
|
|
|
+ public GetAllDeptAndDisInfoDTO getAllDeptAndDisInfo(){
|
|
|
+ QueryWrapper<DeptInfo> deptInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ deptInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey());
|
|
|
+ List<DeptInfo> deptInfoList = deptInfoFacade.list(deptInfoQueryWrapper);
|
|
|
+ List<DeptDTO> deptDTOS = BeanUtil.listCopyTo(deptInfoList,DeptDTO.class);
|
|
|
+ QueryWrapper<DisType> disTypeQueryWrapper = new QueryWrapper<>();
|
|
|
+ disTypeQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
+ .eq("type",1);
|
|
|
+ List<DisType> disTypes = disTypeFacade.list(disTypeQueryWrapper);
|
|
|
+ List<DisDTO> disDTOS = BeanUtil.listCopyTo(disTypes,DisDTO.class);
|
|
|
+ List<Long> questionIds = disTypes.stream().map(DisType::getParentId).collect(Collectors.toList());
|
|
|
+ QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ questionInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
+ .in("id",questionIds);
|
|
|
+ Map<Long,QuestionInfo> questionInfoMap = questionFacade.list(questionInfoQueryWrapper)
|
|
|
+ .stream()
|
|
|
+ .collect(Collectors.toMap(QuestionInfo::getId,questionInfo -> questionInfo));
|
|
|
+ for (DisDTO disDTO: disDTOS) {
|
|
|
+ if(questionInfoMap.get(disDTO.getParentId()) != null){
|
|
|
+ disDTO.setName(questionInfoMap.get(disDTO.getParentId()).getTagName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ GetAllDeptAndDisInfoDTO getAllDeptAndDisInfoDTO = new GetAllDeptAndDisInfoDTO();
|
|
|
+ getAllDeptAndDisInfoDTO.setDeptDTOS(deptDTOS);
|
|
|
+ getAllDeptAndDisInfoDTO.setDisDTOS(disDTOS);
|
|
|
+ return getAllDeptAndDisInfoDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|