package com.ghy.order.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ghy.common.annotation.Excel;
import com.ghy.common.core.domain.BaseEntity;
import com.ghy.common.enums.OrderStatus;
import com.ghy.common.enums.PayStatus;
import com.ghy.common.enums.PayTypeEnum;
import com.ghy.goods.domain.Goods;
import com.ghy.payment.domain.FinancialMaster;
import com.ghy.worker.domain.Worker;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * @author clunt
 * 主单表(对应付款订单)
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class OrderMaster extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Excel(name = "序号", cellType = Excel.ColumnType.NUMERIC)
    private Long id;

    @Excel(name = "商户ID", cellType = Excel.ColumnType.NUMERIC)
    private Long deptId;

    @Excel(name = "订单编码", cellType = Excel.ColumnType.STRING)
    private String code;

    @Excel(name = "消费者用户id", cellType = Excel.ColumnType.NUMERIC)
    private Long customerId;

    @Excel(name = "地址id", cellType = Excel.ColumnType.NUMERIC)
    private Long addressId;

    @Excel(name = "订单类型", cellType = Excel.ColumnType.NUMERIC)
    private Integer orderType;

    /**
     * @see OrderStatus
     */
    @Excel(name = "订单状态", cellType = Excel.ColumnType.NUMERIC)
    private Integer orderStatus;

    /**
     * @see PayTypeEnum
     */
    @Excel(name = "付款类型", cellType = Excel.ColumnType.NUMERIC)
    private Integer payType;

    /**
     * @see PayStatus
     */
    @Excel(name = "付款状态", cellType = Excel.ColumnType.NUMERIC)
    private Integer payStatus;

    private String payStatusList;

    @Excel(name = "接单师傅id", cellType = Excel.ColumnType.NUMERIC)
    private Long workerId;

    @Excel(name = "付款时间", cellType = Excel.ColumnType.STRING)
    private Date payTime;

    @Excel(name = "接单时间", cellType = Excel.ColumnType.STRING)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date revTime;

    private Date expectTimeStart;

    private Date expectTimeEnd;

    private String mixExpectTime;

    private Worker worker;

    private String customerName;

    private String customerPhone;

    private FinancialMaster financialMaster;

    private OrderGoods orderGoods;

    private Long goodsId;

    private Long goodsCategoryId;

    private String goodsName;

    private Long countryId;

    private Integer exceptOrderStatus;

    private String orderStatuses;

    private String orderStatusName;

    private Boolean isOverTime;

    private String orderMasterIds;

    private Boolean useTimeNotRange;

    private Boolean isMonitoredOrder;

    private Integer allSelfAssigned;

    private Boolean resetAllSelfAssigned;

    private Integer hasDispatchedAll;

    private List<Long> customerIds;

    private Boolean shelveStatus;

    private List<Long> exceptOrderMasterIds;

    // 下单总金额
    private BigDecimal financialMasterMoney;

    // 师傅应得金额
    private BigDecimal financialMasterPayMoney;

    private Goods goods;

    /*
    *  后台使用的三级类目*数量 例如 【清洗-电器-空调】x 3
    * */
    private String consoleGoodsName;

    private String addressPhone;

    private String addressName;

    private String address;

    /**
     * 是否超时 1=是 0=否
     */
    private Integer timeout;

    /**
     * 超时扣款次数
     */
    private Integer timeoutFineTimes;

    private String orderMode;

    private String orderImgs;

    private String payMode;

    private String isCharge;

    private String isContact;

    private Integer sysPayStatus;

    /**
     * 是否约单
     * */
    private String isCall;

    private BigDecimal serverMoney;

    private Boolean searchAfterList;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTimeStart;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTimeEnd;

    private String lastCallTime;

    private List<Long> cityIds;

    private List<Long> districtIds;

    private List<Long> streetIds;

    private List<Long> addressIds;

    private List<Long> orderMasterIdList;

    // 商品品牌 -- 后台发单才有
    private String goodsBrand;
    // 商品规格 -- 后台发单才有
    private String goodsSpecification;

    /**
     *  后台关键字搜索
     * */
    private String keywords;

    private String workerPhone;

    private String workerName;

    private String province;

    private String city;

    private String district;

    private String consultMode;

    private Long insuranceId;

}
