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.payment.domain.FinancialMaster;
import com.ghy.worker.domain.Worker;
import lombok.Data;
import lombok.EqualsAndHashCode;

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 Worker worker;

    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 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;

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

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