‘linchangsheng’ 4 months ago
parent
commit
70771d0626

+ 20 - 21
mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBaseEsDate.java

@@ -277,7 +277,7 @@ public class OrderBaseEsDate {
     private Date appraiseTime;
     private Date appraiseTime;
 
 
     @ApiModelProperty(value = "评价来源 1=用户评价 2=商家评价")
     @ApiModelProperty(value = "评价来源 1=用户评价 2=商家评价")
-    @Field(value = "appraise_source", type = FieldType.Keyword)
+    @Field(value = "appraise_source", type = FieldType.Integer)
     private Integer appraiseSource;
     private Integer appraiseSource;
 
 
     @ApiModelProperty(value = "多个图片逗号隔开")
     @ApiModelProperty(value = "多个图片逗号隔开")
@@ -315,7 +315,6 @@ public class OrderBaseEsDate {
     @ApiModelProperty(value = "销售单下单时间")
     @ApiModelProperty(value = "销售单下单时间")
     @Field(value = "sale_create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
     @Field(value = "sale_create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
     private Date saleCreateTime;
     private Date saleCreateTime;
-
     @ApiModelProperty(value = "销售单订单金额")
     @ApiModelProperty(value = "销售单订单金额")
     @Field(value = "sale_total_amount", type = FieldType.Keyword)
     @Field(value = "sale_total_amount", type = FieldType.Keyword)
     private BigDecimal saleTotalAmount;
     private BigDecimal saleTotalAmount;
@@ -337,16 +336,16 @@ public class OrderBaseEsDate {
     private String userSign;
     private String userSign;
 
 
     @ApiModelProperty(value = "是否为导入工单,true=是 false=否")
     @ApiModelProperty(value = "是否为导入工单,true=是 false=否")
-    @Field(value = "is_import", type = FieldType.Keyword)
-    private String isImport;
+    @Field(value = "is_import", type = FieldType.Boolean)
+    private Boolean isImport;
 
 
     @ApiModelProperty(value = "是否已采集 YES 是 NO 否")
     @ApiModelProperty(value = "是否已采集 YES 是 NO 否")
     @Field(value = "is_gather", type = FieldType.Keyword)
     @Field(value = "is_gather", type = FieldType.Keyword)
     private String isGather;
     private String isGather;
 
 
     @ApiModelProperty(value = "是否异常工单 true/false")
     @ApiModelProperty(value = "是否异常工单 true/false")
-    @Field(value = "is_exception", type = FieldType.Keyword)
-    private String isException;
+    @Field(value = "is_exception", type = FieldType.Boolean)
+    private Boolean isException;
 
 
     @ApiModelProperty(value = "增置服务id")
     @ApiModelProperty(value = "增置服务id")
     @Field(value = "pg_incre_id", type = FieldType.Keyword)
     @Field(value = "pg_incre_id", type = FieldType.Keyword)
@@ -389,7 +388,7 @@ public class OrderBaseEsDate {
     private String isAllFee;
     private String isAllFee;
 
 
     @ApiModelProperty(value = "销售类型 1=零售 2=工程 3=延保 4=工程维保")
     @ApiModelProperty(value = "销售类型 1=零售 2=工程 3=延保 4=工程维保")
-    @Field(value = "sale_type", type = FieldType.Keyword)
+    @Field(value = "sale_type", type = FieldType.Integer)
     private Integer saleType;
     private Integer saleType;
 
 
     @ApiModelProperty(value = "工程编号")
     @ApiModelProperty(value = "工程编号")
@@ -401,26 +400,26 @@ public class OrderBaseEsDate {
     private String projectName;
     private String projectName;
 
 
     @ApiModelProperty(value = "是否开启抢单")
     @ApiModelProperty(value = "是否开启抢单")
-    @Field(value = "is_qd", type = FieldType.Keyword)
-    private String isQd;
+    @Field(value = "is_qd", type = FieldType.Boolean)
+    private Boolean isQd;
 
 
     @ApiModelProperty(value = "是否已产生通知 true=是 false=否")
     @ApiModelProperty(value = "是否已产生通知 true=是 false=否")
-    @Field(value = "is_qd_notice", type = FieldType.Keyword)
-    private String isQdNotice;
+    @Field(value = "is_qd_notice", type = FieldType.Boolean)
+    private Boolean isQdNotice;
 
 
     @ApiModelProperty(value = "是否为拆机")
     @ApiModelProperty(value = "是否为拆机")
-    @Field(value = "is_cj", type = FieldType.Keyword)
-    private String isCj;
+    @Field(value = "is_cj", type = FieldType.Boolean)
+    private Boolean isCj;
 
 
     @ApiModelProperty(value = "是否为租赁单 true/false")
     @ApiModelProperty(value = "是否为租赁单 true/false")
-    @Field(value = "is_zl", type = FieldType.Keyword)
-    private String isZl;
+    @Field(value = "is_zl", type = FieldType.Boolean)
+    private Boolean isZl;
 
 
 
 
 
 
     @ApiModelProperty(value = "是否为工单导入 true/false")
     @ApiModelProperty(value = "是否为工单导入 true/false")
-    @Field(value = "is_import_excel", type = FieldType.Keyword)
-    private String isImportExcel;
+    @Field(value = "is_import_excel", type = FieldType.Boolean)
+    private Boolean isImportExcel;
 
 
     @ApiModelProperty(value = "服务状态")
     @ApiModelProperty(value = "服务状态")
     @Field(value = "service_status", type = FieldType.Keyword)
     @Field(value = "service_status", type = FieldType.Keyword)
@@ -513,8 +512,8 @@ public class OrderBaseEsDate {
     private String appraiseLabel;
     private String appraiseLabel;
 
 
     @ApiModelProperty(value = "是否是工单3.0同步true/false")
     @ApiModelProperty(value = "是否是工单3.0同步true/false")
-    @Field(value = "is_three_order", type = FieldType.Keyword)
-    private String isThreeOrder;
+    @Field(value = "is_three_order", type = FieldType.Boolean)
+    private Boolean isThreeOrder;
 
 
     @ApiModelProperty(value = "故障类型")
     @ApiModelProperty(value = "故障类型")
     @Field(value = "trouble_value", type = FieldType.Keyword)
     @Field(value = "trouble_value", type = FieldType.Keyword)
@@ -529,8 +528,8 @@ public class OrderBaseEsDate {
     private String smallType;
     private String smallType;
 
 
     @ApiModelProperty(value = "1 已接单 0未接单")
     @ApiModelProperty(value = "1 已接单 0未接单")
-    @Field(value = "is_meet", type = FieldType.Keyword)
-    private String isMeet;
+    @Field(value = "is_meet", type = FieldType.Boolean)
+    private Boolean isMeet;
 
 
     @ApiModelProperty(value = "申请状态 ING=申请中 END=到货反馈 CANCEL=取消申请")
     @ApiModelProperty(value = "申请状态 ING=申请中 END=到货反馈 CANCEL=取消申请")
     @Field(value = "parts_apply_status", type = FieldType.Keyword)
     @Field(value = "parts_apply_status", type = FieldType.Keyword)

+ 8 - 5
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseEsLogic.java

@@ -21,6 +21,7 @@ import com.gree.mall.manager.plus.entity.PgOrderFlag;
 import com.gree.mall.manager.plus.entity.WorkerOrder;
 import com.gree.mall.manager.plus.entity.WorkerOrder;
 import com.gree.mall.manager.plus.service.PgOrderBaseService;
 import com.gree.mall.manager.plus.service.PgOrderBaseService;
 import com.gree.mall.manager.plus.service.WorkerOrderService;
 import com.gree.mall.manager.plus.service.WorkerOrderService;
+import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.zfire.bean.QueryParamBean;
 import com.gree.mall.manager.zfire.bean.QueryParamBean;
 import io.micrometer.core.instrument.search.Search;
 import io.micrometer.core.instrument.search.Search;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
@@ -266,13 +267,13 @@ public class OrderBaseEsLogic {
 
 
 
 
     public void test() {
     public void test() {
- /*       boolean a = elasticsearchRestTemplate.indexOps(OrderBaseEs.class).delete();
+        boolean a = elasticsearchRestTemplate.indexOps(OrderBaseEs.class).delete();
         IndexOperations indexOperations1 = elasticsearchRestTemplate.indexOps(OrderBaseEsDate.class);
         IndexOperations indexOperations1 = elasticsearchRestTemplate.indexOps(OrderBaseEsDate.class);
         if (!indexOperations1.exists()) {
         if (!indexOperations1.exists()) {
             indexOperations1.create();
             indexOperations1.create();
             Document document = indexOperations1.createMapping();
             Document document = indexOperations1.createMapping();
             indexOperations1.putMapping(document);
             indexOperations1.putMapping(document);
-        }*/
+        }
         List<PgOrderBase> list = pgOrderBaseService.lambdaQuery().list();
         List<PgOrderBase> list = pgOrderBaseService.lambdaQuery().list();
 
 
         List<OrderBaseEsDate> orderBaseEsDates = BeanUtil.copyToList(list, OrderBaseEsDate.class);
         List<OrderBaseEsDate> orderBaseEsDates = BeanUtil.copyToList(list, OrderBaseEsDate.class);
@@ -307,6 +308,8 @@ public class OrderBaseEsLogic {
             should.add(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds()));
             should.add(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds()));
         }
         }
 
 
+        if (!StringUtil.isEmpty(orderSmallTypeText))
+            queryBuilder.must(QueryBuilders.termsQuery("order_type_text",orderSmallTypeText));
 
 
 
 
         //待预约
         //待预约
@@ -385,8 +388,8 @@ public class OrderBaseEsLogic {
                 .withPageable(PageRequest.of(1, 1))
                 .withPageable(PageRequest.of(1, 1))
                 .addAggregation(this.getAggs(AggregationBuilders.filter("DJD", QueryBuilders.boolQuery()
                 .addAggregation(this.getAggs(AggregationBuilders.filter("DJD", QueryBuilders.boolQuery()
                         .mustNot(QueryBuilders.termsQuery("order_status","YQX", "FWQX", "FL", "FWZT", "YCGB"))
                         .mustNot(QueryBuilders.termsQuery("order_status","YQX", "FWQX", "FL", "FWZT", "YCGB"))
-                        .should(QueryBuilders.termsQuery("is_meet", "0"))
-                        .should(QueryBuilders.termsQuery("order_status", "DJD"))
+                        .must(QueryBuilders.boolQuery().should(QueryBuilders.termQuery("is_meet", false))
+                        .should(QueryBuilders.termsQuery("order_status", "DJD")))
                         )))
                         )))
                 .build();
                 .build();
         SearchHits responseDJD = elasticsearchRestTemplate.search(searchQueryDJD, OrderBaseEs.class);
         SearchHits responseDJD = elasticsearchRestTemplate.search(searchQueryDJD, OrderBaseEs.class);
@@ -504,7 +507,7 @@ public class OrderBaseEsLogic {
 
 
         HashMap<String, Object> PJYDH = new HashMap<>();
         HashMap<String, Object> PJYDH = new HashMap<>();
         PJYDH.put("total",this.getWorkerOrderCountResult(responsePJYDH.getAggregations(),"PJYDH"));
         PJYDH.put("total",this.getWorkerOrderCountResult(responsePJYDH.getAggregations(),"PJYDH"));
-        PJYDH.put("orderStatus","PJSQZ");
+        PJYDH.put("orderStatus","PJYDH");
 
 
         maps.add(PJYDH);
         maps.add(PJYDH);