package com.slodon.b2b2c.vo.seller;

import com.slodon.b2b2c.core.util.FileUrlUtil;
import com.slodon.b2b2c.seller.pojo.StoreOpenAccount;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

/**
 * 商户中金开户vo
 */
@Data
@NoArgsConstructor
public class StoreOpenAccountVO implements Serializable {
    private static final long serialVersionUID = 7474135223597947517L;

    public StoreOpenAccountVO(StoreOpenAccount storeOpenAccount) {
        BeanUtils.copyProperties(storeOpenAccount,this);
        this.pUserName = storeOpenAccount.getPUserName();
        this.pPhoneNumber = storeOpenAccount.getPPhoneNumber();
        this.pCredentialNumber = storeOpenAccount.getPCredentialNumber();
        this.pIssDate = storeOpenAccount.getPIssDate();
        this.pExpiryDate = storeOpenAccount.getPExpiryDate();
        this.pIndAddress = storeOpenAccount.getPIndAddress();
        this.pIndEmail = storeOpenAccount.getPIndEmail();
        this.pIndCardUp = storeOpenAccount.getPIndCardUp();
        this.pIndCardDown = storeOpenAccount.getPIndCardDown();
        this.eCorporationName = storeOpenAccount.getECorporationName();
        this.eCategoryType = storeOpenAccount.getECategoryType();
        this.eCategoryTypeName = storeOpenAccount.getECategoryTypeName();
        this.eUnifiedSocialCreditCode = storeOpenAccount.getEUnifiedSocialCreditCode();
        this.eCorEmail = storeOpenAccount.getECorEmail();
        this.eCorAddress = storeOpenAccount.getECorAddress();
        this.eProvince = storeOpenAccount.getEProvince();
        this.eProvinceName = storeOpenAccount.getEProvinceName();
        this.eCity = storeOpenAccount.getECity();
        this.eCityName = storeOpenAccount.getECityName();
        this.eDistrict = storeOpenAccount.getEDistrict();
        this.eDistrictName = storeOpenAccount.getEDistrictName();
        this.eScale = storeOpenAccount.getEScale();
        this.eScaleName = storeOpenAccount.getEScaleName();
        this.eBasicAcctNo = storeOpenAccount.getEBasicAcctNo();
        this.eApprovalNo = storeOpenAccount.getEApprovalNo();
        this.eAllLicenceIssDate = storeOpenAccount.getEAllLicenceIssDate();
        this.eAllLicenceExpiryDate = storeOpenAccount.getEAllLicenceExpiryDate();
        this.eLegalPersonName = storeOpenAccount.getELegalPersonName();
        this.eLegalCredentialNumber = storeOpenAccount.getELegalCredentialNumber();
        this.eLegalPersonIssDate = storeOpenAccount.getELegalPersonIssDate();
        this.eLegalPersonExpiryDate = storeOpenAccount.getELegalPersonExpiryDate();
        this.eLegalPersonContactNumber = storeOpenAccount.getELegalPersonContactNumber();
        this.eBusinessLicenseImage = storeOpenAccount.getEBusinessLicenseImage();
        this.eOpenAccountCertificate = storeOpenAccount.getEOpenAccountCertificate();
        this.eLegalCardUp = storeOpenAccount.getELegalCardUp();
        this.eLegalCardDown = storeOpenAccount.getELegalCardDown();
    }

    public String getUserTypeValue() {
        if (this.userType == null) return "未知";
        return this.userType.equals("11") ? "个人" : "企业";
    }

    @ApiModelProperty("进度id")
    private Integer openAccountId;

    @ApiModelProperty("店铺id")
    private Long storeId;

    @ApiModelProperty("开户类型，11-个人，12-企业")
    private String userType;

    @ApiModelProperty("开户类型，11-个人，12-企业")
    private String userTypeValue;

    @ApiModelProperty("开户状态，10-绑卡成功待开户，20开户成功，21-开户失败，22-开户处理中，30-签约成功，31-签约处理中")
    private Integer state;

    @ApiModelProperty("失败原因")
    private String failReason;

    @ApiModelProperty("绑卡-账户名称")
    private String bankAccountName;

    @ApiModelProperty("绑卡-账户号码")
    private String bankAccountNumber;

    @ApiModelProperty("绑卡-银行id，对应中金附录")
    private String bankId;

    @ApiModelProperty("绑卡-银行名称，对应中金附录")
    private String bankName;

