|
@@ -244,16 +244,25 @@ public class OrderBaseCountLogic {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ BoolQueryBuilder queryBuilderWGD = QueryBuilders.boolQuery();
|
|
|
+
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds())) {
|
|
|
+ queryBuilderWGD.must(
|
|
|
+ QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ );
|
|
|
+ }
|
|
|
+ queryBuilderWGD.must(
|
|
|
+ QueryBuilders.boolQuery()
|
|
|
+ .must(QueryBuilders.termsQuery("order_status",orderStatus))
|
|
|
+ .must( QueryBuilders.rangeQuery("over_time")
|
|
|
+ .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (-6))),"yyyy-MM-dd HH:mm:ss"))
|
|
|
+ .lte(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")))
|
|
|
+ );
|
|
|
+
|
|
|
|
|
|
NativeSearchQuery searchQueryWGD = new NativeSearchQueryBuilder()
|
|
|
- .withQuery(QueryBuilders.boolQuery()
|
|
|
- .must(QueryBuilders.termsQuery("order_status",orderStatus))
|
|
|
- .must( QueryBuilders.rangeQuery("over_time")
|
|
|
- .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (-6))),"yyyy-MM-dd HH:mm:ss"))
|
|
|
- .lte(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")))
|
|
|
- .must( QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
- .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds())))
|
|
|
- )
|
|
|
+ .withQuery(queryBuilderWGD)
|
|
|
.withSourceFilter(new FetchSourceFilter(new String[]{"create_time"}, null))
|
|
|
.withPageable(PageRequest.of(1, 1))
|
|
|
.addAggregation(AggregationBuilders.dateHistogram("WGD")
|
|
@@ -280,18 +289,24 @@ public class OrderBaseCountLogic {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ BoolQueryBuilder queryBuilderJXZ = QueryBuilders.boolQuery();
|
|
|
|
|
|
- NativeSearchQuery searchQueryJXZ= new NativeSearchQueryBuilder()
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds())) {
|
|
|
+ queryBuilderJXZ.must(
|
|
|
+ QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ );
|
|
|
+ }
|
|
|
+ queryBuilderJXZ.must(
|
|
|
+ QueryBuilders.rangeQuery("create_time")
|
|
|
+ .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (-6))),"yyyy-MM-dd HH:mm:ss"))
|
|
|
+ .lte(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
|
|
|
+
|
|
|
+ queryBuilderJXZ.mustNot(QueryBuilders.termsQuery("order_status",orderStatus))
|
|
|
+ .mustNot(QueryBuilders.termsQuery("order_status",orderStatusQx));
|
|
|
|
|
|
- .withQuery(QueryBuilders.boolQuery()
|
|
|
- .must( QueryBuilders.rangeQuery("create_time")
|
|
|
- .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (-6))),"yyyy-MM-dd HH:mm:ss"))
|
|
|
- .lte(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")))
|
|
|
- .must( QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
- .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds())))
|
|
|
- .mustNot(QueryBuilders.termsQuery("order_status",orderStatus))
|
|
|
- .mustNot(QueryBuilders.termsQuery("order_status",orderStatusQx))
|
|
|
- )
|
|
|
+ NativeSearchQuery searchQueryJXZ= new NativeSearchQueryBuilder()
|
|
|
+ .withQuery(queryBuilderJXZ)
|
|
|
.withSourceFilter(new FetchSourceFilter(new String[]{"create_time"}, null))
|
|
|
.withPageable(PageRequest.of(1, 1))
|
|
|
.addAggregation(AggregationBuilders.dateHistogram("JXZ")
|
|
@@ -325,14 +340,23 @@ public class OrderBaseCountLogic {
|
|
|
orderBaseCountBean.setQtddqs(qtddqs);
|
|
|
|
|
|
|
|
|
+ BoolQueryBuilder queryBuilderQTSM = QueryBuilders.boolQuery();
|
|
|
|
|
|
- NativeSearchQuery searchQueryQTSM= new NativeSearchQueryBuilder()
|
|
|
- .withQuery(QueryBuilders.boolQuery()
|
|
|
- .must( QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
- .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds())))
|
|
|
- .must(QueryBuilders.rangeQuery("appointment_time")
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds())) {
|
|
|
+ queryBuilderQTSM.must(
|
|
|
+ QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ queryBuilderQTSM.must(
|
|
|
+ QueryBuilders.rangeQuery("appointment_time")
|
|
|
.gte(DateUtil.format(DateUtil.beginOfDay(new Date()),"yyyy-MM-dd HH:mm:ss"))
|
|
|
- .lte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (7))),"yyyy-MM-dd HH:mm:ss"))))
|
|
|
+ .lte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (7))),"yyyy-MM-dd HH:mm:ss")));
|
|
|
+
|
|
|
+
|
|
|
+ NativeSearchQuery searchQueryQTSM= new NativeSearchQueryBuilder()
|
|
|
+ .withQuery(queryBuilderQTSM)
|
|
|
.withPageable(PageRequest.of(1, 1))
|
|
|
.addAggregation(AggregationBuilders.dateHistogram("QTDSM")
|
|
|
.field("appointment_time")
|
|
@@ -366,15 +390,27 @@ public class OrderBaseCountLogic {
|
|
|
|
|
|
Map<String,List<Long>> wglxfb = new HashMap<>();
|
|
|
|
|
|
+
|
|
|
+ BoolQueryBuilder queryBuilderAZ = QueryBuilders.boolQuery();
|
|
|
+
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds())) {
|
|
|
+ queryBuilderAZ.must(
|
|
|
+ QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ queryBuilderAZ.must(
|
|
|
+ QueryBuilders.termsQuery("order_type_text",OrderTypeEnum.INSTALL.getRemark()));
|
|
|
+
|
|
|
+ queryBuilderAZ.must(
|
|
|
+ QueryBuilders.rangeQuery("over_time")
|
|
|
+ .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (-29))),"yyyy-MM-dd HH:mm:ss"))
|
|
|
+ .lte(DateUtil.format(DateUtil.endOfDay(new Date()),"yyyy-MM-dd HH:mm:ss")));
|
|
|
+
|
|
|
+
|
|
|
NativeSearchQuery searchQueryAZ= new NativeSearchQueryBuilder()
|
|
|
- .withQuery(QueryBuilders.boolQuery()
|
|
|
- .must( QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
- .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds())))
|
|
|
- .must(QueryBuilders.boolQuery()
|
|
|
- .must(QueryBuilders.termsQuery("order_type_text",OrderTypeEnum.INSTALL.getRemark()))
|
|
|
- .must(QueryBuilders.rangeQuery("over_time")
|
|
|
- .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (-29))),"yyyy-MM-dd HH:mm:ss"))
|
|
|
- .lte(DateUtil.format(DateUtil.endOfDay(new Date()),"yyyy-MM-dd HH:mm:ss")))))
|
|
|
+ .withQuery(queryBuilderAZ)
|
|
|
.withPageable(PageRequest.of(1, 1))
|
|
|
.addAggregation(AggregationBuilders.dateHistogram("AZ")
|
|
|
.field("over_time")
|
|
@@ -400,15 +436,22 @@ public class OrderBaseCountLogic {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ BoolQueryBuilder queryBuilderWX = QueryBuilders.boolQuery();
|
|
|
+
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds())) {
|
|
|
+ queryBuilderWX.must(
|
|
|
+ QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds()))
|
|
|
+ );
|
|
|
+ }
|
|
|
+ queryBuilderWX.must(QueryBuilders.termsQuery("order_type_text",OrderTypeEnum.REPAIR.getRemark()));
|
|
|
+
|
|
|
+ queryBuilderWX.must(QueryBuilders.rangeQuery("over_time")
|
|
|
+ .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (-29))),"yyyy-MM-dd HH:mm:ss"))
|
|
|
+ .lte(DateUtil.format(DateUtil.endOfDay(new Date()),"yyyy-MM-dd HH:mm:ss")));
|
|
|
+
|
|
|
NativeSearchQuery searchQueryWX= new NativeSearchQueryBuilder()
|
|
|
- .withQuery(QueryBuilders.boolQuery()
|
|
|
- .must( QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
|
|
|
- .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds())))
|
|
|
- .must(QueryBuilders.boolQuery()
|
|
|
- .must(QueryBuilders.termsQuery("order_type_text",OrderTypeEnum.REPAIR.getRemark()))
|
|
|
- .must(QueryBuilders.rangeQuery("over_time")
|
|
|
- .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (-29))),"yyyy-MM-dd HH:mm:ss"))
|
|
|
- .lte(DateUtil.format(DateUtil.endOfDay(new Date()),"yyyy-MM-dd HH:mm:ss")))))
|
|
|
+ .withQuery(queryBuilderWX)
|
|
|
.withPageable(PageRequest.of(1, 1))
|
|
|
.addAggregation(AggregationBuilders.dateHistogram("WX")
|
|
|
.field("over_time")
|