提交 91213800 作者: 925993793@qq.com

自定义专题-研究中心:增加排序状态字段excludeStatus

上级 34c9aa19
...@@ -2174,11 +2174,33 @@ public class EsService { ...@@ -2174,11 +2174,33 @@ public class EsService {
} }
//资讯状态-研究中心(0-全部;1-模型推荐;2-精选;3-待定;4-移除),和checkStatus、deleteFlag、isFreeCheck互斥 //资讯状态-研究中心(0-全部;1-模型推荐;2-精选;3-待定;4-移除),和checkStatus、deleteFlag、isFreeCheck互斥
Integer status = searchCondition.getStatus(); Integer status = searchCondition.getStatus();
List<Integer> excludeStatus = searchCondition.getExcludeStatus();
if (status != null) { if (status != null) {
if (status == 1) { if (status == 0) {
boolQuery.must(QueryBuilders.termQuery("checkStatus", 0)); if (CollectionUtils.isNotEmpty(excludeStatus)) {
if (excludeStatus.contains(2)) {
boolQuery.mustNot(QueryBuilders.termQuery("checkStatus", 1));
}
if (excludeStatus.contains(3)) {
boolQuery.mustNot(QueryBuilders.termQuery("checkStatus", 3));
}
if (excludeStatus.contains(4)) {
boolQuery.mustNot(QueryBuilders.termQuery("deleteFlag", 1));
}
}
} else if (status == 1) {
boolQuery.must(QueryBuilders.termQuery("isFreeCheck", 1)); boolQuery.must(QueryBuilders.termQuery("isFreeCheck", 1));
boolQuery.mustNot(QueryBuilders.termQuery("deleteFlag", 1)); if (CollectionUtils.isNotEmpty(excludeStatus)) {
if (excludeStatus.contains(2)) {
boolQuery.mustNot(QueryBuilders.termQuery("checkStatus", 1));
}
if (excludeStatus.contains(3)) {
boolQuery.mustNot(QueryBuilders.termQuery("checkStatus", 3));
}
if (excludeStatus.contains(4)) {
boolQuery.mustNot(QueryBuilders.termQuery("deleteFlag", 1));
}
}
} else if (status == 2) { } else if (status == 2) {
boolQuery.must(QueryBuilders.termQuery("checkStatus", 1)); boolQuery.must(QueryBuilders.termQuery("checkStatus", 1));
boolQuery.mustNot(QueryBuilders.termQuery("deleteFlag", 1)); boolQuery.mustNot(QueryBuilders.termQuery("deleteFlag", 1));
......
...@@ -59,6 +59,8 @@ public class InfoDataSearchCondition { ...@@ -59,6 +59,8 @@ public class InfoDataSearchCondition {
//资讯状态-研究中心(0-全部;1-模型推荐;2-精选;3-待定;4-移除),和auditStatus互斥 //资讯状态-研究中心(0-全部;1-模型推荐;2-精选;3-待定;4-移除),和auditStatus互斥
private Integer status; private Integer status;
//排除状态-研究中心(2-精选;3-待定;4-移除)
private List<Integer> excludeStatus;
//平台-审核状态(null-全部;1-通过;2-未审核;3-暂定;4-删除;5-免审核) //平台-审核状态(null-全部;1-通过;2-未审核;3-暂定;4-删除;5-免审核)
private Integer auditStatus; private Integer auditStatus;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论