    @ApiModelProperty("绑卡-个人-身份证号")
    private String credentialNumber;

    @ApiModelProperty("绑卡-个人-银行预留手机号")
    private String bankPhoneNumber;

    @ApiModelProperty("绑卡-企业-分支行名称")
    private String branchName;

    @ApiModelProperty("绑卡-企业-银行省份编码，对应中金附录")
    private String province;

    @ApiModelProperty("provinceName")
    private String provinceName;

    @ApiModelProperty("绑卡-企业-银行城市编码，对应中金附录")
    private String city;

    @ApiModelProperty("cityName")
    private String cityName;

    @ApiModelProperty("开户-个人-用户姓名")
    private String pUserName;

    @ApiModelProperty("开户-个人-用户手机号码")
    private String pPhoneNumber;

    @ApiModelProperty("开户-个人-证件号码")
    private String pCredentialNumber;

    @ApiModelProperty("开户-个人-身份证件有效期（起始）,yyyyMMdd")
    private String pIssDate;

    @ApiModelProperty("开户-个人-身份证件有效期（到期）,当证件长期有效时为99991231")
    private String pExpiryDate;

    @ApiModelProperty("开户-个人-联系地址")
    private String pIndAddress;

    @ApiModelProperty("开户-个人-个人邮箱")
    private String pIndEmail;

    @ApiModelProperty("开户-个人-身份证正面扫描件")
    private String pIndCardUp;

    @ApiModelProperty("开户-个人-身份证背面扫描件")
    private String pIndCardDown;

    @ApiModelProperty("开户-个人-身份证正面扫描件")
    private String pIndCardUpUrl;

    @ApiModelProperty("开户-个人-身份证背面扫描件")
    private String pIndCardDownUrl;

    @ApiModelProperty("开户-企业-企业名称,工商登记企业名称")
    private String eCorporationName;

    @ApiModelProperty("开户-企业-分类类别,营业执照企业类型为“合伙企业”时必填。详见附录")
    private String eCategoryType;

    @ApiModelProperty("开户-企业-分类类别名称,营业执照企业类型为“合伙企业”时必填。详见附录")
    private String eCategoryTypeName;

    @ApiModelProperty("开户-企业-统一社会信用代码")
    private String eUnifiedSocialCreditCode;

    @ApiModelProperty("开户-企业-企业邮箱")
    private String eCorEmail;

    @ApiModelProperty("开户-企业-企业地址")
    private String eCorAddress;

    @ApiModelProperty("开户-企业-省份,详见附录")
    private String eProvince;

    @ApiModelProperty("开户-企业-省份名称,详见附录")
    private String eProvinceName;

    @ApiModelProperty("开户-企业-城市,详见附录")
    private String eCity;

    @ApiModelProperty("开户-企业-城市名称,详见附录")
    private String eCityName;

    @ApiModelProperty("开户-企业-区/县,详见附录")
    private String eDistrict;

    @ApiModelProperty("开户-企业-区/县名称,详见附录")
    private String eDistrictName;

    @ApiModelProperty("开户-企业-企业规模：01=大型;02=中型;03=小型;04=微型;98=其他")
    private String eScale;

    @ApiModelProperty("开户-企业-企业规模名称：01=大型;02=中型;03=小型;04=微型;98=其他")
    private String eScaleName;

    @ApiModelProperty("开户-企业-企业银行账户")
    private String eBasicAcctNo;

    @ApiModelProperty("开户-企业-基础存款账户编号")
    private String eApprovalNo;

    @ApiModelProperty("开户-企业-营业执照有效期（起始）,yyyyMMdd格式")
    private String eAllLicenceIssDate;

    @ApiModelProperty("开户-企业-营业执照有效期（到期），格式：yyyyMMdd；证件长期有效时为 99991231")
    private String eAllLicenceExpiryDate;

    @ApiModelProperty("开户-企业-法人姓名")
    private String eLegalPersonName;

    @ApiModelProperty("开户-企业-法人证件号码")
    private String eLegalCredentialNumber;

    @ApiModelProperty("开户-企业-法人身份证件有效期（起始）,格式：yyyyMMdd")
    private String eLegalPersonIssDate;

    @ApiModelProperty("开户-企业-法人身份证件有效期（到期）,当证件长期有效时为99991231")
    private String eLegalPersonExpiryDate;

