package cn.pluss.platform.entity;

import  java.util.Date;

import cn.pluss.platform.util.StringUtil;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

@Data
@Accessors(chain = true)
public class MerchantBankCard {

    @TableId
    private Integer id;
    private String merchantCode;
    private String storeId;
    private String bankCardNo;
    private String bankAddressNo;
    private String bankCertName;
    private String bankName;
    private String branchName;
    private String accountType;
    private String contactLine;
    private String branchProvince;
    private String branchCity;
    private String branchArea;
    private String certType;
    private String certNo;
    private String certStartTime;
    private String certEndTime;
    private String cardHolderAddress;
    private String orderNo;
    private String merchantId;
    private String registerStatus;
    private String failReason;
    private String accountNo;
    private String wechatChannelList;
    private String phone;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createDt;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateDt;
    private String aisleSwitch;
    /**
     * 身份证正面
     */
    private String certFullPhoto;
    /**
     * 身份证反面
     */
    private String certBacKPhoto;
    /**
     * 银行卡照片
     */
    private String bankCardFrontPic;
    private String userId;

    public String getBankCardNo() {
        if (StringUtil.isEmpty(bankCardNo)) {
            return bankCardNo;
        }

        return bankCardNo.replaceAll("[ 　]", "");
    }

    public String certTypeTransform() {
        if ("01".equals(certType)) {
            return "00";
        }

        return certType;
    }
}

