浏览代码

代码整理

rengb 5 年之前
父节点
当前提交
bcbd1eb0e3

+ 2 - 2
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java

@@ -4,9 +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.GetConceptDetailListDTO;
 import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.ConceptIndexDTO;
+import com.diagbot.dto.GetConceptDetailListDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.ConceptDetail;
 import com.diagbot.enums.IsDeleteEnum;
@@ -19,9 +19,9 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddConceptDetailVO;
+import com.diagbot.vo.ConceptIndexVO;
 import com.diagbot.vo.GetConceptDetailListVO;
 import com.diagbot.vo.GetConceptDetailVO;
-import com.diagbot.vo.ConceptIndexVO;
 import com.diagbot.vo.RemoveConceptDetailVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;

+ 2 - 1
knowledgeman-service/src/main/java/com/diagbot/facade/LexiconFacade.java

@@ -62,7 +62,8 @@ public class LexiconFacade extends LexiconServiceImpl {
     public IPage<GetLexiconListDTO> getLexiconList(GetLexiconListVO getLexiconListVO) {
         IPage<GetLexiconListDTO> ipage = this.baseMapper.getLexiconList(getLexiconListVO);
         if (ipage.getRecords().size() > 0) {
-            List<String> ids = ipage.getRecords().stream().map(i -> i.getModifier()).distinct().collect(Collectors.toList());
+            List<String> ids = ipage.getRecords()
+                    .stream().map(i -> i.getModifier()).distinct().collect(Collectors.toList());
             RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
             if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
                 throw new CommonException(CommonErrorCode.RPC_ERROR,

+ 14 - 13
knowledgeman-service/src/main/java/com/diagbot/facade/LisSonContactFacade.java

@@ -1,12 +1,5 @@
 package com.diagbot.facade;
 
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.LisSonContactListDTO;
@@ -14,6 +7,12 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.service.impl.RelationServiceImpl;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.LisSonContactListVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 医学术语关联业务层
@@ -22,19 +21,21 @@ import com.diagbot.vo.LisSonContactListVO;
  */
 @Component
 public class LisSonContactFacade extends RelationServiceImpl {
-	
-	@Autowired
+
+    @Autowired
     private UserServiceClient userServiceClient;
-	
-	/**
+
+    /**
      * 化验子项维护-列表
+     *
      * @param lisSonContactListVO
      * @return
      */
     public IPage<LisSonContactListDTO> lisSonContactList(LisSonContactListVO lisSonContactListVO) {
-    	IPage<LisSonContactListDTO> ipage = this.baseMapper.lisSonContactList(lisSonContactListVO);
+        IPage<LisSonContactListDTO> ipage = this.baseMapper.lisSonContactList(lisSonContactListVO);
         if (ipage.getRecords().size() > 0) {
-            List<String> ids = ipage.getRecords().stream().map(i -> i.getOperName()).distinct().collect(Collectors.toList());
+            List<String> ids = ipage.getRecords()
+                    .stream().map(i -> i.getOperName()).distinct().collect(Collectors.toList());
             RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
             RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
             ipage.getRecords().forEach(i -> {

+ 25 - 24
knowledgeman-service/src/main/java/com/diagbot/facade/MultContactFacade.java

@@ -1,12 +1,5 @@
 package com.diagbot.facade;
 
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.OnlyByRootListDTO;
@@ -16,6 +9,12 @@ import com.diagbot.service.impl.RelationServiceImpl;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.OnlyByRootListVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 医学术语关联业务层
@@ -30,26 +29,28 @@ public class MultContactFacade extends RelationServiceImpl {
 
     /**
      * 医学术语多层关联维护-列表
-     * @param multContactListVO
+     *
+     * @param onlyByRootListVO
      * @return
      */
     public IPage<OnlyByRootListDTO> multContactList(OnlyByRootListVO onlyByRootListVO) {
-    	IPage<OnlyByRootListDTO> ipage = this.baseMapper.onlyByRootList(onlyByRootListVO);
-    	
-    	if(ListUtil.isNotEmpty(ipage.getRecords())){
-    		List<String> userIds = ipage.getRecords().stream().map(i -> i.getOperName()).distinct().collect(Collectors.toList());
-        	RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(userIds);
-        	RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
-        	
-        	ipage.getRecords().forEach(i->{
-        		i.setOperName(respDTO.data.get(i.getOperName()));
-        		i.setLibType(LexiconTypeEnum.getName(i.getLibTypeId().intValue()));
-                i.setLibNameType(i.getLibName()+"("+i.getLibType()+")");
-        		
-        	});
-    	}
-
-    	return ipage;
+        IPage<OnlyByRootListDTO> ipage = this.baseMapper.onlyByRootList(onlyByRootListVO);
+
+        if (ListUtil.isNotEmpty(ipage.getRecords())) {
+            List<String> userIds = ipage.getRecords()
+					.stream().map(i -> i.getOperName()).distinct().collect(Collectors.toList());
+            RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(userIds);
+            RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
+
+            ipage.getRecords().forEach(i -> {
+                i.setOperName(respDTO.data.get(i.getOperName()));
+                i.setLibType(LexiconTypeEnum.getName(i.getLibTypeId().intValue()));
+                i.setLibNameType(i.getLibName() + "(" + i.getLibType() + ")");
+
+            });
+        }
+
+        return ipage;
     }
 
 }

+ 353 - 322
knowledgeman-service/src/main/java/com/diagbot/facade/RelationContactFacade.java

@@ -1,15 +1,5 @@
 package com.diagbot.facade;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.stereotype.Component;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.UserServiceClient;
@@ -38,6 +28,15 @@ import com.diagbot.vo.RemoveRelationContactVO;
 import com.diagbot.vo.SingleRelationListVO;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 医学术语关联业务层
@@ -46,31 +45,32 @@ import com.google.common.collect.Maps;
  */
 @Component
 public class RelationContactFacade extends RelationServiceImpl {
-	
-	@Autowired
-    private ConceptFacade conceptFacade; 
-	@Autowired
-    private RelationOrderFacade relationOrderFacade; 
-	@Autowired
+
+    @Autowired
+    private ConceptFacade conceptFacade;
+    @Autowired
+    private RelationOrderFacade relationOrderFacade;
+    @Autowired
     @Qualifier("relationServiceImpl")
     private RelationService relationService;
-	@Autowired
+    @Autowired
     @Qualifier("relationOrderServiceImpl")
     private RelationOrderServiceImpl relationOrderServiceImpl;
-	@Autowired
+    @Autowired
     private UserServiceClient userServiceClient;
-	
+
     /**
      * 医学术语关联维护-列表
-     * @param relationContactListVO
+     *
+     * @param singleRelationListVO
      * @return
      */
     public IPage<SingleRelationListDTO> relationContactList(SingleRelationListVO singleRelationListVO) {
-    	String[] relationModelTypeArry = singleRelationListVO.getRelationModelTypeCode().split("101");
-    	singleRelationListVO.setStartTypeId(Long.parseLong(relationModelTypeArry[0]));
-    	singleRelationListVO.setEndTypeId(Long.parseLong(relationModelTypeArry[1]));
-    	
-    	IPage<SingleRelationListDTO> ipage = this.baseMapper.singleRelationList(singleRelationListVO);
+        String[] relationModelTypeArry = singleRelationListVO.getRelationModelTypeCode().split("101");
+        singleRelationListVO.setStartTypeId(Long.parseLong(relationModelTypeArry[0]));
+        singleRelationListVO.setEndTypeId(Long.parseLong(relationModelTypeArry[1]));
+
+        IPage<SingleRelationListDTO> ipage = this.baseMapper.singleRelationList(singleRelationListVO);
         if (ListUtil.isNotEmpty(ipage.getRecords())) {
             List<String> ids = ipage.getRecords().stream().map(i -> i.getOperName()).distinct().collect(Collectors.toList());
             RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
@@ -78,315 +78,346 @@ public class RelationContactFacade extends RelationServiceImpl {
             ipage.getRecords().forEach(i -> {
                 i.setOperName(respDTO.data.get(i.getOperName()));
                 i.setLibType(LexiconTypeEnum.getName(i.getLibTypeId().intValue()));
-                i.setLibNameType(i.getLibName()+"("+i.getLibType()+")");
+                i.setLibNameType(i.getLibName() + "(" + i.getLibType() + ")");
                 i.setRelationModelTypeName(RelationModelTypeEnum.getName(Integer.parseInt(i.getRelationModelTypeCode())));
             });
         }
         return ipage;
     }
 
-	/**
-	 * 医学术语关联维护/医学术语多层关联维护/化验子项维护-添加或者编辑
-	 * @param relationNodeVO
-	 * @return
-	 */
-	public Boolean addRelation(RelationNodeVO relationNodeVO) {
-		if(relationNodeVO.getConceptId()==null){
-			throw new CommonException(CommonErrorCode.RPC_ERROR,"conceptId必填!");
-		}
-		if(ListUtil.isEmpty(relationNodeVO.getNodeList())){
-			throw new CommonException(CommonErrorCode.RPC_ERROR,"nodeList不能为空!");
-		}
-		
-		List<Long> relationIdList = repairRelationDataForDelBeforeAdd(relationNodeVO.getConceptId(),relationNodeVO);
-		if(ListUtil.isNotEmpty(relationIdList)){
-			removeByIds(relationIdList);
-			
-			QueryWrapper<RelationOrder> relationOrderQe = new QueryWrapper<>();
-			relationOrderQe.in("t_relation_id", relationIdList);
-			relationOrderFacade.remove(relationOrderQe);
-		}
-		
-		List<List<Relation>> relationGroupList = repairRelationDataForAdd(relationNodeVO);
-		String currentUser = UserUtils.getCurrentPrincipleID();
+    /**
+     * 医学术语关联维护/医学术语多层关联维护/化验子项维护-添加或者编辑
+     *
+     * @param relationNodeVO
+     * @return
+     */
+    public Boolean addRelation(RelationNodeVO relationNodeVO) {
+        if (relationNodeVO.getConceptId() == null) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "conceptId必填!");
+        }
+        if (ListUtil.isEmpty(relationNodeVO.getNodeList())) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "nodeList不能为空!");
+        }
+
+        List<Long> relationIdList = repairRelationDataForDelBeforeAdd(relationNodeVO.getConceptId(), relationNodeVO);
+        if (ListUtil.isNotEmpty(relationIdList)) {
+            removeByIds(relationIdList);
+
+            QueryWrapper<RelationOrder> relationOrderQe = new QueryWrapper<>();
+            relationOrderQe.in("t_relation_id", relationIdList);
+            relationOrderFacade.remove(relationOrderQe);
+        }
+
+        List<List<Relation>> relationGroupList = repairRelationDataForAdd(relationNodeVO);
+        String currentUser = UserUtils.getCurrentPrincipleID();
         Date now = DateUtil.now();
         List<Relation> relationList = Lists.newArrayList();
-        relationGroupList.forEach(i->{
-        	i.forEach(j->{
-        		j.setCreator(currentUser);
-            	j.setGmtCreate(now);
-            	j.setModifier(currentUser);
-            	j.setGmtModified(now);
-            	relationList.add(j);
-        	});
+        relationGroupList.forEach(i -> {
+            i.forEach(j -> {
+                j.setCreator(currentUser);
+                j.setGmtCreate(now);
+                j.setModifier(currentUser);
+                j.setGmtModified(now);
+                relationList.add(j);
+            });
         });
         relationService.saveOrUpdateBatch(relationList);
-        
-        if(relationNodeVO.getIsOrderBy()==1){
-        	List<RelationOrder> relationOrderList = Lists.newArrayList();
-        	relationGroupList.forEach(i->{
-        		int orderNo = 0;
-            	for(Relation j : i){
-            		orderNo++;
-            		RelationOrder relationOrder = new RelationOrder();
-            		relationOrder.setOrderNo(orderNo);
-            		relationOrder.settRelationId(j.getId());
-            		relationOrder.setGmtCreate(now);
-            		relationOrder.setGmtModified(now);
-            		relationOrder.setCreator(currentUser);
-            		relationOrder.setModifier(currentUser);
-            		relationOrderList.add(relationOrder);
-            	}
+
+        if (relationNodeVO.getIsOrderBy() == 1) {
+            List<RelationOrder> relationOrderList = Lists.newArrayList();
+            relationGroupList.forEach(i -> {
+                int orderNo = 0;
+                for (Relation j : i) {
+                    orderNo++;
+                    RelationOrder relationOrder = new RelationOrder();
+                    relationOrder.setOrderNo(orderNo);
+                    relationOrder.settRelationId(j.getId());
+                    relationOrder.setGmtCreate(now);
+                    relationOrder.setGmtModified(now);
+                    relationOrder.setCreator(currentUser);
+                    relationOrder.setModifier(currentUser);
+                    relationOrderList.add(relationOrder);
+                }
+            });
+            relationOrderServiceImpl.saveBatch(relationOrderList);
+        }
+
+        return true;
+    }
+
+    /**
+     * 处理关系节点-添加或者编辑前先删除掉
+     *
+     * @param conceptId      当前概念id
+     * @param relationNodeVO
+     * @return
+     */
+    private List<Long> repairRelationDataForDelBeforeAdd(Long conceptId, RelationNodeVO relationNodeVO) {
+        List<Long> relationIdList = Lists.newArrayList();
+
+        QueryWrapper<Relation> relationQe = new QueryWrapper<>();
+        relationQe.eq("start_id", conceptId);
+        if (relationNodeVO != null && relationNodeVO.getSonRelationId() != null) {
+            relationQe.eq("relation_id", relationNodeVO.getSonRelationId());
+        } else {
+            relationQe.eq("relation_id", -999999l);
+        }
+
+        List<Relation> relationList = list(relationQe);
+
+        if (ListUtil.isNotEmpty(relationList)) {
+            if (relationNodeVO != null && relationNodeVO.getSonTypeId() != null) {
+                List<Long> conceptIdList = conceptFacade.getCompatibleTypeConceptIds(relationNodeVO.getSonTypeId(),
+						relationList.stream().map(i -> i.getEndId()).collect(Collectors.toList()));
+                if (conceptIdList != null) {
+                    relationList = relationList.stream()
+							.filter(i -> conceptIdList.contains(i.getEndId())).collect(Collectors.toList());
+                }
+            }
+
+            if (ListUtil.isNotEmpty(relationList)) {
+                relationIdList.addAll(relationList.stream().map(i -> i.getId()).collect(Collectors.toList()));
+
+                Map<Long, RelationNodeVO> conceptIdRnMap = Maps.newHashMap();
+                if (relationNodeVO != null && ListUtil.isNotEmpty(relationNodeVO.getNodeList())) {
+                    conceptIdRnMap = relationNodeVO.getNodeList()
+							.stream().collect(Collectors.toMap(RelationNodeVO::getConceptId, i -> i));
+                }
+
+                for (Relation i : relationList) {
+                    relationIdList.addAll(repairRelationDataForDelBeforeAdd(i.getEndId(),
+							conceptIdRnMap.get(i.getEndId())));
+                }
+            }
+        }
+
+        return relationIdList;
+    }
+
+    /**
+     * 处理关系节点-添加或者编辑事件
+     *
+     * @param relationNodeVO
+     * @return
+     */
+    private List<List<Relation>> repairRelationDataForAdd(RelationNodeVO relationNodeVO) {
+        List<List<Relation>> retList = Lists.newArrayList();
+
+        if (ListUtil.isNotEmpty(relationNodeVO.getNodeList())) {
+            List<Relation> relationList = Lists.newArrayList();
+            relationNodeVO.getNodeList().forEach(i -> {
+                Relation relation = new Relation();
+                relation.setStartId(relationNodeVO.getConceptId());
+                relation.setEndId(i.getConceptId());
+                relation.setRelationId(i.getRelationId());
+                relationList.add(relation);
+
+                if (ListUtil.isNotEmpty(i.getNodeList())) {
+                    retList.addAll(repairRelationDataForAdd(i));
+                }
             });
-        	relationOrderServiceImpl.saveBatch(relationOrderList);
+            retList.add(relationList);
         }
-        
-		return true;
-	}
-	
-	/**
-	 * 处理关系节点-添加或者编辑前先删除掉
-	 * @param conceptId 当前概念id
-	 * @param relationNodeVO
-	 * @return
-	 */
-	private List<Long> repairRelationDataForDelBeforeAdd(Long conceptId,RelationNodeVO relationNodeVO){
-		List<Long> relationIdList = Lists.newArrayList();
-		
-		QueryWrapper<Relation> relationQe = new QueryWrapper<>();
-		relationQe.eq("start_id", conceptId);
-		if(relationNodeVO!=null&&relationNodeVO.getSonRelationId()!=null){
-			relationQe.eq("relation_id", relationNodeVO.getSonRelationId());
-		}else{
-			relationQe.eq("relation_id", -999999l);
-		}
-		
-		List<Relation> relationList = list(relationQe);
-		
-		if(ListUtil.isNotEmpty(relationList)){
-			if(relationNodeVO!=null&&relationNodeVO.getSonTypeId()!=null){
-				List<Long> conceptIdList = conceptFacade.getCompatibleTypeConceptIds(relationNodeVO.getSonTypeId(), relationList.stream().map(i->i.getEndId()).collect(Collectors.toList()));
-	        	if(conceptIdList!=null){
-	        		relationList = relationList.stream().filter(i->conceptIdList.contains(i.getEndId())).collect(Collectors.toList());
-	        	}
-			}
-			
-			if(ListUtil.isNotEmpty(relationList)){
-				relationIdList.addAll(relationList.stream().map(i->i.getId()).collect(Collectors.toList()));
-				
-				Map<Long,RelationNodeVO> conceptIdRnMap = Maps.newHashMap();
-				if(relationNodeVO!=null&&ListUtil.isNotEmpty(relationNodeVO.getNodeList())){
-					conceptIdRnMap = relationNodeVO.getNodeList().stream().collect(Collectors.toMap(RelationNodeVO::getConceptId, i->i));
-				}
-				
-				for(Relation i : relationList){
-					relationIdList.addAll(repairRelationDataForDelBeforeAdd(i.getEndId(),conceptIdRnMap.get(i.getEndId())));
-				}
-			}
-		}
-		
-		return relationIdList;
-	}
-	
-	/**
-	 * 处理关系节点-添加或者编辑事件
-	 * @param relationNodeVO
-	 * @return
-	 */
-	private List<List<Relation>> repairRelationDataForAdd(RelationNodeVO relationNodeVO){
-		List<List<Relation>> retList = Lists.newArrayList();
-		
-		if(ListUtil.isNotEmpty(relationNodeVO.getNodeList())){
-			List<Relation> relationList = Lists.newArrayList();
-			relationNodeVO.getNodeList().forEach(i->{
-				Relation relation = new Relation();
-				relation.setStartId(relationNodeVO.getConceptId());
-				relation.setEndId(i.getConceptId());
-				relation.setRelationId(i.getRelationId());
-				relationList.add(relation);
-				
-				if(ListUtil.isNotEmpty(i.getNodeList())){
-					retList.addAll(repairRelationDataForAdd(i));
-				}
-			});
-			retList.add(relationList);
-		}
-		
-		return retList;
-	}
-	
-	/**
-	 * 医学术语关联维护/医学术语多层关联维护/化验子项维护-详情
-	 * @param relationContactDetailVO
-	 * @return
-	 */
-	public RelationNodeDTO relationContactDetail(RelationContactDetailVO relationContactDetailVO){
-		RelationNodeDTO relationNodeDTO = new RelationNodeDTO();
-		
-		Concept concept = conceptFacade.getById(relationContactDetailVO.getConceptId());
-		relationNodeDTO.setConceptId(concept.getId());
-		relationNodeDTO.setConceptName(concept.getLibName());
-		relationNodeDTO.setConceptTypeId(concept.getLibType());
-		relationNodeDTO.setConceptTypeName(LexiconTypeEnum.getName(concept.getLibType().intValue()));
-		relationNodeDTO.setConceptNameType(concept.getLibName()+"("+LexiconTypeEnum.getName(concept.getLibType().intValue())+")");
-		relationNodeDTO.setIsDeletedConcept(concept.getIsDeleted());
-		
-		relationNodeDTO.setNodeList(repairRelationDataForQuery(relationContactDetailVO.getConceptId(),relationContactDetailVO.getRelationIds(),relationContactDetailVO.getTypeIds(),null,concept.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.setConceptTypeName(LexiconTypeEnum.getName(i.getConceptTypeId().intValue()));
-			i.setConceptNameType(i.getConceptName()+"("+LexiconTypeEnum.getName(i.getConceptTypeId().intValue())+")");
-			i.setParentConceptTypeName(LexiconTypeEnum.getName(i.getParentConceptTypeId().intValue()));
-			i.setParentConceptNameType(i.getParentConceptName()+"("+LexiconTypeEnum.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;
-	}
-	
-	/**
-	 * 化验子项维护-逻辑删除或者恢复
-	 * @param removeRelationContactVO
-	 * @return
-	 */
-	public Boolean removeRelationContact(RemoveRelationContactVO removeRelationContactVO){
-		String currentUser = UserUtils.getCurrentPrincipleID();
+
+        return retList;
+    }
+
+    /**
+     * 医学术语关联维护/医学术语多层关联维护/化验子项维护-详情
+     *
+     * @param relationContactDetailVO
+     * @return
+     */
+    public RelationNodeDTO relationContactDetail(RelationContactDetailVO relationContactDetailVO) {
+        RelationNodeDTO relationNodeDTO = new RelationNodeDTO();
+
+        Concept concept = conceptFacade.getById(relationContactDetailVO.getConceptId());
+        relationNodeDTO.setConceptId(concept.getId());
+        relationNodeDTO.setConceptName(concept.getLibName());
+        relationNodeDTO.setConceptTypeId(concept.getLibType());
+        relationNodeDTO.setConceptTypeName(LexiconTypeEnum.getName(concept.getLibType().intValue()));
+        relationNodeDTO.setConceptNameType(concept.getLibName() + "("
+				+ LexiconTypeEnum.getName(concept.getLibType().intValue()) + ")");
+        relationNodeDTO.setIsDeletedConcept(concept.getIsDeleted());
+
+        relationNodeDTO.setNodeList(repairRelationDataForQuery(relationContactDetailVO.getConceptId(),
+				relationContactDetailVO.getRelationIds(), relationContactDetailVO.getTypeIds(),
+				null, concept.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.setConceptTypeName(LexiconTypeEnum.getName(i.getConceptTypeId().intValue()));
+            i.setConceptNameType(i.getConceptName() + "(" + LexiconTypeEnum.getName(i.getConceptTypeId().intValue()) + ")");
+            i.setParentConceptTypeName(LexiconTypeEnum.getName(i.getParentConceptTypeId().intValue()));
+            i.setParentConceptNameType(i.getParentConceptName() + "("
+					+ LexiconTypeEnum.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;
+    }
+
+    /**
+     * 化验子项维护-逻辑删除或者恢复
+     *
+     * @param removeRelationContactVO
+     * @return
+     */
+    public Boolean removeRelationContact(RemoveRelationContactVO removeRelationContactVO) {
+        String currentUser = UserUtils.getCurrentPrincipleID();
         Date now = DateUtil.now();
-        repairRelationDataForRemove(removeRelationContactVO.getConceptId(), removeRelationContactVO.getRelationId(),removeRelationContactVO.getIsDeleted(),currentUser,now);
-		return true;
-	}
-	
-	/**
-	 * 化验子项维护-逻辑删除或者恢复-处理关系节点
-	 * @param conceptId
-	 * @param relationId
-	 * @param isDeleted
-	 * @param currentUser 操作人
-	 * @param now 操作时间
-	 */
-	private void repairRelationDataForRemove(Long conceptId,Long relationId,String isDeleted,String currentUser,Date now){
-		QueryWrapper<Relation> relationQe = new QueryWrapper<>();
-		relationQe.eq("start_id", conceptId);
-		relationQe.eq(relationId!=null,"relation_id", relationId);
-		List<Relation> relationList = list(relationQe);
-		
-		if(relationList.size()==0){
-			return;
-		}
-		
-		if(relationList.stream().map(i->i.getIsDeleted()).distinct().count()>1){
-			throw new CommonException(CommonErrorCode.RPC_ERROR,"数据异常!");
-		}
-		
-		String isDeleted_ = relationList.get(0).getIsDeleted();
-		if(isDeleted.equals(isDeleted_)){
-    		if(isDeleted_.equals("Y")){
-    			throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已删除!");
-    		}
-    		if(isDeleted_.equals("N")){
-    			throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已恢复!");
-    		}
-    	}
-		
-		Relation relation = new Relation();
-		relation.setIsDeleted(isDeleted);
-		relation.setGmtModified(now);
-		relation.setModifier(currentUser);
-		if(!update(relation, relationQe)){
-			throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
-		}
-		
-		relationList.forEach(i->{
-			repairRelationDataForRemove(i.getEndId(), relationId,isDeleted,currentUser,now);
-		});
-	}
-	
-	/**
-	 * 医学术语关联维护/医学术语多层关联维护-物理删除
-	 * @param removeRelationContactVO
-	 * @return
-	 */
-	public Boolean deleteRelationContact(DeleteRelationContactVO deleteRelationContactVO){
-		repairRelationDataForDelete(deleteRelationContactVO.getConceptId(), deleteRelationContactVO.getRelationIds(),deleteRelationContactVO.getTypeIds());
-		return true;
-	}
-	
-	/**
-	 * 医学术语关联维护/医学术语多层关联维护-物理删除-处理关系节点
-	 * @param conceptId
-	 * @param relationId
-	 */
-	private void repairRelationDataForDelete(Long conceptId,List<Long> relationIds,List<Long> typeIds){
-		Long relationId = null,endTypeId = null;
-		if(ListUtil.isNotEmpty(relationIds)){
-			relationId = relationIds.remove(0);
-		}
-		if(ListUtil.isNotEmpty(typeIds)){
-			endTypeId = typeIds.remove(0);
-		}
-		
-		QueryWrapper<Relation> relationQe = new QueryWrapper<>();
-		relationQe.eq("start_id", conceptId);
-		relationQe.eq(relationId!=null,"relation_id", relationId);
-		List<Relation> relationList = list(relationQe);
-		
-		if(endTypeId!=null&&ListUtil.isNotEmpty(relationList)){
-			List<Long> conceptIdList = conceptFacade.getCompatibleTypeConceptIds(endTypeId,relationList.stream().map(i->i.getEndId()).collect(Collectors.toList()));
-        	relationList = relationList.stream().filter(i->conceptIdList.contains(i.getEndId())).collect(Collectors.toList());
-		}
-		
-		if(ListUtil.isEmpty(relationList)){
-			return;
-		}
-		
-		List<Long> removeRelationIds = relationList.stream().map(i->i.getId()).collect(Collectors.toList());
-		
-		QueryWrapper<RelationOrder> relationOrderQe = new QueryWrapper<>();
-		relationOrderQe.in("t_relation_id", removeRelationIds);
-		if(!removeByIds(removeRelationIds)||!relationOrderFacade.remove(relationOrderQe)){
-			throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
-		}
-		
-		removeRelationIds.forEach(i->{
-			repairRelationDataForDelete(i, Lists.newArrayList(relationIds), Lists.newArrayList(typeIds));
-		});
-	}
+        repairRelationDataForRemove(removeRelationContactVO.getConceptId(),
+				removeRelationContactVO.getRelationId(), removeRelationContactVO.getIsDeleted(),
+				currentUser, now);
+        return true;
+    }
+
+    /**
+     * 化验子项维护-逻辑删除或者恢复-处理关系节点
+     *
+     * @param conceptId
+     * @param relationId
+     * @param isDeleted
+     * @param currentUser 操作人
+     * @param now         操作时间
+     */
+    private void repairRelationDataForRemove(Long conceptId, Long relationId,
+											 String isDeleted, String currentUser, Date now) {
+        QueryWrapper<Relation> relationQe = new QueryWrapper<>();
+        relationQe.eq("start_id", conceptId);
+        relationQe.eq(relationId != null, "relation_id", relationId);
+        List<Relation> relationList = list(relationQe);
+
+        if (relationList.size() == 0) {
+            return;
+        }
+
+        if (relationList.stream().map(i -> i.getIsDeleted()).distinct().count() > 1) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "数据异常!");
+        }
+
+        String isDeleted_ = relationList.get(0).getIsDeleted();
+        if (isDeleted.equals(isDeleted_)) {
+            if (isDeleted_.equals("Y")) {
+                throw new CommonException(CommonErrorCode.RPC_ERROR, "该数据已删除!");
+            }
+            if (isDeleted_.equals("N")) {
+                throw new CommonException(CommonErrorCode.RPC_ERROR, "该数据已恢复!");
+            }
+        }
+
+        Relation relation = new Relation();
+        relation.setIsDeleted(isDeleted);
+        relation.setGmtModified(now);
+        relation.setModifier(currentUser);
+        if (!update(relation, relationQe)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+
+        relationList.forEach(i -> {
+            repairRelationDataForRemove(i.getEndId(), relationId, isDeleted, currentUser, now);
+        });
+    }
+
+    /**
+     * 医学术语关联维护/医学术语多层关联维护-物理删除
+     *
+     * @param deleteRelationContactVO
+     * @return
+     */
+    public Boolean deleteRelationContact(DeleteRelationContactVO deleteRelationContactVO) {
+        repairRelationDataForDelete(deleteRelationContactVO.getConceptId(),
+				deleteRelationContactVO.getRelationIds(),
+				deleteRelationContactVO.getTypeIds());
+        return true;
+    }
+
+    /**
+     * 医学术语关联维护/医学术语多层关联维护-物理删除-处理关系节点
+     *
+     * @param conceptId
+     * @param relationIds
+     * @param typeIds
+     */
+    private void repairRelationDataForDelete(Long conceptId, List<Long> relationIds, List<Long> typeIds) {
+        Long relationId = null, endTypeId = null;
+        if (ListUtil.isNotEmpty(relationIds)) {
+            relationId = relationIds.remove(0);
+        }
+        if (ListUtil.isNotEmpty(typeIds)) {
+            endTypeId = typeIds.remove(0);
+        }
+
+        QueryWrapper<Relation> relationQe = new QueryWrapper<>();
+        relationQe.eq("start_id", conceptId);
+        relationQe.eq(relationId != null, "relation_id", relationId);
+        List<Relation> relationList = list(relationQe);
+
+        if (endTypeId != null && ListUtil.isNotEmpty(relationList)) {
+            List<Long> conceptIdList = conceptFacade.getCompatibleTypeConceptIds(endTypeId,
+					relationList.stream().map(i -> i.getEndId()).collect(Collectors.toList()));
+            relationList = relationList.stream()
+					.filter(i -> conceptIdList.contains(i.getEndId())).collect(Collectors.toList());
+        }
+
+        if (ListUtil.isEmpty(relationList)) {
+            return;
+        }
+
+        List<Long> removeRelationIds = relationList.stream().map(i -> i.getId()).collect(Collectors.toList());
+
+        QueryWrapper<RelationOrder> relationOrderQe = new QueryWrapper<>();
+        relationOrderQe.in("t_relation_id", removeRelationIds);
+        if (!removeByIds(removeRelationIds) || !relationOrderFacade.remove(relationOrderQe)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+
+        removeRelationIds.forEach(i -> {
+            repairRelationDataForDelete(i, Lists.newArrayList(relationIds), Lists.newArrayList(typeIds));
+        });
+    }
 
 }

+ 248 - 242
knowledgeman-service/src/main/java/com/diagbot/facade/RelationFacade.java

@@ -54,9 +54,9 @@ import com.diagbot.vo.RemoveRelationInfoVO;
  */
 @Component
 public class RelationFacade extends RelationServiceImpl {
-	
-	@Autowired
-	private ConceptFacade conceptFacade;
+
+    @Autowired
+    private ConceptFacade conceptFacade;
     @Autowired
     private LibraryInfoFacade libraryInfoFacade;
     @Autowired
@@ -66,223 +66,229 @@ public class RelationFacade extends RelationServiceImpl {
     @Autowired
     @Qualifier("relationServiceImpl")
     private RelationService relationService;
-    
+
     /**
      * 获取医学术语关系列表
+     *
      * @param getRelationInfoListVO
      * @return
      */
     public IPage<GetRelationInfoListDTO> getRelationInfoList(GetRelationInfoListVO getRelationInfoListVO) {
-    	IPage<GetRelationInfoListDTO> ipage = this.baseMapper.getRelationInfoList(getRelationInfoListVO);
-    	if(ListUtil.isNotEmpty(ipage.getRecords())){
-    		List<String> ids = ipage.getRecords().stream().map(i->i.getOperName()).distinct().collect(Collectors.toList());
-    		RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
-        	RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
-        	ipage.getRecords().forEach(i->{
-        		i.setOperName(respDTO.data.get(i.getOperName()));
-        	});
-    	}
-    	return ipage;
+        IPage<GetRelationInfoListDTO> ipage = this.baseMapper.getRelationInfoList(getRelationInfoListVO);
+        if (ListUtil.isNotEmpty(ipage.getRecords())) {
+            List<String> ids = ipage.getRecords().stream().map(i -> i.getOperName()).distinct().collect(Collectors.toList());
+            RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
+            RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
+            ipage.getRecords().forEach(i -> {
+                i.setOperName(respDTO.data.get(i.getOperName()));
+            });
+        }
+        return ipage;
     }
-    
+
     /**
      * 医学术语关系删除或者恢复
+     *
      * @param removeRelationInfoVO
      * @return
      */
     public Boolean removeRelationInfo(RemoveRelationInfoVO removeRelationInfoVO) {
-    	Relation relation = this.getById(removeRelationInfoVO.getId());
-    	if(relation==null){
-    		throw new CommonException(CommonErrorCode.NOT_EXISTS);
-    	}
-    	if(relation.getIsDeleted().equals(removeRelationInfoVO.getIsDeleted())){
-    		if(removeRelationInfoVO.getIsDeleted().equals("Y")){
-    			throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已删除!");
-    		}
-    		if(removeRelationInfoVO.getIsDeleted().equals("N")){
-    			throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已恢复!");
-    		}
-    	}
-    	
-    	relation.setIsDeleted(removeRelationInfoVO.getIsDeleted());
-    	relation.setModifier(UserUtils.getCurrentPrincipleID());
-    	relation.setGmtModified(DateUtil.now());
+        Relation relation = this.getById(removeRelationInfoVO.getId());
+        if (relation == null) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS);
+        }
+        if (relation.getIsDeleted().equals(removeRelationInfoVO.getIsDeleted())) {
+            if (removeRelationInfoVO.getIsDeleted().equals("Y")) {
+                throw new CommonException(CommonErrorCode.RPC_ERROR, "该数据已删除!");
+            }
+            if (removeRelationInfoVO.getIsDeleted().equals("N")) {
+                throw new CommonException(CommonErrorCode.RPC_ERROR, "该数据已恢复!");
+            }
+        }
+
+        relation.setIsDeleted(removeRelationInfoVO.getIsDeleted());
+        relation.setModifier(UserUtils.getCurrentPrincipleID());
+        relation.setGmtModified(DateUtil.now());
         return updateById(relation);
     }
-    
+
     /**
      * 获取医学术语关系详情
+     *
      * @param getRelationInfoDetailVO
      * @return
      */
-    public GetRelationInfoDetailDTO getRelationInfoDetail(GetRelationInfoDetailVO getRelationInfoDetailVO){
-    	Relation relation = this.getById(getRelationInfoDetailVO.getId());
-    	if(relation==null||relation.getIsDeleted().equals("Y")){
-    		throw new CommonException(CommonErrorCode.NOT_EXISTS);
-    	}
-    	
-    	GetRelationInfoDetailDTO getRelationInfoDetailDTO = new GetRelationInfoDetailDTO();
-    	getRelationInfoDetailDTO.setId(relation.getId());
-    	
-    	
-    	Concept startConcept = conceptFacade.getById(relation.getStartId());
-    	if(startConcept==null||startConcept.getIsDeleted().equals("Y")){
-    		throw new CommonException(CommonErrorCode.RPC_ERROR, "起始术语不存在");
-    	}
-    	LibraryInfo startLibraryInfo = libraryInfoFacade.getById(startConcept.getLibId());
-    	if(startLibraryInfo==null||startLibraryInfo.getIsDeleted().equals("Y")){
-    		throw new CommonException(CommonErrorCode.RPC_ERROR, "起始术语不存在");
-    	}
-    	getRelationInfoDetailDTO.setStartId(startLibraryInfo.getConceptId());
-    	getRelationInfoDetailDTO.setStartName(startLibraryInfo.getName());
-    	getRelationInfoDetailDTO.setStartType(LexiconTypeEnum.getName(startLibraryInfo.getTypeId().intValue()));
-    	
-    	
-    	Concept endConcept = conceptFacade.getById(relation.getEndId());
-    	if(endConcept==null||endConcept.getIsDeleted().equals("Y")){
-    		throw new CommonException(CommonErrorCode.RPC_ERROR, "终点术语不存在");
-    	}
-    	LibraryInfo endLibraryInfo = libraryInfoFacade.getById(endConcept.getLibId());
-    	if(endLibraryInfo==null||endLibraryInfo.getIsDeleted().equals("Y")){
-    		throw new CommonException(CommonErrorCode.RPC_ERROR, "终点术语不存在");
-    	}
-    	getRelationInfoDetailDTO.setEndId(endLibraryInfo.getConceptId());
-    	getRelationInfoDetailDTO.setEndName(endLibraryInfo.getName());
-    	getRelationInfoDetailDTO.setEndType(LexiconTypeEnum.getName(endLibraryInfo.getTypeId().intValue()));
-    	
-    	LexiconRelationship lexiconRelationship = lexiconRelationshipFacade.getById(relation.getRelationId());
-    	if(lexiconRelationship==null||lexiconRelationship.getIsDeleted().equals("Y")){
-    		throw new CommonException(CommonErrorCode.RPC_ERROR, "关系类型不存在");
-    	}
-    	getRelationInfoDetailDTO.setRelationId(lexiconRelationship.getId());
-		getRelationInfoDetailDTO.setRelationName(lexiconRelationship.getName());
-    	
-    	return getRelationInfoDetailDTO;
+    public GetRelationInfoDetailDTO getRelationInfoDetail(GetRelationInfoDetailVO getRelationInfoDetailVO) {
+        Relation relation = this.getById(getRelationInfoDetailVO.getId());
+        if (relation == null || relation.getIsDeleted().equals("Y")) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS);
+        }
+
+        GetRelationInfoDetailDTO getRelationInfoDetailDTO = new GetRelationInfoDetailDTO();
+        getRelationInfoDetailDTO.setId(relation.getId());
+
+
+        Concept startConcept = conceptFacade.getById(relation.getStartId());
+        if (startConcept == null || startConcept.getIsDeleted().equals("Y")) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "起始术语不存在");
+        }
+        LibraryInfo startLibraryInfo = libraryInfoFacade.getById(startConcept.getLibId());
+        if (startLibraryInfo == null || startLibraryInfo.getIsDeleted().equals("Y")) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "起始术语不存在");
+        }
+        getRelationInfoDetailDTO.setStartId(startLibraryInfo.getConceptId());
+        getRelationInfoDetailDTO.setStartName(startLibraryInfo.getName());
+        getRelationInfoDetailDTO.setStartType(LexiconTypeEnum.getName(startLibraryInfo.getTypeId().intValue()));
+
+
+        Concept endConcept = conceptFacade.getById(relation.getEndId());
+        if (endConcept == null || endConcept.getIsDeleted().equals("Y")) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "终点术语不存在");
+        }
+        LibraryInfo endLibraryInfo = libraryInfoFacade.getById(endConcept.getLibId());
+        if (endLibraryInfo == null || endLibraryInfo.getIsDeleted().equals("Y")) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "终点术语不存在");
+        }
+        getRelationInfoDetailDTO.setEndId(endLibraryInfo.getConceptId());
+        getRelationInfoDetailDTO.setEndName(endLibraryInfo.getName());
+        getRelationInfoDetailDTO.setEndType(LexiconTypeEnum.getName(endLibraryInfo.getTypeId().intValue()));
+
+        LexiconRelationship lexiconRelationship = lexiconRelationshipFacade.getById(relation.getRelationId());
+        if (lexiconRelationship == null || lexiconRelationship.getIsDeleted().equals("Y")) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "关系类型不存在");
+        }
+        getRelationInfoDetailDTO.setRelationId(lexiconRelationship.getId());
+        getRelationInfoDetailDTO.setRelationName(lexiconRelationship.getName());
+
+        return getRelationInfoDetailDTO;
     }
-    
+
     /**
      * 医学术语关系添加或者编辑
+     *
      * @param addRelationInfoVO
      * @return
      */
-	public Boolean addRelationInfo(AddRelationInfoVO addRelationInfoVO){
-		Map<String,Object> ckMap = checkAddRelationInfoVO(addRelationInfoVO);
-		Object message = ckMap.get("message");
-		if(message!=null){
-			throw new CommonException(CommonErrorCode.RPC_ERROR,message.toString());
-		}
-		
-		Relation relation = (Relation)ckMap.get("relation");
-		if(relation.getId()!=null){
-			if(relation.getIsDeleted().equals("Y")){
-				throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已经建立且处于已删除状态,可前往列表中恢复该条数据!");
-			}else{
-				throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已存在!");
-			}
-		}
-		
-		return saveOrUpdate((Relation)(ckMap.get("relation")));
+    public Boolean addRelationInfo(AddRelationInfoVO addRelationInfoVO) {
+        Map<String, Object> ckMap = checkAddRelationInfoVO(addRelationInfoVO);
+        Object message = ckMap.get("message");
+        if (message != null) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, message.toString());
+        }
+
+        Relation relation = (Relation) ckMap.get("relation");
+        if (relation.getId() != null) {
+            if (relation.getIsDeleted().equals("Y")) {
+                throw new CommonException(CommonErrorCode.RPC_ERROR, "该数据已经建立且处于已删除状态,可前往列表中恢复该条数据!");
+            } else {
+                throw new CommonException(CommonErrorCode.RPC_ERROR, "该数据已存在!");
+            }
+        }
+
+        return saveOrUpdate((Relation) (ckMap.get("relation")));
+    }
+
+    /**
+     * 校验即将添加的数据
+     *
+     * @param addRelationInfoVO
+     * @return 返回map中,包含2个字段:message和relation,message-为空时,表示正常,取relation-relation执行更新或者插入操作
+     */
+    private Map<String, Object> checkAddRelationInfoVO(AddRelationInfoVO addRelationInfoVO) {
+        Map<String, Object> retMap = new HashMap<>();
+
+        QueryWrapper<LibraryInfo> libraryInfoQe1 = new QueryWrapper<>();
+        libraryInfoQe1.eq("is_deleted", "N");
+        libraryInfoQe1.eq("is_concept", 1);
+        libraryInfoQe1.eq("name", addRelationInfoVO.getStartName());
+        libraryInfoQe1.eq("type_id", LexiconTypeEnum.getKey(addRelationInfoVO.getStartType()));
+        LibraryInfo startLibraryInfo = libraryInfoFacade.getOne(libraryInfoQe1, false);
+        if (startLibraryInfo == null) {
+            retMap.put("message", "数据库中无该起始术语!");
+            return retMap;
+        }
+        Concept startConcept = conceptFacade.getById(startLibraryInfo.getConceptId());
+        if (startConcept == null) {
+            retMap.put("message", "数据库中无该起始术语!");
+            return retMap;
+        }
+        if (startConcept.getLibId().intValue() != startLibraryInfo.getId().intValue()) {
+            retMap.put("message", "数据库中该起始术语概念绑定数据有问题!");
+            return retMap;
+        }
+        if (startConcept.getIsDeleted().equals("Y")) {
+            retMap.put("message", "数据库中该起始术语状态为已删除!");
+            return retMap;
+        }
+
+        QueryWrapper<LibraryInfo> libraryInfoQe2 = new QueryWrapper<>();
+        libraryInfoQe2.eq("is_deleted", "N");
+        libraryInfoQe2.eq("is_concept", 1);
+        libraryInfoQe2.eq("name", addRelationInfoVO.getEndName());
+        libraryInfoQe2.eq("type_id", LexiconTypeEnum.getKey(addRelationInfoVO.getEndType()));
+        LibraryInfo endLibraryInfo = libraryInfoFacade.getOne(libraryInfoQe2, false);
+        if (endLibraryInfo == null) {
+            retMap.put("message", "数据库中无该终点术语");
+            return retMap;
+        }
+        Concept endConcept = conceptFacade.getById(endLibraryInfo.getConceptId());
+        if (endConcept == null) {
+            retMap.put("message", "数据库中无该终点术语");
+            return retMap;
+        }
+        if (endConcept.getLibId().intValue() != endLibraryInfo.getId().intValue()) {
+            retMap.put("message", "数据库中该终点术语概念绑定数据有问题!");
+            return retMap;
+        }
+        if (endConcept.getIsDeleted().equals("Y")) {
+            retMap.put("message", "数据库中该终点术语状态为已删除!");
+            return retMap;
+        }
+
+        QueryWrapper<LexiconRelationship> lexiconRelationshipQe = new QueryWrapper<>();
+        lexiconRelationshipQe.eq("is_deleted", "N");
+        lexiconRelationshipQe.eq("name", addRelationInfoVO.getRelationName());
+        LexiconRelationship lexiconRelationship = lexiconRelationshipFacade.getOne(lexiconRelationshipQe, false);
+        if (lexiconRelationship == null) {
+            retMap.put("message", "该关系信息在数据库中不存在");
+            return retMap;
+        }
+
+        QueryWrapper<Relation> relationQe = new QueryWrapper<>();
+        relationQe.eq("start_id", startConcept.getId());
+        relationQe.eq("end_id", endConcept.getId());
+        relationQe.eq("relation_id", lexiconRelationship.getId());
+        Relation relation = getOne(relationQe, false);
+
+        String currentUser = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        if (relation == null) {
+            relation = new Relation();
+            relation.setStartId(startConcept.getId());
+            relation.setEndId(endConcept.getId());
+            relation.setRelationId(lexiconRelationship.getId());
+            relation.setCreator(currentUser);
+            relation.setGmtCreate(now);
+        }
+
+        relation.setModifier(currentUser);
+        relation.setGmtModified(now);
+        retMap.put("relation", relation);
+        return retMap;
     }
-	
-	/**
-	 * 校验即将添加的数据
-	 * @param addRelationInfoVO
-	 * @return 返回map中,包含2个字段:message和relation,message-为空时,表示正常,取relation-relation执行更新或者插入操作
-	 */
-	private Map<String,Object> checkAddRelationInfoVO(AddRelationInfoVO addRelationInfoVO){
-		Map<String,Object> retMap = new HashMap<>();
-		
-		QueryWrapper<LibraryInfo> libraryInfoQe1 = new QueryWrapper<>();
-		libraryInfoQe1.eq("is_deleted", "N");
-		libraryInfoQe1.eq("is_concept", 1);
-		libraryInfoQe1.eq("name", addRelationInfoVO.getStartName());
-		libraryInfoQe1.eq("type_id", LexiconTypeEnum.getKey(addRelationInfoVO.getStartType()));
-		LibraryInfo startLibraryInfo = libraryInfoFacade.getOne(libraryInfoQe1, false);
-		if(startLibraryInfo==null){
-			retMap.put("message", "数据库中无该起始术语!");
-			return retMap;
-		}
-		Concept startConcept = conceptFacade.getById(startLibraryInfo.getConceptId());
-		if(startConcept==null){
-			retMap.put("message", "数据库中无该起始术语!");
-			return retMap;
-		}
-		if(startConcept.getLibId().intValue()!=startLibraryInfo.getId().intValue()){
-			retMap.put("message", "数据库中该起始术语概念绑定数据有问题!");
-			return retMap;
-		}
-		if(startConcept.getIsDeleted().equals("Y")){
-			retMap.put("message", "数据库中该起始术语状态为已删除!");
-			return retMap;
-		}
-
-		QueryWrapper<LibraryInfo> libraryInfoQe2 = new QueryWrapper<>();
-		libraryInfoQe2.eq("is_deleted", "N");
-		libraryInfoQe2.eq("is_concept", 1);
-		libraryInfoQe2.eq("name", addRelationInfoVO.getEndName());
-		libraryInfoQe2.eq("type_id", LexiconTypeEnum.getKey(addRelationInfoVO.getEndType()));
-		LibraryInfo endLibraryInfo = libraryInfoFacade.getOne(libraryInfoQe2, false);
-		if(endLibraryInfo==null){
-			retMap.put("message", "数据库中无该终点术语");
-			return retMap;
-		}
-		Concept endConcept = conceptFacade.getById(endLibraryInfo.getConceptId());
-		if(endConcept==null){
-			retMap.put("message", "数据库中无该终点术语");
-			return retMap;
-		}
-		if(endConcept.getLibId().intValue()!=endLibraryInfo.getId().intValue()){
-			retMap.put("message", "数据库中该终点术语概念绑定数据有问题!");
-			return retMap;
-		}
-		if(endConcept.getIsDeleted().equals("Y")){
-			retMap.put("message", "数据库中该终点术语状态为已删除!");
-			return retMap;
-		}
-		
-		QueryWrapper<LexiconRelationship> lexiconRelationshipQe = new QueryWrapper<>();
-		lexiconRelationshipQe.eq("is_deleted", "N");
-		lexiconRelationshipQe.eq("name", addRelationInfoVO.getRelationName());
-		LexiconRelationship lexiconRelationship = lexiconRelationshipFacade.getOne(lexiconRelationshipQe, false);
-		if(lexiconRelationship==null){
-			retMap.put("message", "该关系信息在数据库中不存在");
-			return retMap;
-		}
-		
-		QueryWrapper<Relation> relationQe = new QueryWrapper<>();
-		relationQe.eq("start_id", startConcept.getId());
-		relationQe.eq("end_id", endConcept.getId());
-		relationQe.eq("relation_id", lexiconRelationship.getId());
-		Relation relation = getOne(relationQe, false);
-		
-		String currentUser = UserUtils.getCurrentPrincipleID();
-		Date now = DateUtil.now();
-		if(relation==null){
-			relation = new Relation();
-			relation.setStartId(startConcept.getId());
-			relation.setEndId(endConcept.getId());
-			relation.setRelationId(lexiconRelationship.getId());
-			relation.setCreator(currentUser);
-			relation.setGmtCreate(now);
-		}
-		
-		relation.setModifier(currentUser);
-		relation.setGmtModified(now);
-		retMap.put("relation", relation);
-		return retMap;
-	}
-    
-	/**
+
+    /**
      * 医学术语关系excel文件导入
+     *
      * @param file
      * @return
      */
-	public Boolean relationInfoExcelIm(MultipartFile file) {
+    public Boolean relationInfoExcelIm(MultipartFile file) {
         List<AddRelationInfoVO> addRelationInfoVOList = new ArrayList<>();
         StringBuffer sbf = new StringBuffer();
         InputStream inputStream = null;
         Workbook wb = null;
-        String title_1="",title_2="",title_3="",title_4="",title_5="";
+        String title_1 = "", title_2 = "", title_3 = "", title_4 = "", title_5 = "";
         try {
             if (!file.isEmpty()) {
                 inputStream = file.getInputStream();
@@ -298,21 +304,21 @@ public class RelationFacade extends RelationServiceImpl {
                             wb = new XSSFWorkbook(inputStream);
                         }
                         if (wb != null) {
-                            
+
                             Sheet sheet = wb.getSheetAt(0);
                             int count = 0;
                             String startName, startType, endName, endType, relationName;
                             for (Row row : sheet) {
                                 count++;
-                                if(row == null){
-                                	continue;
+                                if (row == null) {
+                                    continue;
                                 }
                                 if (count == 1) {
-                                	title_1 = getValue(row.getCell(0)).trim().replace(" ", "");
-                                	title_2 = getValue(row.getCell(1)).trim().replace(" ", "");
-                                	title_3 = getValue(row.getCell(2)).trim().replace(" ", "");
-                                	title_4 = getValue(row.getCell(3)).trim().replace(" ", "");
-                                	title_5 = getValue(row.getCell(4)).trim().replace(" ", "");
+                                    title_1 = getValue(row.getCell(0)).trim().replace(" ", "");
+                                    title_2 = getValue(row.getCell(1)).trim().replace(" ", "");
+                                    title_3 = getValue(row.getCell(2)).trim().replace(" ", "");
+                                    title_4 = getValue(row.getCell(3)).trim().replace(" ", "");
+                                    title_5 = getValue(row.getCell(4)).trim().replace(" ", "");
                                     continue;
                                 }
                                 startName = getValue(row.getCell(0)).trim().replace(" ", "");
@@ -320,10 +326,10 @@ public class RelationFacade extends RelationServiceImpl {
                                 endName = getValue(row.getCell(2)).trim().replace(" ", "");
                                 endType = getValue(row.getCell(3)).trim().replace(" ", "");
                                 relationName = getValue(row.getCell(4)).trim().replace(" ", "");
-                                if(StringUtil.isEmpty(startName) && StringUtil.isEmpty(startType)
+                                if (StringUtil.isEmpty(startName) && StringUtil.isEmpty(startType)
                                         && StringUtil.isEmpty(endName) && StringUtil.isEmpty(endType)
-                                        && StringUtil.isEmpty(relationName)){
-                                	continue;
+                                        && StringUtil.isEmpty(relationName)) {
+                                    continue;
                                 }
                                 if (StringUtil.isEmpty(startName) || StringUtil.isEmpty(startType)
                                         || StringUtil.isEmpty(endName) || StringUtil.isEmpty(endType)
@@ -331,8 +337,8 @@ public class RelationFacade extends RelationServiceImpl {
                                     sbf.append("第" + count + "行数据不完整;").append("<br/>");
                                     continue;
                                 }
-                                
-                                addRelationInfoVOList.add(new AddRelationInfoVO(startName,startType,endName,endType,relationName,count));
+
+                                addRelationInfoVOList.add(new AddRelationInfoVO(startName, startType, endName, endType, relationName, count));
                             }
                         } else {
                             sbf.append("非excel文件无法解析!").append("<br/>");
@@ -357,64 +363,64 @@ public class RelationFacade extends RelationServiceImpl {
             } catch (Exception e) {
             }
         }
-        
+
         /*****************excel文件本身问题提醒************************/
-        if(sbf.length()>0){
-        	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
+        if (sbf.length() > 0) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, sbf.toString());
         }
-        
+
         /**********************非规范的excel导入提醒*****************************************/
-        if(title_1.indexOf("关系起点术语名称")==-1
-        		||title_2.indexOf("关系起点术语类型")==-1
-        		||title_3.indexOf("关系终点术语名称")==-1
-        		||title_4.indexOf("关系终点术语类型")==-1
-        		||title_5.indexOf("关系类型名称")==-1){
-        	throw new CommonException(CommonErrorCode.RPC_ERROR,"导入数据不正确,请选择正确数据导入!");
+        if (title_1.indexOf("关系起点术语名称") == -1
+                || title_2.indexOf("关系起点术语类型") == -1
+                || title_3.indexOf("关系终点术语名称") == -1
+                || title_4.indexOf("关系终点术语类型") == -1
+                || title_5.indexOf("关系类型名称") == -1) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "导入数据不正确,请选择正确数据导入!");
         }
-        
-        if(addRelationInfoVOList.size()==0){
-        	throw new CommonException(CommonErrorCode.RPC_ERROR,"导入数据不能为空!");
+
+        if (addRelationInfoVOList.size() == 0) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "导入数据不能为空!");
         }
-        
+
         /****************excel文件中数据存在重复提示---数据一模一样即重复***********************/
-        Map<String,List<AddRelationInfoVO>> addRelationInfoVOListMap = addRelationInfoVOList.stream().collect(Collectors.groupingBy(i->{
-        	AddRelationInfoVO addRelationInfoVO = (AddRelationInfoVO)i;
-    		return addRelationInfoVO.getStartName()+"-"+addRelationInfoVO.getStartType()+"-"+addRelationInfoVO.getEndName()+"-"+addRelationInfoVO.getEndType()+"-"+addRelationInfoVO.getRelationName();
+        Map<String, List<AddRelationInfoVO>> addRelationInfoVOListMap = addRelationInfoVOList.stream().collect(Collectors.groupingBy(i -> {
+            AddRelationInfoVO addRelationInfoVO = (AddRelationInfoVO) i;
+            return addRelationInfoVO.getStartName() + "-" + addRelationInfoVO.getStartType() + "-" + addRelationInfoVO.getEndName() + "-" + addRelationInfoVO.getEndType() + "-" + addRelationInfoVO.getRelationName();
         }));
-        for(String key : addRelationInfoVOListMap.keySet()){
-        	if(addRelationInfoVOListMap.get(key).size()>1){
-        		sbf.append(key).append(" ");
-        	}
+        for (String key : addRelationInfoVOListMap.keySet()) {
+            if (addRelationInfoVOListMap.get(key).size() > 1) {
+                sbf.append(key).append(" ");
+            }
         }
-        if(sbf.length()>0){
-        	sbf.append("(存在重复)");
-        	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
+        if (sbf.length() > 0) {
+            sbf.append("(存在重复)");
+            throw new CommonException(CommonErrorCode.RPC_ERROR, sbf.toString());
         }
-        
+
         /**************校验每一组数据,同时组装*************************/
         List<Relation> saveOrUpdateRelationList = new ArrayList<>();
-        Map<String,Object> ckMap = null;
-    	Object message = null;
-    	for(AddRelationInfoVO i : addRelationInfoVOList){
-    		ckMap = checkAddRelationInfoVO(i);
-    		message = ckMap.get("message");
-    		if(message!=null){
-    			sbf.append("第").append(i.getLineNum()).append("行数据有误,").append(message.toString()).append("<br/>");
-    		}else if(ckMap.get("relation")!=null){
-    			saveOrUpdateRelationList.add((Relation)(ckMap.get("relation")));
-    		}
-    	}
-        if(sbf.length()>0){
-        	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
+        Map<String, Object> ckMap = null;
+        Object message = null;
+        for (AddRelationInfoVO i : addRelationInfoVOList) {
+            ckMap = checkAddRelationInfoVO(i);
+            message = ckMap.get("message");
+            if (message != null) {
+                sbf.append("第").append(i.getLineNum()).append("行数据有误,").append(message.toString()).append("<br/>");
+            } else if (ckMap.get("relation") != null) {
+                saveOrUpdateRelationList.add((Relation) (ckMap.get("relation")));
+            }
+        }
+        if (sbf.length() > 0) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, sbf.toString());
         }
-        
-        if(saveOrUpdateRelationList.size()==0){
-        	return true;
+
+        if (saveOrUpdateRelationList.size() == 0) {
+            return true;
         }
-        
+
         return relationService.saveOrUpdateBatch(saveOrUpdateRelationList);
     }
-	
+
     @SuppressWarnings("deprecation")
     private String getValue(Cell cell) {
         try {
@@ -448,6 +454,6 @@ public class RelationFacade extends RelationServiceImpl {
             return "";
         }
     }
-    
+
 
 }

+ 5 - 5
knowledgeman-service/src/main/java/com/diagbot/web/CommonConceptController.java

@@ -20,7 +20,7 @@ import java.util.Map;
 
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author Weixuan Huang
@@ -31,7 +31,7 @@ import java.util.Map;
 @SuppressWarnings("unchecked")
 @Api(value = "概念公共API", tags = { "知识库标准化-概念公共API" })
 public class CommonConceptController {
-	
+
     @Autowired
     private ConceptFacade conceptFacade;
 
@@ -46,7 +46,7 @@ public class CommonConceptController {
                     "type: 类型")
     @PostMapping("/getConceptMapByNameAndType")
     @SysLogger("getConceptMapByNameAndType")
-    public RespDTO<Map<String, List<Integer>>> getConceptMapByNameAndType(@RequestBody ConceptExistVO conceptExistVO){
+    public RespDTO<Map<String, List<Integer>>> getConceptMapByNameAndType(@RequestBody ConceptExistVO conceptExistVO) {
         return RespDTO.onSuc(conceptFacade.getConceptMap(conceptExistVO));
     }
 
@@ -62,7 +62,7 @@ public class CommonConceptController {
                     "type:类型(1:症状 2:既往史,3:其他史,4:查体,5:化验),必填<br>")
     @PostMapping("/index")
     @SysLogger("index")
-    public RespDTO<List<ConceptBaseDTO>> index(@RequestBody IndexVO indexVO){
+    public RespDTO<List<ConceptBaseDTO>> index(@RequestBody IndexVO indexVO) {
         return RespDTO.onSuc(conceptFacade.indexFac(indexVO));
     }
 
@@ -78,7 +78,7 @@ public class CommonConceptController {
                     "libType:术语库词性类型,必填<br>")
     @PostMapping("/indexByLexicon")
     @SysLogger("indexByLexicon")
-    public RespDTO<List<ConceptBaseDTO>> indexByLexicon(@RequestBody IndexLexiconVO indexLexiconVO){
+    public RespDTO<List<ConceptBaseDTO>> indexByLexicon(@RequestBody IndexLexiconVO indexLexiconVO) {
         return RespDTO.onSuc(conceptFacade.indexByLexiconFac(indexLexiconVO));
     }
 }

+ 16 - 19
knowledgeman-service/src/main/java/com/diagbot/web/LexiconController.java

@@ -1,16 +1,5 @@
 package com.diagbot.web;
 
-import java.util.List;
-
-import javax.validation.Valid;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.GetAllLexiconDTO;
@@ -20,14 +9,22 @@ import com.diagbot.facade.LexiconFacade;
 import com.diagbot.vo.AddLexiconVO;
 import com.diagbot.vo.GetAllLexiconVO;
 import com.diagbot.vo.GetLexiconListVO;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
+import javax.validation.Valid;
+import java.util.List;
+
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author Weixuan Huang
@@ -38,17 +35,17 @@ import springfox.documentation.annotations.ApiIgnore;
 @SuppressWarnings("unchecked")
 @Api(value = "术语类型维护相关API", tags = { "知识库标准化-术语类型维护相关API" })
 public class LexiconController {
-	
+
     @Autowired
     private LexiconFacade lexiconFacade;
-    
+
     @ApiOperation(value = "知识库标准化-获取所有术语类型[by:rengb]")
     @PostMapping("/getAllLexicon")
     @SysLogger("getAllLexicon")
     public RespDTO<List<GetAllLexiconDTO>> getAllLexicon(@RequestBody GetAllLexiconVO getAllLexiconVO) {
         return RespDTO.onSuc(lexiconFacade.getAllLexicon(getAllLexiconVO));
     }
-    
+
     @ApiOperation(value = "获取术语类型列表[by:rengb]")
     @PostMapping("/getLexiconList")
     @SysLogger("getLexiconList")
@@ -57,7 +54,7 @@ public class LexiconController {
     public RespDTO<IPage<GetLexiconListDTO>> getLexiconList(@RequestBody GetLexiconListVO getLexiconListVO) {
         return RespDTO.onSuc(lexiconFacade.getLexiconList(getLexiconListVO));
     }
-    
+
     @ApiOperation(value = "术语类型添加[by:rengb]")
     @PostMapping("/addLexicon")
     @SysLogger("addLexicon")
@@ -67,6 +64,6 @@ public class LexiconController {
     public RespDTO<Boolean> addLexicon(@Valid @RequestBody AddLexiconVO addLexiconVO) {
         return RespDTO.onSuc(lexiconFacade.addLexicon(addLexiconVO));
     }
-    
-    
+
+
 }

+ 8 - 10
knowledgeman-service/src/main/java/com/diagbot/web/MultContactController.java

@@ -1,14 +1,5 @@
 package com.diagbot.web;
 
-import javax.validation.Valid;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.OnlyByRootListDTO;
@@ -20,9 +11,16 @@ import com.diagbot.vo.DeleteRelationContactVO;
 import com.diagbot.vo.OnlyByRootListVO;
 import com.diagbot.vo.RelationContactDetailVO;
 import com.diagbot.vo.RelationNodeVO;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
 
 /**
  * <p>