|
@@ -53,77 +53,7 @@ public class RelationContactFacade extends KlRelationServiceImpl {
|
|
|
@Autowired
|
|
|
KlDiseaseFacade klDiseaseFacade;
|
|
|
|
|
|
- public RelationNodeDTO relationContactDetail(RelationContactDetailVO relationContactDetailVO) {
|
|
|
- RelationNodeDTO relationNodeDTO = new RelationNodeDTO();
|
|
|
|
|
|
- KlConcept klConcept = klConceptFacade.getById(relationContactDetailVO.getConceptId());
|
|
|
- relationNodeDTO.setConceptId(klConcept.getId());
|
|
|
- relationNodeDTO.setConceptName(klConcept.getLibName());
|
|
|
- relationNodeDTO.setIsDeletedConcept(klConcept.getIsDeleted());
|
|
|
- relationNodeDTO.setConceptTypeId(new Long(klConcept.getLibType()));
|
|
|
-
|
|
|
- relationNodeDTO.setNodeList(repairRelationDataForQuery(relationContactDetailVO.getConceptId(),
|
|
|
- relationContactDetailVO.getRelationIds(), relationContactDetailVO.getTypeIds(),
|
|
|
- null, klConcept.getIsDeleted()));
|
|
|
-
|
|
|
- return relationNodeDTO;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 处理关系节点-查询事件
|
|
|
- *
|
|
|
- * @param conceptId
|
|
|
- * @param relationIds
|
|
|
- * @param typeIds
|
|
|
- * @param hookConceptIds
|
|
|
- * @param isDeletedParent
|
|
|
- * @return
|
|
|
- */
|
|
|
- private List<RelationNodeDTO> repairRelationDataForQuery(Long conceptId, List<Long> relationIds,
|
|
|
- List<Long> typeIds, List<Long> hookConceptIds,
|
|
|
- String isDeletedParent) {
|
|
|
- if (hookConceptIds == null) {
|
|
|
- hookConceptIds = new ArrayList<>();
|
|
|
- hookConceptIds.add(conceptId);
|
|
|
- }
|
|
|
-
|
|
|
- Long relationId = null, endTypeId = null;
|
|
|
- if (ListUtil.isNotEmpty(relationIds)) {
|
|
|
- relationId = relationIds.remove(0);
|
|
|
- }
|
|
|
- if (relationId == null) {
|
|
|
- relationId = -999999l;
|
|
|
- }
|
|
|
- if (ListUtil.isNotEmpty(typeIds)) {
|
|
|
- endTypeId = typeIds.remove(0);
|
|
|
- }
|
|
|
- List<RelationNodeDTO> relationNodeDTOList = this.baseMapper.getRelationNodeDTOs(conceptId, relationId, endTypeId);
|
|
|
-
|
|
|
- for (RelationNodeDTO i : relationNodeDTOList) {
|
|
|
- i.setConceptName(i.getConceptName());
|
|
|
- i.setParentConceptName(i.getParentConceptName());
|
|
|
- i.setConceptTypeName(LexiconEnum.getName(i.getConceptTypeId().intValue()));
|
|
|
- i.setConceptNameType(i.getConceptName() + "(" + LexiconEnum.getName(i.getConceptTypeId().intValue()) + ")");
|
|
|
- i.setParentConceptTypeName(LexiconEnum.getName(i.getParentConceptTypeId().intValue()));
|
|
|
- i.setParentConceptNameType(i.getParentConceptName() + "("
|
|
|
- + LexiconEnum.getName(i.getParentConceptTypeId().intValue()) + ")");
|
|
|
- i.setIsDeletedConcept(
|
|
|
- isDeletedParent.equals(IsDeleteEnum.Y.getKey()) ? IsDeleteEnum.Y.getKey() : i.getIsDeletedConcept()
|
|
|
- );
|
|
|
-
|
|
|
- if (!hookConceptIds.contains(i.getConceptId())) {
|
|
|
- List<Long> hookConceptIds_ = new ArrayList<>();
|
|
|
- hookConceptIds_.addAll(hookConceptIds);
|
|
|
- hookConceptIds_.add(i.getConceptId());
|
|
|
- i.setNodeList(repairRelationDataForQuery(i.getConceptId(),
|
|
|
- Lists.newArrayList(relationIds), Lists.newArrayList(typeIds),
|
|
|
- hookConceptIds_, i.getIsDeletedConcept()));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return relationNodeDTOList;
|
|
|
- }
|
|
|
|
|
|
@DS("med")
|
|
|
@DSTransactional
|