
package com.tmerclub.cloud.order.model;

import com.tmerclub.cloud.common.model.BaseModel;
import com.tmerclub.cloud.api.payment.constant.PaySysType;
import lombok.Data;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 订单信息
 *
 * @author tmerclub
 * @date 2020-12-05 14:13:50
 */
@Data
@ToString
public class Order extends BaseModel implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 店铺id
     */
    private Long shopId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 用户订单地址Id
     */
    private Long orderAddrId;

    /**
     * 支付系统类型
     *
     * @see PaySysType
     */
    private Integer paySysType;

    /**
     * 店铺名称
     */
    private String shopName;

    /**
     * 总值
     */
    private Long total;

    /**
     * 实际总值
     */
    private Long actualTotal;

    /**
     * 订单使用积分
     */
    private Long orderScore;

    /**
     * 订单发票id
     */
    private Long orderInvoiceId;

    /**
     * 买家备注
     */
    private String remarks;

    /**
     * 卖家备注
     */
    private String shopRemarks;

    /**
     * 订单状态 1:待付款 2:待发货(待自提) 3:待收货(已发货) 5:成功 6:失败 7:待成团
     */
    private Integer status;

    /**
     * 支付方式 请参考枚举PayType
     */
    private Integer payType;

    /**
     * 配送类型 1:快递 2:自提 3：无需快递 4同城配送
     */
    private Integer deliveryType;

    /**
     * 订单类型1团购订单 2秒杀订单 3积分订单
     */
    private Integer orderType;

    /**
     * 订单关闭原因 1-超时未支付 2-退款关闭 4-买家取消 15-已通过货到付款交易
     */
    private Integer closeType;

    /**
     * 订单商品总数
     */
    private Integer allCount;

    /**
     * 付款时间
     */
    private Date payTime;

    /**
     * 发货时间
     */
    private Date deliveryTime;

    /**
     * 完成时间
     */
    private Date finallyTime;

    /**
     * 结算时间
     */
    private Date settledTime;

    /**
     * 取消时间
     */
    private Date cancelTime;

    /**
     * 预售发货时间
     */
    private Date bookTime;

    /**
     * 是否已支付，1.已支付0.未支付
     */
    private Integer isPayed;

    /**
     * 用户订单删除状态，0：没有删除， 1：回收站， 2：永久删除
     */
    private Integer deleteStatus;

    /**
     * 订单退款状态（1:申请退款 2:退款成功 3:部分退款成功 4:退款失败）
     */
    private Integer refundStatus;

    /**
     * 订单运费
     */
    private Long freightAmount;

    /**
     * 积分抵扣金额
     */
    private Long scoreAmount;

    /**
     * 会员折扣金额
     */
    private Long memberAmount;

    /**
     * 平台优惠券优惠金额
     */
    private Long platformCouponAmount;

    /**
     * 商家优惠券优惠金额
     */
    private Long shopCouponAmount;

    /**
     * 满减优惠金额
     */
    private Long discountAmount;

    /**
     * 分销佣金
     */
    private Long distributionAmount;
    /**
     * 平台优惠金额
     */
    private Long platformAmount;

    /**
     * 运费减免金额
     */
    private Long freeFreightAmount;

    /**
     * 平台运费减免金额
     */
    private Long platformFreeFreightAmount;

    /**
     * 店铺改价优惠金额
     */
    private Long shopChangeFreeAmount;

    /**
     * 优惠总额
     */
    private Long reduceAmount;

    /**
     * 平台佣金
     */
    private Long platformCommission;

    /**
     * 是否已经进行结算
     */
    private Integer isSettled;

    /**
     * 订单项
     */
    private List<OrderItem> orderItems;

    /**
     * 订单地址
     */
    private OrderAddr orderAddr;

    /**
     * 收货人姓名
     */
    private String consignee;

    /**
     * 收货人手机号
     */
    private String mobile;

    /**
     * 供应商id
     */
    private Long supplierId;

    /**
     * 供应商商品发货方式 1.供应商发货 2.仓库发货
     */
    private Integer supplierDeliveryType;
    /**
     * 是否待采购 1.是 0.否 2.采购完成
     */
    private Integer waitPurchase;
    /**
     * 商家采购价差（需要商家从结算金额补上采购价的金额）
     */
    private Long purchaseSpreadAmount;
    /**
     * 预售类型 -1.未开启预售 0.全款预售类型 1.定金预售
     */
    private Integer preSaleType;
    /**
     * 是否为虚拟商品订单 1.是 0.否
     */
    private Integer orderMold;
    /**
     * 预售信息
     */
    private OrderPreSaleInfo orderPreSaleInfo;

    /**
     * 套餐优惠金额
     */
    private Long shopComboAmount;

    /**
     * 核销次数 -1.多次核销 0.无需核销 1.单次核销
     */
    private Integer writeOffNum;

    /**
     * 多次核销次数 -1.无限次
     */
    private Integer writeOffMultipleCount;

    /**
     * 核销开始时间
     */
    private Date writeOffStart;

    /**
     * 核销结束时间
     */
    private Date writeOffEnd;

    /**
     * 订单核销状态 0.待核销 1.核销完成
     */
    private Integer writeOffStatus;

    /**
     * 订单被核销次数
     */
    private Integer writeOffCount;

    /**
     * 主单号,在组合商品拆单时会存在
     */
    private Long mainOrderId;

    public Long getMainOrderId() {
        return mainOrderId;
    }

    public void setMainOrderId(Long mainOrderId) {
        this.mainOrderId = mainOrderId;
    }

    public Integer getWriteOffCount() {
        return writeOffCount;
    }

    public void setWriteOffCount(Integer writeOffCount) {
        this.writeOffCount = writeOffCount;
    }

    public Integer getWriteOffStatus() {
        return writeOffStatus;
    }

    public void setWriteOffStatus(Integer writeOffStatus) {
        this.writeOffStatus = writeOffStatus;
    }

    public Integer getWriteOffNum() {
        return writeOffNum;
    }

    public void setWriteOffNum(Integer writeOffNum) {
        this.writeOffNum = writeOffNum;
    }

    public Integer getWriteOffMultipleCount() {
        return writeOffMultipleCount;
    }

    public void setWriteOffMultipleCount(Integer writeOffMultipleCount) {
        this.writeOffMultipleCount = writeOffMultipleCount;
    }

    public Date getWriteOffStart() {
        return writeOffStart;
    }

    public void setWriteOffStart(Date writeOffStart) {
        this.writeOffStart = writeOffStart;
    }

    public Date getWriteOffEnd() {
        return writeOffEnd;
    }

    public void setWriteOffEnd(Date writeOffEnd) {
        this.writeOffEnd = writeOffEnd;
    }

    public Long getShopComboAmount() {
        return shopComboAmount;
    }

    public void setShopComboAmount(Long shopComboAmount) {
        this.shopComboAmount = shopComboAmount;
    }

    public OrderPreSaleInfo getOrderPreSaleInfo() {
        return orderPreSaleInfo;
    }

    public void setOrderPreSaleInfo(OrderPreSaleInfo orderPreSaleInfo) {
        this.orderPreSaleInfo = orderPreSaleInfo;
    }


    public Integer getOrderMold() {
        return orderMold;
    }

    public void setOrderMold(Integer orderMold) {
        this.orderMold = orderMold;
    }

    public Integer getPreSaleType() {
        return preSaleType;
    }

    public void setPreSaleType(Integer preSaleType) {
        this.preSaleType = preSaleType;
    }

    public Long getPurchaseSpreadAmount() {
        return purchaseSpreadAmount;
    }

    public void setPurchaseSpreadAmount(Long purchaseSpreadAmount) {
        this.purchaseSpreadAmount = purchaseSpreadAmount;
    }

    public Integer getWaitPurchase() {
        return waitPurchase;
    }

    public void setWaitPurchase(Integer waitPurchase) {
        this.waitPurchase = waitPurchase;
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    public Integer getSupplierDeliveryType() {
        return supplierDeliveryType;
    }

    public void setSupplierDeliveryType(Integer supplierDeliveryType) {
        this.supplierDeliveryType = supplierDeliveryType;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getOrderAddrId() {
        return orderAddrId;
    }

    public void setOrderAddrId(Long orderAddrId) {
        this.orderAddrId = orderAddrId;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public Long getActualTotal() {
        return actualTotal;
    }

    public void setActualTotal(Long actualTotal) {
        this.actualTotal = actualTotal;
    }

    public String getRemarks() {
        return remarks;
    }

    public Long getOrderInvoiceId() {
        return orderInvoiceId;
    }

    public void setOrderInvoiceId(Long orderInvoiceId) {
        this.orderInvoiceId = orderInvoiceId;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getShopRemarks() {
        return shopRemarks;
    }

    public void setShopRemarks(String shopRemarks) {
        this.shopRemarks = shopRemarks;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryType(Integer deliveryType) {
        this.deliveryType = deliveryType;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Integer getCloseType() {
        return closeType;
    }

    public void setCloseType(Integer closeType) {
        this.closeType = closeType;
    }

    public Integer getAllCount() {
        return allCount;
    }

    public void setAllCount(Integer allCount) {
        this.allCount = allCount;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(Date deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public Date getFinallyTime() {
        return finallyTime;
    }

    public void setFinallyTime(Date finallyTime) {
        this.finallyTime = finallyTime;
    }

    public Date getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }

    public Date getBookTime() {
        return bookTime;
    }

    public void setBookTime(Date bookTime) {
        this.bookTime = bookTime;
    }

    public Integer getIsPayed() {
        return isPayed;
    }

    public void setIsPayed(Integer isPayed) {
        this.isPayed = isPayed;
    }

    public Integer getDeleteStatus() {
        return deleteStatus;
    }

    public void setDeleteStatus(Integer deleteStatus) {
        this.deleteStatus = deleteStatus;
    }

    public Integer getRefundStatus() {
        return refundStatus;
    }

    public void setRefundStatus(Integer refundStatus) {
        this.refundStatus = refundStatus;
    }

    public Long getFreightAmount() {
        return freightAmount;
    }

    public void setFreightAmount(Long freightAmount) {
        this.freightAmount = freightAmount;
    }

    public Long getScoreAmount() {
        return scoreAmount;
    }

    public void setScoreAmount(Long scoreAmount) {
        this.scoreAmount = scoreAmount;
    }

    public Long getMemberAmount() {
        return memberAmount;
    }

    public void setMemberAmount(Long memberAmount) {
        this.memberAmount = memberAmount;
    }

    public Long getPlatformCouponAmount() {
        return platformCouponAmount;
    }

    public void setPlatformCouponAmount(Long platformCouponAmount) {
        this.platformCouponAmount = platformCouponAmount;
    }

    public Long getShopCouponAmount() {
        return shopCouponAmount;
    }

    public void setShopCouponAmount(Long shopCouponAmount) {
        this.shopCouponAmount = shopCouponAmount;
    }

    public Long getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(Long discountAmount) {
        this.discountAmount = discountAmount;
    }

    public Long getPlatformAmount() {
        return platformAmount;
    }

    public void setPlatformAmount(Long platformAmount) {
        this.platformAmount = platformAmount;
    }

    public Long getReduceAmount() {
        return reduceAmount;
    }

    public void setReduceAmount(Long reduceAmount) {
        this.reduceAmount = reduceAmount;
    }

    public List<OrderItem> getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(List<OrderItem> orderItems) {
        this.orderItems = orderItems;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public Long getFreeFreightAmount() {
        return freeFreightAmount;
    }

    public void setFreeFreightAmount(Long freeFreightAmount) {
        this.freeFreightAmount = freeFreightAmount;
    }

    public Long getShopChangeFreeAmount() {
        return shopChangeFreeAmount;
    }

    public void setShopChangeFreeAmount(Long shopChangeFreeAmount) {
        this.shopChangeFreeAmount = shopChangeFreeAmount;
    }

    public Long getPlatformCommission() {
        return platformCommission;
    }

    public void setPlatformCommission(Long platformCommission) {
        this.platformCommission = platformCommission;
    }

    public Long getPlatformFreeFreightAmount() {
        return platformFreeFreightAmount;
    }

    public void setPlatformFreeFreightAmount(Long platformFreeFreightAmount) {
        this.platformFreeFreightAmount = platformFreeFreightAmount;
    }

    public Long getOrderScore() {
        return orderScore;
    }

    public void setOrderScore(Long orderScore) {
        this.orderScore = orderScore;
    }

    public OrderAddr getOrderAddr() {
        return orderAddr;
    }

    public void setOrderAddr(OrderAddr orderAddr) {
        this.orderAddr = orderAddr;
    }

    public Integer getIsSettled() {
        return isSettled;
    }

    public void setIsSettled(Integer isSettled) {
        this.isSettled = isSettled;
    }

    public Long getDistributionAmount() {
        return distributionAmount;
    }

    public void setDistributionAmount(Long distributionAmount) {
        this.distributionAmount = distributionAmount;
    }

    public Date getSettledTime() {
        return settledTime;
    }

    public void setSettledTime(Date settledTime) {
        this.settledTime = settledTime;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Integer getPaySysType() {
        return paySysType;
    }

    public void setPaySysType(Integer paySysType) {
        this.paySysType = paySysType;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId=" + orderId +
                ", shopId=" + shopId +
                ", userId=" + userId +
                ", orderAddrId=" + orderAddrId +
                ", paySysType=" + paySysType +
                ", shopName='" + shopName + '\'' +
                ", total=" + total +
                ", actualTotal=" + actualTotal +
                ", orderScore=" + orderScore +
                ", orderInvoiceId=" + orderInvoiceId +
                ", remarks='" + remarks + '\'' +
                ", shopRemarks='" + shopRemarks + '\'' +
                ", status=" + status +
                ", payType=" + payType +
                ", deliveryType=" + deliveryType +
                ", orderType=" + orderType +
                ", closeType=" + closeType +
                ", allCount=" + allCount +
                ", payTime=" + payTime +
                ", deliveryTime=" + deliveryTime +
                ", finallyTime=" + finallyTime +
                ", settledTime=" + settledTime +
                ", cancelTime=" + cancelTime +
                ", bookTime=" + bookTime +
                ", isPayed=" + isPayed +
                ", deleteStatus=" + deleteStatus +
                ", refundStatus=" + refundStatus +
                ", freightAmount=" + freightAmount +
                ", scoreAmount=" + scoreAmount +
                ", memberAmount=" + memberAmount +
                ", platformCouponAmount=" + platformCouponAmount +
                ", shopCouponAmount=" + shopCouponAmount +
                ", discountAmount=" + discountAmount +
                ", distributionAmount=" + distributionAmount +
                ", platformAmount=" + platformAmount +
                ", freeFreightAmount=" + freeFreightAmount +
                ", platformFreeFreightAmount=" + platformFreeFreightAmount +
                ", shopChangeFreeAmount=" + shopChangeFreeAmount +
                ", reduceAmount=" + reduceAmount +
                ", platformCommission=" + platformCommission +
                ", isSettled=" + isSettled +
                ", orderItems=" + orderItems +
                ", orderAddr=" + orderAddr +
                ", consignee='" + consignee + '\'' +
                ", mobile='" + mobile + '\'' +
                ", supplierId=" + supplierId +
                ", supplierDeliveryType=" + supplierDeliveryType +
                ", waitPurchase=" + waitPurchase +
                ", purchaseSpreadAmount=" + purchaseSpreadAmount +
                ", preSaleType=" + preSaleType +
                ", orderMold=" + orderMold +
                ", orderPreSaleInfo=" + orderPreSaleInfo +
                ", shopComboAmount=" + shopComboAmount +
                ", writeOffNum=" + writeOffNum +
                ", writeOffMultipleCount=" + writeOffMultipleCount +
                ", writeOffStart=" + writeOffStart +
                ", writeOffEnd=" + writeOffEnd +
                ", writeOffStatus=" + writeOffStatus +
                ", writeOffCount=" + writeOffCount +
                ", mainOrderId=" + mainOrderId +
                '}';
    }
}
