Pārlūkot izejas kodu

标准词搜索接口修改

rengb 5 gadi atpakaļ
vecāks
revīzija
4104fb2ec0

+ 3 - 1
.gitignore

@@ -22,4 +22,6 @@
 /nbbuild/
 /dist/
 /nbdist/
-/.nb-gradle/
+/.nb-gradle/
+
+/logs/

+ 11 - 1
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -251,9 +251,16 @@ public class ConceptFacade extends ConceptServiceImpl {
                     relationQe.eq("relation_id", getAllForRelationVO.getRelationId());
 
                     List<Long> relationConceptIdList = Lists.newArrayList();
+                    List<Long> relationTypeIdList = Lists.newArrayList();
+                    if (ListUtil.isNotEmpty(getAllForRelationVO.getRelationTypeIdSupplement())) {
+                        relationTypeIdList.addAll(getAllForRelationVO.getRelationTypeIdSupplement());
+                    }
                     if (getAllForRelationVO.getRelationTypeId() != null) {
+                        relationTypeIdList.add(getAllForRelationVO.getRelationTypeId());
+                    }
+                    if (ListUtil.isNotEmpty(relationTypeIdList)) {
                         QueryWrapper<Concept> conceptQe1 = new QueryWrapper<>();
-                        conceptQe1.eq("lib_type", getAllForRelationVO.getRelationTypeId());
+                        conceptQe1.in("lib_type", relationTypeIdList);
                         relationConceptIdList = list(conceptQe1)
                                 .stream()
                                 .map(i -> i.getId()).collect(Collectors.toList());
@@ -261,6 +268,9 @@ public class ConceptFacade extends ConceptServiceImpl {
                     if (getAllForRelationVO.getRelationConceptId() != null) {
                         relationConceptIdList.add(getAllForRelationVO.getRelationConceptId());
                     }
+                    if (ListUtil.isNotEmpty(getAllForRelationVO.getRelationConceptIdSupplement())) {
+                        relationConceptIdList.addAll(getAllForRelationVO.getRelationConceptIdSupplement());
+                    }
                     if (ListUtil.isNotEmpty(relationConceptIdList)) {
                         if (getAllForRelationVO.getRelationPosition() == 1) {
                             relationQe.in("start_id", conceptIdList);

+ 12 - 0
knowledgeman-service/src/main/java/com/diagbot/vo/GetAllForRelationVO.java

@@ -38,12 +38,24 @@ public class GetAllForRelationVO {
      */
     @ApiModelProperty(value="相关联的概念id")
     private Long relationConceptId;
+
+    /**
+     * 相关联的概念id补充
+     */
+    @ApiModelProperty(value="相关联的概念id补充")
+    private List<Long> relationConceptIdSupplement;
     
     /**
      * 相关联的概念类型
      */
     @ApiModelProperty(value="相关联的概念类型")
     private Long relationTypeId;
+
+    /**
+     * 相关联的概念类型补充
+     */
+    @ApiModelProperty(value="相关联的概念类型补充")
+    private List<Long> relationTypeIdSupplement;
     
     /**
      * 关系类型id