    @ApiModelProperty("开户-企业-法人联系电话")
    private String eLegalPersonContactNumber;

    @ApiModelProperty("开户-企业-营业执照扫描件")
    private String eBusinessLicenseImage;

    @ApiModelProperty("开户-企业-基本开户证明")
    private String eOpenAccountCertificate;

    @ApiModelProperty("开户-企业-法人身份证正面扫描件")
    private String eLegalCardUp;

    @ApiModelProperty("开户-企业-法人身份证背面扫描件")
    private String eLegalCardDown;

    @ApiModelProperty("开户-企业-营业执照扫描件")
    private String eBusinessLicenseImageUrl;

    @ApiModelProperty("开户-企业-基本开户证明")
    private String eOpenAccountCertificateUrl;

    @ApiModelProperty("开户-企业-法人身份证正面扫描件")
    private String eLegalCardUpUrl;

    @ApiModelProperty("开户-企业-法人身份证背面扫描件")
    private String eLegalCardDownUrl;

    public String getpUserName() {
        return pUserName;
    }

    public String getpPhoneNumber() {
        return pPhoneNumber;
    }

    public String getpCredentialNumber() {
        return pCredentialNumber;
    }

    public String getpIssDate() {
        return pIssDate;
    }

    public String getpExpiryDate() {
        return pExpiryDate;
    }

    public String getpIndAddress() {
        return pIndAddress;
    }

    public String getpIndEmail() {
        return pIndEmail;
    }

    public String getpIndCardUp() {
        return pIndCardUp;
    }

    public String getpIndCardDown() {
        return pIndCardDown;
    }

    public String geteCorporationName() {
        return eCorporationName;
    }

    public String geteCategoryType() {
        return eCategoryType;
    }

    public String geteUnifiedSocialCreditCode() {
        return eUnifiedSocialCreditCode;
    }

    public String geteCorEmail() {
        return eCorEmail;
    }

    public String geteCorAddress() {
        return eCorAddress;
    }

    public String geteProvince() {
        return eProvince;
    }

    public String geteCity() {
        return eCity;
    }

    public String geteDistrict() {
        return eDistrict;
    }

    public String geteScale() {
        return eScale;
    }

    public String geteBasicAcctNo() {
        return eBasicAcctNo;
    }

    public String geteApprovalNo() {
        return eApprovalNo;
    }

    public String geteAllLicenceIssDate() {
        return eAllLicenceIssDate;
    }

    public String geteAllLicenceExpiryDate() {
        return eAllLicenceExpiryDate;
    }

    public String geteLegalPersonName() {
        return eLegalPersonName;
    }

    public String geteLegalCredentialNumber() {
        return eLegalCredentialNumber;
    }

    public String geteLegalPersonIssDate() {
        return eLegalPersonIssDate;
    }

    public String geteLegalPersonExpiryDate() {
        return eLegalPersonExpiryDate;
    }

    public String geteLegalPersonContactNumber() {
        return eLegalPersonContactNumber;
    }

    public String geteBusinessLicenseImage() {
        return eBusinessLicenseImage;
    }

    public String geteOpenAccountCertificate() {
        return eOpenAccountCertificate;
    }

    public String geteLegalCardUp() {
        return eLegalCardUp;
    }

    public String geteLegalCardDown() {
        return eLegalCardDown;
    }

    public String getpIndCardUpUrl() {
        return FileUrlUtil.getFileUrl(pIndCardUp,null);
    }

    public String getpIndCardDownUrl() {
        return FileUrlUtil.getFileUrl(pIndCardDown,null);
    }

    public String geteBusinessLicenseImageUrl() {
        return FileUrlUtil.getFileUrl(eBusinessLicenseImage,null);
    }

    public String geteOpenAccountCertificateUrl() {
        return FileUrlUtil.getFileUrl(eOpenAccountCertificate,null);
    }

    public String geteLegalCardUpUrl() {
        return FileUrlUtil.getFileUrl(eLegalCardUp,null);
    }

    public String geteLegalCardDownUrl() {
        return FileUrlUtil.getFileUrl(eLegalCardDown,null);
    }

    public String geteCategoryTypeName() {
        return eCategoryTypeName;
    }

    public String geteProvinceName() {
        return eProvinceName;
    }

    public String geteCityName() {
        return eCityName;
    }

    public String geteDistrictName() {
        return eDistrictName;
    }

    public String geteScaleName() {
        return eScaleName;
    }
}