|
@@ -4,10 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.dto.RelationDTO;
|
|
|
import com.diagbot.dto.TreeAllDTO;
|
|
|
import com.diagbot.dto.TreeDTO;
|
|
|
-import com.diagbot.entity.CommonParam;
|
|
|
-import com.diagbot.entity.KlRelation;
|
|
|
-import com.diagbot.entity.KlRelationOrder;
|
|
|
-import com.diagbot.entity.KlVitalResult;
|
|
|
+import com.diagbot.entity.*;
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.RelationLibTypeEnum;
|
|
|
import com.diagbot.service.KlRelationOrderService;
|
|
|
import com.diagbot.service.KlRelationService;
|
|
@@ -16,11 +14,7 @@ import com.diagbot.service.impl.KlRelationServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
-import com.diagbot.vo.KlDiseaseVO;
|
|
|
-import com.diagbot.vo.KlSymptomVO;
|
|
|
-import com.diagbot.vo.KlVitalResultVO;
|
|
|
-import com.diagbot.vo.RelationVO;
|
|
|
-import com.diagbot.vo.TreeVO;
|
|
|
+import com.diagbot.vo.*;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
@@ -80,7 +74,7 @@ public class KlRelationFacade extends KlRelationServiceImpl {
|
|
|
List<RelationDTO> root = this.getRelations(relationVO);
|
|
|
TreeAllDTO treeAllDTO = new TreeAllDTO();
|
|
|
treeAllDTO.setTypes(types);
|
|
|
-
|
|
|
+ TreeDTO treeDTO = new TreeDTO();
|
|
|
if (ListUtil.isNotEmpty(root)) {
|
|
|
RelationVO relationVO2 = new RelationVO();
|
|
|
relationVO2.setSType(pList.get(index)[2]);
|
|
@@ -89,7 +83,7 @@ public class KlRelationFacade extends KlRelationServiceImpl {
|
|
|
List<RelationDTO> sub = this.getRelations(relationVO2);
|
|
|
Map<Long, List<RelationDTO>> map = EntityUtil.makeEntityListMap(sub, "sId");
|
|
|
|
|
|
- TreeDTO treeDTO = new TreeDTO();
|
|
|
+
|
|
|
treeDTO.setId(root.get(0).getSId());
|
|
|
treeDTO.setName(root.get(0).getSName());
|
|
|
for (RelationDTO relationDTO : root) {
|
|
@@ -107,8 +101,18 @@ public class KlRelationFacade extends KlRelationServiceImpl {
|
|
|
}
|
|
|
treeDTO.getNextTree().add(treeDTO2);
|
|
|
}
|
|
|
- treeAllDTO.setTreeDTO(treeDTO);
|
|
|
+
|
|
|
+ }else {
|
|
|
+ List<KlConcept> klConcepts = klConceptFacade.list(new QueryWrapper<KlConcept>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("lib_type", types.get(0)));
|
|
|
+ if(ListUtil.isNotEmpty(klConcepts)){
|
|
|
+ treeDTO.setId(klConcepts.get(0).getId());
|
|
|
+ treeDTO.setName(klConcepts.get(0).getLibName());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ treeAllDTO.setTreeDTO(treeDTO);
|
|
|
return treeAllDTO;
|
|
|
}
|
|
|
|