Explorar o código

Merge remote-tracking branch 'origin/dev/KLBstand' into dev/KLBstand

zhoutg %!s(int64=6) %!d(string=hai) anos
pai
achega
2c7837ee3a

+ 4 - 0
aipt-service/src/main/java/com/diagbot/dto/RetrievalDTO.java

@@ -27,4 +27,8 @@ public class RetrievalDTO {
     private String libTypeName;
     //icss标签type
     private Integer type;
+    //父项子项名称
+    private String parentAndSonName;
+    //父项子项ID
+    private Long parentAndSonId;
 }

+ 2 - 1
aipt-service/src/main/java/com/diagbot/enums/LexiconRSTypeEnum.java

@@ -26,7 +26,8 @@ public enum LexiconRSTypeEnum implements KeyedNamed {
     SPEC(15,"规格"),
     HAS(16,"有"),
     ORDER_BY(17,"包含排列于"),
-    SUBITEM(18,"包含子项");
+    SUBITEM(18,"包含子项"),
+    PUSH(19,"推送");
 
     @Setter
     private Integer key;

+ 38 - 7
aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -300,7 +300,7 @@ public class ConceptFacade extends ConceptServiceImpl {
             }
             if (bean.getShowType().intValue() == 1) { // 本体
                 selfList.add(bean.getSelfId());
-            } else if (bean.getShowType().intValue() == 2) { // 子项
+            } else if (bean.getShowType().intValue() == 2 && retrievalVO.getIsSonShow().intValue() == 0) { // 子项
                 subList.add(bean.getSelfId());
             }
         }
