package com.gxwebsoft.common.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.gxwebsoft.common.system.param.MenuParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * 订单
 *
 * @author 科技小王子
 * @since 2024-10-16 12:32:52
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Order对象", description = "订单")
@TableName("sys_order")
public class Order implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单号")
    @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;

    @ApiModelProperty(value = "订单编号")
    private String orderNo;

    @ApiModelProperty(value = "订单类型，0产品 1插件")
    private Integer type;

    @ApiModelProperty(value = "下单渠道，0网站 1小程序 2其他")
    private Integer channel;

    @ApiModelProperty(value = "微信支付订单号")
    private String transactionId;

    @ApiModelProperty(value = "微信退款订单号")
    private String refundOrder;

    @ApiModelProperty(value = "使用的优惠券id")
    private Integer couponId;

    @ApiModelProperty(value = "真实姓名")
    private String realName;

    @ApiModelProperty(value = "手机号码")
    private String phone;

    @ApiModelProperty(value = "订单总额")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "减少的金额，使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格")
    private BigDecimal reducePrice;

    @ApiModelProperty(value = "实际付款")
    private BigDecimal payPrice;

    @ApiModelProperty(value = "用于统计")
    private BigDecimal price;

    @ApiModelProperty(value = "价钱，用于积分赠送")
    private BigDecimal money;

    @ApiModelProperty(value = "退款金额")
    private BigDecimal refundMoney;

    @ApiModelProperty(value = "购买数量")
    private Integer totalNum;

    @ApiModelProperty(value = "0余额支付, 1微信支付，102微信Native，2会员卡支付，3支付宝，4现金，5POS机")
    private Integer payType;

    @ApiModelProperty(value = "0未付款，1已付款")
    private Boolean payStatus;

    @ApiModelProperty(value = "0未完成，1已完成，2已取消，3取消中，4退款申请中，5退款被拒绝，6退款成功，7客户端申请退款")
    private Integer orderStatus;

    @ApiModelProperty(value = "优惠类型：0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡，5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡")
    private Integer couponType;

    @ApiModelProperty(value = "优惠说明")
    private String couponDesc;

    @ApiModelProperty(value = "二维码地址，保存订单号，支付成功后才生成")
    private String qrcode;

    @ApiModelProperty(value = "预约详情开始时间数组")
    private Long startTime;

    @ApiModelProperty(value = "是否已开具发票：0未开发票，1已开发票，2不能开具发票")
    private Boolean isInvoice;

    @ApiModelProperty(value = "发票流水号")
    private String invoiceNo;

    @ApiModelProperty(value = "支付时间")
    private Date payTime;

    @ApiModelProperty(value = "退款时间")
    private Date refundTime;

    @ApiModelProperty(value = "申请退款时间")
    private Date refundApplyTime;

    @ApiModelProperty(value = "过期时间")
    private Date expirationTime;

    @ApiModelProperty(value = "对账情况：0=未对账；1=已对账；3=已对账，金额对不上；4=未查询到该订单")
    private Integer checkBill;

    @ApiModelProperty(value = "订单是否已结算(0未结算 1已结算)")
    private Integer isSettled;

    @ApiModelProperty(value = "系统版本号 0当前版本 value=其他版本")
    private Integer version;

    @ApiModelProperty(value = "用户id")
    private Integer userId;

    @ApiModelProperty(value = "产品控制台")
    private String adminUrl;

    @ApiModelProperty(value = "备注")
    private String comments;

    @ApiModelProperty(value = "排序号")
    private Integer sortNumber;

    @ApiModelProperty(value = "是否删除, 0否, 1是")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "租户id")
    private Integer tenantId;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "购买时长")
    @TableField(exist = false)
    private Integer month;

    @ApiModelProperty(value = "购买数量")
    @TableField(exist = false)
    private Integer cartNum;

    @ApiModelProperty(value = "应用列表")
    private List<Company> list;

    @ApiModelProperty(value = "插件安装参数")
    @TableField(exist = false)
    private MenuParam menuParam;

    @ApiModelProperty(value = "应用名称")
    @TableField(exist = false)
    private String tenantName;

    @ApiModelProperty(value = "应用图标")
    @TableField(exist = false)
    private String logo;

    @ApiModelProperty(value = "订单商品")
    @TableField(exist = false)
    private List<OrderGoods> orderGoods;


}
