فهرست منبع

Merge branch 'master-2'

‘linchangsheng’ 1 ماه پیش
والد
کامیت
fcab32ba9b

+ 86 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/bean/workorder/PgOrderWorkerDateEs.java

@@ -0,0 +1,86 @@
+package com.gree.mall.miniapp.bean.workorder;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.elasticsearch.annotations.DateFormat;
+import org.springframework.data.elasticsearch.annotations.Document;
+import org.springframework.data.elasticsearch.annotations.Field;
+import org.springframework.data.elasticsearch.annotations.FieldType;
+
+import java.util.Date;
+
+/**
+ * @author qinrongjun
+ * @description
+ * @date 2023/6/19 10:39 星期一
+ */
+@Data
+@Document(indexName = "pg_order_worker")
+public class PgOrderWorkerDateEs {
+
+    @Id
+    @Field(value = "id",  type = FieldType.Keyword)
+    private String id;
+
+    @ApiModelProperty(value = "工单号")
+    @Field(value = "order_base_id", type = FieldType.Keyword)
+    private String orderBaseId;
+
+    @ApiModelProperty(value = "网点id")
+    @Field(value = "websit_id", type = FieldType.Keyword)
+    private String websitId;
+
+    @ApiModelProperty(value = "网点名称")
+    @Field(value = "websit_name", type = FieldType.Keyword)
+    private String websitName;
+
+    @ApiModelProperty(value = "师傅id")
+    @Field(value = "worker_id", type = FieldType.Keyword)
+    private String workerId;
+
+    @ApiModelProperty(value = "师傅名称")
+    @Field(value = "worker_name", type = FieldType.Keyword)
+    private String workerName;
+
+    @ApiModelProperty(value = "师傅手机号")
+    @Field(value = "worker_mobile", type = FieldType.Keyword)
+    private String workerMobile;
+
+    @ApiModelProperty(value = "师傅编号")
+    @Field(value = "worker_number", type = FieldType.Keyword)
+    private String workerNumber;
+
+    @ApiModelProperty(value = "师傅身份证")
+    @Field(value = "worker_idcard", type = FieldType.Keyword)
+    private String workerIdcard;
+
+    @ApiModelProperty(value = "师傅查询条件")
+    @Field(value = "worker_query", type = FieldType.Keyword)
+    private String workerQuery;
+
+    @ApiModelProperty(value = "是否费用审批(维保工单用)")
+    @Field(value = "is_examine", type = FieldType.Boolean)
+    private Boolean isExamine;
+
+    @ApiModelProperty(value = "是否为大工或主要服务人员 1=是 0=否")
+    @Field(value = "is_master", type = FieldType.Boolean)
+    private Boolean isMaster;
+
+    @ApiModelProperty(value = "创建时间")
+    @Field(value = "create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String createTime;
+
+    @ApiModelProperty(value = "修改时间")
+    @Field(value = "update_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String updateTime;
+
+    @ApiModelProperty(value = "创建人")
+    @Field(value = "create_by", type = FieldType.Keyword)
+    private String createBy;
+
+    @ApiModelProperty(value = "修改人")
+    @Field(value = "update_by", type = FieldType.Keyword)
+    private String updateBy;
+
+}

+ 2 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/bean/workorder/PgOrderWorkerEs.java

@@ -1,5 +1,6 @@
 package com.gree.mall.miniapp.bean.workorder;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springframework.data.annotation.Id;
@@ -8,6 +9,7 @@ import org.springframework.data.elasticsearch.annotations.Document;
 import org.springframework.data.elasticsearch.annotations.Field;
 import org.springframework.data.elasticsearch.annotations.FieldType;
 
+import java.time.LocalDateTime;
 import java.util.Date;
 
 /**

+ 2 - 6
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/config/aop/ApiAspect.java

@@ -72,23 +72,20 @@ public class ApiAspect {
         }
         String token = CommonUtils.getToken(request);
         String jwtUserId = CommonUtils.getUserId(request);
-        log.info("用户"+jwtUserId+"token:{} 访问 {}+", token, request.getRequestURI());
+      //  log.info("用户"+jwtUserId+"token:{} 访问 {}+", token, request.getRequestURI());
         if (StringUtils.isNotBlank(jwtUserId) && StringUtils.isNotBlank(token) && token.equals(jwtUserId)) {
             throw new RemoteServiceException(ResponseHelper.ResponseCode_TOKEN_ID_ERROR, "请求不合法, token");
         }
 
 
         //String userId = CommonUtils.getUserId(request);
-        log.info("用户"+jwtUserId+"redis开始时间"+ DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
         String userId = (String)redisUtil.get(Constant.RedisPrefix.TOKEN_WX+token);
-        log.info("用户"+jwtUserId+"redis结束时间"+ DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
         if (StringUtils.isBlank(userId) || StringUtils.isBlank(jwtUserId)) {
             throw new RemoteServiceException(ResponseHelper.ResponseCode_TOKEN_ID_ERROR, "请求不合法");
         }
 
-        log.info("用户"+jwtUserId+"mysql开始时间"+ DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
-        User userToken = userService.getById(jwtUserId);
 
+        User userToken = userService.getById(jwtUserId);
         if (userToken == null) {
             throw new RemoteServiceException(ResponseHelper.ResponseCode_TOKEN_ID_ERROR, "请求不合法");
         }
@@ -98,7 +95,6 @@ public class ApiAspect {
         if(user == null){
             throw new RemoteServiceException(ResponseHelper.ResponseCode_AUTH_ERROR, "用户不存在,请联系相关人员");
         }
-        log.info("用户"+jwtUserId+"mysql结束时间"+ DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
     }
 
     private Method getSourceMethod(JoinPoint jp) {

+ 5 - 4
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/order/PayOrderLogic.java

@@ -876,6 +876,9 @@ public class PayOrderLogic {
             endTime = monthDateTime[1];
         }
 
+        if (StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()) && StringUtil.isEmpty(currentCompanyWechat.getUser().getIdCard()))
+            return new Page<>();
+
         return workerOrderService.lambdaQuery()
                 .eq(!StringUtil.isEmpty(goodsType),WorkerOrder::getGoodsType,goodsType)
                 .like(!StringUtil.isEmpty(settlementType),WorkerOrder::getSettlementType,settlementType)
@@ -888,10 +891,8 @@ public class PayOrderLogic {
                         iter -> iter.eq(WorkerOrder::getRefundStatus, IsYesNoEnum.YES.getKey()))
                 )
                 .eq(!StringUtil.isEmpty(payStatus) && payStatus.equals(MaterialExamineStatusEnum.PAID.getKey()),WorkerOrder::getRefundStatus, IsYesNoEnum.NO.getKey())
-
-                .and(item -> item.eq(WorkerOrder::getUserId,currentCompanyWechat.getUser().getUserId())
-                    .or(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber())).eq(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
-                )
+                .eq(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
+                .eq(StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getIdentity,currentCompanyWechat.getUser().getIdCard())
                 .between(!StringUtil.isEmpty(startTime),WorkerOrder::getCreateTime,startTime,endTime)
                 .in(WorkerOrder::getCompanyWechatId,currentCompanyWechat.getCompanyWechatId())
                 .orderByDesc(WorkerOrder::getCreateTime)

+ 246 - 26
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/workorder/OrderBaseLogic.java

@@ -28,6 +28,7 @@ import com.gree.mall.miniapp.plus.service.*;
 import com.gree.mall.miniapp.utils.DateUtils;
 import com.gree.mall.miniapp.utils.StringUtil;
 import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.elasticsearch.client.RestHighLevelClient;
 import org.elasticsearch.index.query.BoolQueryBuilder;
@@ -37,7 +38,9 @@ import org.elasticsearch.search.aggregations.AggregationBuilders;
 import org.elasticsearch.search.aggregations.Aggregations;
 import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
 import org.elasticsearch.search.aggregations.bucket.filter.ParsedFilter;
+import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
 import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
 import org.springframework.data.elasticsearch.core.SearchHits;
@@ -52,6 +55,7 @@ import java.util.stream.Collectors;
 
 @RequiredArgsConstructor
 @Service
+@Slf4j
 public class OrderBaseLogic {
 
     private final PgOrderBaseService pgOrderBaseService;
@@ -107,35 +111,46 @@ public class OrderBaseLogic {
         // 构建查询,最大只能查两万数据
         NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
                 .withQuery(boolQuery)
-                .withPageable(PageRequest.of(1, 20000))
+                .withPageable(PageRequest.of(0, 10000))
                 .build();
 
         // 执行查询
-        List<PgOrderWorkerEs> pgOrderWorkerEs = elasticsearchRestTemplate.search(searchQuery, PgOrderWorkerEs.class).map(searchHit -> searchHit.getContent())
+        List<PgOrderWorkerDateEs> pgOrderWorkerEs = elasticsearchRestTemplate.search(searchQuery, PgOrderWorkerDateEs.class).map(searchHit -> searchHit.getContent())
                 .toList();
 
-        List<String> orderBaseIds = pgOrderWorkerEs.stream().map(PgOrderWorkerEs::getOrderBaseId).collect(Collectors.toList());
+        List<String> orderBaseIds = pgOrderWorkerEs.stream().map(PgOrderWorkerDateEs::getOrderBaseId).collect(Collectors.toList());
+
+        if (CollectionUtil.isEmpty(orderBaseIds))
+            return new CountOrderStatusBean();
 
         BoolQueryBuilder boolQueryOrder = QueryBuilders.boolQuery()
-                .mustNot(QueryBuilders.termsQuery("order_status", "YQX","FWQX","FL","FWZT","YCGB"))
+                .mustNot(QueryBuilders.termsQuery("order_status", "YQX","FWQX","FL","FWZT","YCGB","YZP"))
                 ;
         boolQueryOrder.must(
                 QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("id", orderBaseIds))
                         .should(QueryBuilders.termsQuery("order_status", OrderBaseStatusEnum.DQD.getKey()))
         );
+
+
+
+
+
         //待接单
+        // A 或 B 的条件
+        BoolQueryBuilder orConditionAB = QueryBuilders.boolQuery()
+                .must(QueryBuilders.matchQuery("is_import_excel", false))
+                .must(QueryBuilders.matchQuery("order_status",  OrderBaseStatusEnum.DJD.getKey()));
+
+        // C 或 D 的条件
+        BoolQueryBuilder orConditionCD = QueryBuilders.boolQuery()
+                .must(QueryBuilders.matchQuery("is_import_excel", true))
+                .must(QueryBuilders.matchQuery("is_meet", false));
+
         NativeSearchQuery searchQueryDJD = new NativeSearchQueryBuilder()
                 .withQuery(boolQueryOrder)
                 .withPageable(PageRequest.of(1, 1))
                 .addAggregation(this.getAggs(AggregationBuilders.filter("DJD", QueryBuilders.boolQuery()
-                        .must(
-                                QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("id", orderBaseIds))
-                                        .should(QueryBuilders.termsQuery("order_status", OrderBaseStatusEnum.DJD.getKey()))
-                        )
-                        .must(
-                                QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("id", orderBaseIds))
-                                        .should(QueryBuilders.termsQuery("order_status", OrderBaseStatusEnum.DJD.getKey()))
-                        )
+                        .should(orConditionAB).should(orConditionCD)
                         )))
                 .build();
         SearchHits response = elasticsearchRestTemplate.search(searchQueryDJD, OrderBaseEs.class);
@@ -148,7 +163,7 @@ public class OrderBaseLogic {
                 .withQuery(boolQueryOrder)
                 .withPageable(PageRequest.of(1, 1))
                 .addAggregation(this.getAggs(AggregationBuilders.filter("FWZ", QueryBuilders.boolQuery()
-                        .must(QueryBuilders.termsQuery("order_status","FWZ","GCSZT","BFWG","DSM","YZP","XSBH","TJXSBH","ZBBH","FZXBH","WDBH"))
+                        .must(QueryBuilders.termsQuery("order_status","FWZ","GCSZT","BFWG","DSM","XSBH","TJXSBH","ZBBH","FZXBH","WDBH"))
                 )))
                 .build();
         SearchHits responseFWZ = elasticsearchRestTemplate.search(searchQueryFWZ, OrderBaseEs.class);
@@ -194,7 +209,9 @@ public class OrderBaseLogic {
                 .withQuery(boolQueryOrder)
                 .withPageable(PageRequest.of(1, 1))
                 .addAggregation(this.getAggs(AggregationBuilders.filter("JRWG", QueryBuilders.boolQuery()
-                        .must(QueryBuilders.rangeQuery("over_time").from(DateUtil.beginOfDay(new Date())).to(DateUtil.endOfDay(new Date())))
+                        .must(QueryBuilders.rangeQuery("over_time")
+                                .gte(DateUtil.format(DateUtil.beginOfDay(new Date()),"yyyy-MM-dd HH:mm:ss"))
+                                .lte(DateUtil.format(DateUtil.endOfDay(new Date()),"yyyy-MM-dd HH:mm:ss")))
                 )))
                 .build();
         SearchHits responseJRWG = elasticsearchRestTemplate.search(searchQueryJRWG, OrderBaseEs.class);
@@ -206,7 +223,9 @@ public class OrderBaseLogic {
                 .withQuery(boolQueryOrder)
                 .withPageable(PageRequest.of(1, 1))
                 .addAggregation(this.getAggs(AggregationBuilders.filter("JBNWG", QueryBuilders.boolQuery()
-                        .must(QueryBuilders.rangeQuery("over_time").from(DateUtil.beginOfDay(DateUtil.offsetMonth(new Date(),-6))).to(DateUtil.endOfDay(new Date())))
+                        .must(QueryBuilders.rangeQuery("over_time")
+                                .gte(DateUtil.format(DateUtil.beginOfDay(DateUtil.offsetMonth(new Date(),-6)),"yyyy-MM-dd HH:mm:ss"))
+                                .lte(DateUtil.format(DateUtil.endOfDay(new Date()),"yyyy-MM-dd HH:mm:ss")))
                 )))
                 .build();
         SearchHits responseJBNWG = elasticsearchRestTemplate.search(searchQueryJBNWG, OrderBaseEs.class);
@@ -279,12 +298,28 @@ public class OrderBaseLogic {
         );
         mySchedule7Day.setDayList(dayList);
 
-        List<String> orderBaseIds = pgOrderWorkerService.lambdaQuery()
-                .and(item -> item.eq(PgOrderWorker::getWorkerId, currentCompanyWechat.getUserId())
-                        .or(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()))
-                        .eq(PgOrderWorker::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
-                )
-                .list().stream().map(PgOrderWorker::getOrderBaseId).distinct().collect(Collectors.toList());
+        BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
+
+        // 根据参数动态添加筛选条件
+        if (StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber())) {
+            boolQuery.must(QueryBuilders.matchQuery("worker_idcard", currentCompanyWechat.getUser().getIdCard()));
+        }
+        else  {
+            boolQuery.must(QueryBuilders.matchQuery("worker_number", currentCompanyWechat.getUser().getWorkerNumber()));
+        }
+
+
+        // 构建查询,最大只能查两万数据
+        NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
+                .withQuery(boolQuery)
+                .withPageable(PageRequest.of(0, 10000))
+                .build();
+
+        // 执行查询
+        List<PgOrderWorkerDateEs> pgOrderWorkerEs = elasticsearchRestTemplate.search(searchQuery, PgOrderWorkerDateEs.class).map(searchHit -> searchHit.getContent())
+                .toList();
+
+        List<String> orderBaseIds = pgOrderWorkerEs.stream().map(PgOrderWorkerDateEs::getOrderBaseId).collect(Collectors.toList());
         if(CollectionUtils.isEmpty(orderBaseIds)){
             return mySchedule7Day;
         }
@@ -356,13 +391,13 @@ public class OrderBaseLogic {
     }
 
     /**
-     * 工单列表
+     * 工单列表mysql
      * @param byDay 1=今天 2=明天 3=其他
      * @param startTime
      * @param endTime
      * @return
      */
-    public IPage<OrderBaseVO> list(String keyword,String pgIncreOrderId,Boolean isYb,Boolean isWb,OrderBaseStatusEnum orderBaseStatusEnum,
+    public IPage<OrderBaseVO> listMysql(String keyword,String pgIncreOrderId,Boolean isYb,Boolean isWb,OrderBaseStatusEnum orderBaseStatusEnum,
                                    Integer byDay,String startTime,String endTime,Integer pageNum,Integer pageSize){
         CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
         if(!StringUtils.equals(currentCompanyWechat.getUser().getType(),UserTypeEnum.WORKER.getKey())){
@@ -425,7 +460,6 @@ public class OrderBaseLogic {
             orderStatusList.add(OrderBaseStatusEnum.FWZ.getKey());
             orderStatusList.add(OrderBaseStatusEnum.GCSZT.getKey());
             orderStatusList.add(OrderBaseStatusEnum.BFWG.getKey());
-            orderStatusList.add(OrderBaseStatusEnum.YZP.getKey());
             orderStatusList.add(OrderBaseStatusEnum.DSM.getKey());
 
             orderStatusList.add(OrderBaseStatusEnum.WDBH.getKey());
@@ -532,6 +566,193 @@ public class OrderBaseLogic {
     }
 
 
+
+    public IPage<OrderBaseVO> list(String keyword,String pgIncreOrderId,Boolean isYb,Boolean isWb,OrderBaseStatusEnum orderBaseStatusEnum,
+                                        Integer byDay,String startTime,String endTime,Integer pageNum,Integer pageSize){
+
+        CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
+        if(!StringUtils.equals(currentCompanyWechat.getUser().getType(),UserTypeEnum.WORKER.getKey())){
+            return new Page<>(pageNum,pageSize);
+        }
+        //查询师傅拥有工单
+        BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
+
+        // 根据参数动态添加筛选条件
+        if (StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber())) {
+            boolQuery.must(QueryBuilders.matchQuery("worker_idcard", currentCompanyWechat.getUser().getIdCard()));
+        }
+        else  {
+            boolQuery.must(QueryBuilders.matchQuery("worker_number", currentCompanyWechat.getUser().getWorkerNumber()));
+        }
+
+        // 构建查询,最大只能查两万数据
+        NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
+                .withQuery(boolQuery)
+                .withPageable(PageRequest.of(0, 10000))
+                .build();
+
+        // 执行查询
+        List<PgOrderWorkerDateEs> pgOrderWorkerEs = elasticsearchRestTemplate.search(searchQuery, PgOrderWorkerDateEs.class).map(searchHit -> searchHit.getContent())
+                .toList();
+
+        List<String> orderBaseIds = pgOrderWorkerEs.stream().map(PgOrderWorkerDateEs::getOrderBaseId).collect(Collectors.toList());
+
+
+        if(byDay != null){
+            if(byDay == 1) {
+                startTime = DateUtil.formatDateTime(DateUtil.beginOfDay(new Date()));
+                endTime = DateUtil.formatDateTime(DateUtil.endOfDay(new Date()));
+            }else if(byDay == 2){
+                startTime = DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(new Date()),1));
+                endTime = DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.endOfDay(new Date()),1));
+            }else if(byDay == 3){
+                startTime = DateUtil.formatDateTime(DateUtil.beginOfDay(new Date()));
+                endTime = DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.endOfDay(new Date()),1));
+            }
+        }
+
+        // 创建 Bool 查询
+        BoolQueryBuilder boolQueryOrder = QueryBuilders.boolQuery()
+                .mustNot(QueryBuilders.termsQuery("order_status", "YQX","FWQX","FL","FWZT","YCGB","YZP"))
+                ;
+        boolQueryOrder.must(
+                QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("id", orderBaseIds))
+                        .should(QueryBuilders.termsQuery("order_status", OrderBaseStatusEnum.DQD.getKey()))
+        );
+
+        if (!StringUtil.isEmpty(startTime)) {
+            boolQueryOrder.must(QueryBuilders.rangeQuery("create_time")
+                    .gte(startTime)
+                    .lte(endTime)
+            );
+        }
+
+        String orderStatus = orderBaseStatusEnum != null ? orderBaseStatusEnum.getKey() : null;
+
+        if(StringUtils.isNotBlank(keyword)){
+            boolQueryOrder.must(
+                    QueryBuilders.boolQuery().should(QueryBuilders.wildcardQuery("id","*"+keyword+"*"))
+                            .should(QueryBuilders.wildcardQuery("user_name","*"+keyword+"*"))
+                            .should(QueryBuilders.wildcardQuery("order_small_type_text","*"+keyword+"*"))
+                            .should(QueryBuilders.wildcardQuery("user_mobile","*"+keyword+"*"))
+                            .should(QueryBuilders.wildcardQuery("address","*"+keyword+"*"))
+            );
+        }
+
+        if(StringUtils.equals(orderStatus, OrderBaseStatusEnum.DJD.getKey())) {
+            // A 或 B 的条件
+            BoolQueryBuilder orConditionAB = QueryBuilders.boolQuery()
+                    .must(QueryBuilders.matchQuery("is_import_excel", false))
+                    .must(QueryBuilders.matchQuery("order_status",  OrderBaseStatusEnum.DJD.getKey()));
+
+            // C 或 D 的条件
+            BoolQueryBuilder orConditionCD = QueryBuilders.boolQuery()
+                    .must(QueryBuilders.matchQuery("is_import_excel", true))
+                    .must(QueryBuilders.matchQuery("is_meet", false));
+
+            boolQueryOrder
+                  .must( QueryBuilders.boolQuery()
+                          .should(orConditionAB).should(orConditionCD));
+
+        }
+
+        if(StringUtils.equals(orderStatus, OrderBaseStatusEnum.FWZ.getKey())) {
+            boolQueryOrder .must(QueryBuilders.termsQuery("order_status","FWZ","GCSZT","BFWG","DSM","XSBH","TJXSBH","ZBBH","FZXBH","WDBH"));
+
+        }
+
+        if(StringUtils.equals(orderStatus, OrderBaseStatusEnum.YCD.getKey())) {
+            boolQueryOrder.must(QueryBuilders.termsQuery("is_exception",true));
+        }
+
+        if(StringUtils.equals(orderStatus, OrderBaseStatusEnum.YWG.getKey())) {
+            boolQueryOrder.must(QueryBuilders.termsQuery("order_status","YWG","YJS","GCSZX","YWGO","WDWG"));
+
+        }
+
+        if(StringUtils.equals(orderStatus, OrderBaseStatusEnum.DQD.getKey())) {
+            boolQueryOrder.must(QueryBuilders.termsQuery("order_status","DQD"));
+
+        }
+
+        if(StringUtils.equals(orderStatus, OrderBaseStatusEnum.DCL.getKey())) {
+            boolQueryOrder.mustNot(QueryBuilders.termsQuery("order_status","YWG","YJS","GCSZX","YWGO","WDWG","DQD"));
+        }
+
+        if (pageSize == -1) {
+            pageSize = 10;
+        }
+
+        // 创建分页请求
+        Pageable pageable = PageRequest.of(pageNum-1, pageSize);
+
+        // 创建查询
+        Query searchQueryOrder = new NativeSearchQueryBuilder()
+                .withQuery(boolQueryOrder)
+                .withPageable(pageable)
+                .build();
+
+
+        SearchHits<OrderBaseEs> searchHits  = elasticsearchRestTemplate.search(searchQueryOrder, OrderBaseEs.class);
+
+
+        // 获取结果和总数
+        List<OrderBaseEs> content = searchHits.get().map(hit -> hit.getContent()).collect(Collectors.toList());
+        long totalHits = searchHits.getTotalHits();
+
+        List<OrderBaseVO> orderBaseVOS = BeanUtil.copyToList(content, OrderBaseVO.class);
+
+
+
+        //服务单标识
+        List<String> orderIds = orderBaseVOS
+                .stream()
+                .map(OrderBaseVO::getId)
+                .collect(Collectors.toList());
+        List<AdminWebsit> adminWebsits = new ArrayList<>();
+        Map<String, String> adminWebsitMap = new HashMap<>();
+
+        if (CollectionUtil.isNotEmpty(orderBaseVOS)) {
+            adminWebsits = adminWebsitService.lambdaQuery()
+                    .eq(AdminWebsit::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId())
+                    .in(AdminWebsit::getWebsitId, orderBaseVOS.stream().map(OrderBaseVO::getWebsitId).collect(Collectors.toList()))
+                    .list();
+        }
+
+        if (CollectionUtil.isNotEmpty(adminWebsits)) {
+            adminWebsitMap = adminWebsits.stream().collect(Collectors.toMap(AdminWebsit::getWebsitId, AdminWebsit::getAttr));
+        }
+
+        Map<String, List<PgOrderFlag>> mapList = this.getOrderFlags(orderIds);
+        for (OrderBaseVO orderBaseVO : orderBaseVOS) {
+            orderBaseVO.setOrderFlags(mapList.get(orderBaseVO.getId()));
+            //明细
+            orderBaseVO.setPgOrderProducts(
+                    pgOrderProductService.lambdaQuery().eq(PgOrderProduct::getOrderBaseId,orderBaseVO.getId()).list()
+            );
+            //待抢单状态隐藏
+            if(StringUtils.equals(orderBaseVO.getOrderStatus(),OrderBaseStatusEnum.DQD.getKey())){
+                orderBaseVO.setUserMobile(orderBaseVO.getUserMobile().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
+                orderBaseVO.setAddress(orderBaseVO.getProvince()+orderBaseVO.getCity()+orderBaseVO.getArea()+orderBaseVO.getStreet()+"****");
+            }
+            final String attr = adminWebsitMap.get(orderBaseVO.getWebsitId());
+
+            orderBaseVO.setAttr(attr);
+            if (StringUtils.isNotBlank(attr)
+                    && attr.equals(WebsitAttrEnum.SELF.getKey())
+                    && "安装, 拆移机".contains(orderBaseVO.getOrderSmallTypeText())) {
+                orderBaseVO.setNeedSlave(true);
+            }
+        }
+        Page<OrderBaseVO> page = new Page<>();
+        page.setRecords(orderBaseVOS);
+        page.setCurrent(pageNum);
+        page.setTotal(totalHits);
+        page.setSize(pageSize);
+
+        return page;
+    }
+
     /**
      * 客户的工单列表
      * @param flag 1=待预约 2=服务中 3=待评价 4=已完成
@@ -680,8 +901,7 @@ public class OrderBaseLogic {
         PgOrderBase pgOrderBase = pgOrderBaseService.getById(orderBaseId);
         if (!pgOrderBase.getIsImportExcel() && (!(StringUtils.equals(pgOrderBase.getOrderStatus(), OrderBaseStatusEnum.DJD.getKey())
                 || StringUtils.equals(pgOrderBase.getOrderStatus(), OrderBaseStatusEnum.DSM.getKey())
-                || StringUtils.equals(pgOrderBase.getOrderStatus(), OrderBaseStatusEnum.YZP.getKey()))
-        )) {
+                ))) {
             throw new RemoteServiceException("当前状态不可接单");
         }
 

+ 1 - 1
mall-miniapp-service/src/main/resources/mapper/workorder/OrderBaseCMapper.xml

@@ -7,7 +7,7 @@
         count(DISTINCT if((is_import_excel = false and a.order_status='DJD') or (is_import_excel = true and a.is_meet =
         false) ,a.id,null)) 'djd',
         count(DISTINCT if(a.order_status in
-        ('FWZ','GCSZT','BFWG','DSM','YZP','XSBH','TJXSBH','ZBBH','FZXBH','WDBH'),a.id,null)) 'fwz',
+        ('FWZ','GCSZT','BFWG','DSM','XSBH','TJXSBH','ZBBH','FZXBH','WDBH'),a.id,null)) 'fwz',
         count(DISTINCT if(a.is_exception=1,a.id,null)) 'ycd',
         count(DISTINCT if(a.order_status='DQD',a.id,null)) 'dqd',
         count(DISTINCT if(a.order_status in ('YWG','YJS','GCSZX','YWGO','WDWG') ,a.id,null)) 'ywg',

+ 24 - 5
mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/ESOrderBaseController.java

@@ -81,26 +81,45 @@ public class ESOrderBaseController {
         ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
         //2.查询要导出的内容
         zfireParamBean.setPageNum(1);
-        zfireParamBean.setPageSize(20000);
+        zfireParamBean.setPageSize(10000);
         IPage<OrderBaseVO> orderBaseVOIPage = orderBaseEsLogic.orderBaseEsList(zfireParamBean);
         List<OrderBaseVO> records = orderBaseVOIPage.getRecords();
-        if (records.size() == 20000){
+        if (records.size() == 10000){
             zfireParamBean.setPageNum(2);
-            zfireParamBean.setPageSize(20000);
+            zfireParamBean.setPageSize(10000);
             IPage<OrderBaseVO> orderBaseVOIPage2 = orderBaseEsLogic.orderBaseEsList(zfireParamBean);
 
             records.addAll(orderBaseVOIPage2.getRecords());
 
         }
 
-        if (records.size() == 40000){
+        if (records.size() == 20000){
             zfireParamBean.setPageNum(3);
-            zfireParamBean.setPageSize(20000);
+            zfireParamBean.setPageSize(10000);
+            IPage<OrderBaseVO> orderBaseVOIPage3 = orderBaseEsLogic.orderBaseEsList(zfireParamBean);
+
+            records.addAll(orderBaseVOIPage3.getRecords());
+
+        }
+
+        if (records.size() == 30000){
+            zfireParamBean.setPageNum(4);
+            zfireParamBean.setPageSize(10000);
             IPage<OrderBaseVO> orderBaseVOIPage3 = orderBaseEsLogic.orderBaseEsList(zfireParamBean);
 
             records.addAll(orderBaseVOIPage3.getRecords());
 
         }
+
+        if (records.size() == 40000){
+            zfireParamBean.setPageNum(5);
+            zfireParamBean.setPageSize(10000);
+            IPage<OrderBaseVO> orderBaseVOIPage3 = orderBaseEsLogic.orderBaseEsList(zfireParamBean);
+
+            records.addAll(orderBaseVOIPage3.getRecords());
+
+        }
+
         //3.导出
         FieldUtils.exportData(records, zfireParam.getExportFields(), request, response);
     }

+ 4 - 1
mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/OrderBaseController.java

@@ -19,6 +19,7 @@ import com.gree.mall.manager.enums.workorder.OrderFlagEnum;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.logic.workorder.OrderBaseEsLogic;
 import com.gree.mall.manager.logic.workorder.OrderBaseExcelLogic;
 import com.gree.mall.manager.logic.workorder.OrderBaseLogic;
 import com.gree.mall.manager.logic.workorder.OrderLogLogic;
@@ -60,6 +61,7 @@ public class OrderBaseController {
     private final OrderLogLogic orderLogLogic;
     private final RedisLockRegistry redisLockRegistry;
     private final CommonLogic commonLogic;
+    private final OrderBaseEsLogic orderBaseEsLogic;
 
     @ZfireList
     @PostMapping("/list")
@@ -104,7 +106,8 @@ public class OrderBaseController {
             @RequestParam(required = false) String orderSmallType,
             @RequestParam(required = false) String orderSmallTypeText
     ) {
-        List<Map<String, Object>> maps = orderBaseLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText);
+        List<Map<String, Object>> maps = orderBaseEsLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText);
+       // List<Map<String, Object>> maps = orderBaseLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText);
         return ResponseHelper.success(maps);
     }
 

+ 119 - 42
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseCountLogic.java

@@ -1,5 +1,6 @@
 package com.gree.mall.manager.logic.workorder;
 
+import cn.hutool.core.convert.Convert;
 import cn.hutool.core.date.DateUtil;
 import com.google.common.collect.Lists;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
@@ -54,32 +55,121 @@ public class OrderBaseCountLogic {
     public OrderBaseCountBean baseCountBean( String startTime,
                                              String endTime){
         AdminUserCom adminUser = commonLogic.getAdminUser();
-        OrderBaseCountBean orderBaseCountBean = orderBaseCMapper
-                .countOrderBaseIndex(adminUser.getCompanyWechatId(), adminUser.getAdminWebsitIds(),adminUser.getType()
-                ,startTime,endTime);
-
-/*
-        List<PgOrderBase> pgOrderBaseList = pgOrderBaseService.lambdaQuery()
-                .select(PgOrderBase::getOrderType, PgOrderBase::getOrderTypeText, PgOrderBase::getCreateTime, PgOrderBase::getId
-                        , PgOrderBase::getOrderStatus,PgOrderBase::getAppointmentTime)
-                .between(PgOrderBase::getCreateTime, DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -30)), new Date())
-                .in(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()),PgOrderBase::getCompanyWechatId,adminUser.getCompanyWechatId())
-                .and(CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds()),
-                        v -> v.in(PgOrderBase::getWebsitId,adminUser.getAdminWebsitIds()).or()
-                                .in(PgOrderBase::getCreateWebsitId,adminUser.getAdminWebsitIds()))
-                .list();
-*/
-
-/*
-        List<PgOrderBase> pgOrderBaseListOver = pgOrderBaseService.lambdaQuery()
-                .select(PgOrderBase::getOrderType, PgOrderBase::getOrderTypeText, PgOrderBase::getCreateTime, PgOrderBase::getId
-                        , PgOrderBase::getOrderStatus,PgOrderBase::getAppointmentTime,PgOrderBase::getOverDate,PgOrderBase::getOverTime)
-                .between(PgOrderBase::getOverTime, DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -8)), new Date())
-                .in(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()),PgOrderBase::getCompanyWechatId,adminUser.getCompanyWechatId())
-                .and(CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds()),
-                        v -> v.in(PgOrderBase::getWebsitId,adminUser.getAdminWebsitIds()).or().in(PgOrderBase::getCreateWebsitId,adminUser.getAdminWebsitIds()))
-                .list();
-*/
+        OrderBaseCountBean orderBaseCountBean = new OrderBaseCountBean();
+
+        BoolQueryBuilder queryBuilderCount = QueryBuilders.boolQuery();
+
+        if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds())) {
+            queryBuilderCount.must(
+                    QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("create_websit_id", adminUser.getAdminWebsitIds()))
+                            .should(QueryBuilders.termsQuery("websit_id", adminUser.getAdminWebsitIds()))
+            );
+        }
+
+        if (startTime != null){
+            queryBuilderCount.must(QueryBuilders.rangeQuery("create_time")
+                    .gte(startTime)
+                    .lte(endTime)
+            );
+        }
+
+        //待派工
+        NativeSearchQuery searchQueryDPG = new NativeSearchQueryBuilder()
+                .withQuery(queryBuilderCount)
+                .withPageable(PageRequest.of(1, 1))
+                .addAggregation(this.getAggs(AggregationBuilders.filter("DPG", QueryBuilders.boolQuery()
+                        .must(QueryBuilders.termsQuery("order_status","DSHPG","CJ","YPD","DXSPD","DZBPG","DWDSPGP","DXSSPGP","DTJXSSPGP","DZBSPGP","DFZXPD","DFZXSPGP","DWDPG","DWDPD")
+                ))))
+                .build();
+        SearchHits responseDPG = elasticsearchRestTemplate.search(searchQueryDPG, OrderBaseEs.class);
+
+        orderBaseCountBean.setDpg(Convert.toInt(this.getWorkerOrderCountResult(responseDPG.getAggregations(),"DPG")));
+
+
+        //待接收
+        NativeSearchQuery searchQueryDJS = new NativeSearchQueryBuilder()
+                .withQuery(queryBuilderCount)
+                .withPageable(PageRequest.of(1, 1))
+                .addAggregation(this.getAggs(AggregationBuilders.filter("DJS", QueryBuilders.boolQuery()
+                        .must(QueryBuilders.boolQuery().should(QueryBuilders.termsQuery("is_meet", false))
+                                .should(QueryBuilders.termsQuery("order_status", "DJD")))
+                        .mustNot(QueryBuilders.termsQuery("order_status", "YQX", "FWQX", "FL", "FWZT", "YCGB"))
+                )))
+                .build();
+        SearchHits responseDJS = elasticsearchRestTemplate.search(searchQueryDJS, OrderBaseEs.class);
+
+        orderBaseCountBean.setDjs(Convert.toInt(this.getWorkerOrderCountResult(responseDJS.getAggregations(),"DJS")));
+
+
+        //待抢单
+        NativeSearchQuery searchQueryDQD = new NativeSearchQueryBuilder()
+                .withQuery(queryBuilderCount)
+                .withPageable(PageRequest.of(1, 1))
+                .addAggregation(this.getAggs(AggregationBuilders.filter("DQD", QueryBuilders.boolQuery()
+                        .must(QueryBuilders.termsQuery("order_status","DQD")
+                        ))))
+                .build();
+        SearchHits responseDQD = elasticsearchRestTemplate.search(searchQueryDQD, OrderBaseEs.class);
+
+        orderBaseCountBean.setDqd(Convert.toInt(this.getWorkerOrderCountResult(responseDQD.getAggregations(),"DQD")));
+
+
+        //服务中
+        NativeSearchQuery searchQueryfwz = new NativeSearchQueryBuilder()
+                .withQuery(queryBuilderCount)
+                .withPageable(PageRequest.of(1, 1))
+                .addAggregation(this.getAggs(AggregationBuilders.filter("fwz", QueryBuilders.boolQuery()
+                        .must(QueryBuilders.termsQuery("order_status","FWZ","GCSZT","BFWG","DSM","WDBH","XSBH","TJXSBH","ZBBH","FZXBH")
+                        ))))
+                .build();
+        SearchHits responsefwz = elasticsearchRestTemplate.search(searchQueryfwz, OrderBaseEs.class);
+
+        orderBaseCountBean.setFwz(Convert.toInt(this.getWorkerOrderCountResult(responsefwz.getAggregations(),"fwz")));
+
+
+        //待预约
+        NativeSearchQuery searchQueryDYY = new NativeSearchQueryBuilder()
+                .withQuery(queryBuilderCount)
+                .withPageable(PageRequest.of(1, 1))
+                .addAggregation(this.getAggs(AggregationBuilders.filter("DYY", QueryBuilders.boolQuery()
+                        .mustNot(QueryBuilders.termsQuery("order_status","YWG","GCSZX","WDWG","YWGO","YQX","FWZT","YCGB",
+                                "FWQX","FL","YJS","LRCD","DSHPG","CJ","YPD","DXSPD","DZBPG","DWDSPGP","DXSSPGP","DTJXSSPGP","DZBSPGP")
+                        )
+                        .mustNot(QueryBuilders.existsQuery("appointment_time"))
+                )))
+                .build();
+        SearchHits responseDYY = elasticsearchRestTemplate.search(searchQueryDYY, OrderBaseEs.class);
+
+        orderBaseCountBean.setDyy(Convert.toInt(this.getWorkerOrderCountResult(responseDYY.getAggregations(),"DYY")));
+
+        //异常单处理
+        NativeSearchQuery searchQueryYCDCL = new NativeSearchQueryBuilder()
+                .withQuery(queryBuilderCount)
+                .withPageable(PageRequest.of(1, 1))
+                .addAggregation(this.getAggs(AggregationBuilders.filter("YCDCL", QueryBuilders.boolQuery()
+                        .mustNot(QueryBuilders.termsQuery("order_status","YWG","YWGO","YJS"))
+                        .must(QueryBuilders.termsQuery("is_exception",true))
+
+                )))
+                .build();
+        SearchHits responseYCDCL = elasticsearchRestTemplate.search(searchQueryYCDCL, OrderBaseEs.class);
+
+        orderBaseCountBean.setYcdcl(Convert.toInt(this.getWorkerOrderCountResult(responseYCDCL.getAggregations(),"YCDCL")));
+
+
+        //差评
+        NativeSearchQuery searchQueryCP = new NativeSearchQueryBuilder()
+                .withQuery(queryBuilderCount)
+                .withPageable(PageRequest.of(1, 1))
+                .addAggregation(this.getAggs(AggregationBuilders.filter("CP", QueryBuilders.boolQuery()
+                        .must(QueryBuilders.termsQuery("appraise_status","C"))
+
+                )))
+                .build();
+        SearchHits responseCP = elasticsearchRestTemplate.search(searchQueryCP, OrderBaseEs.class);
+
+        orderBaseCountBean.setCp(Convert.toInt(this.getWorkerOrderCountResult(responseCP.getAggregations(),"CP")));
+
 
         Map<String,List<Long>> qtddqs = new HashMap<>();
 