@@ -342,12 +342,13 @@ public class ConceptFacade extends ConceptServiceImpl {
         RetrievalVO retrievalVO = new RetrievalVO();
         RetrievalDTO retrievalDTO = new RetrievalDTO();
         BeanUtil.copyProperties(getStaticKnowledgeVO,retrievalVO);
+        retrievalVO.setIsSonShow(1);
         retrievalVO.setIsStatic(1);
         List<Integer> types = new ArrayList<>();
-        types.add(LexiconTypeEnum.LIS_TABLES.getKey());//添加化验公表项类型
         for (Integer type : getStaticKnowledgeVO.getTypes()) {
             types.add(ParamConvertUtil.conceptConvert2Lib(type));
         }
+        types.add(LexiconTypeEnum.LIS_DETAILS.getKey());//加入化验类型
         //设置类型为诊断、药品、化验、辅检
         retrievalVO.setOtherType(types);
         //如果为化验时设置子项类型
@@ -355,6 +356,7 @@ public class ConceptFacade extends ConceptServiceImpl {
         //获取标签信息
         List<ConceptRetrievalDTO> conceptRetrievalDTOList = this.retrivelConceptInfo(retrievalVO);
         List<RetrievalDTO> staticRetrievalList = new ArrayList<>();
+        List<String> parentAndSonNameList = new ArrayList<>();
         if (ListUtil.isNotEmpty(conceptRetrievalDTOList)) {
             //封装
             for (ConceptRetrievalDTO conceptRetrievalDTO : conceptRetrievalDTOList) {
@@ -365,6 +367,8 @@ public class ConceptFacade extends ConceptServiceImpl {
                     retrievalDTO.setConceptId(conceptRetrievalDTO.getParentId());
                     retrievalDTO.setName(conceptRetrievalDTO.getParentName());
                     retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSelfName());
+                    retrievalDTO.setParentAndSonName(conceptRetrievalDTO.getParentName()+"--"+conceptRetrievalDTO.getSelfName());
+                    parentAndSonNameList.add(conceptRetrievalDTO.getParentName()+"--"+conceptRetrievalDTO.getSelfName());
                 }
                 if (StringUtil.isNotEmpty(conceptRetrievalDTO.getSameName())) {//同义词
                     retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSameName());
@@ -376,18 +380,45 @@ public class ConceptFacade extends ConceptServiceImpl {
                 retrievalDTOS.add(retrievalDTO);
             }
         }
+        List<Concept> conceptDetilList = new ArrayList<>();//化验公表项
+        if(ListUtil.isNotEmpty(parentAndSonNameList)){
+            QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
+            conceptQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
+                    .eq("lib_type",LexiconTypeEnum.LIS_TABLES.getKey())
+                    .in("lib_name",parentAndSonNameList);
+            conceptDetilList = this.list(conceptQueryWrapper);
+        }
+
         //判断是否存在静态知识
         List<Long> cenceptIdList = retrievalDTOS.stream().map(RetrievalDTO::getConceptId).collect(Collectors.toList());
+        for (RetrievalDTO retrievalDTO1 : retrievalDTOS) {
+            for (Concept concept : conceptDetilList) {
+                if(StringUtil.isNotEmpty(retrievalDTO1.getParentAndSonName()) && retrievalDTO1.getParentAndSonName().equals(concept.getLibName())){//添加公表项id
+                    retrievalDTO1.setParentAndSonId(concept.getId());
+                    cenceptIdList.add(concept.getId());
+                }
+            }
+        }
         ExistListByConceptIdsVO existListByConceptIdsVO = new ExistListByConceptIdsVO();
         existListByConceptIdsVO.setConceptIds(cenceptIdList);
         List<Long> existConceptIdList = conceptDetailFacade.existListByConceptIds(existListByConceptIdsVO);
         if(ListUtil.isNotEmpty(existConceptIdList)){
             for (RetrievalDTO retrievalDTOInfo : retrievalDTOS) {
-                for (Long concept : existConceptIdList) {
-                    if (retrievalDTOInfo.getConceptId().intValue() == concept.intValue()){
-                        retrievalDTO = new RetrievalDTO();
-                        BeanUtil.copyProperties(retrievalDTOInfo,retrievalDTO);
-                        staticRetrievalList.add(retrievalDTO);
+                if(StringUtil.isNotEmpty(retrievalDTOInfo.getParentAndSonName())){
+                    for (Long concept : existConceptIdList) {
+                        if (null != retrievalDTOInfo.getParentAndSonId() && retrievalDTOInfo.getParentAndSonId().intValue() == concept.intValue()){
+                            retrievalDTO = new RetrievalDTO();
+                            BeanUtil.copyProperties(retrievalDTOInfo,retrievalDTO);
+                            staticRetrievalList.add(retrievalDTO);
+                        }
+                    }
+                }else {
+                    for (Long concept : existConceptIdList) {
+                        if (retrievalDTOInfo.getConceptId().intValue() == concept.intValue()){
+                            retrievalDTO = new RetrievalDTO();
+                            BeanUtil.copyProperties(retrievalDTOInfo,retrievalDTO);
+                            staticRetrievalList.add(retrievalDTO);
+                        }
                     }
                 }
             }

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/RetrievalVO.java

@@ -27,4 +27,6 @@ public class RetrievalVO {
     private List<Integer> otherType;
     //是否是静态搜索
     private Integer isStatic;
+    //是否显示子项(0.不显示,1.显示)
+    private Integer isSonShow = 0;
 }

+ 2 - 20
aipt-service/src/main/resources/mapper/ConceptMapper.xml

@@ -339,9 +339,6 @@
             LEFT JOIN kl_concept t5 on t5.id = t4.start_id
             LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
             LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
-            <if test="isStatic != null and isStatic == 1">
-                LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t5.id
-            </if>
             WHERE
             t1.is_deleted = 'N'
             AND t2.is_deleted = 'N'
@@ -349,9 +346,6 @@
             AND t4.is_deleted = 'N'
             AND t5.is_deleted = 'N'
             AND t6.is_deleted = 'N'
-            <if test="isStatic != null and isStatic == 1">
-                AND t7.is_deleted = 'N'
-            </if>
             <if test="detilType != null">
                 AND t1.lib_type = #{detilType}
             </if>
@@ -386,9 +380,6 @@
             LEFT JOIN kl_concept t5 on t5.id = t4.start_id
             LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
             LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
-            <if test="isStatic != null and isStatic == 1">
-                LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t5.id
-            </if>
             WHERE
             t1.is_deleted = 'N'
             AND t2.is_deleted = 'N'
@@ -396,9 +387,6 @@
             AND t4.is_deleted = 'N'
             AND t5.is_deleted = 'N'
             AND t6.is_deleted = 'N'
-            <if test="isStatic != null and isStatic == 1">
-                AND t7.is_deleted = 'N'
-            </if>
             <if test="detilType != null">
                 AND t1.lib_type = #{detilType}
             </if>
@@ -419,10 +407,10 @@
                     #{id}
                 </foreach>
             </if>
+            AND t4.relation_id = 18
             <if test="isStatic != null and isStatic == 1">
                 GROUP BY t5.id
             </if>
-            AND t4.relation_id = 18
             <if test="isStatic == null or isStatic != 1">
                 LIMIT 100
             </if>)
@@ -433,9 +421,6 @@
             LEFT JOIN kl_concept t5 on t5.id = t4.start_id
             LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
             LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
-            <if test="isStatic != null and isStatic == 1">
-                LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t5.id
-            </if>
             WHERE
             t1.is_deleted = 'N'
             AND t2.is_deleted = 'N'
@@ -443,9 +428,6 @@
             AND t4.is_deleted = 'N'
             AND t5.is_deleted = 'N'
             AND t6.is_deleted = 'N'
-            <if test="isStatic != null and isStatic == 1">
-                AND t7.is_deleted = 'N'
-            </if>
             <if test="detilType != null">
                 AND t1.lib_type = #{detilType}
             </if>
@@ -466,10 +448,10 @@
                     #{id}
                 </foreach>
             </if>
+            AND t4.relation_id = 18
             <if test="isStatic != null and isStatic == 1">
                 GROUP BY t5.id
             </if>
-            AND t4.relation_id = 18
             <if test="isStatic == null or isStatic != 1">
                 LIMIT 100
             </if>)

+ 2 - 0
icss-service/src/main/java/com/diagbot/dto/RetrievalDTO.java

@@ -27,4 +27,6 @@ public class RetrievalDTO {
     private String libTypeName;
     //icss标签type
     private Integer type;
+    //父项子项名称
+    private String parentAndSonName;
 }

+ 15 - 16
knowledgeman-service/src/main/java/com/diagbot/enums/LexiconRSTypeEnum.java

@@ -9,22 +9,22 @@ import lombok.Setter;
  * @time: 2019/5/6 13:58
  */
 public enum LexiconRSTypeEnum implements KeyedNamed {
-//    IS_A(1,"是"),
-//    EQUAL_TO(2,"同义于"),
+    IS_A(1,"是"),
+    EQUAL_TO(2,"同义于"),
     INCLUDE_OF(3,"包含于"),
-//    ASSOCIATED_WITH(4,"与相关"),
-//    CAUSE(5,"引起"),
-//    LOCATED_AT(6,"位于"),
-//    AKA(7,"别名"),
-//    INSURE_LEVEL(8,"医保"),
-//    APPLIED_TO(9,"适用于"),
-//    PREFERRED_MEDS(10,"首选药物"),
-//    TREAT(11,"治疗"),
-//    USAGE(12,"用法"),
-//    REACTION(13,"不良反应"),
-//    DO_AND_DONOT(14,"注意事项"),
-//    SPEC(15,"规格"),
-//    HAS(16,"有"),
+    ASSOCIATED_WITH(4,"与相关"),
+    CAUSE(5,"引起"),
+    LOCATED_AT(6,"位于"),
+    AKA(7,"别名"),
+    INSURE_LEVEL(8,"医保"),
+    APPLIED_TO(9,"适用于"),
+    PREFERRED_MEDS(10,"首选药物"),
+    TREAT(11,"治疗"),
+    USAGE(12,"用法"),
+    REACTION(13,"不良反应"),
+    DO_AND_DONOT(14,"注意事项"),
+    SPEC(15,"规格"),
+    HAS(16,"有"),
     ORDER_BY(17,"包含排列于"),
     SUBITEM(18,"包含子项"),
     PUSH(19,"推送");
@@ -64,4 +64,3 @@ public enum LexiconRSTypeEnum implements KeyedNamed {
         return name;
     }
 }
-

+ 1 - 1
knowledgeman-service/src/main/java/com/diagbot/service/impl/EnumsDataServiceImpl.java

@@ -30,7 +30,7 @@ public class EnumsDataServiceImpl implements EnumsDataService {
         Map<String, List<EnumEntriesBuilder.Entry>> enumMap = new EnumEntriesBuilder()
                 .addEnums("disclaimerCodeEnum", DisclaimerCodeEnum.values())
                 .addEnums("positionTypeEnum", PositionTypeEnum.values())
-                .addEnums("lexiconRSTypeEnum", LexiconRSTypeEnum.values())
+                .addEnums("lexiconRSTypeEnum", LexiconRSTypeEnum.INCLUDE_OF, LexiconRSTypeEnum.PUSH)
                 .addEnums("lexiconTypeEnum", LexiconTypeEnum.values())
                 .build();
         return enumMap;