package com.bohuikeji.delivery.backstage.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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 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="t_settle对象", description="支付交易信息表")
public class TSettle extends EntityBase<TSettle> {

    private static final long serialVersionUID = 1L;

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

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

    @ApiModelProperty(value = "分账结算号")
    @TableField("settle_num")
    @TableShowField("分账结算号")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String settleNum;

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

    @ApiModelProperty(value = "下单用户Id")
    @TableField("player_id")
    /*@TableShowField(value = "下单用户",show = false)
    @TableNewField(edit = false,block = SelectBlock.class)
    @TableKeyField(table = "t_customer",keyShowFields = {"customer_name"},keyLikeFields = "customer_name")
    @TableQueryField(like = false,sort = 0.1)*/
    private Integer playerId;

    @ApiModelProperty(value = "订单Id")
    @TableField("order_id")
    @TableShowField(value = "订单Id")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private Integer orderId;

    @ApiModelProperty(value = "商户单号（支付的订单号）")
    @TableField("merchant_num")
    @TableShowField(value = "订单号")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String merchantNum;

    @ApiModelProperty(value = "实际支付总价")
    @TableField("pay_fact_price")
    @TableShowField("实际支付金额(￥)")
    @TableNewField(edit = false)
    private BigDecimal payFactPrice=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "分账状态(待分账,已分账)")
    @TableField("settle_status")
    @TableShowField("分账状态")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String settleStatus="待分账";

    @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("settle_no")
    @TableShowField("分账单号")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String settleNo;

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

    @ApiModelProperty(value = "分账时间")
    @TableField("settle_time")
    @TableShowField("分账时间")
    @TableNewField(edit = false)
    @TableQueryField(sort = 0,like = false)
    private LocalDateTime settleTime;

}
