zhaops 4 лет назад
Родитель
Сommit
5d5206041b

+ 13 - 3
src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -38,6 +38,7 @@ import com.diagbot.vo.StaticKnowledgeHISVO;
 import com.diagbot.vo.StaticKnowledgeIndexVO;
 import com.diagbot.vo.StaticKnowledgeVO;
 import com.google.common.collect.Lists;
+import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
@@ -741,7 +742,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      * @param nameList
      * @return
      */
-    public Map<String, List<ConceptDetail>> getDetailByConcept(List<String> nameList) {
+    public Map<String, List<ConceptDetail>> getDetailByConcept(List<String> nameList, List<Integer> contentTypes) {
         Map<String, List<ConceptDetail>> retMap = new HashMap<>();
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
         QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
@@ -759,8 +760,17 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
 
             QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
             conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("concept_id", conceptIds)
-                    .in("content_type", new Integer[] { 1, 2, 3 });
+                    .in("concept_id", conceptIds);
+            if(ListUtil.isNotEmpty(contentTypes)) {
+                conceptDetailQueryWrapper.and(sql -> {
+                    for (int i = 0; i < contentTypes.size(); i++) {
+                        if (i > 0) {
+                            sql.or();
+                        }
+                        sql.apply("find_in_set({0},content_type)", contentTypes.get(i));
+                    }
+                });
+            }
             List<ConceptDetail> conceptDetailList = conceptDetailFacade.list(conceptDetailQueryWrapper);
             Map<Long, List<ConceptDetail>> detailMap
                     = EntityUtil.makeEntityListMap(conceptDetailList, "conceptId");

+ 2 - 2
src/main/java/com/diagbot/facade/PushFacade.java

@@ -148,7 +148,7 @@ public class PushFacade {
                     .map(i -> i.getName())
                     .collect(Collectors.toList());
 
-            Map<String, List<ConceptDetail>> conceptDetailMap = conceptInfoFacade.getDetailByConcept(conceptNameList);
+            Map<String, List<ConceptDetail>> conceptDetailMap = conceptInfoFacade.getDetailByConcept(conceptNameList, Arrays.asList(new Integer[] { 1, 2, 3 }));
             if (pushDTO.getDis() != null) {
                 for (Map.Entry<String, List<PushBaseDTO>> entry : pushDTO.getDis().entrySet()) {
                     if (ListUtil.isNotEmpty(entry.getValue())) {
@@ -206,7 +206,7 @@ public class PushFacade {
                     .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
                     .map(i -> i.getUniqueName())
                     .collect(Collectors.toList());
-            Map<String, List<ConceptDetail>> conceptDetailMap = conceptInfoFacade.getDetailByConcept(conceptNameList);
+            Map<String, List<ConceptDetail>> conceptDetailMap = conceptInfoFacade.getDetailByConcept(conceptNameList, Arrays.asList(new Integer[] { 4 }));
             if (conceptDetailMap == null || conceptDetailMap.size() == 0) {
                 return retGeneraTreat;
             }