/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.bean.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

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

@Data
@TableName("tz_order")
public class Order implements Serializable {
    private static final long serialVersionUID = 6222259729062826852L;
    /**
     * 订单ID
     */
    @TableId
    private Long orderId;

    /**
     * 店铺ID
     */
    private Long shopId;
    @TableField(exist = false)
    private String shopName;
    /**
     * 渠道ID
     */
    private Long channelId;
    @TableField(exist = false)
    private String channelName;

    /**
     * 商品名称
     */
    private String prodName;

    /**
     * 用户ID
     */
    private String userId;
    /**
     * 父订单号
     */
    private String parentOrderNumber;

    /**
     * 订单编号
     */
    private String orderNumber;

    /**
     * 订单总金额
     */
    private Double total;

    /**
     * 订单实际金额
     */
    private Double actualTotal;

    /**
     * 支付方式
     */
    private Integer payType;

    /**
     * 用户备注
     */
    private String remarks;

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


    /**
     * 订单状态
     * 订单状态
     */
    private Integer hbOrderStatus;

    /**
     * 物流状态
     * 物流状态
     */
    private Integer hbLogisticStatus;

    /**
     * 配送类型
     */
    private Integer dvyType;

    /**
     * 物流公司ID
     */
    private Long dvyId;

    /**
     * 物流单号
     */
    private String dvyFlowId;

    /**
     * 运费金额
     */
    private Double freightAmount;

    /**
     * 收货地址ID
     */
    private Long addrOrderId;

    /**
     * 订单拆单状态
     */
    private Integer orderSplitStatus;
    /**
     * 拆单数量
     */
    private Integer orderSplitNumber;
    /**
     * 是否自动拆单
     */
    private Integer autoSplit;
    /**
     * 拆单状态
     */
    private Integer splitStatus;
    /**
     * 订单层级
     */
    private Integer orderLevel;
    /**
     * 拆单用户ID
     */
    private Long splitUserId;

    private String consigneeName;

    private String consigneeMobile;

    private String consigneeAddress;

    private Double latitude;

    private Double longitude;

    @TableField(exist = false)
    @ApiModelProperty("Split user name")
    private String splitUserName;


    /**
     * 商品数量
     */
    private Integer productNums;
    @ApiModelProperty("订单字段说明")
    private  String qnhOrderId;

    @ApiModelProperty("QNH order status")
    private  String qnhOrderStatus;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 支付时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    /**
     * 发货时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date dvyTime;

    /**
     * 完成时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date finallyTime;


    /**
     * 取消原因
     */
    private String cancelReason;

    /**
     * 取消时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date cancelTime;

    /**
     * 是否已支付
     */
    private Integer isPayed;

    /**
     * 删除状态
     */
    private Integer deleteStatus;

    /**
     * 退款状态
     */
    private Integer refundStatus;

    /**
     * 平台优惠金额
     */
    private Double platformAmount;

    /**
     * 优惠金额
     */
    private Double reduceAmount;

    /**
     * 会员折扣金额
     */
    private Double memberDiscountAmount;

    /**
     * 会员折扣描述
     */
    private String memberDiscountDesc;

    /**
     * 订单类型
     */
    private Integer orderType;

    /**
     * 关闭类型
     */
    private Integer closeType;

    @ApiModelProperty("Delivery status")
    private Integer dvyStatus;


    /**
     * 订单字段说明
     */
    @TableField(exist = false)
    @ApiModelProperty("Nickname")
    private String nickName;
    /**
     * 订单字段说明
     */
    @TableField(exist = false)
    @ApiModelProperty("User mobile")
    private String userMobile;

    @TableField(exist = false)
    @ApiModelProperty("Receiver")
    private String receiver;

    @TableField(exist = false)
    private List<OrderItem> orderItems;

    /**
     * 收货地址信息
     */
    @TableField(exist = false)
    private UserAddrOrder userAddrOrder;

    /**
     * 退款单号
     */
    @TableField(exist = false)
    private String refundSn;

    /**
     * 使用积分
     */
    @TableField(exist = false)
    private Integer score;
    /**
     * 评论状态
     */
    private Integer commSts;
    /**
     * 退款状态
     */
    @TableField(exist = false)
    private Integer returnMoneySts;

    /**
     * 退款类型
     */
    @TableField(exist = false)
    private Integer refundType;

    /**
     * 损失金额
     */
    @TableField(exist = false)
    private Double lossAmount;

    @TableField(exist = false)
    private Integer payScore;

    /**
     * 是否需要下一步支付
     */
    @TableField(exist = false)
    private Boolean nextPay = Boolean.FALSE;

    @TableField
    private Long offsetPoints;

    @TableField(exist = false)
    private Integer goodsTotalCount;


    /**
     * 子订单列表
     */
    @TableField(exist = false)
    private List<Order> subOrders;

    /**
     * 自提码
     */
    private String selfPickCode;


}
