浏览代码

量表内容过滤

zhoutg 6 年之前
父节点
当前提交
c81cad71e1

+ 14 - 1
icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -61,6 +61,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -571,7 +572,19 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
         paramMap.put("existName", questionIndexVO.getExistName());
         paramMap.put("notTagType", questionIndexVO.getNotTagType());
         paramMap.put("notControlType", questionIndexVO.getNotControlType());
-        return this.index(paramMap);
+        List<QuestionInfo> res = this.index(paramMap);
+        //过滤出没有量表内容标签
+        if(questionIndexVO.getFilterList().contains("scale")) {
+            List<ScaleContent> scaleContents = scaleContentFacade.list(new QueryWrapper<ScaleContent>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey()));
+            Set<Long> ids = scaleContents.stream().map(row -> row.getScaleId()).collect(Collectors.toSet());
+            for(int i = 0; i<res.size(); i++) {
+                if(ids.contains(res.get(i).getId())) {
+                    res.remove(i--);
+                }
+            }
+        }
+        return res;
     }
 
     /**

+ 1 - 0
icssman-service/src/main/java/com/diagbot/vo/QuestionIndexVO.java

@@ -23,4 +23,5 @@ public class QuestionIndexVO {
     private String existName; //是否重复
     private List<Integer> notTagType;
     private List<Integer> notControlType;
+    private List<String> filterList;
 }