package com.bohuikeji.delivery.backstage.entity;

import com.alibaba.fastjson.annotation.JSONField;
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.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.TFranchiseeInformation;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.serializer.Decimal2Serializer;
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;

/**
 * 钱包提现表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TWxtransfers对象", description="钱包提现表")
public class TWxtransfers extends EntityBase<TWxtransfers> {

    private static final long serialVersionUID = 1L;

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


    @ApiModelProperty(value = "支付记录id")
    @TableId(value = "customer_pay_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer customerPayId;

    @ApiModelProperty(value = "加盟商id")
    @TableField("fran_id")
    @TableShowField(value = "所属区域",show = true)
    @TableKeyField(table = "t_franchisee_information",keyShowFields = "fran_name",where = "fran_id in(##FRAN_IDS##)",key = TFranchiseeInformation.class)
    @TableQueryField(like = false)
    @TableNewField(block = SelectBlock.class,edit = false,add = false)
    private Integer franId;

    @ApiModelProperty(value = "下单用户Id")
    @TableField("player_id")
    @TableShowField(value = "下单人用户")
    @TableKeyField(table = "t_customer",keyShowFields = "customer_name",keyLikeFields = "customer_name",key = TCustomer.class)
    @TableQueryField(like = false)
    @TableNewField(block = SelectBlock.class,edit = false)
    private Integer playerId;

    @ApiModelProperty(value = "钱包id")
    @TableField("wallet_id")
    @TableShowField(value = "下单用户",show = false)
    @TableNewField(edit = false,block = SelectBlock.class)
    @TableQueryField(like = false,sort = 0.1)
    private Integer walletId;

    @ApiModelProperty(value = "商家付款单号")
    @TableField("partner_num")
    @TableShowField("商家付款单号")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String partnerNum;

    @ApiModelProperty(value = "平台付款单号")
    @TableField("payment_num")
    @TableShowField("平台付款单号")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String paymentNum;

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

    @ApiModelProperty(value = "付款金额")
    @TableField("transfers_price")
    @TableShowField(value = "付款金额")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    @JSONField(serializeUsing = Decimal2Serializer.class)
    private BigDecimal transfersPrice=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "付款状态")
    @TableField("transfers_state")
    @TableShowField(value = "付款状态")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String transfersState;

    @ApiModelProperty(value = "付款渠道")
    @TableField("transfers_channel")
    @TableShowField(value = "付款渠道")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String transfersChannel;

    @ApiModelProperty(value = "付款成功时间")
    @TableField("payment_time")
    @TableShowField("付款成功时间")
    @TableNewField(edit = false)
    @TableQueryField(sort = 0,like = false)
    private LocalDateTime paymentTime;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @TableShowField("创建时间")
    @TableNewField(edit = false)
    @TableQueryField(sort = 0,like = false)
    private LocalDateTime createTime;

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