|
@@ -1,6 +1,7 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.dto.RelationDTO;
|
|
|
+import com.diagbot.dto.TreeAllDTO;
|
|
|
import com.diagbot.dto.TreeDTO;
|
|
|
import com.diagbot.service.impl.KlRelationServiceImpl;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
@@ -20,8 +21,7 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Component
|
|
|
public class KlRelationFacade extends KlRelationServiceImpl {
|
|
|
- public TreeDTO getTree(TreeVO treeVO) {
|
|
|
- TreeDTO treeDTO = new TreeDTO();
|
|
|
+ public TreeAllDTO getTree(TreeVO treeVO) {
|
|
|
List<Long[]> pList = new ArrayList<>();
|
|
|
pList.add(new Long[] { 402L, 600L, 301L, 600L, 101L });//药品化学物质类别
|
|
|
pList.add(new Long[] { 403L, 600L, 302L, 600L, 101L });//药品治疗学类别
|
|
@@ -32,9 +32,15 @@ public class KlRelationFacade extends KlRelationServiceImpl {
|
|
|
pList.add(new Long[] { 408L, 600L, 107L, 600L, 108L });//实验室检查类别
|
|
|
pList.add(new Long[] { 409L, 600L, 109L, 600L, 110L });//实验室检查类别
|
|
|
|
|
|
+ Integer index = treeVO.getType() - 1;
|
|
|
+ List<Long> types = new ArrayList<>();
|
|
|
+ types.add(pList.get(index)[0]);
|
|
|
+ types.add(pList.get(index)[1]);
|
|
|
+ types.add(pList.get(index)[2]);
|
|
|
+ types.add(pList.get(index)[3]);
|
|
|
+ types.add(pList.get(index)[4]);
|
|
|
|
|
|
RelationVO relationVO = new RelationVO();
|
|
|
- Integer index = treeVO.getType() - 1;
|
|
|
relationVO.setSType(pList.get(index)[0]);
|
|
|
relationVO.setRId(pList.get(index)[1]);
|
|
|
relationVO.setEType(pList.get(index)[2]);
|
|
@@ -47,6 +53,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) {
|
|
@@ -64,6 +71,10 @@ public class KlRelationFacade extends KlRelationServiceImpl {
|
|
|
}
|
|
|
treeDTO.getNextTree().add(treeDTO2);
|
|
|
}
|
|
|
- return treeDTO;
|
|
|
+
|
|
|
+ TreeAllDTO treeAllDTO = new TreeAllDTO();
|
|
|
+ treeAllDTO.setTypes(types);
|
|
|
+ treeAllDTO.setTreeDTO(treeDTO);
|
|
|
+ return treeAllDTO;
|
|
|
}
|
|
|
}
|