@@ -107,10 +197,7 @@ public class OrderBaseCountLogic {
 
         for (int i = 6; i >= 0; i--) {
             Integer day = i*-1;
-       /*     Long xzgd = pgOrderBaseList.stream().filter(item -> item.getCreateTime().before(DateUtil.endOfDay(DateUtil.offsetDay(new Date(), (day)))) &&
-                    item.getCreateTime().after(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (day))))
-            ).count();
-*/
+
             BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
 
             if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds())) {
@@ -120,10 +207,7 @@ public class OrderBaseCountLogic {
                 );
             }
 
-      /*      queryBuilder.must(QueryBuilders.rangeQuery("create_time")
-                    .gte(startTime)
-                    .lte(endTime)
-            );*/
+
             //新增工单
             NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
                     .withQuery(queryBuilder)
@@ -138,9 +222,7 @@ public class OrderBaseCountLogic {
 
             xzgdList.add(this.getWorkerOrderCountResult(response.getAggregations(),"xzgd"));
 
-    /*        Long wgd = pgOrderBaseListOver.stream().filter(item -> item.getOverTime().before(DateUtil.endOfDay(DateUtil.offsetDay(new Date(), (day)))) &&
-                            item.getOverTime().after(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (day))))
-                            && orderStatus.contains(item.getOrderStatus())      ).count();*/
+
 
 
             //完工单
@@ -159,11 +241,6 @@ public class OrderBaseCountLogic {
 
 
 
-/*            Long jxz = pgOrderBaseList.stream().filter(item -> item.getCreateTime().before(DateUtil.endOfDay(DateUtil.offsetDay(new Date(), (day)))) &&
-                    item.getCreateTime().after(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), (day))))
-                    && !orderStatus.contains(item.getOrderStatus())
-                    && !orderStatusQx.contains(item.getOrderStatus())
-            ).count();*/
 
 
             //待商户派工

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

@@ -201,7 +201,7 @@ public class OrderBaseEsLogic {
                 ){
 
                     queryBuilder.mustNot(QueryBuilders.existsQuery("appointment_time"));
-                    queryBuilder.mustNot(QueryBuilders.termsQuery("order_status", "YWG", "GCSZX", "WDWG", "YWGO", "YQX", "FWZT", "YCGB",
+                    queryBuilder.mustNot(QueryBuilders.termsQuery("order_status", "YWG", "GCSZX", "WDWG", "YWGO", "YQX", "FWZT", "YCGB","YZP",
                                     "FWQX", "FL", "YJS", "LRCD", "DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP"));
 
                     continue;
@@ -220,7 +220,7 @@ public class OrderBaseEsLogic {
                 ){
 
                     queryBuilder.must(QueryBuilders.boolQuery()
-                            .mustNot(QueryBuilders.termsQuery("order_status","YQX", "FWQX", "FL", "FWZT", "YCGB"))
+                            .mustNot(QueryBuilders.termsQuery("order_status","YQX", "FWQX", "FL", "FWZT", "YCGB","YZP"))
                             .must(QueryBuilders.boolQuery().should(QueryBuilders.termQuery("is_meet", false))
                                     .should(QueryBuilders.termsQuery("order_status", "DJD"))));
                     continue;
@@ -285,14 +285,13 @@ public class OrderBaseEsLogic {
 
     public void test() {
 
-   /*     boolean a = elasticsearchRestTemplate.indexOps(OrderBaseEsDate.class).delete();
+        boolean a = elasticsearchRestTemplate.indexOps(OrderBaseEsDate.class).delete();
         IndexOperations indexOperations1 = elasticsearchRestTemplate.indexOps(OrderBaseEsDate.class);
         if (!indexOperations1.exists()) {
             indexOperations1.create();
             Document document = indexOperations1.createMapping();
             indexOperations1.putMapping(document);
         }
-*/
 /*
         List<PgOrderBase> list = pgOrderBaseService.lambdaQuery().list();
 
@@ -352,7 +351,7 @@ public class OrderBaseEsLogic {
                 .withPageable(PageRequest.of(1, 1))
                 .addAggregation(this.getAggs(AggregationBuilders.filter("DYY", QueryBuilders.boolQuery()
                         .mustNot(QueryBuilders.existsQuery("appointment_time"))
-                        .mustNot(QueryBuilders.termsQuery("order_status", "YWG", "GCSZX", "WDWG", "YWGO", "YQX", "FWZT", "YCGB",
+                        .mustNot(QueryBuilders.termsQuery("order_status", "YWG", "GCSZX", "WDWG", "YWGO", "YQX", "FWZT", "YCGB","YZP",
                                 "FWQX", "FL", "YJS", "LRCD", "DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP"))
                         .must(QueryBuilders.rangeQuery("create_time")
                                 .gte(startTime)
@@ -421,7 +420,7 @@ public class OrderBaseEsLogic {
                 .withQuery(queryBuilder)
                 .withPageable(PageRequest.of(1, 1))
                 .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","YZP"))
                         .must(QueryBuilders.boolQuery().should(QueryBuilders.termQuery("is_meet", false))
                         .should(QueryBuilders.termsQuery("order_status", "DJD")))
                         )))
@@ -440,7 +439,7 @@ public class OrderBaseEsLogic {
                 .withPageable(PageRequest.of(1, 1))
                 .addAggregation(this.getAggs(AggregationBuilders.filter("FWZ", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termsQuery("order_status","FWZ","GCSZT","BFWG",
-                                "DSM","YZP","WDBH", "XSBH","TJXSBH","ZBBH","FZXBH")))))
+                                "DSM","WDBH", "XSBH","TJXSBH","ZBBH","FZXBH")))))
                 .build();
         SearchHits responseFWZ = elasticsearchRestTemplate.search(searchQueryfwz, OrderBaseEs.class);
 
@@ -503,7 +502,7 @@ public class OrderBaseEsLogic {
                 .withQuery(queryBuilder)
                 .withPageable(PageRequest.of(1, 1))
                 .addAggregation(this.getAggs(AggregationBuilders.filter("YQX", QueryBuilders.boolQuery()
-                        .must(QueryBuilders.termsQuery("order_status","YQX","FWZT","YCGB","FWQX","FL")))))
+                        .must(QueryBuilders.termsQuery("order_status","YZP","YQX","FWZT","YCGB","FWQX","FL")))))
                 .build();
         SearchHits responseYQX = elasticsearchRestTemplate.search(searchQueryYQX, OrderBaseEs.class);
 

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseLogic.java

@@ -2369,7 +2369,7 @@ public class OrderBaseLogic {
                 .notIn(!StringUtil.isEmpty(jsmWorkerOrder.getStatus()) && jsmWorkerOrder.getStatus().equals("DYY"),PgOrderBase::getOrderStatus,"YWG","GCSZX","WDWG","YWGO","YQX","FWZT","YCGB",
                         "FWQX","FL","YJS","LRCD","DSHPG","CJ","YPD","DXSPD","DZBPG","DWDSPGP","DXSSPGP","DTJXSSPGP","DZBSPGP")
                 .in(!StringUtil.isEmpty(jsmWorkerOrder.getStatus()) && jsmWorkerOrder.getStatus().equals("DFW"),PgOrderBase::getOrderStatus,"DSHPG","CJ","YPD","DXSPD","DZBPG","DWDSPGP","DXSSPGP","DTJXSSPGP","DZBSPGP","DFZXPD",
-                        "DFZXSPGP","DWDPG","DWDPD","FWZ","GCSZT","BFWG","DSM","YZP","WDBH","XSBH","TJXSBH","ZBBH","FZXBH")
+                        "DFZXSPGP","DWDPG","DWDPD","FWZ","GCSZT","BFWG","DSM","WDBH","XSBH","TJXSBH","ZBBH","FZXBH")
                 .in(!StringUtil.isEmpty(jsmWorkerOrder.getStatus()) && jsmWorkerOrder.getStatus().equals("DPJ"),PgOrderBase::getAppraiseStatus,"N")
                 .isNotNull(!StringUtil.isEmpty(jsmWorkerOrder.getStatus()) && jsmWorkerOrder.getStatus().equals("DPJ"),PgOrderBase::getOverTime)
 

+ 1 - 1
mall-server-api/src/main/resources/mapper/workorder/OrderBaseCMapper.xml

@@ -238,7 +238,7 @@
             count(if(order_status in ('DSHPG','CJ','YPD','DXSPD','DZBPG','DWDSPGP','DXSSPGP','DTJXSSPGP','DZBSPGP','DFZXPD','DFZXSPGP','DWDPG','DWDPD'),1,null)) as 'dpg',
             count(if((a.is_meet =0 or a.order_status  IN ('DJD')) and a.order_status not in ('YQX','FWQX','FL','FWZT','YCGB'),1,null)) as 'djs',
             count(if(order_status in ('DQD'),1,null)) as 'dqd',
-            count(if(order_status in ('FWZ','GCSZT','BFWG','DSM','YZP','WDBH','XSBH','TJXSBH','ZBBH','FZXBH'),1,null)) as 'fwz',
+            count(if(order_status in ('FWZ','GCSZT','BFWG','DSM','WDBH','XSBH','TJXSBH','ZBBH','FZXBH'),1,null)) as 'fwz',
             count(if(appointment_time is null  and a.order_status not in ('YWG','GCSZX','WDWG','YWGO','YQX','FWZT','YCGB',
         'FWQX','FL','YJS','LRCD','DSHPG','CJ','YPD','DXSPD','DZBPG','DWDSPGP','DXSSPGP','DTJXSSPGP','DZBSPGP'
         ),1,null)) as 'dyy',

+ 1 - 1
mall-server-sync-api/src/main/resources/mapper/workorder/OrderBaseCMapper.xml

@@ -133,7 +133,7 @@
             count(if(order_status in ('DSHPG','DWDPG','DSHPG','CJ','YPD','DXSPD','DZBPG','DWDSPGP','DXSSPGP','DTJXSSPGP','DZBSPGP','DFZXPD','DFZXSPGP'),1,null)) as 'dpg',
             count(if((a.is_meet =0 or a.order_status  IN ('DJD')) and a.order_status not in ('YQX','FWQX','FL','FWZT','YCGB'),1,null)) as 'djs',
             count(if(order_status in ('DQD'),1,null)) as 'dqd',
-            count(if(order_status in ('FWZ','GCSZT','BFWG','DSM','YZP','WDBH','XSBH','TJXSBH','ZBBH','FZXBH'),1,null)) as 'fwz',
+            count(if(order_status in ('FWZ','GCSZT','BFWG','DSM','WDBH','XSBH','TJXSBH','ZBBH','FZXBH'),1,null)) as 'fwz',
             count(if(appointment_time is null  and a.order_status not in ('YWG','GCSZX','WDWG','YWGO','YQX','FWZT','YCGB',
         'FWQX','FL','YJS','LRCD','DSHPG','CJ','YPD','DXSPD','DZBPG','DWDSPGP','DXSSPGP','DTJXSSPGP','DZBSPGP'
         ),1,null)) as 'dyy',