Browse Source

解决冲突,格式化代码

gaodm 5 years ago
parent
commit
d7f1e1c677

+ 30 - 31
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -208,15 +208,15 @@ public class ConceptFacade extends ConceptServiceImpl {
     public List<GetAllForRelationDTO> getAllForRelation(GetAllForRelationVO getAllForRelationVO) {
         List<GetAllForRelationDTO> retList = Lists.newArrayList();
 
-        if(StringUtil.isNotBlank(getAllForRelationVO.getName())||getAllForRelationVO.getTypeId()!=null){
-        	QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
+        if (StringUtil.isNotBlank(getAllForRelationVO.getName()) || getAllForRelationVO.getTypeId() != null) {
+            QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
             conceptQe.eq("is_deleted", IsDeleteEnum.N.getKey());
-            conceptQe.like(StringUtil.isNotBlank(getAllForRelationVO.getName()),"lib_name", getAllForRelationVO.getName());
-            conceptQe.eq(getAllForRelationVO.getTypeId()!=null,"lib_type", getAllForRelationVO.getTypeId());
+            conceptQe.like(StringUtil.isNotBlank(getAllForRelationVO.getName()), "lib_name", getAllForRelationVO.getName());
+            conceptQe.eq(getAllForRelationVO.getTypeId() != null, "lib_type", getAllForRelationVO.getTypeId());
             List<Concept> conceptList = list(conceptQe);
 
-            if(ListUtil.isNotEmpty(conceptList)){
-            	Map<Long, Long> reCouMap = new HashMap<>();
+            if (ListUtil.isNotEmpty(conceptList)) {
+                Map<Long, Long> reCouMap = new HashMap<>();
                 if (getAllForRelationVO.getRelationPosition() != 3) {
                     if (getAllForRelationVO.getRelationId() == null) {
                         throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "关系类型id必传!");
@@ -227,24 +227,24 @@ public class ConceptFacade extends ConceptServiceImpl {
                     relationQe.eq("relation_id", getAllForRelationVO.getRelationId());
 
                     List<Long> relationConceptIdList = Lists.newArrayList();
-                    if(getAllForRelationVO.getRelationTypeId() != null){
-                    	QueryWrapper<Concept> conceptQe1 = new QueryWrapper<>();
-                    	conceptQe1.eq("lib_type", getAllForRelationVO.getRelationTypeId());
-                    	relationConceptIdList = list(conceptQe1).stream().map(i->i.getId()).collect(Collectors.toList());
+                    if (getAllForRelationVO.getRelationTypeId() != null) {
+                        QueryWrapper<Concept> conceptQe1 = new QueryWrapper<>();
+                        conceptQe1.eq("lib_type", getAllForRelationVO.getRelationTypeId());
+                        relationConceptIdList = list(conceptQe1).stream().map(i -> i.getId()).collect(Collectors.toList());
                     }
-                    if(getAllForRelationVO.getRelationConceptId() != null){
-                    	relationConceptIdList.add(getAllForRelationVO.getRelationConceptId());
+                    if (getAllForRelationVO.getRelationConceptId() != null) {
+                        relationConceptIdList.add(getAllForRelationVO.getRelationConceptId());
                     }
-                    if(ListUtil.isNotEmpty(relationConceptIdList)){
-                    	if (getAllForRelationVO.getRelationPosition() == 1) {
-                    		relationQe.in("start_id", conceptIdList);
-                    		relationQe.in("end_id", relationConceptIdList);
-                    		reCouMap = relationFacade.list(relationQe).stream().collect(Collectors.groupingBy(Relation::getStartId, Collectors.counting()));
-                    	}else{
-                    		relationQe.in("end_id", conceptIdList);
+                    if (ListUtil.isNotEmpty(relationConceptIdList)) {
+                        if (getAllForRelationVO.getRelationPosition() == 1) {
+                            relationQe.in("start_id", conceptIdList);
+                            relationQe.in("end_id", relationConceptIdList);
+                            reCouMap = relationFacade.list(relationQe).stream().collect(Collectors.groupingBy(Relation::getStartId, Collectors.counting()));
+                        } else {
+                            relationQe.in("end_id", conceptIdList);
                             relationQe.in("start_id", relationConceptIdList);
                             reCouMap = relationFacade.list(relationQe).stream().collect(Collectors.groupingBy(Relation::getEndId, Collectors.counting()));
-                    	}
+                        }
                     }
                 }
 
@@ -257,7 +257,7 @@ public class ConceptFacade extends ConceptServiceImpl {
                     GetAllForRelationDTO getAllForRelationDTO = new GetAllForRelationDTO();
                     getAllForRelationDTO.setConceptId(i.getId());
                     getAllForRelationDTO.setConceptName(i.getLibName());
-                    getAllForRelationDTO.setConceptNameType(i.getLibName()+"("+LexiconTypeEnum.getName(i.getLibType().intValue())+")");
+                    getAllForRelationDTO.setConceptNameType(i.getLibName() + "(" + LexiconTypeEnum.getName(i.getLibType().intValue()) + ")");
                     retList.add(getAllForRelationDTO);
                 }
             }
@@ -1342,23 +1342,22 @@ public class ConceptFacade extends ConceptServiceImpl {
 
     /**
      * 筛选符合类型的概念id
+     *
      * @param libTypeId
      * @param sourceConceptIds
      * @return
      */
-    public List<Long> getCompatibleTypeConceptIds(Long libTypeId,List<Long> sourceConceptIds){
-    	if(libTypeId==null||ListUtil.isEmpty(sourceConceptIds)){
-    		return null;
-    	}
-    	QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
-    	conceptQe.in("id", sourceConceptIds);
-    	conceptQe.eq("lib_type", libTypeId);
-    	return list(conceptQe).stream().map(i->i.getId()).collect(Collectors.toList());
+    public List<Long> getCompatibleTypeConceptIds(Long libTypeId, List<Long> sourceConceptIds) {
+        if (libTypeId == null || ListUtil.isEmpty(sourceConceptIds)) {
+            return null;
+        }
+        QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
+        conceptQe.in("id", sourceConceptIds);
+        conceptQe.eq("lib_type", libTypeId);
+        return list(conceptQe).stream().map(i -> i.getId()).collect(Collectors.toList());
     }
 
 
-}
-
     /**
      * 删除缓存(化验相关)
      *