package com.jeequan.jeepay.core.model.df;

import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.entity.AccountCashInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * TODO
 * 签约
 * @author crystal
 * @date 2024/3/25 10:11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PaymentSign {

    /**
     * 用户名
     */
    private String userName;

    /**
     * 身份证号
     */
    private String idCard;

    /**
     * 手机号码
     */
    private String mobile;

    /**
     * 结算银行名称
     */
    private String bankName;

    /**
     * 结算账号
     */
    private String settleNo;
    /**
     * {"cashAmt": 10000, "bankName": "中国工商银行", "settleNo": "62122632004197881",
     * "bankMobile": "13554638400", "settleCard": "420222199504044815", "settleName": "鲍志刚",
     * "bankCardAreaCode": "[\"1001\",\"1000\",\"1021\"]", "bankCardAreaName": "北京市-北京市-东城区"}
     * @param extra
     */
    public PaymentSign(JSONObject extra) {
        if(extra != null){
            AccountCashInfo accountCashInfo = extra.toJavaObject(AccountCashInfo.class);
            this.userName = accountCashInfo.getSettleName();
            this.idCard = accountCashInfo.getSettleCard();
            this.mobile = accountCashInfo.getBankMobile();
            this.bankName = accountCashInfo.getBankName();
            this.settleNo = accountCashInfo.getSettleNo();
        }
    }
}
