|
@@ -3,8 +3,8 @@ package com.diagbot.facade;
|
|
|
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.dto.DictionaryInfoDTO;
|
|
|
import com.diagbot.dto.KlDiagnoseByIdDTO;
|
|
|
+import com.diagbot.dto.KlDiagnoseGroupDTO;
|
|
|
import com.diagbot.dto.KlDiagnoseInfoDTO;
|
|
|
import com.diagbot.dto.KlDiagnoseTypeDTO;
|
|
|
import com.diagbot.entity.KlDiagnose;
|
|
@@ -49,44 +49,37 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public List<KlDiagnoseByIdDTO> getByIdDiagnoseAll(KlDiagnoseByIdVO klDiagnoseByIdVO) {
|
|
|
+ public List<KlDiagnoseTypeDTO> getByIdDiagnoseAll(KlDiagnoseByIdVO klDiagnoseByIdVO) {
|
|
|
List<KlDiagnoseByIdDTO> byIdDiagnoses = this.getByIdDiagnoses(klDiagnoseByIdVO);
|
|
|
//基础条件
|
|
|
Map<Integer, List<KlDiagnoseByIdDTO>> baseGroupMap = byIdDiagnoses.stream().filter(i -> i.getConditionType().equals(1)).collect(Collectors.groupingBy(KlDiagnoseByIdDTO::getBaseGroup));
|
|
|
+ //根据ConditionType 和 getConditionGroup两个添加分组
|
|
|
+ Map<Integer, Map<Integer, List<KlDiagnoseByIdDTO>>> collect = byIdDiagnoses.stream().filter(i -> !i.getConditionType().equals(1)).collect(Collectors.groupingBy(KlDiagnoseByIdDTO::getConditionType, Collectors.groupingBy(KlDiagnoseByIdDTO::getConditionGroup)));
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- List<DictionaryInfoDTO> listByGroupType = klDictionaryInfoFacade.getListByGroupType(30);
|
|
|
- List<KlDiagnoseTypeDTO> KlDiagnoseTypeList = new ArrayList<>();
|
|
|
- for (DictionaryInfoDTO data : listByGroupType) {
|
|
|
+ List<KlDiagnoseTypeDTO> klDiagnoseTypeList = new ArrayList<>();
|
|
|
+ for (Map.Entry<Integer, Map<Integer, List<KlDiagnoseByIdDTO>>> entry : collect.entrySet()) {
|
|
|
KlDiagnoseTypeDTO klDiagnoseTypeDTO = new KlDiagnoseTypeDTO();
|
|
|
- klDiagnoseTypeDTO.setConditionType(Integer.parseInt(data.getVal()));
|
|
|
- KlDiagnoseTypeList.add(klDiagnoseTypeDTO);
|
|
|
- }
|
|
|
- for (KlDiagnoseByIdDTO byIdDTO : byIdDiagnoses) {
|
|
|
- for (KlDiagnoseTypeDTO typeDTO : KlDiagnoseTypeList) {
|
|
|
- if (typeDTO.getConditionType().equals(byIdDTO.getConditionType())) {
|
|
|
-
|
|
|
+ klDiagnoseTypeDTO.setConditionType(entry.getKey());
|
|
|
+ Map<Integer, List<KlDiagnoseByIdDTO>> value = entry.getValue();
|
|
|
+ List<KlDiagnoseGroupDTO> byIdDTO = new ArrayList<>();
|
|
|
+ for (Map.Entry<Integer, List<KlDiagnoseByIdDTO>> entry2 : value.entrySet()) {
|
|
|
+ List<KlDiagnoseByIdDTO> value1 = entry2.getValue();
|
|
|
+ for (KlDiagnoseByIdDTO data : value1) {
|
|
|
+ KlDiagnoseGroupDTO klDiagnoseGroupDTO = new KlDiagnoseGroupDTO();
|
|
|
+ klDiagnoseGroupDTO.setConditionGroup(entry2.getKey());
|
|
|
+ klDiagnoseGroupDTO.setFitNo(data.getFitNo());
|
|
|
+ klDiagnoseGroupDTO.setBaseGroup(data.getBaseGroup());
|
|
|
+ klDiagnoseGroupDTO.setKlDiagnoseByIdDTO(baseGroupMap.get(data.getBaseGroup()));
|
|
|
+ byIdDTO.add(klDiagnoseGroupDTO);
|
|
|
|
|
|
}
|
|
|
|
|
|
+ klDiagnoseTypeDTO.setByIdDTO(byIdDTO);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- Map<Integer, List<KlDiagnoseByIdDTO>> map = byIdDiagnoses.stream().collect(Collectors.groupingBy(KlDiagnoseByIdDTO::getConditionType));
|
|
|
-
|
|
|
- for (Map.Entry<Integer, List<KlDiagnoseByIdDTO>> entry : map.entrySet()) {
|
|
|
- if (entry.getKey().equals(2)) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ klDiagnoseTypeList.add(klDiagnoseTypeDTO);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- return byIdDiagnoses;
|
|
|
+ return klDiagnoseTypeList;
|
|
|
}
|
|
|
|
|
|
public Boolean clearDiagnoseAll(KlDiagnoseClearVO klDiagnoseClearVO) {
|