package com.bohuikeji.delivery.backstage.entity.discount;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.bohuikeji.delivery.backstage.entity.TCustomer;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 支付交易信息表
 * </p>
 *
 * @author 10552
 * @since 2019-12-27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TDiscountPay对象", description="支付交易信息表")
public class TDiscountPay extends EntityBase<TDiscountPay> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增id")
    @TableId(value = "dispay_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer dispayId;

    @ApiModelProperty(value = "购买用户")
    @TableField("player_id")
    @TableShowField(value = "购买用户")
    @TableNewField(edit = false,block = SelectBlock.class)
    @TableKeyField(table = "t_customer",keyShowFields = {"customer_name"},keyLikeFields = "customer_name",key = TCustomer.class)
    @TableQueryField(like = false,sort = 0.1)
    private Integer playerId;

    @ApiModelProperty(value = "购买单号")
    @TableField("pay_num")
    @TableShowField("购买单号")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String payNum;

    @ApiModelProperty(value = "付款方式")
    @TableField("pay_way")
    @TableShowField("付款方式")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String payWay;

    @ApiModelProperty(value = "优惠id")
    @TableField("dis_id")
    @TableShowField(value = "优惠id")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private Integer disId;


    @ApiModelProperty(value = "支付总价")
    @TableField("dis_price")
    @TableShowField("支付金额(￥)")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private BigDecimal disPrice=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "支付状态(待支付,已支付,取消支付)")
    @TableField("pay_status")
    @TableShowField("支付状态")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String payStatus;

    @ApiModelProperty(value = "付款渠道")
    @TableField("pay_channel")
    @TableShowField(value = "付款渠道",show = false)
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String payChannel;

    @ApiModelProperty(value = "渠道商单号(微信,支付宝，银联等第三方单号)")
    @TableField("pay_channel_num")
    @TableShowField("渠道商单号")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String payChannelNum;

    @ApiModelProperty(value = "交易创建时间")
    @TableField("create_time")
    @TableShowField(value = "交易发起时间",show = false)
    @TableNewField(edit = false)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "支付时间")
    @TableField("pay_time")
    @TableShowField("支付时间")
    @TableNewField(edit = false)
    @TableQueryField(sort = 0,like = false)
    private LocalDateTime payTime;

    /**
     * 优惠卷类型
     */
    @ApiModelProperty(value = "优惠卷类型")
    @TableQueryField(show = false)
    @TableShowField(value = "优惠卷类型")
    @TableNewField()
    @TableField("dis_type")
    private String disType;

    @ApiModelProperty(value = "支付场景")
    @TableField("pay_scenario")
    @TableShowField("支付场景")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String payScenario;

    @ApiModelProperty(value = "支付方式（客户支付、骑手代付）")
    @TableField("pay_method")
    @TableShowField("支付方式")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String payMethod;


}
