Selaa lähdekoodia

Merge branch 'develop-FB'

‘linchangsheng’ 1 viikko sitten
vanhempi
commit
cc30316a2a
23 muutettua tiedostoa jossa 4140 lisäystä ja 152 poistoa
  1. 3 0
      mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/workorder/OrderBaseLogic.java
  2. 551 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBase2022Es.java
  3. 551 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBase2023Es.java
  4. 551 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBase2024Es.java
  5. 553 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBaseEs2022Date.java
  6. 553 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBaseEs2023Date.java
  7. 553 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBaseEs2024Date.java
  8. 3 1
      mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/CommonMapper.java
  9. 5 4
      mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/ChangeOrderController.java
  10. 9 6
      mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/ESOrderBaseController.java
  11. 18 13
      mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/OrderBaseController.java
  12. 6 2
      mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/OrderBaseCountController.java
  13. 14 0
      mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2022EsRepository.java
  14. 14 0
      mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2023EsRepository.java
  15. 14 0
      mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2024EsRepository.java
  16. 159 5
      mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/ChangeOrderLogic.java
  17. 41 14
      mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseCountLogic.java
  18. 358 80
      mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseEsLogic.java
  19. 91 15
      mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseLogic.java
  20. 33 10
      mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderFlagLogic.java
  21. 47 1
      mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderLogLogic.java
  22. 12 0
      mall-server-api/src/main/java/com/gree/mall/manager/utils/CommonUtils.java
  23. 1 1
      mall-server-api/src/main/resources/mapper/CommonMapper.xml

+ 3 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/workorder/OrderBaseLogic.java

@@ -38,6 +38,8 @@ 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.elasticsearch.search.sort.SortBuilders;
+import org.elasticsearch.search.sort.SortOrder;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Pageable;
@@ -689,6 +691,7 @@ public class OrderBaseLogic {
         // 创建查询
         Query searchQueryOrder = new NativeSearchQueryBuilder()
                 .withQuery(boolQueryOrder)
+                .withSort(SortBuilders.fieldSort("create_time").order(SortOrder.DESC))
                 .withPageable(pageable)
                 .build();
 

+ 551 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBase2022Es.java

@@ -0,0 +1,551 @@
+package com.gree.mall.manager.bean.es;
+
+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.math.BigDecimal;
+
+/**
+ * @author qinrongjun
+ * @description
+ * @date 2023/6/19 10:39 星期一
+ */
+@Data
+@Document(indexName = "pg_order_base2022")
+public class OrderBase2022Es {
+
+    @Id
+    @Field(value = "id", type = FieldType.Keyword)
+    private String id;
+
+    @ApiModelProperty(value = "服务说明(例如:家用空调x1,洗衣机x1)")
+    @Field(value = "order_title", type = FieldType.Keyword)
+    private String orderTitle;
+
+    @ApiModelProperty(value = "所属业务线   INSTALL=安装 REPAIR=维修")
+    @Field(value = "order_type", type = FieldType.Keyword)
+    private String orderType;
+
+    @ApiModelProperty(value = "所属业务线名称")
+    @Field(value = "order_type_text", type = FieldType.Keyword)
+    private String orderTypeText;
+
+    @ApiModelProperty(value = "工单类型")
+    @Field(value = "order_small_type", type = FieldType.Keyword)
+    private String orderSmallType;
+
+    @ApiModelProperty(value = "工单类型名称")
+    @Field(value = "order_small_type_text", type = FieldType.Keyword)
+    private String orderSmallTypeText;
+
+    @ApiModelProperty(value = "商户id")
+    @Field(value = "company_wechat_id", type = FieldType.Keyword)
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "商户名称")
+    @Field(value = "company_wechat_name", type = FieldType.Keyword)
+    private String companyWechatName;
+
+    @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_idcard", type = FieldType.Keyword)
+    private String workerIdcard;
+
+    @ApiModelProperty(value = "所有师傅的id(冗余字段),实际请看order_worker")
+    @Field(value = "worker_id_list", type = FieldType.Keyword)
+    private String workerIdList;
+
+    @ApiModelProperty(value = "工单状态 DYY=待预约 DSHPG=待商户派工 DWDPG=待网点派工 DQD=待抢单 DJD=待接单 FWZ=服务中 YCD=异常单 YWG=已完工待结算 YJS=已结算 YQX=已取消")
+    @Field(value = "order_status", type = FieldType.Keyword)
+    private String orderStatus;
+
+    @ApiModelProperty(value = "工单状态中文名称")
+    @Field(value = "order_status_text", type = FieldType.Keyword)
+    private String orderStatusText;
+
+    @ApiModelProperty(value = "派单给师傅的时间")
+    @Field(value = "dispatch_time", type = FieldType.Date,format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String dispatchTime;
+
+    @ApiModelProperty(value = "师傅接单时间")
+    @Field(value = "worker_rece_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String workerReceTime;
+
+    @ApiModelProperty(value = "派工网点时间")
+    @Field(value = "dispatch_websit_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String dispatchWebsitTime;
+
+    @ApiModelProperty(value = "客户id(客户建单才有)")
+    @Field(value = "user_id", type = FieldType.Keyword)
+    private String userId;
+
+    @ApiModelProperty(value = "客户名称")
+    @Field(value = "user_name", type = FieldType.Keyword)
+    private String userName;
+
+    @ApiModelProperty(value = "联系人")
+    @Field(value = "link_name", type = FieldType.Keyword)
+    private String linkName;
+
+    @ApiModelProperty(value = "客户电话")
+    @Field(value = "user_mobile", type = FieldType.Keyword)
+    private String userMobile;
+
+    @ApiModelProperty(value = "客户电话2")
+    @Field(value = "user_mobile2", type = FieldType.Keyword)
+    private String userMobile2;
+
+    @ApiModelProperty(value = "省")
+    @Field(value = "province", type = FieldType.Keyword)
+    private String province;
+
+    @ApiModelProperty(value = "省id")
+    @Field(value = "province_id", type = FieldType.Keyword)
+    private String provinceId;
+
+    @ApiModelProperty(value = "市")
+    @Field(value = "city", type = FieldType.Keyword)
+    private String city;
+
+    @ApiModelProperty(value = "市id")
+    @Field(value = "city_id", type = FieldType.Keyword)
+    private String cityId;
+
+    @ApiModelProperty(value = "区")
+    @Field(value = "area", type = FieldType.Keyword)
+    private String area;
+
+    @ApiModelProperty(value = "区id")
+    @Field(value = "area_id", type = FieldType.Keyword)
+    private String areaId;
+
+    @ApiModelProperty(value = "街道")
+    @Field(value = "street", type = FieldType.Keyword)
+    private String street;
+
+    @ApiModelProperty(value = "街道id")
+    @Field(value = "street_id", type = FieldType.Keyword)
+    private String streetId;
+
+    @ApiModelProperty(value = "详细地址")
+    @Field(value = "address", type = FieldType.Keyword)
+    private String address;
+
+    @ApiModelProperty(value = "备注")
+    @Field(value = "remark", type = FieldType.Keyword)
+    private String remark;
+
+    @ApiModelProperty(value = "安装或维修网点名称(售后网点)")
+    @Field(value = "websit_name", type = FieldType.Keyword)
+    private String websitName;
+
+    @ApiModelProperty(value = "安装或维修网点编号(售后网点)")
+    @Field(value = "websit_id", type = FieldType.Keyword)
+    private String websitId;
+
+    @ApiModelProperty(value = "售后网点联系电话")
+    @Field(value = "websit_phone", type = FieldType.Keyword)
+    private String websitPhone;
+
+    @ApiModelProperty(value = "创建网点编号")
+    @Field(value = "create_websit_id", type = FieldType.Keyword)
+    private String createWebsitId;
+
+    @ApiModelProperty(value = "创建网点名称")
+    @Field(value = "create_websit_name", type = FieldType.Keyword)
+    private String createWebsitName;
+
+    @ApiModelProperty(value = "gps地址信息")
+    @Field(value = "gps_address", type = FieldType.Keyword)
+    private String gpsAddress;
+
+    @ApiModelProperty(value = "最新反馈记录")
+    @Field(value = "last_operator", type = FieldType.Keyword)
+    private String lastOperator;
+
+    @ApiModelProperty(value = "最近操作网点")
+    @Field(value = "last_operator_websit", type = FieldType.Keyword)
+    private String lastOperatorWebsit;
+
+    @ApiModelProperty(value = "最近操作网点编号")
+    @Field(value = "last_operator_by", type = FieldType.Keyword)
+    private String lastOperatorBy;
+
+    @ApiModelProperty(value = "最近操作时间")
+    @Field(value = "last_operator_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String lastOperatorTime;
+
+    @ApiModelProperty(value = "预约安装/维修时间")
+    @Field(value = "appointment_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appointmentTime;
+
+    @ApiModelProperty(value = "预约结束时间")
+    @Field(value = "appointment_end_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appointmentEndTime;
+
+    @ApiModelProperty(value = "预约备注")
+    @Field(value = "appointment_remark", type = FieldType.Keyword)
+    private String appointmentRemark;
+
+    @ApiModelProperty(value = "安装/维修总数量")
+    @Field(value = "total_num", type = FieldType.Keyword)
+    private Integer totalNum;
+
+    @ApiModelProperty(value = "未完成数量")
+    @Field(value = "undone_num", type = FieldType.Keyword)
+    private Integer undoneNum;
+
+    @ApiModelProperty(value = "经度")
+    @Field(value = "lng", type = FieldType.Keyword)
+    private String lng;
+
+    @ApiModelProperty(value = "纬度")
+    @Field(value = "lat", type = FieldType.Keyword)
+    private String lat;
+
+    @ApiModelProperty(value = "师傅报完工时间")
+    @Field(value = "over_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String overTime;
+
+    @ApiModelProperty(value = "网点报完工时间")
+    @Field(value = "websit_over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String websitOverTime;
+
+    @ApiModelProperty(value = "完工时间(精确到天)")
+    @Field(value = "over_date", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String overDate;
+
+    @ApiModelProperty(value = "正常关闭时间")
+    @Field(value = "close_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String closeTime;
+
+    @ApiModelProperty(value = "创建时间(精确到天)")
+    @Field(value = "create_date", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String createDate;
+
+    @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 = "create_mobile", type = FieldType.Keyword)
+    private String createMobile;
+
+    @ApiModelProperty(value = "创建人")
+    @Field(value = "create_by", type = FieldType.Keyword)
+    private String createBy;
+
+    @ApiModelProperty(value = "创建人名称")
+    @Field(value = "create_name", type = FieldType.Keyword)
+    private String createName;
+
+    @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 = "update_by", type = FieldType.Keyword)
+    private String updateBy;
+
+    @ApiModelProperty(value = "首次评价(A:好评,B:中评,C:差评,N:未评价,O:其他")
+    @Field(value = "appraise_status", type = FieldType.Keyword)
+    private String appraiseStatus;
+
+    @ApiModelProperty(value = "首次评价内容")
+    @Field(value = "appraise_content", type = FieldType.Keyword)
+    private String appraiseContent;
+
+    @ApiModelProperty(value = "首次评价时间")
+    @Field(value = "appraise_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appraiseTime;
+
+    @ApiModelProperty(value = "评价来源 1=用户评价 2=商家评价")
+    @Field(value = "appraise_source", type = FieldType.Keyword)
+    private Integer appraiseSource;
+
+    @ApiModelProperty(value = "多个图片逗号隔开")
+    @Field(value = "appraise_img_url", type = FieldType.Keyword)
+    private String appraiseImgUrl;
+
+    @ApiModelProperty(value = "师傅记事备注")
+    @Field(value = "worker_remark", type = FieldType.Keyword)
+    private String workerRemark;
+
+    @ApiModelProperty(value = "销售单位")
+    @Field(value = "sale_company", type = FieldType.Keyword)
+    private String saleCompany;
+
+    @ApiModelProperty(value = "最近一次操作预约/改约的时间")
+    @Field(value = "last_operator_appointment_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String lastOperatorAppointmentTime;
+
+    @ApiModelProperty(value = "工单渠道id")
+    @Field(value = "order_channel_id", type = FieldType.Keyword)
+    private String orderChannelId;
+
+    @ApiModelProperty(value = "工单渠道")
+    @Field(value = "order_channel_text", type = FieldType.Keyword)
+    private String orderChannelText;
+
+    @ApiModelProperty(value = "改约备注")
+    @Field(value = "change_remark", type = FieldType.Keyword)
+    private String changeRemark;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sale_order_id", type = FieldType.Keyword)
+    private String saleOrderId;
+
+    @ApiModelProperty(value = "销售单下单时间")
+    @Field(value = "sale_create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String saleCreateTime;
+
+    @ApiModelProperty(value = "销售单订单金额")
+    @Field(value = "sale_total_amount", type = FieldType.Keyword)
+    private BigDecimal saleTotalAmount;
+
+    @ApiModelProperty(value = "销售单备注")
+    @Field(value = "sale_remark", type = FieldType.Keyword)
+    private String saleRemark;
+
+    @ApiModelProperty(value = "内部来源")
+    @Field(value = "source", type = FieldType.Keyword)
+    private String source;
+
+    @ApiModelProperty(value = "完工反馈备注")
+    @Field(value = "over_remark", type = FieldType.Keyword)
+    private String overRemark;
+
+    @ApiModelProperty(value = "客户签名")
+    @Field(value = "user_sign", type = FieldType.Keyword)
+    private String userSign;
+
+    @ApiModelProperty(value = "是否为导入工单,true=是 false=否")
+    @Field(value = "is_import", type = FieldType.Keyword)
+    private Boolean isImport;
+
+    @ApiModelProperty(value = "是否已采集 YES 是 NO 否")
+    @Field(value = "is_gather", type = FieldType.Keyword)
+    private String isGather;
+
+    @ApiModelProperty(value = "是否异常工单 true/false")
+    @Field(value = "is_exception", type = FieldType.Keyword)
+    private Boolean isException;
+
+    @ApiModelProperty(value = "增置服务id")
+    @Field(value = "pg_incre_id", type = FieldType.Keyword)
+    private String pgIncreId;
+
+    @ApiModelProperty(value = "增置服务订单id")
+    @Field(value = "pg_incre_order_id", type = FieldType.Keyword)
+    private String pgIncreOrderId;
+
+    @ApiModelProperty(value = "增置服务明细id")
+    @Field(value = "pg_incre_item_id", type = FieldType.Keyword)
+    private String pgIncreItemId;
+
+    @ApiModelProperty(value = "增置服务售卖网点")
+    @Field(value = "pg_incre_websit_name", type = FieldType.Keyword)
+    private String pgIncreWebsitName;
+
+    @ApiModelProperty(value = "增置服务售卖网点id")
+    @Field(value = "pg_incre_websit_id", type = FieldType.Keyword)
+    private String pgIncreWebsitId;
+
+    @ApiModelProperty(value = "结算服务费用")
+    @Field(value = "settle_service_amount", type = FieldType.Keyword)
+    private BigDecimal settleServiceAmount;
+
+    @ApiModelProperty(value = "维保基础id")
+    @Field(value = "rp_project_repair_id", type = FieldType.Keyword)
+    private String rpProjectRepairId;
+
+    @ApiModelProperty(value = "工程维保名称")
+    @Field(value = "rp_project_repair_name", type = FieldType.Keyword)
+    private String rpProjectRepairName;
+
+    @ApiModelProperty(value = "费用支付方式 EXAMINE=审批后结算 SITE=现场支付")
+    @Field(value = "fee_pay_method", type = FieldType.Keyword)
+    private String feePayMethod;
+
+    @ApiModelProperty(value = "是否包含全部费用 YES=是 NO=否")
+    @Field(value = "is_all_fee", type = FieldType.Keyword)
+    private String isAllFee;
+
+    @ApiModelProperty(value = "销售类型 1=零售 2=工程 3=延保 4=工程维保")
+    @Field(value = "sale_type", type = FieldType.Keyword)
+    private Integer saleType;
+
+    @ApiModelProperty(value = "工程编号")
+    @Field(value = "project_no", type = FieldType.Keyword)
+    private String projectNo;
+
+    @ApiModelProperty(value = "工程名称")
+    @Field(value = "project_name", type = FieldType.Keyword)
+    private String projectName;
+
+    @ApiModelProperty(value = "是否开启抢单")
+    @Field(value = "is_qd", type = FieldType.Keyword)
+    private Boolean isQd;
+
+    @ApiModelProperty(value = "是否已产生通知 true=是 false=否")
+    @Field(value = "is_qd_notice", type = FieldType.Keyword)
+    private Boolean isQdNotice;
+
+    @ApiModelProperty(value = "是否为拆机")
+    @Field(value = "is_cj", type = FieldType.Keyword)
+    private Boolean isCj;
+
+    @ApiModelProperty(value = "是否为租赁单 true/false")
+    @Field(value = "is_zl", type = FieldType.Keyword)
+    private Boolean isZl;
+
+
+
+    @ApiModelProperty(value = "是否为工单导入 true/false")
+    @Field(value = "is_import_excel", type = FieldType.Keyword)
+    private Boolean isImportExcel;
+
+    @ApiModelProperty(value = "服务状态")
+    @Field(value = "service_status", type = FieldType.Keyword)
+    private String serviceStatus;
+
+    @ApiModelProperty(value = "投诉等级")
+    @Field(value = "complaint", type = FieldType.Keyword)
+    private String complaint;
+
+    @ApiModelProperty(value = "紧急程度")
+    @Field(value = "urgent", type = FieldType.Keyword)
+    private String urgent;
+
+    @ApiModelProperty(value = "评价结果")
+    @Field(value = "evaluate", type = FieldType.Keyword)
+    private String evaluate;
+
+    @ApiModelProperty(value = "销售平台")
+    @Field(value = "sales_platform", type = FieldType.Keyword)
+    private String salesPlatform;
+
+    @ApiModelProperty(value = "购买单位")
+    @Field(value = "buy_name", type = FieldType.Keyword)
+    private String buyName;
+
+    @ApiModelProperty(value = "销售类型")
+    @Field(value = "sales_type_name", type = FieldType.Keyword)
+    private String salesTypeName;
+
+    @ApiModelProperty(value = "要求状态")
+    @Field(value = "req_status", type = FieldType.Keyword)
+    private String reqStatus;
+
+    @ApiModelProperty(value = "要求类型")
+    @Field(value = "req_type", type = FieldType.Keyword)
+    private String reqType;
+
+    @ApiModelProperty(value = "要求内容")
+    @Field(value = "req_text", type = FieldType.Keyword)
+    private String reqText;
+
+    @ApiModelProperty(value = "服务单号")
+    @Field(value = "service_order_id", type = FieldType.Keyword)
+    private String serviceOrderId;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sales_order_id", type = FieldType.Keyword)
+    private String salesOrderId;
+
+    @ApiModelProperty(value = "管理组织")
+    @Field(value = "manager_name", type = FieldType.Keyword)
+    private String managerName;
+
+    @ApiModelProperty(value = "运营主体")
+    @Field(value = "operate_entity", type = FieldType.Keyword)
+    private String operateEntity;
+
+    @ApiModelProperty(value = "大类名称")
+    @Field(value = "main_name", type = FieldType.Keyword)
+    private String mainName;
+
+
+
+    @ApiModelProperty(value = "师傅编号")
+    @Field(value = "worker_number", type = FieldType.Keyword)
+    private String workerNumber;
+
+
+
+    @ApiModelProperty(value = "上午下午")
+    @Field(value = "time_name", type = FieldType.Keyword)
+    private String timeName;
+
+    @ApiModelProperty(value = "所属公司")
+    @Field(value = "belong_company", type = FieldType.Keyword)
+    private String belongCompany;
+
+    @ApiModelProperty(value = "销售网点编号")
+    @Field(value = "sales_websit_number", type = FieldType.Keyword)
+    private String salesWebsitNumber;
+
+    @ApiModelProperty(value = "销售网点名称")
+    @Field(value = "sales_websit", type = FieldType.Keyword)
+    private String salesWebsit;
+
+    @ApiModelProperty(value = "创建人编号")
+    @Field(value = "create_number", type = FieldType.Keyword)
+    private String createNumber;
+
+    @ApiModelProperty(value = "评价标签")
+    @Field(value = "appraise_label", type = FieldType.Keyword)
+    private String appraiseLabel;
+
+    @ApiModelProperty(value = "是否是工单3.0同步true/false")
+    @Field(value = "is_three_order", type = FieldType.Keyword)
+    private Boolean isThreeOrder;
+
+    @ApiModelProperty(value = "故障类型")
+    @Field(value = "trouble_value", type = FieldType.Keyword)
+    private String troubleValue;
+
+    @ApiModelProperty(value = "需求类别")
+    @Field(value = "type", type = FieldType.Keyword)
+    private String type;
+
+    @ApiModelProperty(value = "需求小类")
+    @Field(value = "small_type", type = FieldType.Keyword)
+    private String smallType;
+
+    @ApiModelProperty(value = "1 已接单 0未接单")
+    @Field(value = "is_meet", type = FieldType.Keyword)
+    private Boolean isMeet;
+
+    @ApiModelProperty(value = "申请状态 ING=申请中 END=到货反馈 CANCEL=取消申请")
+    @Field(value = "parts_apply_status", type = FieldType.Keyword)
+    private String partsApplyStatus;
+
+    @ApiModelProperty(value = "首次派工时间")
+    @Field(value = "first_dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String firstDispatchTime;
+
+    @ApiModelProperty(value = "首次预约时间")
+    @Field(value = "first_appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String firstAppointmentTime;
+
+    @ApiModelProperty(value = "取消时间")
+    @Field(value = "cancel_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String cancelTime;
+}

+ 551 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBase2023Es.java

@@ -0,0 +1,551 @@
+package com.gree.mall.manager.bean.es;
+
+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.math.BigDecimal;
+
+/**
+ * @author qinrongjun
+ * @description
+ * @date 2023/6/19 10:39 星期一
+ */
+@Data
+@Document(indexName = "pg_order_base2023")
+public class OrderBase2023Es {
+
+    @Id
+    @Field(value = "id", type = FieldType.Keyword)
+    private String id;
+
+    @ApiModelProperty(value = "服务说明(例如:家用空调x1,洗衣机x1)")
+    @Field(value = "order_title", type = FieldType.Keyword)
+    private String orderTitle;
+
+    @ApiModelProperty(value = "所属业务线   INSTALL=安装 REPAIR=维修")
+    @Field(value = "order_type", type = FieldType.Keyword)
+    private String orderType;
+
+    @ApiModelProperty(value = "所属业务线名称")
+    @Field(value = "order_type_text", type = FieldType.Keyword)
+    private String orderTypeText;
+
+    @ApiModelProperty(value = "工单类型")
+    @Field(value = "order_small_type", type = FieldType.Keyword)
+    private String orderSmallType;
+
+    @ApiModelProperty(value = "工单类型名称")
+    @Field(value = "order_small_type_text", type = FieldType.Keyword)
+    private String orderSmallTypeText;
+
+    @ApiModelProperty(value = "商户id")
+    @Field(value = "company_wechat_id", type = FieldType.Keyword)
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "商户名称")
+    @Field(value = "company_wechat_name", type = FieldType.Keyword)
+    private String companyWechatName;
+
+    @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_idcard", type = FieldType.Keyword)
+    private String workerIdcard;
+
+    @ApiModelProperty(value = "所有师傅的id(冗余字段),实际请看order_worker")
+    @Field(value = "worker_id_list", type = FieldType.Keyword)
+    private String workerIdList;
+
+    @ApiModelProperty(value = "工单状态 DYY=待预约 DSHPG=待商户派工 DWDPG=待网点派工 DQD=待抢单 DJD=待接单 FWZ=服务中 YCD=异常单 YWG=已完工待结算 YJS=已结算 YQX=已取消")
+    @Field(value = "order_status", type = FieldType.Keyword)
+    private String orderStatus;
+
+    @ApiModelProperty(value = "工单状态中文名称")
+    @Field(value = "order_status_text", type = FieldType.Keyword)
+    private String orderStatusText;
+
+    @ApiModelProperty(value = "派单给师傅的时间")
+    @Field(value = "dispatch_time", type = FieldType.Date,format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String dispatchTime;
+
+    @ApiModelProperty(value = "师傅接单时间")
+    @Field(value = "worker_rece_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String workerReceTime;
+
+    @ApiModelProperty(value = "派工网点时间")
+    @Field(value = "dispatch_websit_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String dispatchWebsitTime;
+
+    @ApiModelProperty(value = "客户id(客户建单才有)")
+    @Field(value = "user_id", type = FieldType.Keyword)
+    private String userId;
+
+    @ApiModelProperty(value = "客户名称")
+    @Field(value = "user_name", type = FieldType.Keyword)
+    private String userName;
+
+    @ApiModelProperty(value = "联系人")
+    @Field(value = "link_name", type = FieldType.Keyword)
+    private String linkName;
+
+    @ApiModelProperty(value = "客户电话")
+    @Field(value = "user_mobile", type = FieldType.Keyword)
+    private String userMobile;
+
+    @ApiModelProperty(value = "客户电话2")
+    @Field(value = "user_mobile2", type = FieldType.Keyword)
+    private String userMobile2;
+
+    @ApiModelProperty(value = "省")
+    @Field(value = "province", type = FieldType.Keyword)
+    private String province;
+
+    @ApiModelProperty(value = "省id")
+    @Field(value = "province_id", type = FieldType.Keyword)
+    private String provinceId;
+
+    @ApiModelProperty(value = "市")
+    @Field(value = "city", type = FieldType.Keyword)
+    private String city;
+
+    @ApiModelProperty(value = "市id")
+    @Field(value = "city_id", type = FieldType.Keyword)
+    private String cityId;
+
+    @ApiModelProperty(value = "区")
+    @Field(value = "area", type = FieldType.Keyword)
+    private String area;
+
+    @ApiModelProperty(value = "区id")
+    @Field(value = "area_id", type = FieldType.Keyword)
+    private String areaId;
+
+    @ApiModelProperty(value = "街道")
+    @Field(value = "street", type = FieldType.Keyword)
+    private String street;
+
+    @ApiModelProperty(value = "街道id")
+    @Field(value = "street_id", type = FieldType.Keyword)
+    private String streetId;
+
+    @ApiModelProperty(value = "详细地址")
+    @Field(value = "address", type = FieldType.Keyword)
+    private String address;
+
+    @ApiModelProperty(value = "备注")
+    @Field(value = "remark", type = FieldType.Keyword)
+    private String remark;
+
+    @ApiModelProperty(value = "安装或维修网点名称(售后网点)")
+    @Field(value = "websit_name", type = FieldType.Keyword)
+    private String websitName;
+
+    @ApiModelProperty(value = "安装或维修网点编号(售后网点)")
+    @Field(value = "websit_id", type = FieldType.Keyword)
+    private String websitId;
+
+    @ApiModelProperty(value = "售后网点联系电话")
+    @Field(value = "websit_phone", type = FieldType.Keyword)
+    private String websitPhone;
+
+    @ApiModelProperty(value = "创建网点编号")
+    @Field(value = "create_websit_id", type = FieldType.Keyword)
+    private String createWebsitId;
+
+    @ApiModelProperty(value = "创建网点名称")
+    @Field(value = "create_websit_name", type = FieldType.Keyword)
+    private String createWebsitName;
+
+    @ApiModelProperty(value = "gps地址信息")
+    @Field(value = "gps_address", type = FieldType.Keyword)
+    private String gpsAddress;
+
+    @ApiModelProperty(value = "最新反馈记录")
+    @Field(value = "last_operator", type = FieldType.Keyword)
+    private String lastOperator;
+
+    @ApiModelProperty(value = "最近操作网点")
+    @Field(value = "last_operator_websit", type = FieldType.Keyword)
+    private String lastOperatorWebsit;
+
+    @ApiModelProperty(value = "最近操作网点编号")
+    @Field(value = "last_operator_by", type = FieldType.Keyword)
+    private String lastOperatorBy;
+
+    @ApiModelProperty(value = "最近操作时间")
+    @Field(value = "last_operator_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String lastOperatorTime;
+
+    @ApiModelProperty(value = "预约安装/维修时间")
+    @Field(value = "appointment_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appointmentTime;
+
+    @ApiModelProperty(value = "预约结束时间")
+    @Field(value = "appointment_end_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appointmentEndTime;
+
+    @ApiModelProperty(value = "预约备注")
+    @Field(value = "appointment_remark", type = FieldType.Keyword)
+    private String appointmentRemark;
+
+    @ApiModelProperty(value = "安装/维修总数量")
+    @Field(value = "total_num", type = FieldType.Keyword)
+    private Integer totalNum;
+
+    @ApiModelProperty(value = "未完成数量")
+    @Field(value = "undone_num", type = FieldType.Keyword)
+    private Integer undoneNum;
+
+    @ApiModelProperty(value = "经度")
+    @Field(value = "lng", type = FieldType.Keyword)
+    private String lng;
+
+    @ApiModelProperty(value = "纬度")
+    @Field(value = "lat", type = FieldType.Keyword)
+    private String lat;
+
+    @ApiModelProperty(value = "师傅报完工时间")
+    @Field(value = "over_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String overTime;
+
+    @ApiModelProperty(value = "网点报完工时间")
+    @Field(value = "websit_over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String websitOverTime;
+
+    @ApiModelProperty(value = "完工时间(精确到天)")
+    @Field(value = "over_date", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String overDate;
+
+    @ApiModelProperty(value = "正常关闭时间")
+    @Field(value = "close_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String closeTime;
+
+    @ApiModelProperty(value = "创建时间(精确到天)")
+    @Field(value = "create_date", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String createDate;
+
+    @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 = "create_mobile", type = FieldType.Keyword)
+    private String createMobile;
+
+    @ApiModelProperty(value = "创建人")
+    @Field(value = "create_by", type = FieldType.Keyword)
+    private String createBy;
+
+    @ApiModelProperty(value = "创建人名称")
+    @Field(value = "create_name", type = FieldType.Keyword)
+    private String createName;
+
+    @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 = "update_by", type = FieldType.Keyword)
+    private String updateBy;
+
+    @ApiModelProperty(value = "首次评价(A:好评,B:中评,C:差评,N:未评价,O:其他")
+    @Field(value = "appraise_status", type = FieldType.Keyword)
+    private String appraiseStatus;
+
+    @ApiModelProperty(value = "首次评价内容")
+    @Field(value = "appraise_content", type = FieldType.Keyword)
+    private String appraiseContent;
+
+    @ApiModelProperty(value = "首次评价时间")
+    @Field(value = "appraise_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appraiseTime;
+
+    @ApiModelProperty(value = "评价来源 1=用户评价 2=商家评价")
+    @Field(value = "appraise_source", type = FieldType.Keyword)
+    private Integer appraiseSource;
+
+    @ApiModelProperty(value = "多个图片逗号隔开")
+    @Field(value = "appraise_img_url", type = FieldType.Keyword)
+    private String appraiseImgUrl;
+
+    @ApiModelProperty(value = "师傅记事备注")
+    @Field(value = "worker_remark", type = FieldType.Keyword)
+    private String workerRemark;
+
+    @ApiModelProperty(value = "销售单位")
+    @Field(value = "sale_company", type = FieldType.Keyword)
+    private String saleCompany;
+
+    @ApiModelProperty(value = "最近一次操作预约/改约的时间")
+    @Field(value = "last_operator_appointment_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String lastOperatorAppointmentTime;
+
+    @ApiModelProperty(value = "工单渠道id")
+    @Field(value = "order_channel_id", type = FieldType.Keyword)
+    private String orderChannelId;
+
+    @ApiModelProperty(value = "工单渠道")
+    @Field(value = "order_channel_text", type = FieldType.Keyword)
+    private String orderChannelText;
+
+    @ApiModelProperty(value = "改约备注")
+    @Field(value = "change_remark", type = FieldType.Keyword)
+    private String changeRemark;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sale_order_id", type = FieldType.Keyword)
+    private String saleOrderId;
+
+    @ApiModelProperty(value = "销售单下单时间")
+    @Field(value = "sale_create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String saleCreateTime;
+
+    @ApiModelProperty(value = "销售单订单金额")
+    @Field(value = "sale_total_amount", type = FieldType.Keyword)
+    private BigDecimal saleTotalAmount;
+
+    @ApiModelProperty(value = "销售单备注")
+    @Field(value = "sale_remark", type = FieldType.Keyword)
+    private String saleRemark;
+
+    @ApiModelProperty(value = "内部来源")
+    @Field(value = "source", type = FieldType.Keyword)
+    private String source;
+
+    @ApiModelProperty(value = "完工反馈备注")
+    @Field(value = "over_remark", type = FieldType.Keyword)
+    private String overRemark;
+
+    @ApiModelProperty(value = "客户签名")
+    @Field(value = "user_sign", type = FieldType.Keyword)
+    private String userSign;
+
+    @ApiModelProperty(value = "是否为导入工单,true=是 false=否")
+    @Field(value = "is_import", type = FieldType.Keyword)
+    private Boolean isImport;
+
+    @ApiModelProperty(value = "是否已采集 YES 是 NO 否")
+    @Field(value = "is_gather", type = FieldType.Keyword)
+    private String isGather;
+
+    @ApiModelProperty(value = "是否异常工单 true/false")
+    @Field(value = "is_exception", type = FieldType.Keyword)
+    private Boolean isException;
+
+    @ApiModelProperty(value = "增置服务id")
+    @Field(value = "pg_incre_id", type = FieldType.Keyword)
+    private String pgIncreId;
+
+    @ApiModelProperty(value = "增置服务订单id")
+    @Field(value = "pg_incre_order_id", type = FieldType.Keyword)
+    private String pgIncreOrderId;
+
+    @ApiModelProperty(value = "增置服务明细id")
+    @Field(value = "pg_incre_item_id", type = FieldType.Keyword)
+    private String pgIncreItemId;
+
+    @ApiModelProperty(value = "增置服务售卖网点")
+    @Field(value = "pg_incre_websit_name", type = FieldType.Keyword)
+    private String pgIncreWebsitName;
+
+    @ApiModelProperty(value = "增置服务售卖网点id")
+    @Field(value = "pg_incre_websit_id", type = FieldType.Keyword)
+    private String pgIncreWebsitId;
+
+    @ApiModelProperty(value = "结算服务费用")
+    @Field(value = "settle_service_amount", type = FieldType.Keyword)
+    private BigDecimal settleServiceAmount;
+
+    @ApiModelProperty(value = "维保基础id")
+    @Field(value = "rp_project_repair_id", type = FieldType.Keyword)
+    private String rpProjectRepairId;
+
+    @ApiModelProperty(value = "工程维保名称")
+    @Field(value = "rp_project_repair_name", type = FieldType.Keyword)
+    private String rpProjectRepairName;
+
+    @ApiModelProperty(value = "费用支付方式 EXAMINE=审批后结算 SITE=现场支付")
+    @Field(value = "fee_pay_method", type = FieldType.Keyword)
+    private String feePayMethod;
+
+    @ApiModelProperty(value = "是否包含全部费用 YES=是 NO=否")
+    @Field(value = "is_all_fee", type = FieldType.Keyword)
+    private String isAllFee;
+
+    @ApiModelProperty(value = "销售类型 1=零售 2=工程 3=延保 4=工程维保")
+    @Field(value = "sale_type", type = FieldType.Keyword)
+    private Integer saleType;
+
+    @ApiModelProperty(value = "工程编号")
+    @Field(value = "project_no", type = FieldType.Keyword)
+    private String projectNo;
+
+    @ApiModelProperty(value = "工程名称")
+    @Field(value = "project_name", type = FieldType.Keyword)
+    private String projectName;
+
+    @ApiModelProperty(value = "是否开启抢单")
+    @Field(value = "is_qd", type = FieldType.Keyword)
+    private Boolean isQd;
+
+    @ApiModelProperty(value = "是否已产生通知 true=是 false=否")
+    @Field(value = "is_qd_notice", type = FieldType.Keyword)
+    private Boolean isQdNotice;
+
+    @ApiModelProperty(value = "是否为拆机")
+    @Field(value = "is_cj", type = FieldType.Keyword)
+    private Boolean isCj;
+
+    @ApiModelProperty(value = "是否为租赁单 true/false")
+    @Field(value = "is_zl", type = FieldType.Keyword)
+    private Boolean isZl;
+
+
+
+    @ApiModelProperty(value = "是否为工单导入 true/false")
+    @Field(value = "is_import_excel", type = FieldType.Keyword)
+    private Boolean isImportExcel;
+
+    @ApiModelProperty(value = "服务状态")
+    @Field(value = "service_status", type = FieldType.Keyword)
+    private String serviceStatus;
+
+    @ApiModelProperty(value = "投诉等级")
+    @Field(value = "complaint", type = FieldType.Keyword)
+    private String complaint;
+
+    @ApiModelProperty(value = "紧急程度")
+    @Field(value = "urgent", type = FieldType.Keyword)
+    private String urgent;
+
+    @ApiModelProperty(value = "评价结果")
+    @Field(value = "evaluate", type = FieldType.Keyword)
+    private String evaluate;
+
+    @ApiModelProperty(value = "销售平台")
+    @Field(value = "sales_platform", type = FieldType.Keyword)
+    private String salesPlatform;
+
+    @ApiModelProperty(value = "购买单位")
+    @Field(value = "buy_name", type = FieldType.Keyword)
+    private String buyName;
+
+    @ApiModelProperty(value = "销售类型")
+    @Field(value = "sales_type_name", type = FieldType.Keyword)
+    private String salesTypeName;
+
+    @ApiModelProperty(value = "要求状态")
+    @Field(value = "req_status", type = FieldType.Keyword)
+    private String reqStatus;
+
+    @ApiModelProperty(value = "要求类型")
+    @Field(value = "req_type", type = FieldType.Keyword)
+    private String reqType;
+
+    @ApiModelProperty(value = "要求内容")
+    @Field(value = "req_text", type = FieldType.Keyword)
+    private String reqText;
+
+    @ApiModelProperty(value = "服务单号")
+    @Field(value = "service_order_id", type = FieldType.Keyword)
+    private String serviceOrderId;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sales_order_id", type = FieldType.Keyword)
+    private String salesOrderId;
+
+    @ApiModelProperty(value = "管理组织")
+    @Field(value = "manager_name", type = FieldType.Keyword)
+    private String managerName;
+
+    @ApiModelProperty(value = "运营主体")
+    @Field(value = "operate_entity", type = FieldType.Keyword)
+    private String operateEntity;
+
+    @ApiModelProperty(value = "大类名称")
+    @Field(value = "main_name", type = FieldType.Keyword)
+    private String mainName;
+
+
+
+    @ApiModelProperty(value = "师傅编号")
+    @Field(value = "worker_number", type = FieldType.Keyword)
+    private String workerNumber;
+
+
+
+    @ApiModelProperty(value = "上午下午")
+    @Field(value = "time_name", type = FieldType.Keyword)
+    private String timeName;
+
+    @ApiModelProperty(value = "所属公司")
+    @Field(value = "belong_company", type = FieldType.Keyword)
+    private String belongCompany;
+
+    @ApiModelProperty(value = "销售网点编号")
+    @Field(value = "sales_websit_number", type = FieldType.Keyword)
+    private String salesWebsitNumber;
+
+    @ApiModelProperty(value = "销售网点名称")
+    @Field(value = "sales_websit", type = FieldType.Keyword)
+    private String salesWebsit;
+
+    @ApiModelProperty(value = "创建人编号")
+    @Field(value = "create_number", type = FieldType.Keyword)
+    private String createNumber;
+
+    @ApiModelProperty(value = "评价标签")
+    @Field(value = "appraise_label", type = FieldType.Keyword)
+    private String appraiseLabel;
+
+    @ApiModelProperty(value = "是否是工单3.0同步true/false")
+    @Field(value = "is_three_order", type = FieldType.Keyword)
+    private Boolean isThreeOrder;
+
+    @ApiModelProperty(value = "故障类型")
+    @Field(value = "trouble_value", type = FieldType.Keyword)
+    private String troubleValue;
+
+    @ApiModelProperty(value = "需求类别")
+    @Field(value = "type", type = FieldType.Keyword)
+    private String type;
+
+    @ApiModelProperty(value = "需求小类")
+    @Field(value = "small_type", type = FieldType.Keyword)
+    private String smallType;
+
+    @ApiModelProperty(value = "1 已接单 0未接单")
+    @Field(value = "is_meet", type = FieldType.Keyword)
+    private Boolean isMeet;
+
+    @ApiModelProperty(value = "申请状态 ING=申请中 END=到货反馈 CANCEL=取消申请")
+    @Field(value = "parts_apply_status", type = FieldType.Keyword)
+    private String partsApplyStatus;
+
+    @ApiModelProperty(value = "首次派工时间")
+    @Field(value = "first_dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String firstDispatchTime;
+
+    @ApiModelProperty(value = "首次预约时间")
+    @Field(value = "first_appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String firstAppointmentTime;
+
+    @ApiModelProperty(value = "取消时间")
+    @Field(value = "cancel_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String cancelTime;
+}

+ 551 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBase2024Es.java

@@ -0,0 +1,551 @@
+package com.gree.mall.manager.bean.es;
+
+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.math.BigDecimal;
+
+/**
+ * @author qinrongjun
+ * @description
+ * @date 2023/6/19 10:39 星期一
+ */
+@Data
+@Document(indexName = "pg_order_base2024")
+public class OrderBase2024Es {
+
+    @Id
+    @Field(value = "id", type = FieldType.Keyword)
+    private String id;
+
+    @ApiModelProperty(value = "服务说明(例如:家用空调x1,洗衣机x1)")
+    @Field(value = "order_title", type = FieldType.Keyword)
+    private String orderTitle;
+
+    @ApiModelProperty(value = "所属业务线   INSTALL=安装 REPAIR=维修")
+    @Field(value = "order_type", type = FieldType.Keyword)
+    private String orderType;
+
+    @ApiModelProperty(value = "所属业务线名称")
+    @Field(value = "order_type_text", type = FieldType.Keyword)
+    private String orderTypeText;
+
+    @ApiModelProperty(value = "工单类型")
+    @Field(value = "order_small_type", type = FieldType.Keyword)
+    private String orderSmallType;
+
+    @ApiModelProperty(value = "工单类型名称")
+    @Field(value = "order_small_type_text", type = FieldType.Keyword)
+    private String orderSmallTypeText;
+
+    @ApiModelProperty(value = "商户id")
+    @Field(value = "company_wechat_id", type = FieldType.Keyword)
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "商户名称")
+    @Field(value = "company_wechat_name", type = FieldType.Keyword)
+    private String companyWechatName;
+
+    @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_idcard", type = FieldType.Keyword)
+    private String workerIdcard;
+
+    @ApiModelProperty(value = "所有师傅的id(冗余字段),实际请看order_worker")
+    @Field(value = "worker_id_list", type = FieldType.Keyword)
+    private String workerIdList;
+
+    @ApiModelProperty(value = "工单状态 DYY=待预约 DSHPG=待商户派工 DWDPG=待网点派工 DQD=待抢单 DJD=待接单 FWZ=服务中 YCD=异常单 YWG=已完工待结算 YJS=已结算 YQX=已取消")
+    @Field(value = "order_status", type = FieldType.Keyword)
+    private String orderStatus;
+
+    @ApiModelProperty(value = "工单状态中文名称")
+    @Field(value = "order_status_text", type = FieldType.Keyword)
+    private String orderStatusText;
+
+    @ApiModelProperty(value = "派单给师傅的时间")
+    @Field(value = "dispatch_time", type = FieldType.Date,format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String dispatchTime;
+
+    @ApiModelProperty(value = "师傅接单时间")
+    @Field(value = "worker_rece_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String workerReceTime;
+
+    @ApiModelProperty(value = "派工网点时间")
+    @Field(value = "dispatch_websit_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String dispatchWebsitTime;
+
+    @ApiModelProperty(value = "客户id(客户建单才有)")
+    @Field(value = "user_id", type = FieldType.Keyword)
+    private String userId;
+
+    @ApiModelProperty(value = "客户名称")
+    @Field(value = "user_name", type = FieldType.Keyword)
+    private String userName;
+
+    @ApiModelProperty(value = "联系人")
+    @Field(value = "link_name", type = FieldType.Keyword)
+    private String linkName;
+
+    @ApiModelProperty(value = "客户电话")
+    @Field(value = "user_mobile", type = FieldType.Keyword)
+    private String userMobile;
+
+    @ApiModelProperty(value = "客户电话2")
+    @Field(value = "user_mobile2", type = FieldType.Keyword)
+    private String userMobile2;
+
+    @ApiModelProperty(value = "省")
+    @Field(value = "province", type = FieldType.Keyword)
+    private String province;
+
+    @ApiModelProperty(value = "省id")
+    @Field(value = "province_id", type = FieldType.Keyword)
+    private String provinceId;
+
+    @ApiModelProperty(value = "市")
+    @Field(value = "city", type = FieldType.Keyword)
+    private String city;
+
+    @ApiModelProperty(value = "市id")
+    @Field(value = "city_id", type = FieldType.Keyword)
+    private String cityId;
+
+    @ApiModelProperty(value = "区")
+    @Field(value = "area", type = FieldType.Keyword)
+    private String area;
+
+    @ApiModelProperty(value = "区id")
+    @Field(value = "area_id", type = FieldType.Keyword)
+    private String areaId;
+
+    @ApiModelProperty(value = "街道")
+    @Field(value = "street", type = FieldType.Keyword)
+    private String street;
+
+    @ApiModelProperty(value = "街道id")
+    @Field(value = "street_id", type = FieldType.Keyword)
+    private String streetId;
+
+    @ApiModelProperty(value = "详细地址")
+    @Field(value = "address", type = FieldType.Keyword)
+    private String address;
+
+    @ApiModelProperty(value = "备注")
+    @Field(value = "remark", type = FieldType.Keyword)
+    private String remark;
+
+    @ApiModelProperty(value = "安装或维修网点名称(售后网点)")
+    @Field(value = "websit_name", type = FieldType.Keyword)
+    private String websitName;
+
+    @ApiModelProperty(value = "安装或维修网点编号(售后网点)")
+    @Field(value = "websit_id", type = FieldType.Keyword)
+    private String websitId;
+
+    @ApiModelProperty(value = "售后网点联系电话")
+    @Field(value = "websit_phone", type = FieldType.Keyword)
+    private String websitPhone;
+
+    @ApiModelProperty(value = "创建网点编号")
+    @Field(value = "create_websit_id", type = FieldType.Keyword)
+    private String createWebsitId;
+
+    @ApiModelProperty(value = "创建网点名称")
+    @Field(value = "create_websit_name", type = FieldType.Keyword)
+    private String createWebsitName;
+
+    @ApiModelProperty(value = "gps地址信息")
+    @Field(value = "gps_address", type = FieldType.Keyword)
+    private String gpsAddress;
+
+    @ApiModelProperty(value = "最新反馈记录")
+    @Field(value = "last_operator", type = FieldType.Keyword)
+    private String lastOperator;
+
+    @ApiModelProperty(value = "最近操作网点")
+    @Field(value = "last_operator_websit", type = FieldType.Keyword)
+    private String lastOperatorWebsit;
+
+    @ApiModelProperty(value = "最近操作网点编号")
+    @Field(value = "last_operator_by", type = FieldType.Keyword)
+    private String lastOperatorBy;
+
+    @ApiModelProperty(value = "最近操作时间")
+    @Field(value = "last_operator_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String lastOperatorTime;
+
+    @ApiModelProperty(value = "预约安装/维修时间")
+    @Field(value = "appointment_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appointmentTime;
+
+    @ApiModelProperty(value = "预约结束时间")
+    @Field(value = "appointment_end_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appointmentEndTime;
+
+    @ApiModelProperty(value = "预约备注")
+    @Field(value = "appointment_remark", type = FieldType.Keyword)
+    private String appointmentRemark;
+
+    @ApiModelProperty(value = "安装/维修总数量")
+    @Field(value = "total_num", type = FieldType.Keyword)
+    private Integer totalNum;
+
+    @ApiModelProperty(value = "未完成数量")
+    @Field(value = "undone_num", type = FieldType.Keyword)
+    private Integer undoneNum;
+
+    @ApiModelProperty(value = "经度")
+    @Field(value = "lng", type = FieldType.Keyword)
+    private String lng;
+
+    @ApiModelProperty(value = "纬度")
+    @Field(value = "lat", type = FieldType.Keyword)
+    private String lat;
+
+    @ApiModelProperty(value = "师傅报完工时间")
+    @Field(value = "over_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String overTime;
+
+    @ApiModelProperty(value = "网点报完工时间")
+    @Field(value = "websit_over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String websitOverTime;
+
+    @ApiModelProperty(value = "完工时间(精确到天)")
+    @Field(value = "over_date", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String overDate;
+
+    @ApiModelProperty(value = "正常关闭时间")
+    @Field(value = "close_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String closeTime;
+
+    @ApiModelProperty(value = "创建时间(精确到天)")
+    @Field(value = "create_date", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String createDate;
+
+    @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 = "create_mobile", type = FieldType.Keyword)
+    private String createMobile;
+
+    @ApiModelProperty(value = "创建人")
+    @Field(value = "create_by", type = FieldType.Keyword)
+    private String createBy;
+
+    @ApiModelProperty(value = "创建人名称")
+    @Field(value = "create_name", type = FieldType.Keyword)
+    private String createName;
+
+    @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 = "update_by", type = FieldType.Keyword)
+    private String updateBy;
+
+    @ApiModelProperty(value = "首次评价(A:好评,B:中评,C:差评,N:未评价,O:其他")
+    @Field(value = "appraise_status", type = FieldType.Keyword)
+    private String appraiseStatus;
+
+    @ApiModelProperty(value = "首次评价内容")
+    @Field(value = "appraise_content", type = FieldType.Keyword)
+    private String appraiseContent;
+
+    @ApiModelProperty(value = "首次评价时间")
+    @Field(value = "appraise_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private String appraiseTime;
+
+    @ApiModelProperty(value = "评价来源 1=用户评价 2=商家评价")
+    @Field(value = "appraise_source", type = FieldType.Keyword)
+    private Integer appraiseSource;
+
+    @ApiModelProperty(value = "多个图片逗号隔开")
+    @Field(value = "appraise_img_url", type = FieldType.Keyword)
+    private String appraiseImgUrl;
+
+    @ApiModelProperty(value = "师傅记事备注")
+    @Field(value = "worker_remark", type = FieldType.Keyword)
+    private String workerRemark;
+
+    @ApiModelProperty(value = "销售单位")
+    @Field(value = "sale_company", type = FieldType.Keyword)
+    private String saleCompany;
+
+    @ApiModelProperty(value = "最近一次操作预约/改约的时间")
+    @Field(value = "last_operator_appointment_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String lastOperatorAppointmentTime;
+
+    @ApiModelProperty(value = "工单渠道id")
+    @Field(value = "order_channel_id", type = FieldType.Keyword)
+    private String orderChannelId;
+
+    @ApiModelProperty(value = "工单渠道")
+    @Field(value = "order_channel_text", type = FieldType.Keyword)
+    private String orderChannelText;
+
+    @ApiModelProperty(value = "改约备注")
+    @Field(value = "change_remark", type = FieldType.Keyword)
+    private String changeRemark;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sale_order_id", type = FieldType.Keyword)
+    private String saleOrderId;
+
+    @ApiModelProperty(value = "销售单下单时间")
+    @Field(value = "sale_create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String saleCreateTime;
+
+    @ApiModelProperty(value = "销售单订单金额")
+    @Field(value = "sale_total_amount", type = FieldType.Keyword)
+    private BigDecimal saleTotalAmount;
+
+    @ApiModelProperty(value = "销售单备注")
+    @Field(value = "sale_remark", type = FieldType.Keyword)
+    private String saleRemark;
+
+    @ApiModelProperty(value = "内部来源")
+    @Field(value = "source", type = FieldType.Keyword)
+    private String source;
+
+    @ApiModelProperty(value = "完工反馈备注")
+    @Field(value = "over_remark", type = FieldType.Keyword)
+    private String overRemark;
+
+    @ApiModelProperty(value = "客户签名")
+    @Field(value = "user_sign", type = FieldType.Keyword)
+    private String userSign;
+
+    @ApiModelProperty(value = "是否为导入工单,true=是 false=否")
+    @Field(value = "is_import", type = FieldType.Keyword)
+    private Boolean isImport;
+
+    @ApiModelProperty(value = "是否已采集 YES 是 NO 否")
+    @Field(value = "is_gather", type = FieldType.Keyword)
+    private String isGather;
+
+    @ApiModelProperty(value = "是否异常工单 true/false")
+    @Field(value = "is_exception", type = FieldType.Keyword)
+    private Boolean isException;
+
+    @ApiModelProperty(value = "增置服务id")
+    @Field(value = "pg_incre_id", type = FieldType.Keyword)
+    private String pgIncreId;
+
+    @ApiModelProperty(value = "增置服务订单id")
+    @Field(value = "pg_incre_order_id", type = FieldType.Keyword)
+    private String pgIncreOrderId;
+
+    @ApiModelProperty(value = "增置服务明细id")
+    @Field(value = "pg_incre_item_id", type = FieldType.Keyword)
+    private String pgIncreItemId;
+
+    @ApiModelProperty(value = "增置服务售卖网点")
+    @Field(value = "pg_incre_websit_name", type = FieldType.Keyword)
+    private String pgIncreWebsitName;
+
+    @ApiModelProperty(value = "增置服务售卖网点id")
+    @Field(value = "pg_incre_websit_id", type = FieldType.Keyword)
+    private String pgIncreWebsitId;
+
+    @ApiModelProperty(value = "结算服务费用")
+    @Field(value = "settle_service_amount", type = FieldType.Keyword)
+    private BigDecimal settleServiceAmount;
+
+    @ApiModelProperty(value = "维保基础id")
+    @Field(value = "rp_project_repair_id", type = FieldType.Keyword)
+    private String rpProjectRepairId;
+
+    @ApiModelProperty(value = "工程维保名称")
+    @Field(value = "rp_project_repair_name", type = FieldType.Keyword)
+    private String rpProjectRepairName;
+
+    @ApiModelProperty(value = "费用支付方式 EXAMINE=审批后结算 SITE=现场支付")
+    @Field(value = "fee_pay_method", type = FieldType.Keyword)
+    private String feePayMethod;
+
+    @ApiModelProperty(value = "是否包含全部费用 YES=是 NO=否")
+    @Field(value = "is_all_fee", type = FieldType.Keyword)
+    private String isAllFee;
+
+    @ApiModelProperty(value = "销售类型 1=零售 2=工程 3=延保 4=工程维保")
+    @Field(value = "sale_type", type = FieldType.Keyword)
+    private Integer saleType;
+
+    @ApiModelProperty(value = "工程编号")
+    @Field(value = "project_no", type = FieldType.Keyword)
+    private String projectNo;
+
+    @ApiModelProperty(value = "工程名称")
+    @Field(value = "project_name", type = FieldType.Keyword)
+    private String projectName;
+
+    @ApiModelProperty(value = "是否开启抢单")
+    @Field(value = "is_qd", type = FieldType.Keyword)
+    private Boolean isQd;
+
+    @ApiModelProperty(value = "是否已产生通知 true=是 false=否")
+    @Field(value = "is_qd_notice", type = FieldType.Keyword)
+    private Boolean isQdNotice;
+
+    @ApiModelProperty(value = "是否为拆机")
+    @Field(value = "is_cj", type = FieldType.Keyword)
+    private Boolean isCj;
+
+    @ApiModelProperty(value = "是否为租赁单 true/false")
+    @Field(value = "is_zl", type = FieldType.Keyword)
+    private Boolean isZl;
+
+
+
+    @ApiModelProperty(value = "是否为工单导入 true/false")
+    @Field(value = "is_import_excel", type = FieldType.Keyword)
+    private Boolean isImportExcel;
+
+    @ApiModelProperty(value = "服务状态")
+    @Field(value = "service_status", type = FieldType.Keyword)
+    private String serviceStatus;
+
+    @ApiModelProperty(value = "投诉等级")
+    @Field(value = "complaint", type = FieldType.Keyword)
+    private String complaint;
+
+    @ApiModelProperty(value = "紧急程度")
+    @Field(value = "urgent", type = FieldType.Keyword)
+    private String urgent;
+
+    @ApiModelProperty(value = "评价结果")
+    @Field(value = "evaluate", type = FieldType.Keyword)
+    private String evaluate;
+
+    @ApiModelProperty(value = "销售平台")
+    @Field(value = "sales_platform", type = FieldType.Keyword)
+    private String salesPlatform;
+
+    @ApiModelProperty(value = "购买单位")
+    @Field(value = "buy_name", type = FieldType.Keyword)
+    private String buyName;
+
+    @ApiModelProperty(value = "销售类型")
+    @Field(value = "sales_type_name", type = FieldType.Keyword)
+    private String salesTypeName;
+
+    @ApiModelProperty(value = "要求状态")
+    @Field(value = "req_status", type = FieldType.Keyword)
+    private String reqStatus;
+
+    @ApiModelProperty(value = "要求类型")
+    @Field(value = "req_type", type = FieldType.Keyword)
+    private String reqType;
+
+    @ApiModelProperty(value = "要求内容")
+    @Field(value = "req_text", type = FieldType.Keyword)
+    private String reqText;
+
+    @ApiModelProperty(value = "服务单号")
+    @Field(value = "service_order_id", type = FieldType.Keyword)
+    private String serviceOrderId;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sales_order_id", type = FieldType.Keyword)
+    private String salesOrderId;
+
+    @ApiModelProperty(value = "管理组织")
+    @Field(value = "manager_name", type = FieldType.Keyword)
+    private String managerName;
+
+    @ApiModelProperty(value = "运营主体")
+    @Field(value = "operate_entity", type = FieldType.Keyword)
+    private String operateEntity;
+
+    @ApiModelProperty(value = "大类名称")
+    @Field(value = "main_name", type = FieldType.Keyword)
+    private String mainName;
+
+
+
+    @ApiModelProperty(value = "师傅编号")
+    @Field(value = "worker_number", type = FieldType.Keyword)
+    private String workerNumber;
+
+
+
+    @ApiModelProperty(value = "上午下午")
+    @Field(value = "time_name", type = FieldType.Keyword)
+    private String timeName;
+
+    @ApiModelProperty(value = "所属公司")
+    @Field(value = "belong_company", type = FieldType.Keyword)
+    private String belongCompany;
+
+    @ApiModelProperty(value = "销售网点编号")
+    @Field(value = "sales_websit_number", type = FieldType.Keyword)
+    private String salesWebsitNumber;
+
+    @ApiModelProperty(value = "销售网点名称")
+    @Field(value = "sales_websit", type = FieldType.Keyword)
+    private String salesWebsit;
+
+    @ApiModelProperty(value = "创建人编号")
+    @Field(value = "create_number", type = FieldType.Keyword)
+    private String createNumber;
+
+    @ApiModelProperty(value = "评价标签")
+    @Field(value = "appraise_label", type = FieldType.Keyword)
+    private String appraiseLabel;
+
+    @ApiModelProperty(value = "是否是工单3.0同步true/false")
+    @Field(value = "is_three_order", type = FieldType.Keyword)
+    private Boolean isThreeOrder;
+
+    @ApiModelProperty(value = "故障类型")
+    @Field(value = "trouble_value", type = FieldType.Keyword)
+    private String troubleValue;
+
+    @ApiModelProperty(value = "需求类别")
+    @Field(value = "type", type = FieldType.Keyword)
+    private String type;
+
+    @ApiModelProperty(value = "需求小类")
+    @Field(value = "small_type", type = FieldType.Keyword)
+    private String smallType;
+
+    @ApiModelProperty(value = "1 已接单 0未接单")
+    @Field(value = "is_meet", type = FieldType.Keyword)
+    private Boolean isMeet;
+
+    @ApiModelProperty(value = "申请状态 ING=申请中 END=到货反馈 CANCEL=取消申请")
+    @Field(value = "parts_apply_status", type = FieldType.Keyword)
+    private String partsApplyStatus;
+
+    @ApiModelProperty(value = "首次派工时间")
+    @Field(value = "first_dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String firstDispatchTime;
+
+    @ApiModelProperty(value = "首次预约时间")
+    @Field(value = "first_appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String firstAppointmentTime;
+
+    @ApiModelProperty(value = "取消时间")
+    @Field(value = "cancel_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private String cancelTime;
+}

+ 553 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBaseEs2022Date.java

@@ -0,0 +1,553 @@
+package com.gree.mall.manager.bean.es;
+
+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.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author qinrongjun
+ * @description
+ * @date 2023/6/19 10:39 星期一
+ */
+@Data
+@Document(indexName = "pg_order_base2022")
+public class OrderBaseEs2022Date {
+
+    @Id
+    @Field(value = "id", type = FieldType.Keyword)
+    private String id;
+
+    @ApiModelProperty(value = "服务说明(例如:家用空调x1,洗衣机x1)")
+    @Field(value = "order_title", type = FieldType.Keyword)
+    private String orderTitle;
+
+    @ApiModelProperty(value = "所属业务线   INSTALL=安装 REPAIR=维修")
+    @Field(value = "order_type", type = FieldType.Keyword)
+    private String orderType;
+
+    @ApiModelProperty(value = "所属业务线名称")
+    @Field(value = "order_type_text", type = FieldType.Keyword)
+    private String orderTypeText;
+
+    @ApiModelProperty(value = "工单类型")
+    @Field(value = "order_small_type", type = FieldType.Keyword)
+    private String orderSmallType;
+
+    @ApiModelProperty(value = "工单类型名称")
+    @Field(value = "order_small_type_text", type = FieldType.Keyword)
+    private String orderSmallTypeText;
+
+    @ApiModelProperty(value = "商户id")
+    @Field(value = "company_wechat_id", type = FieldType.Keyword)
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "商户名称")
+    @Field(value = "company_wechat_name", type = FieldType.Keyword)
+    private String companyWechatName;
+
+    @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_idcard", type = FieldType.Keyword)
+    private String workerIdcard;
+
+    @ApiModelProperty(value = "所有师傅的id(冗余字段),实际请看order_worker")
+    @Field(value = "worker_id_list", type = FieldType.Keyword)
+    private String workerIdList;
+
+    @ApiModelProperty(value = "工单状态 DYY=待预约 DSHPG=待商户派工 DWDPG=待网点派工 DQD=待抢单 DJD=待接单 FWZ=服务中 YCD=异常单 YWG=已完工待结算 YJS=已结算 YQX=已取消")
+    @Field(value = "order_status", type = FieldType.Keyword)
+    private String orderStatus;
+
+    @ApiModelProperty(value = "工单状态中文名称")
+    @Field(value = "order_status_text", type = FieldType.Keyword)
+    private String orderStatusText;
+
+    @ApiModelProperty(value = "派单给师傅的时间")
+    @Field(value = "dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date dispatchTime;
+
+    @ApiModelProperty(value = "师傅接单时间")
+    @Field(value = "worker_rece_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date workerReceTime;
+
+    @ApiModelProperty(value = "派工网点时间")
+    @Field(value = "dispatch_websit_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date dispatchWebsitTime;
+
+    @ApiModelProperty(value = "客户id(客户建单才有)")
+    @Field(value = "user_id", type = FieldType.Keyword)
+    private String userId;
+
+    @ApiModelProperty(value = "客户名称")
+    @Field(value = "user_name", type = FieldType.Keyword)
+    private String userName;
+
+    @ApiModelProperty(value = "联系人")
+    @Field(value = "link_name", type = FieldType.Keyword)
+    private String linkName;
+
+    @ApiModelProperty(value = "客户电话")
+    @Field(value = "user_mobile", type = FieldType.Keyword)
+    private String userMobile;
+
+    @ApiModelProperty(value = "客户电话2")
+    @Field(value = "user_mobile2", type = FieldType.Keyword)
+    private String userMobile2;
+
+    @ApiModelProperty(value = "省")
+    @Field(value = "province", type = FieldType.Keyword)
+    private String province;
+
+    @ApiModelProperty(value = "省id")
+    @Field(value = "province_id", type = FieldType.Keyword)
+    private String provinceId;
+
+    @ApiModelProperty(value = "市")
+    @Field(value = "city", type = FieldType.Keyword)
+    private String city;
+
+    @ApiModelProperty(value = "市id")
+    @Field(value = "city_id", type = FieldType.Keyword)
+    private String cityId;
+
+    @ApiModelProperty(value = "区")
+    @Field(value = "area", type = FieldType.Keyword)
+    private String area;
+
+    @ApiModelProperty(value = "区id")
+    @Field(value = "area_id", type = FieldType.Keyword)
+    private String areaId;
+
+    @ApiModelProperty(value = "街道")
+    @Field(value = "street", type = FieldType.Keyword)
+    private String street;
+
+    @ApiModelProperty(value = "街道id")
+    @Field(value = "street_id", type = FieldType.Keyword)
+    private String streetId;
+
+    @ApiModelProperty(value = "详细地址")
+    @Field(value = "address", type = FieldType.Keyword)
+    private String address;
+
+    @ApiModelProperty(value = "备注")
+    @Field(value = "remark", type = FieldType.Keyword)
+    private String remark;
+
+    @ApiModelProperty(value = "安装或维修网点名称(售后网点)")
+    @Field(value = "websit_name", type = FieldType.Keyword)
+    private String websitName;
+
+    @ApiModelProperty(value = "安装或维修网点编号(售后网点)")
+    @Field(value = "websit_id", type = FieldType.Keyword)
+    private String websitId;
+
+    @ApiModelProperty(value = "售后网点联系电话")
+    @Field(value = "websit_phone", type = FieldType.Keyword)
+    private String websitPhone;
+
+    @ApiModelProperty(value = "创建网点编号")
+    @Field(value = "create_websit_id", type = FieldType.Keyword)
+    private String createWebsitId;
+
+    @ApiModelProperty(value = "创建网点名称")
+    @Field(value = "create_websit_name", type = FieldType.Keyword)
+    private String createWebsitName;
+
+    @ApiModelProperty(value = "gps地址信息")
+    @Field(value = "gps_address", type = FieldType.Keyword)
+    private String gpsAddress;
+
+    @ApiModelProperty(value = "最新反馈记录")
+    @Field(value = "last_operator", type = FieldType.Keyword)
+    private String lastOperator;
+
+    @ApiModelProperty(value = "最近操作网点")
+    @Field(value = "last_operator_websit", type = FieldType.Keyword)
+    private String lastOperatorWebsit;
+
+    @ApiModelProperty(value = "最近操作网点编号")
+    @Field(value = "last_operator_by", type = FieldType.Keyword)
+    private String lastOperatorBy;
+
+    @ApiModelProperty(value = "最近操作时间")
+    @Field(value = "last_operator_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date lastOperatorTime;
+
+    @ApiModelProperty(value = "预约安装/维修时间")
+    @Field(value = "appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appointmentTime;
+
+    @ApiModelProperty(value = "预约结束时间")
+    @Field(value = "appointment_end_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appointmentEndTime;
+
+    @ApiModelProperty(value = "预约备注")
+    @Field(value = "appointment_remark", type = FieldType.Keyword)
+    private String appointmentRemark;
+
+    @ApiModelProperty(value = "安装/维修总数量")
+    @Field(value = "total_num", type = FieldType.Integer)
+    private Integer totalNum;
+
+    @ApiModelProperty(value = "未完成数量")
+    @Field(value = "undone_num", type = FieldType.Integer)
+    private Integer undoneNum;
+
+    @ApiModelProperty(value = "经度")
+    @Field(value = "lng", type = FieldType.Keyword)
+    private String lng;
+
+    @ApiModelProperty(value = "纬度")
+    @Field(value = "lat", type = FieldType.Keyword)
+    private String lat;
+
+    @ApiModelProperty(value = "师傅报完工时间")
+    @Field(value = "over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date overTime;
+
+    @ApiModelProperty(value = "网点报完工时间")
+    @Field(value = "websit_over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date websitOverTime;
+
+    @ApiModelProperty(value = "完工时间(精确到天)")
+    @Field(value = "over_date", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date overDate;
+
+    @ApiModelProperty(value = "正常关闭时间")
+    @Field(value = "close_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date closeTime;
+
+    @ApiModelProperty(value = "创建时间(精确到天)")
+    @Field(value = "create_date", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date createDate;
+
+    @ApiModelProperty(value = "创建时间")
+    @Field(value = "create_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人手机")
+    @Field(value = "create_mobile", type = FieldType.Keyword)
+    private String createMobile;
+
+    @ApiModelProperty(value = "创建人")
+    @Field(value = "create_by", type = FieldType.Keyword)
+    private String createBy;
+
+    @ApiModelProperty(value = "创建人名称")
+    @Field(value = "create_name", type = FieldType.Keyword)
+    private String createName;
+
+    @ApiModelProperty(value = "修改时间")
+    @Field(value = "update_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改人")
+    @Field(value = "update_by", type = FieldType.Keyword)
+    private String updateBy;
+
+    @ApiModelProperty(value = "首次评价(A:好评,B:中评,C:差评,N:未评价,O:其他")
+    @Field(value = "appraise_status", type = FieldType.Keyword)
+    private String appraiseStatus;
+
+    @ApiModelProperty(value = "首次评价内容")
+    @Field(value = "appraise_content", type = FieldType.Keyword)
+    private String appraiseContent;
+
+    @ApiModelProperty(value = "首次评价时间")
+    @Field(value = "appraise_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appraiseTime;
+
+    @ApiModelProperty(value = "评价来源 1=用户评价 2=商家评价")
+    @Field(value = "appraise_source", type = FieldType.Integer)
+    private Integer appraiseSource;
+
+    @ApiModelProperty(value = "多个图片逗号隔开")
+    @Field(value = "appraise_img_url", type = FieldType.Keyword)
+    private String appraiseImgUrl;
+
+    @ApiModelProperty(value = "师傅记事备注")
+    @Field(value = "worker_remark", type = FieldType.Keyword)
+    private String workerRemark;
+
+    @ApiModelProperty(value = "销售单位")
+    @Field(value = "sale_company", type = FieldType.Keyword)
+    private String saleCompany;
+
+    @ApiModelProperty(value = "最近一次操作预约/改约的时间")
+    @Field(value = "last_operator_appointment_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date lastOperatorAppointmentTime;
+
+    @ApiModelProperty(value = "工单渠道id")
+    @Field(value = "order_channel_id", type = FieldType.Keyword)
+    private String orderChannelId;
+
+    @ApiModelProperty(value = "工单渠道")
+    @Field(value = "order_channel_text", type = FieldType.Keyword)
+    private String orderChannelText;
+
+    @ApiModelProperty(value = "改约备注")
+    @Field(value = "change_remark", type = FieldType.Keyword)
+    private String changeRemark;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sale_order_id", type = FieldType.Keyword)
+    private String saleOrderId;
+
+    @ApiModelProperty(value = "销售单下单时间")
+    @Field(value = "sale_create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date saleCreateTime;
+    @ApiModelProperty(value = "销售单订单金额")
+    @Field(value = "sale_total_amount", type = FieldType.Keyword)
+    private BigDecimal saleTotalAmount;
+
+    @ApiModelProperty(value = "销售单备注")
+    @Field(value = "sale_remark", type = FieldType.Keyword)
+    private String saleRemark;
+
+    @ApiModelProperty(value = "内部来源")
+    @Field(value = "source", type = FieldType.Keyword)
+    private String source;
+
+    @ApiModelProperty(value = "完工反馈备注")
+    @Field(value = "over_remark", type = FieldType.Keyword)
+    private String overRemark;
+
+    @ApiModelProperty(value = "客户签名")
+    @Field(value = "user_sign", type = FieldType.Keyword)
+    private String userSign;
+
+    @ApiModelProperty(value = "是否为导入工单,true=是 false=否")
+    @Field(value = "is_import", type = FieldType.Boolean)
+    private Boolean isImport;
+
+    @ApiModelProperty(value = "是否已采集 YES 是 NO 否")
+    @Field(value = "is_gather", type = FieldType.Keyword)
+    private String isGather;
+
+    @ApiModelProperty(value = "是否异常工单 true/false")
+    @Field(value = "is_exception", type = FieldType.Boolean)
+    private Boolean isException;
+
+    @ApiModelProperty(value = "增置服务id")
+    @Field(value = "pg_incre_id", type = FieldType.Keyword)
+    private String pgIncreId;
+
+    @ApiModelProperty(value = "增置服务订单id")
+    @Field(value = "pg_incre_order_id", type = FieldType.Keyword)
+    private String pgIncreOrderId;
+
+    @ApiModelProperty(value = "增置服务明细id")
+    @Field(value = "pg_incre_item_id", type = FieldType.Keyword)
+    private String pgIncreItemId;
+
+    @ApiModelProperty(value = "增置服务售卖网点")
+    @Field(value = "pg_incre_websit_name", type = FieldType.Keyword)
+    private String pgIncreWebsitName;
+
+    @ApiModelProperty(value = "增置服务售卖网点id")
+    @Field(value = "pg_incre_websit_id", type = FieldType.Keyword)
+    private String pgIncreWebsitId;
+
+    @ApiModelProperty(value = "结算服务费用")
+    @Field(value = "settle_service_amount", type = FieldType.Keyword)
+    private BigDecimal settleServiceAmount;
+
+    @ApiModelProperty(value = "维保基础id")
+    @Field(value = "rp_project_repair_id", type = FieldType.Keyword)
+    private String rpProjectRepairId;
+
+    @ApiModelProperty(value = "工程维保名称")
+    @Field(value = "rp_project_repair_name", type = FieldType.Keyword)
+    private String rpProjectRepairName;
+
+    @ApiModelProperty(value = "费用支付方式 EXAMINE=审批后结算 SITE=现场支付")
+    @Field(value = "fee_pay_method", type = FieldType.Keyword)
+    private String feePayMethod;
+
+    @ApiModelProperty(value = "是否包含全部费用 YES=是 NO=否")
+    @Field(value = "is_all_fee", type = FieldType.Keyword)
+    private String isAllFee;
+
+    @ApiModelProperty(value = "销售类型 1=零售 2=工程 3=延保 4=工程维保")
+    @Field(value = "sale_type", type = FieldType.Integer)
+    private Integer saleType;
+
+    @ApiModelProperty(value = "工程编号")
+    @Field(value = "project_no", type = FieldType.Keyword)
+    private String projectNo;
+
+    @ApiModelProperty(value = "工程名称")
+    @Field(value = "project_name", type = FieldType.Keyword)
+    private String projectName;
+
+    @ApiModelProperty(value = "是否开启抢单")
+    @Field(value = "is_qd", type = FieldType.Boolean)
+    private Boolean isQd;
+
+    @ApiModelProperty(value = "是否已产生通知 true=是 false=否")
+    @Field(value = "is_qd_notice", type = FieldType.Boolean)
+    private Boolean isQdNotice;
+
+    @ApiModelProperty(value = "是否为拆机")
+    @Field(value = "is_cj", type = FieldType.Boolean)
+    private Boolean isCj;
+
+    @ApiModelProperty(value = "是否为租赁单 true/false")
+    @Field(value = "is_zl", type = FieldType.Boolean)
+    private Boolean isZl;
+
+
+
+    @ApiModelProperty(value = "是否为工单导入 true/false")
+    @Field(value = "is_import_excel", type = FieldType.Boolean)
+    private Boolean isImportExcel;
+
+    @ApiModelProperty(value = "服务状态")
+    @Field(value = "service_status", type = FieldType.Keyword)
+    private String serviceStatus;
+
+    @ApiModelProperty(value = "投诉等级")
+    @Field(value = "complaint", type = FieldType.Keyword)
+    private String complaint;
+
+    @ApiModelProperty(value = "紧急程度")
+    @Field(value = "urgent", type = FieldType.Keyword)
+    private String urgent;
+
+    @ApiModelProperty(value = "评价结果")
+    @Field(value = "evaluate", type = FieldType.Keyword)
+    private String evaluate;
+
+    @ApiModelProperty(value = "销售平台")
+    @Field(value = "sales_platform", type = FieldType.Keyword)
+    private String salesPlatform;
+
+    @ApiModelProperty(value = "购买单位")
+    @Field(value = "buy_name", type = FieldType.Keyword)
+    private String buyName;
+
+    @ApiModelProperty(value = "销售类型")
+    @Field(value = "sales_type_name", type = FieldType.Keyword)
+    private String salesTypeName;
+
+    @ApiModelProperty(value = "要求状态")
+    @Field(value = "req_status", type = FieldType.Keyword)
+    private String reqStatus;
+
+    @ApiModelProperty(value = "要求类型")
+    @Field(value = "req_type", type = FieldType.Keyword)
+    private String reqType;
+
+    @ApiModelProperty(value = "要求内容")
+    @Field(value = "req_text", type = FieldType.Keyword)
+    private String reqText;
+
+    @ApiModelProperty(value = "服务单号")
+    @Field(value = "service_order_id", type = FieldType.Keyword)
+    private String serviceOrderId;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sales_order_id", type = FieldType.Keyword)
+    private String salesOrderId;
+
+    @ApiModelProperty(value = "管理组织")
+    @Field(value = "manager_name", type = FieldType.Keyword)
+    private String managerName;
+
+    @ApiModelProperty(value = "运营主体")
+    @Field(value = "operate_entity", type = FieldType.Keyword)
+    private String operateEntity;
+
+    @ApiModelProperty(value = "大类名称")
+    @Field(value = "main_name", type = FieldType.Keyword)
+    private String mainName;
+
+
+    @ApiModelProperty(value = "师傅编号")
+    @Field(value = "worker_number", type = FieldType.Keyword)
+    private String workerNumber;
+
+
+    @ApiModelProperty(value = "上午下午")
+    @Field(value = "time_name", type = FieldType.Keyword)
+    private String timeName;
+
+    @ApiModelProperty(value = "所属公司")
+    @Field(value = "belong_company", type = FieldType.Keyword)
+    private String belongCompany;
+
+    @ApiModelProperty(value = "销售网点编号")
+    @Field(value = "sales_websit_number", type = FieldType.Keyword)
+    private String salesWebsitNumber;
+
+    @ApiModelProperty(value = "销售网点名称")
+    @Field(value = "sales_websit", type = FieldType.Keyword)
+    private String salesWebsit;
+
+    @ApiModelProperty(value = "创建人编号")
+    @Field(value = "create_number", type = FieldType.Keyword)
+    private String createNumber;
+
+    @ApiModelProperty(value = "评价标签")
+    @Field(value = "appraise_label", type = FieldType.Keyword)
+    private String appraiseLabel;
+
+    @ApiModelProperty(value = "是否是工单3.0同步true/false")
+    @Field(value = "is_three_order", type = FieldType.Boolean)
+    private Boolean isThreeOrder;
+
+    @ApiModelProperty(value = "故障类型")
+    @Field(value = "trouble_value", type = FieldType.Keyword)
+    private String troubleValue;
+
+    @ApiModelProperty(value = "需求类别")
+    @Field(value = "type", type = FieldType.Keyword)
+    private String type;
+
+    @ApiModelProperty(value = "需求小类")
+    @Field(value = "small_type", type = FieldType.Keyword)
+    private String smallType;
+
+    @ApiModelProperty(value = "1 已接单 0未接单")
+    @Field(value = "is_meet", type = FieldType.Boolean)
+    private Boolean isMeet;
+
+    @ApiModelProperty(value = "申请状态 ING=申请中 END=到货反馈 CANCEL=取消申请")
+    @Field(value = "parts_apply_status", type = FieldType.Keyword)
+    private String partsApplyStatus;
+
+    @ApiModelProperty(value = "首次派工时间")
+    @Field(value = "first_dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date firstDispatchTime;
+
+    @ApiModelProperty(value = "首次预约时间")
+    @Field(value = "first_appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date firstAppointmentTime;
+
+    @ApiModelProperty(value = "取消时间")
+    @Field(value = "cancel_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date cancelTime;
+
+    @ApiModelProperty(value = "联系人虚拟号")
+    @Field(value = "contact_virtual_no", type = FieldType.Keyword)
+    private String contactVirtualNo;
+}

+ 553 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBaseEs2023Date.java

@@ -0,0 +1,553 @@
+package com.gree.mall.manager.bean.es;
+
+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.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author qinrongjun
+ * @description
+ * @date 2023/6/19 10:39 星期一
+ */
+@Data
+@Document(indexName = "pg_order_base2023")
+public class OrderBaseEs2023Date {
+
+    @Id
+    @Field(value = "id", type = FieldType.Keyword)
+    private String id;
+
+    @ApiModelProperty(value = "服务说明(例如:家用空调x1,洗衣机x1)")
+    @Field(value = "order_title", type = FieldType.Keyword)
+    private String orderTitle;
+
+    @ApiModelProperty(value = "所属业务线   INSTALL=安装 REPAIR=维修")
+    @Field(value = "order_type", type = FieldType.Keyword)
+    private String orderType;
+
+    @ApiModelProperty(value = "所属业务线名称")
+    @Field(value = "order_type_text", type = FieldType.Keyword)
+    private String orderTypeText;
+
+    @ApiModelProperty(value = "工单类型")
+    @Field(value = "order_small_type", type = FieldType.Keyword)
+    private String orderSmallType;
+
+    @ApiModelProperty(value = "工单类型名称")
+    @Field(value = "order_small_type_text", type = FieldType.Keyword)
+    private String orderSmallTypeText;
+
+    @ApiModelProperty(value = "商户id")
+    @Field(value = "company_wechat_id", type = FieldType.Keyword)
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "商户名称")
+    @Field(value = "company_wechat_name", type = FieldType.Keyword)
+    private String companyWechatName;
+
+    @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_idcard", type = FieldType.Keyword)
+    private String workerIdcard;
+
+    @ApiModelProperty(value = "所有师傅的id(冗余字段),实际请看order_worker")
+    @Field(value = "worker_id_list", type = FieldType.Keyword)
+    private String workerIdList;
+
+    @ApiModelProperty(value = "工单状态 DYY=待预约 DSHPG=待商户派工 DWDPG=待网点派工 DQD=待抢单 DJD=待接单 FWZ=服务中 YCD=异常单 YWG=已完工待结算 YJS=已结算 YQX=已取消")
+    @Field(value = "order_status", type = FieldType.Keyword)
+    private String orderStatus;
+
+    @ApiModelProperty(value = "工单状态中文名称")
+    @Field(value = "order_status_text", type = FieldType.Keyword)
+    private String orderStatusText;
+
+    @ApiModelProperty(value = "派单给师傅的时间")
+    @Field(value = "dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date dispatchTime;
+
+    @ApiModelProperty(value = "师傅接单时间")
+    @Field(value = "worker_rece_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date workerReceTime;
+
+    @ApiModelProperty(value = "派工网点时间")
+    @Field(value = "dispatch_websit_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date dispatchWebsitTime;
+
+    @ApiModelProperty(value = "客户id(客户建单才有)")
+    @Field(value = "user_id", type = FieldType.Keyword)
+    private String userId;
+
+    @ApiModelProperty(value = "客户名称")
+    @Field(value = "user_name", type = FieldType.Keyword)
+    private String userName;
+
+    @ApiModelProperty(value = "联系人")
+    @Field(value = "link_name", type = FieldType.Keyword)
+    private String linkName;
+
+    @ApiModelProperty(value = "客户电话")
+    @Field(value = "user_mobile", type = FieldType.Keyword)
+    private String userMobile;
+
+    @ApiModelProperty(value = "客户电话2")
+    @Field(value = "user_mobile2", type = FieldType.Keyword)
+    private String userMobile2;
+
+    @ApiModelProperty(value = "省")
+    @Field(value = "province", type = FieldType.Keyword)
+    private String province;
+
+    @ApiModelProperty(value = "省id")
+    @Field(value = "province_id", type = FieldType.Keyword)
+    private String provinceId;
+
+    @ApiModelProperty(value = "市")
+    @Field(value = "city", type = FieldType.Keyword)
+    private String city;
+
+    @ApiModelProperty(value = "市id")
+    @Field(value = "city_id", type = FieldType.Keyword)
+    private String cityId;
+
+    @ApiModelProperty(value = "区")
+    @Field(value = "area", type = FieldType.Keyword)
+    private String area;
+
+    @ApiModelProperty(value = "区id")
+    @Field(value = "area_id", type = FieldType.Keyword)
+    private String areaId;
+
+    @ApiModelProperty(value = "街道")
+    @Field(value = "street", type = FieldType.Keyword)
+    private String street;
+
+    @ApiModelProperty(value = "街道id")
+    @Field(value = "street_id", type = FieldType.Keyword)
+    private String streetId;
+
+    @ApiModelProperty(value = "详细地址")
+    @Field(value = "address", type = FieldType.Keyword)
+    private String address;
+
+    @ApiModelProperty(value = "备注")
+    @Field(value = "remark", type = FieldType.Keyword)
+    private String remark;
+
+    @ApiModelProperty(value = "安装或维修网点名称(售后网点)")
+    @Field(value = "websit_name", type = FieldType.Keyword)
+    private String websitName;
+
+    @ApiModelProperty(value = "安装或维修网点编号(售后网点)")
+    @Field(value = "websit_id", type = FieldType.Keyword)
+    private String websitId;
+
+    @ApiModelProperty(value = "售后网点联系电话")
+    @Field(value = "websit_phone", type = FieldType.Keyword)
+    private String websitPhone;
+
+    @ApiModelProperty(value = "创建网点编号")
+    @Field(value = "create_websit_id", type = FieldType.Keyword)
+    private String createWebsitId;
+
+    @ApiModelProperty(value = "创建网点名称")
+    @Field(value = "create_websit_name", type = FieldType.Keyword)
+    private String createWebsitName;
+
+    @ApiModelProperty(value = "gps地址信息")
+    @Field(value = "gps_address", type = FieldType.Keyword)
+    private String gpsAddress;
+
+    @ApiModelProperty(value = "最新反馈记录")
+    @Field(value = "last_operator", type = FieldType.Keyword)
+    private String lastOperator;
+
+    @ApiModelProperty(value = "最近操作网点")
+    @Field(value = "last_operator_websit", type = FieldType.Keyword)
+    private String lastOperatorWebsit;
+
+    @ApiModelProperty(value = "最近操作网点编号")
+    @Field(value = "last_operator_by", type = FieldType.Keyword)
+    private String lastOperatorBy;
+
+    @ApiModelProperty(value = "最近操作时间")
+    @Field(value = "last_operator_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date lastOperatorTime;
+
+    @ApiModelProperty(value = "预约安装/维修时间")
+    @Field(value = "appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appointmentTime;
+
+    @ApiModelProperty(value = "预约结束时间")
+    @Field(value = "appointment_end_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appointmentEndTime;
+
+    @ApiModelProperty(value = "预约备注")
+    @Field(value = "appointment_remark", type = FieldType.Keyword)
+    private String appointmentRemark;
+
+    @ApiModelProperty(value = "安装/维修总数量")
+    @Field(value = "total_num", type = FieldType.Integer)
+    private Integer totalNum;
+
+    @ApiModelProperty(value = "未完成数量")
+    @Field(value = "undone_num", type = FieldType.Integer)
+    private Integer undoneNum;
+
+    @ApiModelProperty(value = "经度")
+    @Field(value = "lng", type = FieldType.Keyword)
+    private String lng;
+
+    @ApiModelProperty(value = "纬度")
+    @Field(value = "lat", type = FieldType.Keyword)
+    private String lat;
+
+    @ApiModelProperty(value = "师傅报完工时间")
+    @Field(value = "over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date overTime;
+
+    @ApiModelProperty(value = "网点报完工时间")
+    @Field(value = "websit_over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date websitOverTime;
+
+    @ApiModelProperty(value = "完工时间(精确到天)")
+    @Field(value = "over_date", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date overDate;
+
+    @ApiModelProperty(value = "正常关闭时间")
+    @Field(value = "close_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date closeTime;
+
+    @ApiModelProperty(value = "创建时间(精确到天)")
+    @Field(value = "create_date", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date createDate;
+
+    @ApiModelProperty(value = "创建时间")
+    @Field(value = "create_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人手机")
+    @Field(value = "create_mobile", type = FieldType.Keyword)
+    private String createMobile;
+
+    @ApiModelProperty(value = "创建人")
+    @Field(value = "create_by", type = FieldType.Keyword)
+    private String createBy;
+
+    @ApiModelProperty(value = "创建人名称")
+    @Field(value = "create_name", type = FieldType.Keyword)
+    private String createName;
+
+    @ApiModelProperty(value = "修改时间")
+    @Field(value = "update_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改人")
+    @Field(value = "update_by", type = FieldType.Keyword)
+    private String updateBy;
+
+    @ApiModelProperty(value = "首次评价(A:好评,B:中评,C:差评,N:未评价,O:其他")
+    @Field(value = "appraise_status", type = FieldType.Keyword)
+    private String appraiseStatus;
+
+    @ApiModelProperty(value = "首次评价内容")
+    @Field(value = "appraise_content", type = FieldType.Keyword)
+    private String appraiseContent;
+
+    @ApiModelProperty(value = "首次评价时间")
+    @Field(value = "appraise_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appraiseTime;
+
+    @ApiModelProperty(value = "评价来源 1=用户评价 2=商家评价")
+    @Field(value = "appraise_source", type = FieldType.Integer)
+    private Integer appraiseSource;
+
+    @ApiModelProperty(value = "多个图片逗号隔开")
+    @Field(value = "appraise_img_url", type = FieldType.Keyword)
+    private String appraiseImgUrl;
+
+    @ApiModelProperty(value = "师傅记事备注")
+    @Field(value = "worker_remark", type = FieldType.Keyword)
+    private String workerRemark;
+
+    @ApiModelProperty(value = "销售单位")
+    @Field(value = "sale_company", type = FieldType.Keyword)
+    private String saleCompany;
+
+    @ApiModelProperty(value = "最近一次操作预约/改约的时间")
+    @Field(value = "last_operator_appointment_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date lastOperatorAppointmentTime;
+
+    @ApiModelProperty(value = "工单渠道id")
+    @Field(value = "order_channel_id", type = FieldType.Keyword)
+    private String orderChannelId;
+
+    @ApiModelProperty(value = "工单渠道")
+    @Field(value = "order_channel_text", type = FieldType.Keyword)
+    private String orderChannelText;
+
+    @ApiModelProperty(value = "改约备注")
+    @Field(value = "change_remark", type = FieldType.Keyword)
+    private String changeRemark;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sale_order_id", type = FieldType.Keyword)
+    private String saleOrderId;
+
+    @ApiModelProperty(value = "销售单下单时间")
+    @Field(value = "sale_create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date saleCreateTime;
+    @ApiModelProperty(value = "销售单订单金额")
+    @Field(value = "sale_total_amount", type = FieldType.Keyword)
+    private BigDecimal saleTotalAmount;
+
+    @ApiModelProperty(value = "销售单备注")
+    @Field(value = "sale_remark", type = FieldType.Keyword)
+    private String saleRemark;
+
+    @ApiModelProperty(value = "内部来源")
+    @Field(value = "source", type = FieldType.Keyword)
+    private String source;
+
+    @ApiModelProperty(value = "完工反馈备注")
+    @Field(value = "over_remark", type = FieldType.Keyword)
+    private String overRemark;
+
+    @ApiModelProperty(value = "客户签名")
+    @Field(value = "user_sign", type = FieldType.Keyword)
+    private String userSign;
+
+    @ApiModelProperty(value = "是否为导入工单,true=是 false=否")
+    @Field(value = "is_import", type = FieldType.Boolean)
+    private Boolean isImport;
+
+    @ApiModelProperty(value = "是否已采集 YES 是 NO 否")
+    @Field(value = "is_gather", type = FieldType.Keyword)
+    private String isGather;
+
+    @ApiModelProperty(value = "是否异常工单 true/false")
+    @Field(value = "is_exception", type = FieldType.Boolean)
+    private Boolean isException;
+
+    @ApiModelProperty(value = "增置服务id")
+    @Field(value = "pg_incre_id", type = FieldType.Keyword)
+    private String pgIncreId;
+
+    @ApiModelProperty(value = "增置服务订单id")
+    @Field(value = "pg_incre_order_id", type = FieldType.Keyword)
+    private String pgIncreOrderId;
+
+    @ApiModelProperty(value = "增置服务明细id")
+    @Field(value = "pg_incre_item_id", type = FieldType.Keyword)
+    private String pgIncreItemId;
+
+    @ApiModelProperty(value = "增置服务售卖网点")
+    @Field(value = "pg_incre_websit_name", type = FieldType.Keyword)
+    private String pgIncreWebsitName;
+
+    @ApiModelProperty(value = "增置服务售卖网点id")
+    @Field(value = "pg_incre_websit_id", type = FieldType.Keyword)
+    private String pgIncreWebsitId;
+
+    @ApiModelProperty(value = "结算服务费用")
+    @Field(value = "settle_service_amount", type = FieldType.Keyword)
+    private BigDecimal settleServiceAmount;
+
+    @ApiModelProperty(value = "维保基础id")
+    @Field(value = "rp_project_repair_id", type = FieldType.Keyword)
+    private String rpProjectRepairId;
+
+    @ApiModelProperty(value = "工程维保名称")
+    @Field(value = "rp_project_repair_name", type = FieldType.Keyword)
+    private String rpProjectRepairName;
+
+    @ApiModelProperty(value = "费用支付方式 EXAMINE=审批后结算 SITE=现场支付")
+    @Field(value = "fee_pay_method", type = FieldType.Keyword)
+    private String feePayMethod;
+
+    @ApiModelProperty(value = "是否包含全部费用 YES=是 NO=否")
+    @Field(value = "is_all_fee", type = FieldType.Keyword)
+    private String isAllFee;
+
+    @ApiModelProperty(value = "销售类型 1=零售 2=工程 3=延保 4=工程维保")
+    @Field(value = "sale_type", type = FieldType.Integer)
+    private Integer saleType;
+
+    @ApiModelProperty(value = "工程编号")
+    @Field(value = "project_no", type = FieldType.Keyword)
+    private String projectNo;
+
+    @ApiModelProperty(value = "工程名称")
+    @Field(value = "project_name", type = FieldType.Keyword)
+    private String projectName;
+
+    @ApiModelProperty(value = "是否开启抢单")
+    @Field(value = "is_qd", type = FieldType.Boolean)
+    private Boolean isQd;
+
+    @ApiModelProperty(value = "是否已产生通知 true=是 false=否")
+    @Field(value = "is_qd_notice", type = FieldType.Boolean)
+    private Boolean isQdNotice;
+
+    @ApiModelProperty(value = "是否为拆机")
+    @Field(value = "is_cj", type = FieldType.Boolean)
+    private Boolean isCj;
+
+    @ApiModelProperty(value = "是否为租赁单 true/false")
+    @Field(value = "is_zl", type = FieldType.Boolean)
+    private Boolean isZl;
+
+
+
+    @ApiModelProperty(value = "是否为工单导入 true/false")
+    @Field(value = "is_import_excel", type = FieldType.Boolean)
+    private Boolean isImportExcel;
+
+    @ApiModelProperty(value = "服务状态")
+    @Field(value = "service_status", type = FieldType.Keyword)
+    private String serviceStatus;
+
+    @ApiModelProperty(value = "投诉等级")
+    @Field(value = "complaint", type = FieldType.Keyword)
+    private String complaint;
+
+    @ApiModelProperty(value = "紧急程度")
+    @Field(value = "urgent", type = FieldType.Keyword)
+    private String urgent;
+
+    @ApiModelProperty(value = "评价结果")
+    @Field(value = "evaluate", type = FieldType.Keyword)
+    private String evaluate;
+
+    @ApiModelProperty(value = "销售平台")
+    @Field(value = "sales_platform", type = FieldType.Keyword)
+    private String salesPlatform;
+
+    @ApiModelProperty(value = "购买单位")
+    @Field(value = "buy_name", type = FieldType.Keyword)
+    private String buyName;
+
+    @ApiModelProperty(value = "销售类型")
+    @Field(value = "sales_type_name", type = FieldType.Keyword)
+    private String salesTypeName;
+
+    @ApiModelProperty(value = "要求状态")
+    @Field(value = "req_status", type = FieldType.Keyword)
+    private String reqStatus;
+
+    @ApiModelProperty(value = "要求类型")
+    @Field(value = "req_type", type = FieldType.Keyword)
+    private String reqType;
+
+    @ApiModelProperty(value = "要求内容")
+    @Field(value = "req_text", type = FieldType.Keyword)
+    private String reqText;
+
+    @ApiModelProperty(value = "服务单号")
+    @Field(value = "service_order_id", type = FieldType.Keyword)
+    private String serviceOrderId;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sales_order_id", type = FieldType.Keyword)
+    private String salesOrderId;
+
+    @ApiModelProperty(value = "管理组织")
+    @Field(value = "manager_name", type = FieldType.Keyword)
+    private String managerName;
+
+    @ApiModelProperty(value = "运营主体")
+    @Field(value = "operate_entity", type = FieldType.Keyword)
+    private String operateEntity;
+
+    @ApiModelProperty(value = "大类名称")
+    @Field(value = "main_name", type = FieldType.Keyword)
+    private String mainName;
+
+
+    @ApiModelProperty(value = "师傅编号")
+    @Field(value = "worker_number", type = FieldType.Keyword)
+    private String workerNumber;
+
+
+    @ApiModelProperty(value = "上午下午")
+    @Field(value = "time_name", type = FieldType.Keyword)
+    private String timeName;
+
+    @ApiModelProperty(value = "所属公司")
+    @Field(value = "belong_company", type = FieldType.Keyword)
+    private String belongCompany;
+
+    @ApiModelProperty(value = "销售网点编号")
+    @Field(value = "sales_websit_number", type = FieldType.Keyword)
+    private String salesWebsitNumber;
+
+    @ApiModelProperty(value = "销售网点名称")
+    @Field(value = "sales_websit", type = FieldType.Keyword)
+    private String salesWebsit;
+
+    @ApiModelProperty(value = "创建人编号")
+    @Field(value = "create_number", type = FieldType.Keyword)
+    private String createNumber;
+
+    @ApiModelProperty(value = "评价标签")
+    @Field(value = "appraise_label", type = FieldType.Keyword)
+    private String appraiseLabel;
+
+    @ApiModelProperty(value = "是否是工单3.0同步true/false")
+    @Field(value = "is_three_order", type = FieldType.Boolean)
+    private Boolean isThreeOrder;
+
+    @ApiModelProperty(value = "故障类型")
+    @Field(value = "trouble_value", type = FieldType.Keyword)
+    private String troubleValue;
+
+    @ApiModelProperty(value = "需求类别")
+    @Field(value = "type", type = FieldType.Keyword)
+    private String type;
+
+    @ApiModelProperty(value = "需求小类")
+    @Field(value = "small_type", type = FieldType.Keyword)
+    private String smallType;
+
+    @ApiModelProperty(value = "1 已接单 0未接单")
+    @Field(value = "is_meet", type = FieldType.Boolean)
+    private Boolean isMeet;
+
+    @ApiModelProperty(value = "申请状态 ING=申请中 END=到货反馈 CANCEL=取消申请")
+    @Field(value = "parts_apply_status", type = FieldType.Keyword)
+    private String partsApplyStatus;
+
+    @ApiModelProperty(value = "首次派工时间")
+    @Field(value = "first_dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date firstDispatchTime;
+
+    @ApiModelProperty(value = "首次预约时间")
+    @Field(value = "first_appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date firstAppointmentTime;
+
+    @ApiModelProperty(value = "取消时间")
+    @Field(value = "cancel_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date cancelTime;
+
+    @ApiModelProperty(value = "联系人虚拟号")
+    @Field(value = "contact_virtual_no", type = FieldType.Keyword)
+    private String contactVirtualNo;
+}

+ 553 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/es/OrderBaseEs2024Date.java

@@ -0,0 +1,553 @@
+package com.gree.mall.manager.bean.es;
+
+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.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author qinrongjun
+ * @description
+ * @date 2023/6/19 10:39 星期一
+ */
+@Data
+@Document(indexName = "pg_order_base2024")
+public class OrderBaseEs2024Date {
+
+    @Id
+    @Field(value = "id", type = FieldType.Keyword)
+    private String id;
+
+    @ApiModelProperty(value = "服务说明(例如:家用空调x1,洗衣机x1)")
+    @Field(value = "order_title", type = FieldType.Keyword)
+    private String orderTitle;
+
+    @ApiModelProperty(value = "所属业务线   INSTALL=安装 REPAIR=维修")
+    @Field(value = "order_type", type = FieldType.Keyword)
+    private String orderType;
+
+    @ApiModelProperty(value = "所属业务线名称")
+    @Field(value = "order_type_text", type = FieldType.Keyword)
+    private String orderTypeText;
+
+    @ApiModelProperty(value = "工单类型")
+    @Field(value = "order_small_type", type = FieldType.Keyword)
+    private String orderSmallType;
+
+    @ApiModelProperty(value = "工单类型名称")
+    @Field(value = "order_small_type_text", type = FieldType.Keyword)
+    private String orderSmallTypeText;
+
+    @ApiModelProperty(value = "商户id")
+    @Field(value = "company_wechat_id", type = FieldType.Keyword)
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "商户名称")
+    @Field(value = "company_wechat_name", type = FieldType.Keyword)
+    private String companyWechatName;
+
+    @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_idcard", type = FieldType.Keyword)
+    private String workerIdcard;
+
+    @ApiModelProperty(value = "所有师傅的id(冗余字段),实际请看order_worker")
+    @Field(value = "worker_id_list", type = FieldType.Keyword)
+    private String workerIdList;
+
+    @ApiModelProperty(value = "工单状态 DYY=待预约 DSHPG=待商户派工 DWDPG=待网点派工 DQD=待抢单 DJD=待接单 FWZ=服务中 YCD=异常单 YWG=已完工待结算 YJS=已结算 YQX=已取消")
+    @Field(value = "order_status", type = FieldType.Keyword)
+    private String orderStatus;
+
+    @ApiModelProperty(value = "工单状态中文名称")
+    @Field(value = "order_status_text", type = FieldType.Keyword)
+    private String orderStatusText;
+
+    @ApiModelProperty(value = "派单给师傅的时间")
+    @Field(value = "dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date dispatchTime;
+
+    @ApiModelProperty(value = "师傅接单时间")
+    @Field(value = "worker_rece_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date workerReceTime;
+
+    @ApiModelProperty(value = "派工网点时间")
+    @Field(value = "dispatch_websit_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date dispatchWebsitTime;
+
+    @ApiModelProperty(value = "客户id(客户建单才有)")
+    @Field(value = "user_id", type = FieldType.Keyword)
+    private String userId;
+
+    @ApiModelProperty(value = "客户名称")
+    @Field(value = "user_name", type = FieldType.Keyword)
+    private String userName;
+
+    @ApiModelProperty(value = "联系人")
+    @Field(value = "link_name", type = FieldType.Keyword)
+    private String linkName;
+
+    @ApiModelProperty(value = "客户电话")
+    @Field(value = "user_mobile", type = FieldType.Keyword)
+    private String userMobile;
+
+    @ApiModelProperty(value = "客户电话2")
+    @Field(value = "user_mobile2", type = FieldType.Keyword)
+    private String userMobile2;
+
+    @ApiModelProperty(value = "省")
+    @Field(value = "province", type = FieldType.Keyword)
+    private String province;
+
+    @ApiModelProperty(value = "省id")
+    @Field(value = "province_id", type = FieldType.Keyword)
+    private String provinceId;
+
+    @ApiModelProperty(value = "市")
+    @Field(value = "city", type = FieldType.Keyword)
+    private String city;
+
+    @ApiModelProperty(value = "市id")
+    @Field(value = "city_id", type = FieldType.Keyword)
+    private String cityId;
+
+    @ApiModelProperty(value = "区")
+    @Field(value = "area", type = FieldType.Keyword)
+    private String area;
+
+    @ApiModelProperty(value = "区id")
+    @Field(value = "area_id", type = FieldType.Keyword)
+    private String areaId;
+
+    @ApiModelProperty(value = "街道")
+    @Field(value = "street", type = FieldType.Keyword)
+    private String street;
+
+    @ApiModelProperty(value = "街道id")
+    @Field(value = "street_id", type = FieldType.Keyword)
+    private String streetId;
+
+    @ApiModelProperty(value = "详细地址")
+    @Field(value = "address", type = FieldType.Keyword)
+    private String address;
+
+    @ApiModelProperty(value = "备注")
+    @Field(value = "remark", type = FieldType.Keyword)
+    private String remark;
+
+    @ApiModelProperty(value = "安装或维修网点名称(售后网点)")
+    @Field(value = "websit_name", type = FieldType.Keyword)
+    private String websitName;
+
+    @ApiModelProperty(value = "安装或维修网点编号(售后网点)")
+    @Field(value = "websit_id", type = FieldType.Keyword)
+    private String websitId;
+
+    @ApiModelProperty(value = "售后网点联系电话")
+    @Field(value = "websit_phone", type = FieldType.Keyword)
+    private String websitPhone;
+
+    @ApiModelProperty(value = "创建网点编号")
+    @Field(value = "create_websit_id", type = FieldType.Keyword)
+    private String createWebsitId;
+
+    @ApiModelProperty(value = "创建网点名称")
+    @Field(value = "create_websit_name", type = FieldType.Keyword)
+    private String createWebsitName;
+
+    @ApiModelProperty(value = "gps地址信息")
+    @Field(value = "gps_address", type = FieldType.Keyword)
+    private String gpsAddress;
+
+    @ApiModelProperty(value = "最新反馈记录")
+    @Field(value = "last_operator", type = FieldType.Keyword)
+    private String lastOperator;
+
+    @ApiModelProperty(value = "最近操作网点")
+    @Field(value = "last_operator_websit", type = FieldType.Keyword)
+    private String lastOperatorWebsit;
+
+    @ApiModelProperty(value = "最近操作网点编号")
+    @Field(value = "last_operator_by", type = FieldType.Keyword)
+    private String lastOperatorBy;
+
+    @ApiModelProperty(value = "最近操作时间")
+    @Field(value = "last_operator_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date lastOperatorTime;
+
+    @ApiModelProperty(value = "预约安装/维修时间")
+    @Field(value = "appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appointmentTime;
+
+    @ApiModelProperty(value = "预约结束时间")
+    @Field(value = "appointment_end_time",type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appointmentEndTime;
+
+    @ApiModelProperty(value = "预约备注")
+    @Field(value = "appointment_remark", type = FieldType.Keyword)
+    private String appointmentRemark;
+
+    @ApiModelProperty(value = "安装/维修总数量")
+    @Field(value = "total_num", type = FieldType.Integer)
+    private Integer totalNum;
+
+    @ApiModelProperty(value = "未完成数量")
+    @Field(value = "undone_num", type = FieldType.Integer)
+    private Integer undoneNum;
+
+    @ApiModelProperty(value = "经度")
+    @Field(value = "lng", type = FieldType.Keyword)
+    private String lng;
+
+    @ApiModelProperty(value = "纬度")
+    @Field(value = "lat", type = FieldType.Keyword)
+    private String lat;
+
+    @ApiModelProperty(value = "师傅报完工时间")
+    @Field(value = "over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date overTime;
+
+    @ApiModelProperty(value = "网点报完工时间")
+    @Field(value = "websit_over_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date websitOverTime;
+
+    @ApiModelProperty(value = "完工时间(精确到天)")
+    @Field(value = "over_date", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date overDate;
+
+    @ApiModelProperty(value = "正常关闭时间")
+    @Field(value = "close_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date closeTime;
+
+    @ApiModelProperty(value = "创建时间(精确到天)")
+    @Field(value = "create_date", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date createDate;
+
+    @ApiModelProperty(value = "创建时间")
+    @Field(value = "create_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人手机")
+    @Field(value = "create_mobile", type = FieldType.Keyword)
+    private String createMobile;
+
+    @ApiModelProperty(value = "创建人")
+    @Field(value = "create_by", type = FieldType.Keyword)
+    private String createBy;
+
+    @ApiModelProperty(value = "创建人名称")
+    @Field(value = "create_name", type = FieldType.Keyword)
+    private String createName;
+
+    @ApiModelProperty(value = "修改时间")
+    @Field(value = "update_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改人")
+    @Field(value = "update_by", type = FieldType.Keyword)
+    private String updateBy;
+
+    @ApiModelProperty(value = "首次评价(A:好评,B:中评,C:差评,N:未评价,O:其他")
+    @Field(value = "appraise_status", type = FieldType.Keyword)
+    private String appraiseStatus;
+
+    @ApiModelProperty(value = "首次评价内容")
+    @Field(value = "appraise_content", type = FieldType.Keyword)
+    private String appraiseContent;
+
+    @ApiModelProperty(value = "首次评价时间")
+    @Field(value = "appraise_time", type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date appraiseTime;
+
+    @ApiModelProperty(value = "评价来源 1=用户评价 2=商家评价")
+    @Field(value = "appraise_source", type = FieldType.Integer)
+    private Integer appraiseSource;
+
+    @ApiModelProperty(value = "多个图片逗号隔开")
+    @Field(value = "appraise_img_url", type = FieldType.Keyword)
+    private String appraiseImgUrl;
+
+    @ApiModelProperty(value = "师傅记事备注")
+    @Field(value = "worker_remark", type = FieldType.Keyword)
+    private String workerRemark;
+
+    @ApiModelProperty(value = "销售单位")
+    @Field(value = "sale_company", type = FieldType.Keyword)
+    private String saleCompany;
+
+    @ApiModelProperty(value = "最近一次操作预约/改约的时间")
+    @Field(value = "last_operator_appointment_time",type = FieldType.Date, format = DateFormat.custom,pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date lastOperatorAppointmentTime;
+
+    @ApiModelProperty(value = "工单渠道id")
+    @Field(value = "order_channel_id", type = FieldType.Keyword)
+    private String orderChannelId;
+
+    @ApiModelProperty(value = "工单渠道")
+    @Field(value = "order_channel_text", type = FieldType.Keyword)
+    private String orderChannelText;
+
+    @ApiModelProperty(value = "改约备注")
+    @Field(value = "change_remark", type = FieldType.Keyword)
+    private String changeRemark;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sale_order_id", type = FieldType.Keyword)
+    private String saleOrderId;
+
+    @ApiModelProperty(value = "销售单下单时间")
+    @Field(value = "sale_create_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date saleCreateTime;
+    @ApiModelProperty(value = "销售单订单金额")
+    @Field(value = "sale_total_amount", type = FieldType.Keyword)
+    private BigDecimal saleTotalAmount;
+
+    @ApiModelProperty(value = "销售单备注")
+    @Field(value = "sale_remark", type = FieldType.Keyword)
+    private String saleRemark;
+
+    @ApiModelProperty(value = "内部来源")
+    @Field(value = "source", type = FieldType.Keyword)
+    private String source;
+
+    @ApiModelProperty(value = "完工反馈备注")
+    @Field(value = "over_remark", type = FieldType.Keyword)
+    private String overRemark;
+
+    @ApiModelProperty(value = "客户签名")
+    @Field(value = "user_sign", type = FieldType.Keyword)
+    private String userSign;
+
+    @ApiModelProperty(value = "是否为导入工单,true=是 false=否")
+    @Field(value = "is_import", type = FieldType.Boolean)
+    private Boolean isImport;
+
+    @ApiModelProperty(value = "是否已采集 YES 是 NO 否")
+    @Field(value = "is_gather", type = FieldType.Keyword)
+    private String isGather;
+
+    @ApiModelProperty(value = "是否异常工单 true/false")
+    @Field(value = "is_exception", type = FieldType.Boolean)
+    private Boolean isException;
+
+    @ApiModelProperty(value = "增置服务id")
+    @Field(value = "pg_incre_id", type = FieldType.Keyword)
+    private String pgIncreId;
+
+    @ApiModelProperty(value = "增置服务订单id")
+    @Field(value = "pg_incre_order_id", type = FieldType.Keyword)
+    private String pgIncreOrderId;
+
+    @ApiModelProperty(value = "增置服务明细id")
+    @Field(value = "pg_incre_item_id", type = FieldType.Keyword)
+    private String pgIncreItemId;
+
+    @ApiModelProperty(value = "增置服务售卖网点")
+    @Field(value = "pg_incre_websit_name", type = FieldType.Keyword)
+    private String pgIncreWebsitName;
+
+    @ApiModelProperty(value = "增置服务售卖网点id")
+    @Field(value = "pg_incre_websit_id", type = FieldType.Keyword)
+    private String pgIncreWebsitId;
+
+    @ApiModelProperty(value = "结算服务费用")
+    @Field(value = "settle_service_amount", type = FieldType.Keyword)
+    private BigDecimal settleServiceAmount;
+
+    @ApiModelProperty(value = "维保基础id")
+    @Field(value = "rp_project_repair_id", type = FieldType.Keyword)
+    private String rpProjectRepairId;
+
+    @ApiModelProperty(value = "工程维保名称")
+    @Field(value = "rp_project_repair_name", type = FieldType.Keyword)
+    private String rpProjectRepairName;
+
+    @ApiModelProperty(value = "费用支付方式 EXAMINE=审批后结算 SITE=现场支付")
+    @Field(value = "fee_pay_method", type = FieldType.Keyword)
+    private String feePayMethod;
+
+    @ApiModelProperty(value = "是否包含全部费用 YES=是 NO=否")
+    @Field(value = "is_all_fee", type = FieldType.Keyword)
+    private String isAllFee;
+
+    @ApiModelProperty(value = "销售类型 1=零售 2=工程 3=延保 4=工程维保")
+    @Field(value = "sale_type", type = FieldType.Integer)
+    private Integer saleType;
+
+    @ApiModelProperty(value = "工程编号")
+    @Field(value = "project_no", type = FieldType.Keyword)
+    private String projectNo;
+
+    @ApiModelProperty(value = "工程名称")
+    @Field(value = "project_name", type = FieldType.Keyword)
+    private String projectName;
+
+    @ApiModelProperty(value = "是否开启抢单")
+    @Field(value = "is_qd", type = FieldType.Boolean)
+    private Boolean isQd;
+
+    @ApiModelProperty(value = "是否已产生通知 true=是 false=否")
+    @Field(value = "is_qd_notice", type = FieldType.Boolean)
+    private Boolean isQdNotice;
+
+    @ApiModelProperty(value = "是否为拆机")
+    @Field(value = "is_cj", type = FieldType.Boolean)
+    private Boolean isCj;
+
+    @ApiModelProperty(value = "是否为租赁单 true/false")
+    @Field(value = "is_zl", type = FieldType.Boolean)
+    private Boolean isZl;
+
+
+
+    @ApiModelProperty(value = "是否为工单导入 true/false")
+    @Field(value = "is_import_excel", type = FieldType.Boolean)
+    private Boolean isImportExcel;
+
+    @ApiModelProperty(value = "服务状态")
+    @Field(value = "service_status", type = FieldType.Keyword)
+    private String serviceStatus;
+
+    @ApiModelProperty(value = "投诉等级")
+    @Field(value = "complaint", type = FieldType.Keyword)
+    private String complaint;
+
+    @ApiModelProperty(value = "紧急程度")
+    @Field(value = "urgent", type = FieldType.Keyword)
+    private String urgent;
+
+    @ApiModelProperty(value = "评价结果")
+    @Field(value = "evaluate", type = FieldType.Keyword)
+    private String evaluate;
+
+    @ApiModelProperty(value = "销售平台")
+    @Field(value = "sales_platform", type = FieldType.Keyword)
+    private String salesPlatform;
+
+    @ApiModelProperty(value = "购买单位")
+    @Field(value = "buy_name", type = FieldType.Keyword)
+    private String buyName;
+
+    @ApiModelProperty(value = "销售类型")
+    @Field(value = "sales_type_name", type = FieldType.Keyword)
+    private String salesTypeName;
+
+    @ApiModelProperty(value = "要求状态")
+    @Field(value = "req_status", type = FieldType.Keyword)
+    private String reqStatus;
+
+    @ApiModelProperty(value = "要求类型")
+    @Field(value = "req_type", type = FieldType.Keyword)
+    private String reqType;
+
+    @ApiModelProperty(value = "要求内容")
+    @Field(value = "req_text", type = FieldType.Keyword)
+    private String reqText;
+
+    @ApiModelProperty(value = "服务单号")
+    @Field(value = "service_order_id", type = FieldType.Keyword)
+    private String serviceOrderId;
+
+    @ApiModelProperty(value = "销售单号")
+    @Field(value = "sales_order_id", type = FieldType.Keyword)
+    private String salesOrderId;
+
+    @ApiModelProperty(value = "管理组织")
+    @Field(value = "manager_name", type = FieldType.Keyword)
+    private String managerName;
+
+    @ApiModelProperty(value = "运营主体")
+    @Field(value = "operate_entity", type = FieldType.Keyword)
+    private String operateEntity;
+
+    @ApiModelProperty(value = "大类名称")
+    @Field(value = "main_name", type = FieldType.Keyword)
+    private String mainName;
+
+
+    @ApiModelProperty(value = "师傅编号")
+    @Field(value = "worker_number", type = FieldType.Keyword)
+    private String workerNumber;
+
+
+    @ApiModelProperty(value = "上午下午")
+    @Field(value = "time_name", type = FieldType.Keyword)
+    private String timeName;
+
+    @ApiModelProperty(value = "所属公司")
+    @Field(value = "belong_company", type = FieldType.Keyword)
+    private String belongCompany;
+
+    @ApiModelProperty(value = "销售网点编号")
+    @Field(value = "sales_websit_number", type = FieldType.Keyword)
+    private String salesWebsitNumber;
+
+    @ApiModelProperty(value = "销售网点名称")
+    @Field(value = "sales_websit", type = FieldType.Keyword)
+    private String salesWebsit;
+
+    @ApiModelProperty(value = "创建人编号")
+    @Field(value = "create_number", type = FieldType.Keyword)
+    private String createNumber;
+
+    @ApiModelProperty(value = "评价标签")
+    @Field(value = "appraise_label", type = FieldType.Keyword)
+    private String appraiseLabel;
+
+    @ApiModelProperty(value = "是否是工单3.0同步true/false")
+    @Field(value = "is_three_order", type = FieldType.Boolean)
+    private Boolean isThreeOrder;
+
+    @ApiModelProperty(value = "故障类型")
+    @Field(value = "trouble_value", type = FieldType.Keyword)
+    private String troubleValue;
+
+    @ApiModelProperty(value = "需求类别")
+    @Field(value = "type", type = FieldType.Keyword)
+    private String type;
+
+    @ApiModelProperty(value = "需求小类")
+    @Field(value = "small_type", type = FieldType.Keyword)
+    private String smallType;
+
+    @ApiModelProperty(value = "1 已接单 0未接单")
+    @Field(value = "is_meet", type = FieldType.Boolean)
+    private Boolean isMeet;
+
+    @ApiModelProperty(value = "申请状态 ING=申请中 END=到货反馈 CANCEL=取消申请")
+    @Field(value = "parts_apply_status", type = FieldType.Keyword)
+    private String partsApplyStatus;
+
+    @ApiModelProperty(value = "首次派工时间")
+    @Field(value = "first_dispatch_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date firstDispatchTime;
+
+    @ApiModelProperty(value = "首次预约时间")
+    @Field(value = "first_appointment_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date firstAppointmentTime;
+
+    @ApiModelProperty(value = "取消时间")
+    @Field(value = "cancel_time", type = FieldType.Date,format = DateFormat.custom, pattern ="yyyy-MM-dd HH:mm:ss")
+    private Date cancelTime;
+
+    @ApiModelProperty(value = "联系人虚拟号")
+    @Field(value = "contact_virtual_no", type = FieldType.Keyword)
+    private String contactVirtualNo;
+}

+ 3 - 1
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/CommonMapper.java

@@ -229,7 +229,9 @@ public interface CommonMapper {
                                             @Param("ex") WorkOrderZfireParam zfireParamBean,
                                             @Param("adminUserType") Integer adminUserType
             ,@Param("companyWechatId") String companyWechatId,
-            @Param("orderBaseId") List<String> orderBaseId
+            @Param("orderBaseId") List<String> orderBaseId,
+            @Param("sqlBase") String sqlBase
+
                                             );
 
     /**

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

@@ -85,7 +85,7 @@ public class ChangeOrderController {
             @ApiParam(value = "WAIT 待采集 WAIT_SAVE 待完善  OK 已采集" , required = false) @RequestParam(required = false) List<String> status,
             HttpServletRequest request
     ) throws ParseException {
-        List<PgOrderProductDetail> pgOrderProducts = changeOrderLogic.getOrderProduct(id,status);
+        List<PgOrderProductDetail> pgOrderProducts = changeOrderLogic.getOrderProduct(id,status,request);
         return ResponseHelper.success(pgOrderProducts);
     }
 
@@ -96,17 +96,18 @@ public class ChangeOrderController {
             @ApiParam(value = "采集详细id" , required = true) @RequestParam(required = true) String id,
             HttpServletRequest request
     ) throws ParseException {
-        PgOrderProductDetailVO pgOrderProductDetail = changeOrderLogic.productDetail(id);
+        PgOrderProductDetailVO pgOrderProductDetail = changeOrderLogic.productDetail(id,request);
         return ResponseHelper.success(pgOrderProductDetail);
     }
 
     @PostMapping("/getOrderList")
     @ApiOperation(value = "获得电子支付")
     public ResponseHelper<List<WorkerOrderDetail>> getOrder(
-            @ApiParam(required = false, value = "工单号") @RequestParam(required = false) String id
+            @ApiParam(required = false, value = "工单号") @RequestParam(required = false) String id,
+            HttpServletRequest request
 
     ) throws Exception {
-        List<WorkerOrderDetail> workerOrderDetail = changeOrderLogic.getOrderList(id);
+        List<WorkerOrderDetail> workerOrderDetail = changeOrderLogic.getOrderList(id,request);
         return ResponseHelper.success(workerOrderDetail);
     }
 

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

@@ -66,20 +66,22 @@ public class ESOrderBaseController {
     @PostMapping("/list")
     @ApiOperation(value = "列表")
     public ResponseHelper<Page<OrderBaseVO>> list(
-            @RequestBody WorkOrderZfireParam workOrderZfireParam
+            @RequestBody WorkOrderZfireParam workOrderZfireParam,
+            HttpServletRequest request
     ) {
-        IPage<OrderBaseVO> orderBaseVOIPage = orderBaseEsLogic.orderBaseEsList(workOrderZfireParam);
+        IPage<OrderBaseVO> orderBaseVOIPage = orderBaseEsLogic.orderBaseEsList(workOrderZfireParam,request);
         return ResponseHelper.success(orderBaseVOIPage, new TypeReference<OrderBaseVO>() {});
     }
 
     @PostMapping("/list/export")
     @ApiOperation(value = "导出")
-    public synchronized void listExport(@RequestBody WorkOrderZfireParam zfireParamBean, HttpServletRequest request, HttpServletResponse response) throws Exception {
+    public synchronized void listExport(@RequestBody WorkOrderZfireParam zfireParamBean,
+                                        HttpServletRequest request, HttpServletResponse response) throws Exception {
         //1.组装查询条件
         ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
         //2.查询要导出的内容
 
-        List<OrderBaseVO> orderBaseVOIPage = orderBaseEsLogic.listExport(zfireParamBean);
+        List<OrderBaseVO> orderBaseVOIPage = orderBaseEsLogic.listExport(zfireParamBean,request);
 
         //3.导出
         FieldUtils.exportData(orderBaseVOIPage, zfireParam.getExportFields(), request, response);
@@ -91,9 +93,10 @@ public class ESOrderBaseController {
             @RequestParam(required = false) String startTime,
             @RequestParam(required = false) String endTime,
             @RequestParam(required = false) String orderSmallType,
-            @RequestParam(required = false) String orderSmallTypeText
+            @RequestParam(required = false) String orderSmallTypeText,
+            HttpServletRequest request
     ) {
-        List<Map<String, Object>> maps = orderBaseEsLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText);
+        List<Map<String, Object>> maps = orderBaseEsLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText,request);
         return ResponseHelper.success(maps);
     }
 

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

@@ -27,6 +27,7 @@ import com.gree.mall.manager.plus.entity.PgOrderBase;
 import com.gree.mall.manager.plus.entity.PgOrderOperatorLog;
 import com.gree.mall.manager.plus.entity.PgOrderProduct;
 import com.gree.mall.manager.plus.entity.PgOrderWorker;
+import com.gree.mall.manager.utils.CommonUtils;
 import com.gree.mall.manager.utils.excel.ExcelUtils;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
@@ -67,9 +68,10 @@ public class OrderBaseController {
     @PostMapping("/list")
     @ApiOperation(value = "列表")
     public ResponseHelper<Page<OrderBaseVO>> list(
-            @RequestBody WorkOrderZfireParam workOrderZfireParam
+            @RequestBody WorkOrderZfireParam workOrderZfireParam,
+            HttpServletRequest request
     ) {
-        IPage<OrderBaseVO> orderBaseVOIPage = orderBaseLogic.orderBaseList(workOrderZfireParam);
+        IPage<OrderBaseVO> orderBaseVOIPage = orderBaseLogic.orderBaseList(workOrderZfireParam,request);
         return ResponseHelper.success(orderBaseVOIPage, new TypeReference<OrderBaseVO>() {});
     }
 
@@ -80,7 +82,7 @@ public class OrderBaseController {
         ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
         zfireParam.setPageSize(10000);
         //2.查询要导出的内容
-        IPage<OrderBaseVO> page = orderBaseLogic.orderBaseList(zfireParamBean);
+        IPage<OrderBaseVO> page = orderBaseLogic.orderBaseList(zfireParamBean,request);
         //3.导出
         FieldUtils.exportData(page.getRecords(), zfireParam.getExportFields(), request, response);
     }
@@ -104,9 +106,10 @@ public class OrderBaseController {
             @RequestParam(required = false) String startTime,
             @RequestParam(required = false) String endTime,
             @RequestParam(required = false) String orderSmallType,
-            @RequestParam(required = false) String orderSmallTypeText
+            @RequestParam(required = false) String orderSmallTypeText,
+            HttpServletRequest request
     ) {
-        List<Map<String, Object>> maps = orderBaseEsLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText);
+        List<Map<String, Object>> maps = orderBaseEsLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText,request);
        // List<Map<String, Object>> maps = orderBaseLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText);
         return ResponseHelper.success(maps);
     }
@@ -241,23 +244,24 @@ public class OrderBaseController {
 
     @PostMapping("/detail")
     @ApiOperation(value = "工单-详情")
-    public ResponseHelper<OrderAddBeanDTO> detail(@RequestParam String orderBaseId){
-        OrderAddBeanDTO detail = orderBaseLogic.detail(orderBaseId);
+    public ResponseHelper<OrderAddBeanDTO> detail(@RequestParam String orderBaseId, HttpServletRequest request){
+        OrderAddBeanDTO detail = orderBaseLogic.detail(orderBaseId,request);
         return ResponseHelper.success(detail);
     }
 
     @PostMapping("/worker/list")
     @ApiOperation(value = "工单师傅-列表")
-    public ResponseHelper<List<PgOrderWorker>> workerList(@RequestParam String orderBaseId){
-        List<PgOrderWorker> orderWorkers = orderBaseLogic.orderWorkerList(orderBaseId);
+    public ResponseHelper<List<PgOrderWorker>> workerList(@RequestParam String orderBaseId,HttpServletRequest request){
+        String year = CommonUtils.getYear(request);
+        List<PgOrderWorker> orderWorkers = orderBaseLogic.orderWorkerList(orderBaseId,year);
         return ResponseHelper.success(orderWorkers);
     }
 
 
     @PostMapping("/product/list")
     @ApiOperation(value = "服务单-工单机型列表")
-    public ResponseHelper<List<PgOrderProduct>> productList(@RequestParam String orderBaseId) {
-        List<PgOrderProduct> orderProducts = orderBaseLogic.listOrderProduct(orderBaseId);
+    public ResponseHelper<List<PgOrderProduct>> productList(@RequestParam String orderBaseId,HttpServletRequest request) {
+        List<PgOrderProduct> orderProducts = orderBaseLogic.listOrderProduct(orderBaseId,request);
         return ResponseHelper.success(orderProducts);
     }
 
@@ -308,9 +312,10 @@ public class OrderBaseController {
     @PostMapping("/log/list")
     @ApiOperation(value = "工单操作明细-列表")
     public ResponseHelper<List<PgOrderOperatorLog>> orderOperatorLog(
-            @RequestParam String orderBaseId
+            @RequestParam String orderBaseId,
+            HttpServletRequest request
     ) {
-        List<PgOrderOperatorLog> pgOrderOperatorLogs = orderLogLogic.operatorLogList(orderBaseId);
+        List<PgOrderOperatorLog> pgOrderOperatorLogs = orderLogLogic.operatorLogList(orderBaseId,request);
         return ResponseHelper.success(pgOrderOperatorLogs);
     }
 

+ 6 - 2
mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/OrderBaseCountController.java

@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
+
 @RequiredArgsConstructor
 @Slf4j
 @RestController
@@ -25,8 +27,10 @@ public class OrderBaseCountController {
     @PostMapping("/status/count")
     @ApiOperation(value = "按工单状态统计")
     public ResponseHelper<OrderBaseCountBean> countStatus(   @RequestParam(required = false) String startTime,
-                                                             @RequestParam(required = false) String endTime) {
-        OrderBaseCountBean orderBaseCountBean = orderBaseCountLogic.baseCountBean(startTime,endTime);
+                                                             @RequestParam(required = false) String endTime,
+                                                             HttpServletRequest request
+                                                             ) {
+        OrderBaseCountBean orderBaseCountBean = orderBaseCountLogic.baseCountBean(startTime,endTime,request);
         return ResponseHelper.success(orderBaseCountBean);
     }
 

+ 14 - 0
mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2022EsRepository.java

@@ -0,0 +1,14 @@
+package com.gree.mall.manager.es;
+
+
+import com.gree.mall.manager.bean.es.OrderBaseEs2022Date;
+import com.gree.mall.manager.bean.es.OrderBaseEsDate;
+import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
+
+/**
+ * @author
+ * @description
+ * @date 2023/6/19 10:37 星期一
+ */
+public interface OrderBase2022EsRepository extends ElasticsearchRepository<OrderBaseEs2022Date, String> {
+}

+ 14 - 0
mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2023EsRepository.java

@@ -0,0 +1,14 @@
+package com.gree.mall.manager.es;
+
+
+import com.gree.mall.manager.bean.es.OrderBaseEs2023Date;
+import com.gree.mall.manager.bean.es.OrderBaseEsDate;
+import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
+
+/**
+ * @author
+ * @description
+ * @date 2023/6/19 10:37 星期一
+ */
+public interface OrderBase2023EsRepository extends ElasticsearchRepository<OrderBaseEs2023Date, String> {
+}

+ 14 - 0
mall-server-api/src/main/java/com/gree/mall/manager/es/OrderBase2024EsRepository.java

@@ -0,0 +1,14 @@
+package com.gree.mall.manager.es;
+
+
+import com.gree.mall.manager.bean.es.OrderBaseEs2024Date;
+import com.gree.mall.manager.bean.es.OrderBaseEsDate;
+import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
+
+/**
+ * @author
+ * @description
+ * @date 2023/6/19 10:37 星期一
+ */
+public interface OrderBase2024EsRepository extends ElasticsearchRepository<OrderBaseEs2024Date, String> {
+}

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

@@ -2,6 +2,8 @@ package com.gree.mall.manager.logic.workorder;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -19,6 +21,7 @@ import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.logic.common.SysDictCompanyLogic;
 import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.*;
+import com.gree.mall.manager.utils.CommonUtils;
 import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.utils.excel.ExcelUtils;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
@@ -26,11 +29,13 @@ import com.gree.mall.manager.zfire.util.FieldUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 import org.apache.commons.lang3.StringUtils;
 
+import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Date;
@@ -46,6 +51,12 @@ public class ChangeOrderLogic {
 
     @Autowired
     PgOrderBaseService pgOrderBaseService;
+    @Autowired
+    PgOrderBase2024Service pgOrderBase2024Service;
+    @Autowired
+    PgOrderBase2023Service pgOrderBase2023Service;
+    @Autowired
+    PgOrderBase2022Service pgOrderBase2022Service;
 
     @Autowired
     UserService userService;
@@ -55,6 +66,12 @@ public class ChangeOrderLogic {
 
     @Autowired
     PgOrderWorkerService pgOrderWorkerService;
+    @Autowired
+    PgOrderWorker2022Service pgOrderWorker2022Service;
+    @Autowired
+    PgOrderWorker2023Service pgOrderWorker2023Service;
+    @Autowired
+    PgOrderWorker2024Service pgOrderWorker2024Service;
 
 
     @Autowired
@@ -64,6 +81,15 @@ public class ChangeOrderLogic {
     PgOrderDetailService pgOrderDetailService;
 
     @Autowired
+    PgOrderDetail2024Service pgOrderDetail2024Service;
+
+    @Autowired
+    PgOrderDetail2023Service pgOrderDetail2023Service;
+
+    @Autowired
+    PgOrderDetail2022Service pgOrderDetail2022Service;
+
+    @Autowired
     WorkerOrderService workerOrderService;
 
     @Autowired
@@ -77,6 +103,15 @@ public class ChangeOrderLogic {
     PgOrderProductDetailService pgOrderProductDetailService;
 
     @Autowired
+    PgOrderProductDetail2022Service pgOrderProductDetail2022Service;
+
+    @Autowired
+    PgOrderProductDetail2023Service pgOrderProductDetail2023Service;
+
+    @Autowired
+    PgOrderProductDetail2024Service pgOrderProductDetail2024Service;
+
+    @Autowired
     PgOrderOperatorLogService pgOrderOperatorLogService;
 
     @Autowired
@@ -281,13 +316,56 @@ public class ChangeOrderLogic {
     }
 
 
-    public List<PgOrderProductDetail> getOrderProduct(String id, List<String> status) {
+    public List<PgOrderProductDetail> getOrderProduct(String id, List<String> status, HttpServletRequest request) {
+
+        String year = CommonUtils.getYear(request);
+
+        if (year.equals("2024")){
+            List<PgOrderProductDetail2024> list = pgOrderProductDetail2024Service.lambdaQuery().eq(PgOrderProductDetail2024::getOrderBaseId, id)
+                    .in(!CollectionUtils.isEmpty(status), PgOrderProductDetail2024::getStatus, status).list();
+            List<PgOrderProductDetail> pgOrderProductDetails = BeanUtil.copyToList(list, PgOrderProductDetail.class);
+
+            return pgOrderProductDetails;
+        }
+
+        if (year.equals("2023")){
+            List<PgOrderProductDetail2023> list = pgOrderProductDetail2023Service.lambdaQuery().eq(PgOrderProductDetail2023::getOrderBaseId, id)
+                    .in(!CollectionUtils.isEmpty(status), PgOrderProductDetail2023::getStatus, status).list();
+            List<PgOrderProductDetail> pgOrderProductDetails = BeanUtil.copyToList(list, PgOrderProductDetail.class);
+
+            return pgOrderProductDetails;
+        }
+
+        if (year.equals("2022") || Convert.toInt(year) < 2022) {
+            List<PgOrderProductDetail2022> list = pgOrderProductDetail2022Service.lambdaQuery().eq(PgOrderProductDetail2022::getOrderBaseId, id)
+                    .in(!CollectionUtils.isEmpty(status), PgOrderProductDetail2022::getStatus, status).list();
+            List<PgOrderProductDetail> pgOrderProductDetails = BeanUtil.copyToList(list, PgOrderProductDetail.class);
+
+            return pgOrderProductDetails;
+        }
+
 
         return pgOrderProductDetailService.lambdaQuery().eq(PgOrderProductDetail::getOrderBaseId, id)
                 .in(!CollectionUtils.isEmpty(status), PgOrderProductDetail::getStatus, status).list();
     }
 
-    public PgOrderProductDetailVO productDetail(String id) {
+    public PgOrderProductDetailVO productDetail(String id,HttpServletRequest request) {
+        String year = CommonUtils.getYear(request);
+        if (year.equals("2024")) {
+
+            return this.productDetail2024(id);
+        }
+
+        if (year.equals("2023")) {
+            return this.productDetail2023(id);
+        }
+
+        if (year.equals("2022") || Convert.toInt(year) < 2022) {
+            return this.productDetail2022(id);
+
+        }
+
+
         PgOrderProductDetail pgOrderProduct = pgOrderProductDetailService.getById(id);
 
         PgOrderProductDetailVO pgOrderProductDetail = BeanUtil.toBean(pgOrderProduct, PgOrderProductDetailVO.class);
@@ -306,8 +384,64 @@ public class ChangeOrderLogic {
 
     }
 
+    private PgOrderProductDetailVO productDetail2022(String id) {
+        PgOrderProductDetail2022 pgOrderProduct = pgOrderProductDetail2022Service.getById(id);
+
+        PgOrderProductDetailVO pgOrderProductDetail = BeanUtil.toBean(pgOrderProduct, PgOrderProductDetailVO.class);
 
-    public List<WorkerOrderDetail> getOrderList(String workerOrderId) {
+        List<PgOrderDetail2022> list = pgOrderDetail2022Service.lambdaQuery().eq(PgOrderDetail2022::getProductDetailId, id).list();
+
+        pgOrderProductDetail.setPgOrderProductDetails(BeanUtil.copyToList(list,PgOrderDetail.class));
+        PgOrderBase2022 pgOrderBase = pgOrderBase2022Service.getById(pgOrderProduct.getOrderBaseId());
+
+        pgOrderProductDetail.setPgOrderBase(BeanUtil.toBean(pgOrderBase,PgOrderBase.class));
+
+        List<PgOrderWorker2022> list1 = pgOrderWorker2022Service.lambdaQuery().eq(PgOrderWorker2022::getOrderBaseId, pgOrderProductDetail.getOrderBaseId()).list();
+        pgOrderProductDetail.setPgOrderWorkers(BeanUtil.copyToList(list1,PgOrderWorker.class));
+        return pgOrderProductDetail;
+    }
+
+    private PgOrderProductDetailVO productDetail2023(String id) {
+        PgOrderProductDetail2023 pgOrderProduct = pgOrderProductDetail2023Service.getById(id);
+
+        PgOrderProductDetailVO pgOrderProductDetail = BeanUtil.toBean(pgOrderProduct, PgOrderProductDetailVO.class);
+
+        List<PgOrderDetail2023> list = pgOrderDetail2023Service.lambdaQuery().eq(PgOrderDetail2023::getProductDetailId, id).list();
+
+        pgOrderProductDetail.setPgOrderProductDetails(BeanUtil.copyToList(list,PgOrderDetail.class));
+        PgOrderBase2023 pgOrderBase = pgOrderBase2023Service.getById(pgOrderProduct.getOrderBaseId());
+
+        pgOrderProductDetail.setPgOrderBase(BeanUtil.toBean(pgOrderBase,PgOrderBase.class));
+
+        List<PgOrderWorker2023> list1 = pgOrderWorker2023Service.lambdaQuery().eq(PgOrderWorker2023::getOrderBaseId, pgOrderProductDetail.getOrderBaseId()).list();
+        pgOrderProductDetail.setPgOrderWorkers(BeanUtil.copyToList(list1,PgOrderWorker.class));
+        return pgOrderProductDetail;
+    }
+
+    private PgOrderProductDetailVO productDetail2024(String id) {
+
+        PgOrderProductDetail2024 pgOrderProduct = pgOrderProductDetail2024Service.getById(id);
+
+        PgOrderProductDetailVO pgOrderProductDetail = BeanUtil.toBean(pgOrderProduct, PgOrderProductDetailVO.class);
+
+        List<PgOrderDetail2024> list = pgOrderDetail2024Service.lambdaQuery().eq(PgOrderDetail2024::getProductDetailId, id).list();
+
+        pgOrderProductDetail.setPgOrderProductDetails(BeanUtil.copyToList(list,PgOrderDetail.class));
+        PgOrderBase2024 pgOrderBase = pgOrderBase2024Service.getById(pgOrderProduct.getOrderBaseId());
+
+        pgOrderProductDetail.setPgOrderBase(BeanUtil.toBean(pgOrderBase,PgOrderBase.class));
+
+        List<PgOrderWorker2024> list1 = pgOrderWorker2024Service.lambdaQuery().eq(PgOrderWorker2024::getOrderBaseId, pgOrderProductDetail.getOrderBaseId()).list();
+        pgOrderProductDetail.setPgOrderWorkers(BeanUtil.copyToList(list1,PgOrderWorker.class));
+
+        return pgOrderProductDetail;
+
+    }
+
+
+    public List<WorkerOrderDetail> getOrderList(String workerOrderId,HttpServletRequest request) {
+
+        String year = CommonUtils.getYear(request);
 
         List<WorkerOrder> list = workerOrderService.lambdaQuery().eq(WorkerOrder::getWorkerOrderId, workerOrderId)
                 .in(WorkerOrder::getPayStatus, PayStatusEnum.WAIT.getKey(), PayStatusEnum.PAID.getKey()).list();
@@ -320,8 +454,28 @@ public class ChangeOrderLogic {
             workerOrder.setWorkerOrderItems(workerOrderItemService.lambdaQuery()
                     .eq(WorkerOrderItem::getOrderId, workerOrder.getOrderId()).list());
 
-            PgOrderBase pgOrderBase = pgOrderBaseService.getById(workerOrderId);
-            workerOrder.setPgOrderBase(pgOrderBase);
+
+
+            if (year.equals("2024")) {
+
+                PgOrderBase2024 pgOrderBase = pgOrderBase2024Service.getById(workerOrderId);
+                workerOrder.setPgOrderBase(BeanUtil.toBean(pgOrderBase,PgOrderBase.class));
+            }
+
+            if (year.equals("2023")) {
+                PgOrderBase2023 pgOrderBase = pgOrderBase2023Service.getById(workerOrderId);
+                workerOrder.setPgOrderBase(BeanUtil.toBean(pgOrderBase,PgOrderBase.class));
+            }
+
+            if (year.equals("2022") || Convert.toInt(year) < 2022) {
+                PgOrderBase2022 pgOrderBase = pgOrderBase2022Service.getById(workerOrderId);
+                workerOrder.setPgOrderBase(BeanUtil.toBean(pgOrderBase,PgOrderBase.class));
+
+            }else {
+
+                PgOrderBase pgOrderBase = pgOrderBaseService.getById(workerOrderId);
+                workerOrder.setPgOrderBase(pgOrderBase);
+            }
 
 
         }

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

@@ -4,6 +4,9 @@ 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;
+import com.gree.mall.manager.bean.es.OrderBase2022Es;
+import com.gree.mall.manager.bean.es.OrderBase2023Es;
+import com.gree.mall.manager.bean.es.OrderBase2024Es;
 import com.gree.mall.manager.bean.es.OrderBaseEs;
 import com.gree.mall.manager.bean.workorder.OrderBaseCountBean;
 import com.gree.mall.manager.bean.workorder.OrderCount7DayBean;
@@ -14,6 +17,7 @@ import com.gree.mall.manager.enums.workorder.OrderTypeEnum;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.plus.entity.PgOrderBase;
 import com.gree.mall.manager.plus.service.PgOrderBaseService;
+import com.gree.mall.manager.utils.CommonUtils;
 import io.swagger.models.auth.In;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -40,6 +44,7 @@ import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilde
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.ZoneOffset;
@@ -61,8 +66,10 @@ public class OrderBaseCountLogic {
      * @return
      */
     public OrderBaseCountBean baseCountBean( String startTime,
-                                             String endTime){
+                                             String endTime,
+                                             HttpServletRequest request){
         AdminUserCom adminUser = commonLogic.getAdminUser();
+        String year = CommonUtils.getYear(request);
         OrderBaseCountBean orderBaseCountBean = new OrderBaseCountBean();
         BoolQueryBuilder queryBuilderCount = QueryBuilders.boolQuery();
 
@@ -88,7 +95,7 @@ public class OrderBaseCountLogic {
                         .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);
+        SearchHits responseDPG = this.search(searchQueryDPG,year);
 
         orderBaseCountBean.setDpg(Convert.toInt(this.getWorkerOrderCountResult(responseDPG.getAggregations(),"DPG")));
 
@@ -103,7 +110,7 @@ public class OrderBaseCountLogic {
                         .mustNot(QueryBuilders.termsQuery("order_status", "YQX", "FWQX", "FL", "FWZT", "YCGB","YZP"))
                 )))
                 .build();
-        SearchHits responseDJS = elasticsearchRestTemplate.search(searchQueryDJS, OrderBaseEs.class);
+        SearchHits responseDJS = this.search(searchQueryDJS,year);
 
         orderBaseCountBean.setDjs(Convert.toInt(this.getWorkerOrderCountResult(responseDJS.getAggregations(),"DJS")));
 
@@ -116,7 +123,7 @@ public class OrderBaseCountLogic {
                         .must(QueryBuilders.termsQuery("order_status","DQD")
                         ))))
                 .build();
-        SearchHits responseDQD = elasticsearchRestTemplate.search(searchQueryDQD, OrderBaseEs.class);
+        SearchHits responseDQD = this.search(searchQueryDQD,year);
 
         orderBaseCountBean.setDqd(Convert.toInt(this.getWorkerOrderCountResult(responseDQD.getAggregations(),"DQD")));
 
@@ -129,7 +136,7 @@ public class OrderBaseCountLogic {
                         .must(QueryBuilders.termsQuery("order_status","FWZ","GCSZT","BFWG","DSM","WDBH","XSBH","TJXSBH","ZBBH","FZXBH")
                         ))))
                 .build();
-        SearchHits responsefwz = elasticsearchRestTemplate.search(searchQueryfwz, OrderBaseEs.class);
+        SearchHits responsefwz = this.search(searchQueryfwz,year);
 
         orderBaseCountBean.setFwz(Convert.toInt(this.getWorkerOrderCountResult(responsefwz.getAggregations(),"fwz")));
 
@@ -145,7 +152,7 @@ public class OrderBaseCountLogic {
                         .mustNot(QueryBuilders.existsQuery("appointment_time"))
                 )))
                 .build();
-        SearchHits responseDYY = elasticsearchRestTemplate.search(searchQueryDYY, OrderBaseEs.class);
+        SearchHits responseDYY = this.search(searchQueryDYY,year);
 
         orderBaseCountBean.setDyy(Convert.toInt(this.getWorkerOrderCountResult(responseDYY.getAggregations(),"DYY")));
 
@@ -159,7 +166,7 @@ public class OrderBaseCountLogic {
 
                 )))
                 .build();
-        SearchHits responseYCDCL = elasticsearchRestTemplate.search(searchQueryYCDCL, OrderBaseEs.class);
+        SearchHits responseYCDCL = this.search(searchQueryYCDCL,year);
 
         orderBaseCountBean.setYcdcl(Convert.toInt(this.getWorkerOrderCountResult(responseYCDCL.getAggregations(),"YCDCL")));
 
@@ -173,7 +180,7 @@ public class OrderBaseCountLogic {
 
                 )))
                 .build();
-        SearchHits responseCP = elasticsearchRestTemplate.search(searchQueryCP, OrderBaseEs.class);
+        SearchHits responseCP = this.search(searchQueryCP,year);
 
         orderBaseCountBean.setCp(Convert.toInt(this.getWorkerOrderCountResult(responseCP.getAggregations(),"CP")));
 
@@ -228,7 +235,7 @@ public class OrderBaseCountLogic {
 
 
         // 执行查询并获取聚合结果
-        SearchHits<OrderBaseEs> searchHitsXZGD = elasticsearchRestTemplate.search(searchQueryDay, OrderBaseEs.class);
+        SearchHits<OrderBaseEs> searchHitsXZGD = this.search(searchQueryDay,year);
 
         var aggregationsXZGD = searchHitsXZGD.getAggregations();
 
@@ -273,7 +280,7 @@ public class OrderBaseCountLogic {
 
 
         // 执行查询并获取聚合结果
-        SearchHits<OrderBaseEs> searchHitsXWGD = elasticsearchRestTemplate.search(searchQueryWGD, OrderBaseEs.class);
+        SearchHits<OrderBaseEs> searchHitsXWGD = this.search(searchQueryWGD,year);
 
         var aggregationsWGD = searchHitsXWGD.getAggregations();
 
@@ -317,7 +324,7 @@ public class OrderBaseCountLogic {
 
 
         // 执行查询并获取聚合结果
-        SearchHits<OrderBaseEs> searchHitsJXZ= elasticsearchRestTemplate.search(searchQueryJXZ, OrderBaseEs.class);
+        SearchHits<OrderBaseEs> searchHitsJXZ= this.search(searchQueryJXZ,year);
 
         var aggregationsJXZ = searchHitsJXZ.getAggregations();
 
@@ -363,7 +370,7 @@ public class OrderBaseCountLogic {
                         .calendarInterval(DateHistogramInterval.DAY)
                         .format("yyyy-MM-dd"))
                 .build();
-        SearchHits responseQTSM = elasticsearchRestTemplate.search(searchQueryQTSM, OrderBaseEs.class);
+        SearchHits responseQTSM = this.search(searchQueryQTSM,year);
 
         var aggregationsQTSM = responseQTSM.getAggregations();
 
@@ -417,7 +424,7 @@ public class OrderBaseCountLogic {
                         .calendarInterval(DateHistogramInterval.DAY)
                         .format("yyyy-MM-dd"))
                 .build();
-        SearchHits responseAZ = elasticsearchRestTemplate.search(searchQueryAZ, OrderBaseEs.class);
+        SearchHits responseAZ = this.search(searchQueryAZ,year);
 
         var aggregationsAZ = responseAZ.getAggregations();
 
@@ -458,7 +465,7 @@ public class OrderBaseCountLogic {
                         .calendarInterval(DateHistogramInterval.DAY)
                         .format("yyyy-MM-dd"))
                 .build();
-        SearchHits responseWX = elasticsearchRestTemplate.search(searchQueryWX, OrderBaseEs.class);
+        SearchHits responseWX = this.search(searchQueryWX,year);
 
         var aggregationsWX = responseWX.getAggregations();
 
@@ -482,6 +489,26 @@ public class OrderBaseCountLogic {
         return orderBaseCountBean;
     }
 
+    private SearchHits search(NativeSearchQuery searchQuery,String year) {
+
+        if (year.equals("2023")) {
+            SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBase2023Es.class);
+            return response;
+        }
+        if (year.equals("2024")) {
+            SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBase2024Es.class);
+            return response;
+        }
+
+        if (year.equals("2022") || Convert.toInt(year) < 2022) {
+            SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBase2022Es.class);
+            return response;
+        }else {
+            SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBaseEs.class);
+            return response;
+        }
+    }
+
 
     public AbstractAggregationBuilder<?> getAggs(FilterAggregationBuilder filter) {
         return filter.subAggregation(AggregationBuilders.sum("total_mac_sum").field("total_num"))

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

@@ -1,27 +1,22 @@
 package com.gree.mall.manager.logic.workorder;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.convert.Convert;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
-import com.gree.mall.manager.bean.es.OrderBaseEs;
-import com.gree.mall.manager.bean.es.OrderBaseEsDate;
-import com.gree.mall.manager.bean.es.PgOrderWorkerEs;
-import com.gree.mall.manager.bean.es.SettlementOrderEs;
+import com.gree.mall.manager.bean.es.*;
 import com.gree.mall.manager.bean.listvo.param.WorkOrderZfireParam;
 import com.gree.mall.manager.bean.listvo.workorder.OrderBaseVO;
 import com.gree.mall.manager.enums.MaterialExamineStatusEnum;
-import com.gree.mall.manager.es.OrderBaseEsRepository;
-import com.gree.mall.manager.es.OrderWorkerEsRepository;
-import com.gree.mall.manager.es.SettlementOrderEsRepository;
+import com.gree.mall.manager.es.*;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.plus.entity.*;
-import com.gree.mall.manager.plus.service.PgOrderBaseService;
-import com.gree.mall.manager.plus.service.PgOrderWorkerService;
-import com.gree.mall.manager.plus.service.SettlementOrderService;
-import com.gree.mall.manager.plus.service.WorkerOrderService;
+import com.gree.mall.manager.plus.service.*;
+import com.gree.mall.manager.utils.CommonUtils;
 import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.zfire.bean.QueryParamBean;
 import lombok.RequiredArgsConstructor;
@@ -50,6 +45,7 @@ import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
 import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
 import org.springframework.stereotype.Service;
 
+import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -68,16 +64,24 @@ public class OrderBaseEsLogic {
 
     private final CommonLogic commonLogic;
     private final OrderBaseEsRepository orderBaseEsRepository;
+    private final OrderBase2022EsRepository orderBase2022EsRepository;
+    private final OrderBase2023EsRepository orderBase2023EsRepository;
+    private final OrderBase2024EsRepository orderBase2024EsRepository;
     private final PgOrderBaseService pgOrderBaseService;
+    private final PgOrderBase2022Service pgOrderBase2022Service;
+    private final PgOrderBase2023Service pgOrderBase2023Service;
+    private final PgOrderBase2024Service pgOrderBase2024Service;
     private final SettlementOrderService settlementOrderService;
     private final SettlementOrderEsRepository settlementOrderEsRepository;
     private final OrderWorkerEsRepository orderWorkerEsRepository;
     private final PgOrderWorkerService pgOrderWorkerService;
 
-    public IPage<OrderBaseVO> orderBaseEsList(WorkOrderZfireParam zfireParamBean) {
+    public IPage<OrderBaseVO> orderBaseEsList(WorkOrderZfireParam zfireParamBean, HttpServletRequest request) {
 
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
+        String year = CommonUtils.getYear(request);
+
         BoolQueryBuilder queryBuilder1 = QueryBuilders.boolQuery();
         this.montage(queryBuilder1,zfireParamBean);
 
@@ -120,28 +124,78 @@ public class OrderBaseEsLogic {
 
         build.setTrackTotalHits(true);
 
+        List<OrderBaseEs> orderBaseEs = new ArrayList<>();
+        IPage<OrderBaseVO> page = new Page<>();
 
-        SearchHits<OrderBaseEs> orderBaseEsSearchHits = elasticsearchRestTemplate.search(build, OrderBaseEs.class);
-        SearchPage<OrderBaseEs> searchHits = SearchHitSupport.searchPageFor(orderBaseEsSearchHits, build.getPageable());
 
 
-        List<OrderBaseEs> orderBaseEs = new ArrayList<>();
-        for (SearchHit<OrderBaseEs> searchHit : searchHits.getContent()) {
-            orderBaseEs.add(searchHit.getContent());
+        if (year.equals("2023")) {
+            SearchHits<OrderBase2023Es> orderBaseEsSearchHits = elasticsearchRestTemplate.search(build, OrderBase2023Es.class);
+            SearchPage<OrderBase2023Es> searchHits2023 = SearchHitSupport.searchPageFor(orderBaseEsSearchHits, build.getPageable());
+
+            for (SearchHit<OrderBase2023Es> searchHit : searchHits2023.getContent()) {
+                orderBaseEs.add(BeanUtil.toBean(searchHit.getContent(),OrderBaseEs.class));
+            }
+
+
+            page.setTotal(searchHits2023.getSearchHits().getTotalHits());
+            page.setCurrent(zfireParamBean.getPageNum());
+            page.setSize(zfireParamBean.getPageSize());
+            page.setRecords(BeanUtil.copyToList(orderBaseEs,OrderBaseVO.class));
+        }else
+
+        if (year.equals("2024")) {
+            SearchHits<OrderBase2024Es> orderBaseEsSearchHits = elasticsearchRestTemplate.search(build, OrderBase2024Es.class);
+            SearchPage<OrderBase2024Es> searchHits2024 = SearchHitSupport.searchPageFor(orderBaseEsSearchHits, build.getPageable());
+
+            for (SearchHit<OrderBase2024Es> searchHit : searchHits2024.getContent()) {
+                orderBaseEs.add(BeanUtil.toBean(searchHit.getContent(),OrderBaseEs.class));
+            }
+
+
+            page.setTotal(searchHits2024.getSearchHits().getTotalHits());
+            page.setCurrent(zfireParamBean.getPageNum());
+            page.setSize(zfireParamBean.getPageSize());
+            page.setRecords(BeanUtil.copyToList(orderBaseEs,OrderBaseVO.class));
+        }else
+
+
+        if (year.equals("2022") || Convert.toInt(year) < 2022) {
+            SearchHits<OrderBase2022Es> orderBaseEsSearchHits = elasticsearchRestTemplate.search(build, OrderBase2022Es.class);
+            SearchPage<OrderBase2022Es> searchHits2022 = SearchHitSupport.searchPageFor(orderBaseEsSearchHits, build.getPageable());
+
+            for (SearchHit<OrderBase2022Es> searchHit : searchHits2022.getContent()) {
+                orderBaseEs.add(BeanUtil.toBean(searchHit.getContent(),OrderBaseEs.class));
+            }
+
+
+            page.setTotal(searchHits2022.getSearchHits().getTotalHits());
+            page.setCurrent(zfireParamBean.getPageNum());
+            page.setSize(zfireParamBean.getPageSize());
+            page.setRecords(BeanUtil.copyToList(orderBaseEs,OrderBaseVO.class));
+        }else {
+            SearchHits<OrderBaseEs> orderBaseEsSearchHits = elasticsearchRestTemplate.search(build, OrderBaseEs.class);
+            SearchPage<OrderBaseEs> searchHits = SearchHitSupport.searchPageFor(orderBaseEsSearchHits, build.getPageable());
+
+            for (SearchHit<OrderBaseEs> searchHit : searchHits.getContent()) {
+                orderBaseEs.add(searchHit.getContent());
+            }
+            page.setTotal(searchHits.getSearchHits().getTotalHits());
+            page.setCurrent(zfireParamBean.getPageNum());
+            page.setSize(zfireParamBean.getPageSize());
+            page.setRecords(BeanUtil.copyToList(orderBaseEs,OrderBaseVO.class));
         }
 
-        IPage<OrderBaseVO> page = new Page<>();
-        page.setTotal(searchHits.getSearchHits().getTotalHits());
-        page.setCurrent(zfireParamBean.getPageNum());
-        page.setSize(zfireParamBean.getPageSize());
-        page.setRecords(BeanUtil.copyToList(orderBaseEs,OrderBaseVO.class));
+
+
+
         //服务单标识
         if (zfireParamBean.getPageSize() != -1 && page.getTotal() > 0 && page.getRecords().size() > 0) {
             List<String> orderBaseIds = page.getRecords()
                     .stream()
                     .map(OrderBaseVO::getId)
                     .collect(Collectors.toList());
-            Map<String, List<PgOrderFlag>> mapList = orderFlagLogic.list(orderBaseIds);
+            Map<String, List<PgOrderFlag>> mapList = orderFlagLogic.list(orderBaseIds,year);
 
             List<WorkerOrder> workerOrderList = workerOrderService.lambdaQuery().in(WorkerOrder::getWorkerOrderId, orderBaseIds)
                     .eq(WorkerOrder::getPayStatus, MaterialExamineStatusEnum.PAID.getKey())
@@ -291,13 +345,38 @@ public class OrderBaseEsLogic {
 
     public void test() {
 
-        boolean a = elasticsearchRestTemplate.indexOps(OrderBaseEsDate.class).delete();
-        IndexOperations indexOperations1 = elasticsearchRestTemplate.indexOps(OrderBaseEsDate.class);
+        boolean a = elasticsearchRestTemplate.indexOps(OrderBaseEs2022Date.class).delete();
+        IndexOperations indexOperations1 = elasticsearchRestTemplate.indexOps(OrderBaseEs2022Date.class);
         if (!indexOperations1.exists()) {
             indexOperations1.create();
             Document document = indexOperations1.createMapping();
             indexOperations1.putMapping(document);
         }
+        boolean b = elasticsearchRestTemplate.indexOps(OrderBaseEs2023Date.class).delete();
+        IndexOperations indexOperations2 = elasticsearchRestTemplate.indexOps(OrderBaseEs2023Date.class);
+        if (!indexOperations2.exists()) {
+            indexOperations2.create();
+            Document document = indexOperations2.createMapping();
+            indexOperations2.putMapping(document);
+        }
+        boolean c = elasticsearchRestTemplate.indexOps(OrderBaseEs2024Date.class).delete();
+        IndexOperations indexOperations3 = elasticsearchRestTemplate.indexOps(OrderBaseEs2024Date.class);
+        if (!indexOperations3.exists()) {
+            indexOperations3.create();
+            Document document = indexOperations3.createMapping();
+            indexOperations3.putMapping(document);
+        }
+
+
+/*        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();
 
@@ -328,8 +407,10 @@ public class OrderBaseEsLogic {
         }*/
     }
 
-    public List<Map<String, Object>> countStatus(String startTime, String endTime, String orderSmallType, String orderSmallTypeText) {
+    public List<Map<String, Object>> countStatus(String startTime, String endTime, String orderSmallType, String orderSmallTypeText,HttpServletRequest request) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        String year = CommonUtils.getYear(request);
         BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
 
         List<Map<String, Object>> maps = new ArrayList<>();
@@ -364,15 +445,15 @@ public class OrderBaseEsLogic {
                                 .lte(endTime)
                         ))))
                 .build();
-        SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBaseEs.class);
 
+        SearchHits response = this.search(searchQuery,year);
         HashMap<String, Object> dyy = new HashMap<>();
-        dyy.put("total",this.getWorkerOrderCountResult(response.getAggregations(),"DYY"));
-        dyy.put("orderStatus","DYY");
-
+        dyy.put("total", this.getWorkerOrderCountResult(response.getAggregations(), "DYY"));
+        dyy.put("orderStatus", "DYY");
         maps.add(dyy);
 
 
+
         //待抢单
         NativeSearchQuery searchQueryDqd = new NativeSearchQueryBuilder()
                 .withQuery(queryBuilder)
@@ -380,12 +461,12 @@ public class OrderBaseEsLogic {
                 .addAggregation(this.getAggs(AggregationBuilders.filter("DQD", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termQuery("order_status","DQD")))))
                 .build();
-        SearchHits responsedqd = elasticsearchRestTemplate.search(searchQueryDqd, OrderBaseEs.class);
+
+        SearchHits responsedqd = this.search(searchQueryDqd,year);
 
         HashMap<String, Object> dqd = new HashMap<>();
         dqd.put("total",this.getWorkerOrderCountResult(responsedqd.getAggregations(),"DQD"));
         dqd.put("orderStatus","DQD");
-
         maps.add(dqd);
 
 
@@ -397,7 +478,7 @@ public class OrderBaseEsLogic {
                         .must(QueryBuilders.termsQuery("order_status","DSHPG","CJ","YPD","DXSPD","DZBPG","DWDSPGP","DXSSPGP",
                                 "DTJXSSPGP","DZBSPGP","DFZXPD","DFZXSPGP")))))
                 .build();
-        SearchHits responseDshpg = elasticsearchRestTemplate.search(searchQueryDshpg, OrderBaseEs.class);
+        SearchHits responseDshpg =this.search(searchQueryDshpg,year);
 
         HashMap<String, Object> dshpg = new HashMap<>();
         dshpg.put("total",this.getWorkerOrderCountResult(responseDshpg.getAggregations(),"DSHPG"));
@@ -413,7 +494,7 @@ public class OrderBaseEsLogic {
                 .addAggregation(this.getAggs(AggregationBuilders.filter("DWDPG", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termsQuery("order_status","DWDPG","DWDPD")))))
                 .build();
-        SearchHits responseDwdpg = elasticsearchRestTemplate.search(searchQueryDwdpg, OrderBaseEs.class);
+        SearchHits responseDwdpg = this.search(searchQueryDwdpg,year);
 
         HashMap<String, Object> DWDPG = new HashMap<>();
         DWDPG.put("total",this.getWorkerOrderCountResult(responseDwdpg.getAggregations(),"DWDPG"));
@@ -431,7 +512,7 @@ public class OrderBaseEsLogic {
                         .should(QueryBuilders.termsQuery("order_status", "DJD")))
                         )))
                 .build();
-        SearchHits responseDJD = elasticsearchRestTemplate.search(searchQueryDJD, OrderBaseEs.class);
+        SearchHits responseDJD = this.search(searchQueryDJD,year);
 
         HashMap<String, Object> DJD = new HashMap<>();
         DJD.put("total",this.getWorkerOrderCountResult(responseDJD.getAggregations(),"DJD"));
@@ -447,7 +528,7 @@ public class OrderBaseEsLogic {
                         .must(QueryBuilders.termsQuery("order_status","FWZ","GCSZT","BFWG",
                                 "DSM","WDBH", "XSBH","TJXSBH","ZBBH","FZXBH")))))
                 .build();
-        SearchHits responseFWZ = elasticsearchRestTemplate.search(searchQueryfwz, OrderBaseEs.class);
+        SearchHits responseFWZ = this.search(searchQueryfwz,year);
 
         HashMap<String, Object> FWZ = new HashMap<>();
         FWZ.put("total",this.getWorkerOrderCountResult(responseFWZ.getAggregations(),"FWZ"));
@@ -464,7 +545,7 @@ public class OrderBaseEsLogic {
                         .must(QueryBuilders.termQuery("is_exception",true))
                         .mustNot(QueryBuilders.termsQuery("order_status", "YWG", "YWGO", "YJS")))))
                 .build();
-        SearchHits responseYCD = elasticsearchRestTemplate.search(searchQueryYCD, OrderBaseEs.class);
+        SearchHits responseYCD = this.search(searchQueryYCD,year);
 
         HashMap<String, Object> YCD = new HashMap<>();
         YCD.put("total",this.getWorkerOrderCountResult(responseYCD.getAggregations(),"YCD"));
@@ -479,7 +560,7 @@ public class OrderBaseEsLogic {
                 .addAggregation(this.getAggs(AggregationBuilders.filter("YWG", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termsQuery("order_status","YWG","GCSZX","WDWG","YWGO")))))
                 .build();
-        SearchHits responseYWG = elasticsearchRestTemplate.search(searchQueryYWGDJS, OrderBaseEs.class);
+        SearchHits responseYWG = this.search(searchQueryYWGDJS,year);
 
         HashMap<String, Object> YWG = new HashMap<>();
         YWG.put("total",this.getWorkerOrderCountResult(responseYWG.getAggregations(),"YWG"));
@@ -495,7 +576,7 @@ public class OrderBaseEsLogic {
                 .addAggregation(this.getAggs(AggregationBuilders.filter("YJS", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termsQuery("order_status","YJS","LRCD")))))
                 .build();
-        SearchHits responseYJS = elasticsearchRestTemplate.search(searchQueryYJS, OrderBaseEs.class);
+        SearchHits responseYJS = this.search(searchQueryYJS,year);
 
         HashMap<String, Object> YJS = new HashMap<>();
         YJS.put("total",this.getWorkerOrderCountResult(responseYJS.getAggregations(),"YJS"));
@@ -510,7 +591,7 @@ public class OrderBaseEsLogic {
                 .addAggregation(this.getAggs(AggregationBuilders.filter("YQX", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termsQuery("order_status","YZP","YQX","FWZT","YCGB","FWQX","FL")))))
                 .build();
-        SearchHits responseYQX = elasticsearchRestTemplate.search(searchQueryYQX, OrderBaseEs.class);
+        SearchHits responseYQX = this.search(searchQueryYQX,year);
 
         HashMap<String, Object> YQX = new HashMap<>();
         YQX.put("total",this.getWorkerOrderCountResult(responseYQX.getAggregations(),"YQX"));
@@ -526,7 +607,7 @@ public class OrderBaseEsLogic {
                 .addAggregation(this.getAggs(AggregationBuilders.filter("PJSQZ", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termQuery("parts_apply_status","ING")))))
                 .build();
-        SearchHits responsePJSQZ = elasticsearchRestTemplate.search(searchQueryPJSQZ, OrderBaseEs.class);
+        SearchHits responsePJSQZ = this.search(searchQueryPJSQZ,year);
 
         HashMap<String, Object> PJSQZ = new HashMap<>();
         PJSQZ.put("total",this.getWorkerOrderCountResult(responsePJSQZ.getAggregations(),"PJSQZ"));
@@ -542,7 +623,7 @@ public class OrderBaseEsLogic {
                 .addAggregation(this.getAggs(AggregationBuilders.filter("PJYDH", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termQuery("parts_apply_status","END")))))
                 .build();
-        SearchHits responsePJYDH = elasticsearchRestTemplate.search(searchQueryPJYDH, OrderBaseEs.class);
+        SearchHits responsePJYDH =  this.search(searchQueryPJYDH,year);
 
         HashMap<String, Object> PJYDH = new HashMap<>();
         PJYDH.put("total",this.getWorkerOrderCountResult(responsePJYDH.getAggregations(),"PJYDH"));
@@ -558,7 +639,7 @@ public class OrderBaseEsLogic {
                 .addAggregation(this.getAggs(AggregationBuilders.filter("PJYQX", QueryBuilders.boolQuery()
                         .must(QueryBuilders.termQuery("parts_apply_status","CANCEL")))))
                 .build();
-        SearchHits responsePJYQX = elasticsearchRestTemplate.search(searchQueryPJYQX, OrderBaseEs.class);
+        SearchHits responsePJYQX = this.search(searchQueryPJYQX,year);
 
         HashMap<String, Object> PJYQX = new HashMap<>();
         PJYQX.put("total",this.getWorkerOrderCountResult(responsePJYQX.getAggregations(),"PJYQX"));
@@ -585,7 +666,7 @@ public class OrderBaseEsLogic {
                             .must(QueryBuilders.termsQuery("id",orderBaseId))
                     )))
                     .build();
-            SearchHits responseDZF = elasticsearchRestTemplate.search(searchQueryDZF, OrderBaseEs.class);
+            SearchHits responseDZF = this.search(searchQueryDZF,year);
             DZF.put("total",this.getWorkerOrderCountResult(responseDZF.getAggregations(),"DZF"));
             DZF.put("orderStatus","DZF");
 
@@ -596,6 +677,27 @@ public class OrderBaseEsLogic {
         return maps;
     }
 
+
+    private SearchHits search(NativeSearchQuery searchQuery,String year) {
+
+        if (year.equals("2023")) {
+            SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBase2023Es.class);
+             return response;
+        }
+        if (year.equals("2024")) {
+            SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBase2024Es.class);
+            return response;
+        }
+
+        if (year.equals("2022") || Convert.toInt(year) < 2022) {
+            SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBase2022Es.class);
+            return response;
+        }else {
+            SearchHits response = elasticsearchRestTemplate.search(searchQuery, OrderBaseEs.class);
+            return response;
+        }
+    }
+
     public AbstractAggregationBuilder<?> getAggs(FilterAggregationBuilder filter) {
         return filter.subAggregation(AggregationBuilders.sum("total_mac_sum").field("total_num"))
                 .subAggregation(AggregationBuilders.terms("order_type_group").field("order_type")
@@ -620,6 +722,32 @@ public class OrderBaseEsLogic {
 
 
         orderBaseEsRepository.saveAll(orderBaseEsDates);
+
+
+        List<PgOrderBase2022> list2022 = pgOrderBase2022Service.lambdaQuery()
+                .gt(PgOrderBase2022::getUpdateTime,DateUtil.offsetMinute(new Date(),-5))
+                .list();
+
+        List<OrderBaseEs2022Date> orderBaseEsDates2022 = BeanUtil.copyToList(list2022, OrderBaseEs2022Date.class);
+
+        orderBase2022EsRepository.saveAll(orderBaseEsDates2022);
+
+
+        List<PgOrderBase2023> list2023 = pgOrderBase2023Service.lambdaQuery()
+                .gt(PgOrderBase2023::getUpdateTime,DateUtil.offsetMinute(new Date(),-5))
+                .list();
+
+        List<OrderBaseEs2023Date> orderBaseEsDates2023 = BeanUtil.copyToList(list2023, OrderBaseEs2023Date.class);
+
+        orderBase2023EsRepository.saveAll(orderBaseEsDates2023);
+
+        List<PgOrderBase2024> list2024 = pgOrderBase2024Service.lambdaQuery()
+                .gt(PgOrderBase2024::getUpdateTime,DateUtil.offsetMinute(new Date(),-5))
+                .list();
+
+        List<OrderBaseEs2024Date> orderBaseEsDates2024 = BeanUtil.copyToList(list2024, OrderBaseEs2024Date.class);
+
+        orderBase2024EsRepository.saveAll(orderBaseEsDates2024);
     }
 
     public void esSync1() {
@@ -648,10 +776,12 @@ public class OrderBaseEsLogic {
         orderWorkerEsRepository.saveAll(pgOrderWorkerEs);
     }
 
-    public List<OrderBaseVO> listExport(WorkOrderZfireParam zfireParamBean) {
+    public List<OrderBaseVO> listExport(WorkOrderZfireParam zfireParamBean,HttpServletRequest request) {
 
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
+        String year = CommonUtils.getYear(request);
+
         BoolQueryBuilder queryBuilder1 = QueryBuilders.boolQuery();
         this.montage(queryBuilder1,zfireParamBean);
 
@@ -695,51 +825,199 @@ public class OrderBaseEsLogic {
 
 
         // 2. 初始化 Scroll
-        SearchScrollHits<OrderBaseEs> scrollHits = elasticsearchRestTemplate.searchScrollStart(
-                60000, // Scroll 上下文保持时间(毫秒)
-                query,
-                OrderBaseEs.class,
-                IndexCoordinates.of("pg_order_base")
-        );
 
-        String scrollId = scrollHits.getScrollId();
-        int batch = 0;
+        List<OrderBaseVO> orderBaseVOS1 = new ArrayList<>();
+
+        if (year.equals("2023")) {
+
+            List<OrderBase2023Es> orderBaseVOS = new ArrayList<>();
+            SearchScrollHits<OrderBase2023Es> scrollHits = elasticsearchRestTemplate.searchScrollStart(
+                    60000, // Scroll 上下文保持时间(毫秒)
+                    query,
+                    OrderBase2023Es.class,
+                    IndexCoordinates.of("pg_order_base2023")
+            );
 
-        if (scrollHits.getTotalHits() > 60000)
-            throw  new RemoteServiceException("数据超过六万上限,请分批导出");
+            String scrollId = scrollHits.getScrollId();
+            int batch = 0;
 
-        List<OrderBaseEs> orderBaseVOS = new ArrayList<>();
+            if (scrollHits.getTotalHits() > 60000)
+                throw  new RemoteServiceException("数据超过六万上限,请分批导出");
 
-        try {
-            while (!scrollHits.isEmpty()) {
-                // 3. 处理当前批次数据
-                scrollHits.forEach(hit -> {
-                    OrderBaseEs entity = hit.getContent();
-                    orderBaseVOS.add(entity);
-                });
 
-                batch++;
+            try {
+                while (!scrollHits.isEmpty()) {
+                    // 3. 处理当前批次数据
+                    scrollHits.forEach(hit -> {
+                        OrderBase2023Es entity = hit.getContent();
+                        orderBaseVOS.add(entity);
+                    });
 
-                // 4. 获取下一批次
-                scrollHits = elasticsearchRestTemplate.searchScrollContinue(
-                        scrollId,
-                        60000,
-                        OrderBaseEs.class,
-                        IndexCoordinates.of("pg_order_base")
-                );
-                scrollId = scrollHits.getScrollId(); // 更新 scrollId
+                    batch++;
+
+                    // 4. 获取下一批次
+                    scrollHits = elasticsearchRestTemplate.searchScrollContinue(
+                            scrollId,
+                            60000,
+                            OrderBase2023Es.class,
+                            IndexCoordinates.of("pg_order_base2023")
+                    );
+                    scrollId = scrollHits.getScrollId(); // 更新 scrollId
+                }
+            } finally {
+                // 5. 清理 Scroll 上下文
+                if (scrollId != null) {
+                    List<String> scroll = new ArrayList<>();
+                    scroll.add(scrollId);
+                    elasticsearchRestTemplate.searchScrollClear(scroll);
+                }
+            }
+
+            orderBaseVOS1 = BeanUtil.copyToList(orderBaseVOS,OrderBaseVO.class);
+        }else
+
+        if (year.equals("2024")) {
+
+            List<OrderBase2024Es> orderBaseVOS = new ArrayList<>();
+            SearchScrollHits<OrderBase2024Es> scrollHits = elasticsearchRestTemplate.searchScrollStart(
+                    60000, // Scroll 上下文保持时间(毫秒)
+                    query,
+                    OrderBase2024Es.class,
+                    IndexCoordinates.of("pg_order_base2024")
+            );
+
+            String scrollId = scrollHits.getScrollId();
+            int batch = 0;
+
+            if (scrollHits.getTotalHits() > 60000)
+                throw  new RemoteServiceException("数据超过六万上限,请分批导出");
+
+
+            try {
+                while (!scrollHits.isEmpty()) {
+                    // 3. 处理当前批次数据
+                    scrollHits.forEach(hit -> {
+                        OrderBase2024Es entity = hit.getContent();
+                        orderBaseVOS.add(entity);
+                    });
+
+                    batch++;
+
+                    // 4. 获取下一批次
+                    scrollHits = elasticsearchRestTemplate.searchScrollContinue(
+                            scrollId,
+                            60000,
+                            OrderBase2024Es.class,
+                            IndexCoordinates.of("pg_order_base2024")
+                    );
+                    scrollId = scrollHits.getScrollId(); // 更新 scrollId
+                }
+            } finally {
+                // 5. 清理 Scroll 上下文
+                if (scrollId != null) {
+                    List<String> scroll = new ArrayList<>();
+                    scroll.add(scrollId);
+                    elasticsearchRestTemplate.searchScrollClear(scroll);
+                }
             }
-        } finally {
-            // 5. 清理 Scroll 上下文
-            if (scrollId != null) {
-                List<String> scroll = new ArrayList<>();
-                scroll.add(scrollId);
-                elasticsearchRestTemplate.searchScrollClear(scroll);
+
+            orderBaseVOS1 = BeanUtil.copyToList(orderBaseVOS,OrderBaseVO.class);
+        }else
+
+
+        if (year.equals("2022") || Convert.toInt(year) < 2022) {
+
+            List<OrderBase2022Es> orderBaseVOS = new ArrayList<>();
+            SearchScrollHits<OrderBase2022Es> scrollHits = elasticsearchRestTemplate.searchScrollStart(
+                    60000, // Scroll 上下文保持时间(毫秒)
+                    query,
+                    OrderBase2022Es.class,
+                    IndexCoordinates.of("pg_order_base2022")
+            );
+
+            String scrollId = scrollHits.getScrollId();
+            int batch = 0;
+
+            if (scrollHits.getTotalHits() > 60000)
+                throw  new RemoteServiceException("数据超过六万上限,请分批导出");
+
+
+            try {
+                while (!scrollHits.isEmpty()) {
+                    // 3. 处理当前批次数据
+                    scrollHits.forEach(hit -> {
+                        OrderBase2022Es entity = hit.getContent();
+                        orderBaseVOS.add(entity);
+                    });
+
+                    batch++;
+
+                    // 4. 获取下一批次
+                    scrollHits = elasticsearchRestTemplate.searchScrollContinue(
+                            scrollId,
+                            60000,
+                            OrderBase2022Es.class,
+                            IndexCoordinates.of("pg_order_base2022")
+                    );
+                    scrollId = scrollHits.getScrollId(); // 更新 scrollId
+                }
+            } finally {
+                // 5. 清理 Scroll 上下文
+                if (scrollId != null) {
+                    List<String> scroll = new ArrayList<>();
+                    scroll.add(scrollId);
+                    elasticsearchRestTemplate.searchScrollClear(scroll);
+                }
             }
-        }
 
-        List<OrderBaseVO> orderBaseVOS1 = BeanUtil.copyToList(orderBaseVOS, OrderBaseVO.class);
+            orderBaseVOS1 = BeanUtil.copyToList(orderBaseVOS,OrderBaseVO.class);
+        }else {
+
+            List<OrderBaseEs> orderBaseVOS = new ArrayList<>();
+            SearchScrollHits<OrderBaseEs> scrollHits = elasticsearchRestTemplate.searchScrollStart(
+                    60000, // Scroll 上下文保持时间(毫秒)
+                    query,
+                    OrderBaseEs.class,
+                    IndexCoordinates.of("pg_order_base")
+            );
+
+            String scrollId = scrollHits.getScrollId();
+            int batch = 0;
+
+            if (scrollHits.getTotalHits() > 60000)
+                throw  new RemoteServiceException("数据超过六万上限,请分批导出");
+
+
+            try {
+                while (!scrollHits.isEmpty()) {
+                    // 3. 处理当前批次数据
+                    scrollHits.forEach(hit -> {
+                        OrderBaseEs entity = hit.getContent();
+                        orderBaseVOS.add(entity);
+                    });
 
+                    batch++;
+
+                    // 4. 获取下一批次
+                    scrollHits = elasticsearchRestTemplate.searchScrollContinue(
+                            scrollId,
+                            60000,
+                            OrderBaseEs.class,
+                            IndexCoordinates.of("pg_order_base")
+                    );
+                    scrollId = scrollHits.getScrollId(); // 更新 scrollId
+                }
+            } finally {
+                // 5. 清理 Scroll 上下文
+                if (scrollId != null) {
+                    List<String> scroll = new ArrayList<>();
+                    scroll.add(scrollId);
+                    elasticsearchRestTemplate.searchScrollClear(scroll);
+                }
+            }
+
+            orderBaseVOS1 = BeanUtil.copyToList(orderBaseVOS,OrderBaseVO.class);
+        }
 
         List<String> orderBaseIds = orderBaseVOS1
                 .stream()

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

@@ -2,6 +2,7 @@ package com.gree.mall.manager.logic.workorder;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.convert.Convert;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -60,6 +61,7 @@ import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilde
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -81,10 +83,19 @@ public class OrderBaseLogic {
     private final CommonMapper commonMapper;
     private final OrderBaseCMapper orderBaseCMapper;
     private final PgOrderBaseService pgOrderBaseService;
+    private final PgOrderBase2022Service pgOrderBase2022Service;
+    private final PgOrderBase2023Service pgOrderBase2023Service;
+    private final PgOrderBase2024Service pgOrderBase2024Service;
     private final PgOrderWorkerService pgOrderWorkerService;
+    private final PgOrderWorker2022Service pgOrderWorker2022Service;
+    private final PgOrderWorker2023Service pgOrderWorker2023Service;
+    private final PgOrderWorker2024Service pgOrderWorker2024Service;
     private final AdminWebsitService adminWebsitService;
     private final OrderSmallTypeService orderSmallTypeService;
     private final PgOrderProductService pgOrderProductService;
+    private final PgOrderProduct2022Service pgOrderProduct2022Service;
+    private final PgOrderProduct2023Service pgOrderProduct2023Service;
+    private final PgOrderProduct2024Service pgOrderProduct2024Service;
     private final UserAddressService userAddressService;
     private final GoodsCategoryService goodsCategoryService;
     private final UserService userService;
@@ -116,7 +127,9 @@ public class OrderBaseLogic {
      * @param zfireParamBean
      * @return
      */
-    public IPage<OrderBaseVO> orderBaseList(WorkOrderZfireParam zfireParamBean) {
+    public IPage<OrderBaseVO> orderBaseList(WorkOrderZfireParam zfireParamBean, HttpServletRequest request) {
+
+        String year = CommonUtils.getYear(request);
 
         //特殊处理 "异常单","待预约","配件申请中","配件已到货","配件已取消" 的查询条件
         if (zfireParamBean.getParamValue("a.order_status") instanceof String) {
@@ -154,8 +167,21 @@ public class OrderBaseLogic {
         FieldUtils.supplyParam(zfireParamBean, OrderBaseVO.class, commonLogic.getAdminUser());
         zfireParamBean.setAdminWebsitIds(zfireParamBean.getAdminWebsitIds());
 
+        String sqlBase = "pg_order_base";
+        if (year.equals("2024")) {
+            sqlBase = "pg_order_base2024";
+        }
+        if (year.equals("2023")) {
+            sqlBase = "pg_order_base2023";
+        }
+
+        if (year.equals("2022") || Convert.toInt(year) < 2022) {
+            sqlBase = "pg_order_base2022";
+        }
+
+
         IPage<OrderBaseVO> page = commonMapper.orderBaseList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()),
-                zfireParamBean, adminUser.getType(), adminUser.getType().equals(1) ? adminUser.getCompanyWechatId() : null, orderBaseId);
+                zfireParamBean, adminUser.getType(), adminUser.getType().equals(1) ? adminUser.getCompanyWechatId() : null, orderBaseId, sqlBase);
 
         //服务单标识
         if (zfireParamBean.getPageSize() != -1 && page.getTotal() > 0) {
@@ -163,7 +189,7 @@ public class OrderBaseLogic {
                     .stream()
                     .map(OrderBaseVO::getId)
                     .collect(Collectors.toList());
-            Map<String, List<PgOrderFlag>> mapList = orderFlagLogic.list(orderBaseIds);
+            Map<String, List<PgOrderFlag>> mapList = orderFlagLogic.list(orderBaseIds, year);
 
             List<WorkerOrder> workerOrderList = workerOrderService.lambdaQuery().in(WorkerOrder::getWorkerOrderId, orderBaseIds)
                     .eq(WorkerOrder::getPayStatus, MaterialExamineStatusEnum.PAID.getKey())
@@ -281,7 +307,7 @@ public class OrderBaseLogic {
         }
 
         if (!StringUtil.isEmpty(orderSmallTypeText))
-            queryBuilder.must(QueryBuilders.termsQuery("order_small_type_text",orderSmallTypeText));
+            queryBuilder.must(QueryBuilders.termsQuery("order_small_type_text", orderSmallTypeText));
 
 
         if (startTime != null)
@@ -1098,22 +1124,53 @@ public class OrderBaseLogic {
      * @param id
      * @return
      */
-    public OrderAddBeanDTO detail(String id) {
-        PgOrderBase orderBase = pgOrderBaseService.getById(id);
+    public OrderAddBeanDTO detail(String id,HttpServletRequest request) {
+        String year = CommonUtils.getYear(request);
+
+        PgOrderBase orderBase = this.getOrderBase(id,year);
         if (Objects.isNull(orderBase)) {
             throw new RemoteServiceException("工单编号不存在");
         }
         OrderAddBeanDTO orderAddBeanDTO = BeanUtil.copyProperties(orderBase, OrderAddBeanDTO.class);
         //产品信息
-        List<PgOrderProduct> list = pgOrderProductService.lambdaQuery().eq(PgOrderProduct::getOrderBaseId, id).list();
+        List<PgOrderProduct> list = this.getOrderProductList(id,year);
         orderAddBeanDTO.setOrderProducts(list);
         //师傅信息
-        orderAddBeanDTO.setOrderWorkers(this.orderWorkerList(id));
+        orderAddBeanDTO.setOrderWorkers(this.orderWorkerList(id,year));
         //标记
-        orderAddBeanDTO.setOrderFlags(orderFlagLogic.list(id));
+        orderAddBeanDTO.setOrderFlags(orderFlagLogic.list(id,year));
         return orderAddBeanDTO;
     }
 
+    private List<PgOrderProduct> getOrderProductList(String id, String year) {
+
+        if (year.equals("2024"))
+            return BeanUtil.copyToList(pgOrderProduct2024Service.lambdaQuery().eq(PgOrderProduct2024::getOrderBaseId,id).list(),PgOrderProduct.class);
+
+        if (year.equals("2023"))
+            return BeanUtil.copyToList(pgOrderProduct2023Service.lambdaQuery().eq(PgOrderProduct2023::getOrderBaseId,id).list(),PgOrderProduct.class);
+
+        if (year.equals("2022"))
+            return BeanUtil.copyToList(pgOrderProduct2022Service.lambdaQuery().eq(PgOrderProduct2022::getOrderBaseId,id).list(),PgOrderProduct.class);
+
+
+        return pgOrderProductService.lambdaQuery().eq(PgOrderProduct::getOrderBaseId,id).list();
+    }
+
+    private PgOrderBase getOrderBase(String id, String year) {
+        if (year.equals("2024"))
+            return BeanUtil.toBean(pgOrderBase2024Service.getById(id),PgOrderBase.class);
+
+        if (year.equals("2023"))
+            return BeanUtil.toBean(pgOrderBase2023Service.getById(id),PgOrderBase.class);
+
+        if (year.equals("2022"))
+            return BeanUtil.toBean(pgOrderBase2022Service.getById(id),PgOrderBase.class);
+
+
+        return pgOrderBaseService.getById(id);
+    }
+
     /**
      * 打标记/取消标记
      *
@@ -1141,8 +1198,19 @@ public class OrderBaseLogic {
      * @param orderBaseId
      * @return
      */
-    public List<PgOrderWorker> orderWorkerList(String orderBaseId) {
+    public List<PgOrderWorker> orderWorkerList(String orderBaseId,String year) {
         //师傅信息
+
+        if (year.equals("2024"))
+            return BeanUtil.copyToList( pgOrderWorker2024Service.lambdaQuery().eq(PgOrderWorker2024::getOrderBaseId, orderBaseId).list(),PgOrderWorker.class);
+
+        if (year.equals("2023"))
+            return BeanUtil.copyToList( pgOrderWorker2023Service.lambdaQuery().eq(PgOrderWorker2023::getOrderBaseId, orderBaseId).list(),PgOrderWorker.class);
+
+        if (year.equals("2022"))
+            return BeanUtil.copyToList( pgOrderWorker2022Service.lambdaQuery().eq(PgOrderWorker2022::getOrderBaseId, orderBaseId).list(),PgOrderWorker.class);
+
+
         List<PgOrderWorker> orderWorkers = pgOrderWorkerService.lambdaQuery().eq(PgOrderWorker::getOrderBaseId, orderBaseId).list();
         return orderWorkers;
     }
@@ -1489,6 +1557,14 @@ public class OrderBaseLogic {
     }
 
     /**
+     * 机型列表
+     */
+    public List<PgOrderProduct> listOrderProduct(String orderBaseId ,HttpServletRequest request) {
+        String year = CommonUtils.getYear(request);
+        return this.getOrderProductList(orderBaseId,year);
+    }
+
+    /**
      * 新增机型
      *
      * @param orderProduct
@@ -1850,7 +1926,7 @@ public class OrderBaseLogic {
                     .stream()
                     .map(OrderBase2VO::getId)
                     .collect(Collectors.toList());
-            Map<String, List<PgOrderFlag>> mapList = orderFlagLogic.list(orderBaseIds);
+            Map<String, List<PgOrderFlag>> mapList = orderFlagLogic.list(orderBaseIds,"2025");
             for (OrderBase2VO orderBaseVO : page.getRecords()) {
                 orderBaseVO.setOrderFlags(mapList.get(orderBaseVO.getId()));
             }
@@ -2311,17 +2387,17 @@ public class OrderBaseLogic {
         orderLogLogic.addLog(orderBaseId, "取消工单", "取消工单-家盛茂商城api", "");
     }
 
-    public List<PgOrderBaseDetail> orderDetailJsm(String saleOrderId,List<String> workerOrderIds) {
+    public List<PgOrderBaseDetail> orderDetailJsm(String saleOrderId, List<String> workerOrderIds) {
 
         if (StringUtil.isEmpty(saleOrderId) && CollectionUtil.isEmpty(workerOrderIds))
             return null;
 
         List<PgOrderBase> pgOrderBases = pgOrderBaseService.lambdaQuery()
-                .eq(!StringUtil.isEmpty(saleOrderId),PgOrderBase::getSaleOrderId, saleOrderId)
-                .in(!CollectionUtil.isEmpty(workerOrderIds),PgOrderBase::getId, workerOrderIds)
+                .eq(!StringUtil.isEmpty(saleOrderId), PgOrderBase::getSaleOrderId, saleOrderId)
+                .in(!CollectionUtil.isEmpty(workerOrderIds), PgOrderBase::getId, workerOrderIds)
                 .list();
 
-        List<PgOrderBaseDetail>  pgOrderBaseDetails = new ArrayList<>();
+        List<PgOrderBaseDetail> pgOrderBaseDetails = new ArrayList<>();
 
         for (PgOrderBase pgOrderBase : pgOrderBases) {
             PgOrderBaseDetail pgOrderBaseDetail = BeanUtil.toBean(pgOrderBase, PgOrderBaseDetail.class);

+ 33 - 10
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderFlagLogic.java

@@ -1,16 +1,13 @@
 package com.gree.mall.manager.logic.workorder;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import com.gree.mall.manager.enums.MaterialExamineStatusEnum;
 import com.gree.mall.manager.enums.workorder.OrderFlagEnum;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
-import com.gree.mall.manager.plus.entity.PgOrderBase;
-import com.gree.mall.manager.plus.entity.PgOrderFlag;
-import com.gree.mall.manager.plus.entity.RpMaterialOrder;
-import com.gree.mall.manager.plus.service.PgOrderBaseService;
-import com.gree.mall.manager.plus.service.PgOrderFlagService;
-import com.gree.mall.manager.plus.service.RpMaterialOrderService;
+import com.gree.mall.manager.plus.entity.*;
+import com.gree.mall.manager.plus.service.*;
 import com.gree.mall.manager.utils.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,6 +28,16 @@ public class OrderFlagLogic {
 
     @Autowired
     PgOrderFlagService pgOrderFlagService;
+
+    @Autowired
+    PgOrderFlag2022Service pgOrderFlag2022Service;
+
+    @Autowired
+    PgOrderFlag2023Service pgOrderFlag2023Service;
+
+    @Autowired
+    PgOrderFlag2024Service pgOrderFlag2024Service;
+
     @Autowired
     PgOrderBaseService pgOrderBaseService;
     @Autowired
@@ -136,11 +143,11 @@ public class OrderFlagLogic {
     /**
      * 查询服务单标识-列表
      */
-    public List<PgOrderFlag> list(String orderBaseId){
-        return this.list(orderBaseId,1);
+    public List<PgOrderFlag> list(String orderBaseId,String year){
+        return this.list(orderBaseId,1,year);
     }
 
-    public Map<String, List<PgOrderFlag>> list(List<String> orderBaseIds){
+    public Map<String, List<PgOrderFlag>> list(List<String> orderBaseIds,String year){
         if(CollectionUtil.isEmpty(orderBaseIds)){
             return Collections.emptyMap();
         }
@@ -153,7 +160,23 @@ public class OrderFlagLogic {
      * @param type 0=系统内部标注用  1=需要展示在服务单列表上的
      * @return
      */
-    public List<PgOrderFlag> list(String orderBaseId,Integer type){
+    public List<PgOrderFlag> list(String orderBaseId,Integer type,String year){
+
+        if (year.equals("2024")){
+            return BeanUtil.copyToList(pgOrderFlag2024Service.lambdaQuery()
+                    .eq(PgOrderFlag2024::getOrderBaseId, orderBaseId)
+                    .eq(type != null,PgOrderFlag2024::getType,type)
+                    .orderByAsc(PgOrderFlag2024::getSortNum)
+                    .list(),PgOrderFlag.class);
+        }
+        if (year.equals("2023")){
+            return BeanUtil.copyToList(pgOrderFlag2023Service.lambdaQuery()
+                    .eq(PgOrderFlag2023::getOrderBaseId, orderBaseId)
+                    .eq(type != null,PgOrderFlag2023::getType,type)
+                    .orderByAsc(PgOrderFlag2023::getSortNum)
+                    .list(),PgOrderFlag.class);
+        }
+
         return pgOrderFlagService.lambdaQuery()
                 .eq(PgOrderFlag::getOrderBaseId, orderBaseId)
                 .eq(type != null,PgOrderFlag::getType,type)

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

@@ -29,6 +29,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -42,6 +43,9 @@ public class OrderLogLogic {
     private final CommonLogic commonLogic;
     private final OrderFlagLogic orderFlagLogic;
     private final PgOrderOperatorLogService pgOrderOperatorLogService;
+    private final PgOrderOperatorLog2022Service pgOrderOperatorLog2022Service;
+    private final PgOrderOperatorLog2023Service pgOrderOperatorLog2023Service;
+    private final PgOrderOperatorLog2024Service pgOrderOperatorLog2024Service;
     private final PgOrderBaseService pgOrderBaseService;
     private final PgOrderSettleNormService pgOrderSettleNormService;
     private final PgSettleOrderService pgSettleOrderService;
@@ -66,8 +70,49 @@ public class OrderLogLogic {
      * @param orderBaseId
      * @return
      */
-    public List<PgOrderOperatorLog> operatorLogList(String orderBaseId){
+    public List<PgOrderOperatorLog> operatorLogList(String orderBaseId, HttpServletRequest request){
+        String year = CommonUtils.getYear(request);
+
+
+        return this.getOperatorLog(orderBaseId,year);
+
+
+    }
+
+    private List<PgOrderOperatorLog> getOperatorLog(String orderBaseId, String year) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
+
+
+        if (year.equals("2024")){
+            return BeanUtil.copyToList(pgOrderOperatorLog2024Service.lambdaQuery()
+                    .eq(PgOrderOperatorLog2024::getOrderBaseId, orderBaseId)
+                    .eq(StringUtils.isNotBlank(adminUser.getCompanyWechatId()),
+                            PgOrderOperatorLog2024::getCompanyWechatId,
+                            adminUser.getCompanyWechatId())
+                    .orderByDesc(PgOrderOperatorLog2024::getCreateTime,PgOrderOperatorLog2024::getId)
+                    .list(),PgOrderOperatorLog.class);
+        }
+
+        if (year.equals("2023")){
+            return BeanUtil.copyToList(pgOrderOperatorLog2023Service.lambdaQuery()
+                    .eq(PgOrderOperatorLog2023::getOrderBaseId, orderBaseId)
+                    .eq(StringUtils.isNotBlank(adminUser.getCompanyWechatId()),
+                            PgOrderOperatorLog2023::getCompanyWechatId,
+                            adminUser.getCompanyWechatId())
+                    .orderByDesc(PgOrderOperatorLog2023::getCreateTime,PgOrderOperatorLog2023::getId)
+                    .list(),PgOrderOperatorLog.class);
+        }
+
+        if (year.equals("2022")){
+            return BeanUtil.copyToList(pgOrderOperatorLog2022Service.lambdaQuery()
+                    .eq(PgOrderOperatorLog2022::getOrderBaseId, orderBaseId)
+                    .eq(StringUtils.isNotBlank(adminUser.getCompanyWechatId()),
+                            PgOrderOperatorLog2022::getCompanyWechatId,
+                            adminUser.getCompanyWechatId())
+                    .orderByDesc(PgOrderOperatorLog2022::getCreateTime,PgOrderOperatorLog2022::getId)
+                    .list(),PgOrderOperatorLog.class);
+        }
+
         List<PgOrderOperatorLog> list = pgOrderOperatorLogService.lambdaQuery()
                 .eq(PgOrderOperatorLog::getOrderBaseId, orderBaseId)
                 .eq(StringUtils.isNotBlank(adminUser.getCompanyWechatId()),
@@ -75,6 +120,7 @@ public class OrderLogLogic {
                         adminUser.getCompanyWechatId())
                 .orderByDesc(PgOrderOperatorLog::getCreateTime,PgOrderOperatorLog::getId)
                 .list();
+
         return list;
     }
 

+ 12 - 0
mall-server-api/src/main/java/com/gree/mall/manager/utils/CommonUtils.java

@@ -119,6 +119,18 @@ public class CommonUtils {
         return url;
     }
 
+    /**
+     * 获取年份
+     */
+    public static String getYear(HttpServletRequest request){
+        String orderYear = request.getHeader("orderYear");
+        if(StringUtils.isBlank(orderYear)){
+            return "2025";
+        }
+        return orderYear;
+    }
+
+
 
     public static String getUserId(HttpServletRequest request){
         String token = getToken(request);

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

@@ -320,7 +320,7 @@
     <select id="orderBaseList" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderBaseVO">
         select
           ${ex.selected}
-        from pg_order_base a
+        from ${sqlBase} a
           ${ex.query}
           <if test="ex.orderSmallType != null and ex.orderSmallType !=''">
               and a.order_small_type = #{ex.orderSmallType}