Commit 6623aee0 by 程裕兵

feat:apply

parent 3d3f2f26
package com.jiejing.fitness.finance.api.merchant.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author chengyubing
* @since 2024/2/22 13:57
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "地址")
public class AddressInfo {
@ApiModelProperty(value = "省", required = true)
@NotBlank(message = "省份不能为空")
private String province;
@ApiModelProperty(value = "市", required = true)
@NotBlank(message = "市不能为空")
private String city;
@ApiModelProperty(value = "区", required = true)
@NotBlank(message = "区不能为空")
private String district;
@ApiModelProperty(value = "详细地址", notes = "XX省XX市XX区XX街道")
private String address;
}
package com.jiejing.fitness.finance.api.merchant.model;
import com.jiejing.paycenter.common.enums.merchant.CardTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.CertTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.ExpireTypeEnums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author chengyubing
* @since 2024/2/20 15:10
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "银行卡信息")
public class BrandBankCardInfo {
@ApiModelProperty(value = "银行卡类型", required = true)
@NotNull(message = "银行卡类型不能为空")
private CardTypeEnums cardType;
@ApiModelProperty(value = "银行卡号", required = true)
@NotBlank(message = "银行卡号不能为空")
private String cardNo;
@ApiModelProperty(value = "银行卡账户名(对私卡:持卡人姓名;对公卡:开户许可证的名称)", required = true)
@NotBlank(message = "银行卡账户名不能为空")
private String cardName;
@ApiModelProperty(value = "持卡人手机号(对私卡必填)")
private String phone;
@ApiModelProperty(value = "证件号(对私卡:持卡人身份证;对公卡:营业执照号)", required = true)
@NotBlank(message = "证件号不能为空")
private String certNo;
@ApiModelProperty(value = "证件类型", required = true)
@NotNull(message = "证件类型不能为空")
private CertTypeEnums certType;
@ApiModelProperty(value = "基本存款账户编号或开户许可证核准号", notes = "对公卡必填")
private String baseDepositNo;
@ApiModelProperty(value = "证件有效期类型", notes = "对私卡必填")
private ExpireTypeEnums certExpireType;
@ApiModelProperty(value = "持卡人证件有效期开始日期", notes = "对私卡必填")
private Date certStartDate;
@ApiModelProperty(value = "持卡人证件有效期截止日期")
private Date certEndDate;
@ApiModelProperty(value = "银行编码")
private String bankCode;
@ApiModelProperty(value = "银行名称")
private String bankName;
@ApiModelProperty(value = "支行名称")
private String branchName;
@ApiModelProperty(value = "支行联行号")
private String branchCode;
@ApiModelProperty(value = "开卡地址:省市区详细地址")
private AddressInfo cardAddress;
}
package com.jiejing.fitness.finance.api.merchant.model;
import com.jiejing.paycenter.common.enums.merchant.CertTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.ExpireTypeEnums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author chengyubing
* @since 2024/2/22 14:02
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "品牌商户:法人信息")
public class BrandLegalInfo {
@ApiModelProperty(value = "法人证件类型", required = true)
@NotNull(message = "法人证件类型不能为空")
private CertTypeEnums legalCertType;
@ApiModelProperty(value = "法人姓名", required = true)
@NotBlank(message = "法人姓名不能为空")
@Size(max = 16)
private String legalName;
@ApiModelProperty(value = "法人证件号", required = true)
@NotBlank(message = "法人证件号不能为空")
private String legalCertNo;
@ApiModelProperty(value = "法人证件有效期类型", required = true)
@NotNull(message = "法人证件有效期类型不能为空")
private ExpireTypeEnums legalCertExpireType;
@ApiModelProperty(value = "法人证件有效期开始日期", required = true)
@NotNull(message = "法人证件有效期开始日期不能为空")
private Date legalCertStartDate;
@ApiModelProperty(value = "法人证件有效期截止日期")
private Date legalCertEndDate;
@ApiModelProperty(value = "法人手机号")
private String legalPhone;
@ApiModelProperty(value = "法人身份证地址")
private AddressInfo legalAddress;
@ApiModelProperty(value = "法人邮箱", required = true)
@NotBlank(message = "法人邮箱不能为空")
private String legalEmail;
}
package com.jiejing.fitness.finance.api.merchant.model;
import com.jiejing.paycenter.common.enums.merchant.ExpireTypeEnums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author chengyubing
* @since 2024/2/22 13:57
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "品牌商户:营业执照信息")
public class BrandLicenseInfo {
@ApiModelProperty(value = "营业执照编号", required = true)
@NotBlank(message = "营业执照编号不能为空")
private String licenseCode;
@ApiModelProperty(value = "营业执照有效期类型", required = true)
@NotNull(message = "营业执照有效期类型不能为空")
private ExpireTypeEnums licenseExpireType;
@ApiModelProperty(value = "营业执照有效期开始日期", required = true)
@NotNull(message = "营业执照有效期开始日期不能为空")
private Date licenseStartDate;
@ApiModelProperty(value = "营业执照有效期截止日期")
private Date licenseEndDate;
@ApiModelProperty(value = "经营范围", required = true)
@NotBlank(message = "经营范围不能为空")
private String businessScope;
@ApiModelProperty(value = "成立时间", required = true)
@NotNull(message = "成立时间不能为空")
private Date foundDate;
@ApiModelProperty(value = "注册资本", notes = "国营企业、私营企业、外资企业、事业单位、其他、集体经济必填;政府机构、个体工商户可为空")
private String registeredCapital;
@ApiModelProperty(value = "注册地址", required = true)
@NotNull(message = "注册地址不能为空")
private AddressInfo licenseAddress;
}
package com.jiejing.fitness.finance.api.merchant.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author chengyubing
* @since 2024/2/22 14:03
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "品牌商户:进件资料")
public class BrandResourceInfo {
@ApiModelProperty(value = "营业执照图片", required = true)
@NotNull(message = "营业执照图片不能为空")
private Long licensePicId;
@ApiModelProperty(value = "线下经营门头照", required = true)
@NotNull(message = "线下经营门头照不能为空")
private Long storeHeaderPicId;
@ApiModelProperty(value = "线下经营内景照", required = true)
@NotNull(message = "线下经营内景照不能为空")
private Long storeInnerPicId;
@ApiModelProperty(value = "线下经营收银台", required = true)
@NotNull(message = "线下经营收银台不能为空")
private Long storeCashierDescPicId;
@ApiModelProperty(value = "法人证件人像面(正面)", required = true)
@NotNull(message = "法人身份证人像面不能为空")
private Long legalCertFrontPicId;
@ApiModelProperty(value = "法人证件国徽面(反面)", required = true)
@NotNull(message = "法人身份证国徽面不能为空")
private Long legalCertBackPicId;
@ApiModelProperty(value = "银行卡正面")
private Long bankCardFrontPicId;
@ApiModelProperty(value = "银行卡反面")
private Long bankCardBackPicId;
@ApiModelProperty(value = "结算卡持卡人证件人像面(正面)")
private Long bankCardCertFrontPicId;
@ApiModelProperty(value = "结算卡持卡人证件国徽面(反面)")
private Long bankCardCertBackPicId;
}
package com.jiejing.fitness.finance.api.merchant.request; package com.jiejing.fitness.finance.api.merchant.request;
import com.jiejing.paycenter.common.enums.merchant.CardTypeEnums; import com.jiejing.fitness.finance.api.merchant.model.BrandBankCardInfo;
import com.jiejing.paycenter.common.enums.merchant.CertTypeEnums; import com.jiejing.fitness.finance.api.merchant.model.BrandLegalInfo;
import com.jiejing.fitness.finance.api.merchant.model.BrandLicenseInfo;
import com.jiejing.fitness.finance.api.merchant.model.BrandResourceInfo;
import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums; import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.ExpireTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums;
import com.jiejing.paycenter.common.model.ResourceInfo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.Map;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -36,177 +33,38 @@ public class ApplyBrandMerchantRequest { ...@@ -36,177 +33,38 @@ public class ApplyBrandMerchantRequest {
@NotNull(message = "场馆ID不能为空") @NotNull(message = "场馆ID不能为空")
private Long studioId; private Long studioId;
@ApiModelProperty(value = "企业类型", required = true)
@NotNull(message = "企业类型不能为空")
private CompanyTypeEnums companyType;
@ApiModelProperty(value = "商户名称", required = true) @ApiModelProperty(value = "商户名称", required = true)
@NotBlank(message = "商户名称不能为空") @NotBlank(message = "商户名称不能为空")
@Size(max = 32, message = "最多32个字")
private String merchantName; private String merchantName;
@ApiModelProperty(value = "商户简称", required = true) @ApiModelProperty(value = "商户简称", required = true)
@NotBlank(message = "商户简称不能为空") @NotBlank(message = "商户简称不能为空")
@Size(max = 32, message = "最多32个字")
private String shortName; private String shortName;
@ApiModelProperty(value = "企业类型", required = true) @ApiModelProperty(value = "营业执照", required = true)
@NotNull(message = "企业类型不能为空") @NotNull(message = "营业执照不能为空")
private CompanyTypeEnums companyType; @Valid
private BrandLicenseInfo license;
@ApiModelProperty(value = "经营地址:省", required = true)
@NotBlank(message = "经营地址不能为空")
private String businessProvince;
@ApiModelProperty(value = "经营地址:市", required = true)
@NotBlank(message = "经营地址不能为空")
private String businessCity;
@ApiModelProperty(value = "经营地址:区", required = true)
@NotBlank(message = "经营地址不能为空")
private String businessDistrict;
@ApiModelProperty(value = "经营详细地址", required = true)
@NotBlank(message = "经营地址不能为空")
private String businessAddress;
@ApiModelProperty(value = "营业执照编号", required = true)
@NotBlank(message = "营业执照编号不能为空")
private String licenseCode;
@ApiModelProperty(value = "营业执照有效期类型", required = true)
@NotNull(message = "营业执照有效期类型不能为空")
private ExpireTypeEnums licenseExpireType;
@ApiModelProperty(value = "营业执照有效期开始日期", required = true)
@NotNull(message = "营业执照有效期开始日期不能为空")
private Date licenseStartDate;
@ApiModelProperty(value = "营业执照有效期截止日期")
private Date licenseEndDate;
@ApiModelProperty(value = "营业护照规定的经营范围", required = true)
@NotBlank(message = "经营范围不能为空")
private String licenseBusinessScope;
@ApiModelProperty(value = "营业执照成立时间", required = true)
@NotNull(message = "成立时间不能为空")
private Date licenseFoundDate;
@ApiModelProperty(value = "商户注册地址:省", required = true)
@NotBlank(message = "注册省不能为空")
private String licenseProvince;
@ApiModelProperty(value = "商户注册地址:市", required = true)
@NotBlank(message = "注册市不能为空")
private String licenseCity;
@ApiModelProperty(value = "商户注册地址:区", required = true)
@NotBlank(message = "注册区不能为空")
private String licenseDistrict;
@ApiModelProperty(value = "营业执照注册详细地址", required = true)
@NotBlank(message = "注册地址不能为空")
private String licenseAddress;
@ApiModelProperty(value = "法人姓名", required = true)
@NotBlank(message = "法人姓名不能为空")
private String legalName;
@ApiModelProperty(value = "法人证件号码", required = true)
@NotBlank(message = "法人证件号码不能为空")
private String legalCertNo;
@ApiModelProperty(value = "法人证件类型", required = true)
@NotNull(message = "法人证件类型不能为空")
private CertTypeEnums legalCertType;
@ApiModelProperty(value = "法人证件有效期类型", required = true)
@NotNull(message = "法人证件有效期类型不能为空")
private ExpireTypeEnums legalCertExpireType;
@ApiModelProperty(value = "法人证件有效期开始日期", required = true)
@NotNull(message = "法人证件有效期开始日期不能为空")
private Date legalCertStartDate;
@ApiModelProperty(value = "法人证件有效期截止日期")
private Date legalCertEndDate;
@ApiModelProperty(value = "法人手机号")
private String legalPhone;
@ApiModelProperty(value = "法人证件地址:省")
private String legalProvince;
@ApiModelProperty(value = "法人证件地址:市")
private String legalCity;
@ApiModelProperty(value = "法人证件地址:区")
private String legalDistrict;
@ApiModelProperty(value = "法人证件详细地址")
private String legalAddress;
@ApiModelProperty(value = "联系人邮箱", required = true)
@NotBlank(message = "联系人邮箱不能为空")
private String contactEmail;
@ApiModelProperty(value = "结算卡类型", required = true)
@NotNull(message = "结算卡类型不能为空")
private CardTypeEnums bankCardType;
@ApiModelProperty(value = "结算卡卡号", required = true)
@NotBlank(message = "结算卡卡号不能为空")
private String bankCardNo;
@ApiModelProperty(value = "银行卡账户名(对私卡:持卡人姓名;对公卡:营业执照名称)", required = true)
@NotBlank(message = "结算卡账户名不能为空")
private String bankCardName;
@ApiModelProperty(value = "持卡人手机号", notes = "对私卡必填")
private String bankPhone;
@ApiModelProperty(value = "结算卡证件号码(对私卡:持卡人身份证;对公卡:营业执照号)", required = true)
@NotBlank(message = "结算卡证件号码不能为空")
private String bankCertNo;
@ApiModelProperty(value = "结算卡持卡人证件类型", required = true)
@NotNull(message = "证件类型不能为空")
private CertTypeEnums bankCertType;
@ApiModelProperty(value = "结算卡证件有效期类型", notes = "对私卡必填")
private ExpireTypeEnums bankCertExpireType;
@ApiModelProperty(value = "持卡人证件有效期开始日期", notes = "对私卡必填")
private Date bankCertStartDate;
@ApiModelProperty(value = "持卡人证件有效期截止日期")
private Date bankCertEndDate;
@ApiModelProperty(value = "基本存款账户编号|开户许可证核准号", notes = "对公卡必填")
private String bankBaseDepositNo;
@ApiModelProperty(value = "银行编码", notes = "对公卡必填")
private String bankCode;
@ApiModelProperty(value = "bankName", notes = "对公卡必填")
private String bankName;
@ApiModelProperty(value = "支行名称", notes = "对公卡必填")
private String bankBranchName;
@ApiModelProperty(value = "支行号", notes = "对公卡必填")
private String bankBranchCode;
@ApiModelProperty(value = "结算卡开卡地址:省")
private String bankCardProvince;
@ApiModelProperty(value = "结算卡开卡地址:市")
private String bankCardCity;
@ApiModelProperty(value = "结算卡开卡地址:区") @ApiModelProperty(value = "法人信息", required = true)
private String bankCardDistrict; @NotNull(message = "法人信息不能为空")
@Valid
private BrandLegalInfo legal;
@ApiModelProperty(value = "结算卡开卡详细地址") @ApiModelProperty(value = "结算卡信息", required = true)
private String bankCardAddress; @NotNull(message = "结算卡信息不能为空")
@Valid
private BrandBankCardInfo bankCard;
@ApiModelProperty(value = "资源信息", required = true) @ApiModelProperty(value = "进件所需资料", required = true)
@NotEmpty(message = "资源信息不能为空") @NotNull(message = "进件所需资料不能为空")
@Valid @Valid
private Map<ResourceTypeEnums, ResourceInfo> resourceInfo; private BrandResourceInfo resource;
} }
...@@ -17,10 +17,7 @@ package com.jiejing.fitness.finance.repository.entity; ...@@ -17,10 +17,7 @@ package com.jiejing.fitness.finance.repository.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.jiejing.fitness.finance.api.enums.ApplyTypeEnums; import com.jiejing.fitness.finance.api.enums.ApplyTypeEnums;
import com.jiejing.paycenter.common.enums.common.OpenStateEnums; import com.jiejing.paycenter.common.enums.common.OpenStateEnums;
import com.jiejing.paycenter.common.enums.merchant.CardTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.CertTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums; import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.ExpireTypeEnums;
import java.util.Date; import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable; import java.io.Serializable;
...@@ -173,229 +170,9 @@ public class BrandMerchantApply implements Serializable { ...@@ -173,229 +170,9 @@ public class BrandMerchantApply implements Serializable {
private String wxOnlineOpenFailMessage; private String wxOnlineOpenFailMessage;
/** /**
* 经营地址:省 * 商户详细信息
*/ */
private String businessProvince; private String merchantInfo;
/**
* 经营地址:市
*/
private String businessCity;
/**
* 经营地址:区
*/
private String businessDistrict;
/**
* 商户经营详细地址
*/
private String businessAddress;
/**
* 营业执照号
*/
private String licenseCode;
/**
* 营业执照有效期类型
*/
private ExpireTypeEnums licenseExpireType;
/**
* 营业执照有效期开始日期
*/
private Date licenseStartDate;
/**
* 营业执照有效期截止日期
*/
private Date licenseEndDate;
/**
* 营业护照规定的经营范围
*/
private String licenseBusinessScope;
/**
* 营业执照创办日期
*/
private Date licenseFoundDate;
/**
* 商户经营地址:省
*/
private String licenseProvince;
/**
* 商户经营地址:市
*/
private String licenseCity;
/**
* 商户经营地址:区
*/
private String licenseDistrict;
/**
* 营业执照注册详细地址
*/
private String licenseAddress;
/**
* 法人姓名
*/
private String legalName;
/**
* 法人证件号码
*/
private String legalCertNo;
/**
* 法人证件类型
*/
private CertTypeEnums legalCertType;
/**
* 法人证件有效期类型
*/
private ExpireTypeEnums legalCertExpireType;
/**
* 法人证件有效期开始日期
*/
private Date legalCertStartDate;
/**
* 法人证件有效期截止日期
*/
private Date legalCertEndDate;
/**
* 法人手机号
*/
private String legalPhone;
/**
* 法人证件地址:省
*/
private String legalProvince;
/**
* 法人证件地址:市
*/
private String legalCity;
/**
* 法人证件地址:区
*/
private String legalDistrict;
/**
* 法人证件详细地址
*/
private String legalAddress;
/**
* 联系人邮箱
*/
private String contactEmail;
/**
* 结算卡类型:对公卡、对私卡
*/
private CardTypeEnums bankCardType;
/**
* 结算卡卡号
*/
private String bankCardNo;
/**
* 银行卡账户名(对私卡:持卡人姓名;对公卡:营业执照名称)
*/
private String bankCardName;
/**
* 持卡人手机号(对私卡必填)
*/
private String bankPhone;
/**
* 结算卡证件号码(对私卡:持卡人身份证;对公卡:营业执照号)
*/
private String bankCertNo;
/**
* 结算卡持卡人证件类型
*/
private CertTypeEnums bankCertType;
/**
* 证件有效期类型,对私卡必填
*/
private ExpireTypeEnums bankCertExpireType;
/**
* 持卡人证件有效期开始日期,对私卡必填
*/
private Date bankCertStartDate;
/**
* 持卡人证件有效期截止日期
*/
private Date bankCertEndDate;
/**
* 基本存款账户编号
*/
private String bankBaseDepositNo;
/**
* 银行编码
*/
private String bankCode;
/**
* bankName
*/
private String bankName;
/**
* 支行名称
*/
private String bankBranchName;
/**
* 支行号
*/
private String bankBranchCode;
/**
* 结算卡开卡地址:省
*/
private String bankCardProvince;
/**
* 结算卡开卡地址:市
*/
private String bankCardCity;
/**
* 结算卡开卡地址:区
*/
private String bankCardDistrict;
/**
* 结算卡开卡详细地址
*/
private String bankCardAddress;
/**
* 资源信息
*/
private String resourceInfo;
/** /**
* 盐 * 盐
...@@ -468,95 +245,7 @@ public class BrandMerchantApply implements Serializable { ...@@ -468,95 +245,7 @@ public class BrandMerchantApply implements Serializable {
public static final String WX_ONLINE_OPEN_FAIL_MESSAGE = "wx_online_open_fail_message"; public static final String WX_ONLINE_OPEN_FAIL_MESSAGE = "wx_online_open_fail_message";
public static final String BUSINESS_PROVINCE = "business_province"; public static final String MERCHANT_INFO = "merchant_info";
public static final String BUSINESS_CITY = "business_city";
public static final String BUSINESS_DISTRICT = "business_district";
public static final String BUSINESS_ADDRESS = "business_address";
public static final String LICENSE_CODE = "license_code";
public static final String LICENSE_EXPIRE_TYPE = "license_expire_type";
public static final String LICENSE_START_DATE = "license_start_date";
public static final String LICENSE_END_DATE = "license_end_date";
public static final String LICENSE_BUSINESS_SCOPE = "license_business_scope";
public static final String LICENSE_FOUND_DATE = "license_found_date";
public static final String LICENSE_PROVINCE = "license_province";
public static final String LICENSE_CITY = "license_city";
public static final String LICENSE_DISTRICT = "license_district";
public static final String LICENSE_ADDRESS = "license_address";
public static final String LEGAL_NAME = "legal_name";
public static final String LEGAL_CERT_NO = "legal_cert_no";
public static final String LEGAL_CERT_TYPE = "legal_cert_type";
public static final String LEGAL_CERT_EXPIRE_TYPE = "legal_cert_expire_type";
public static final String LEGAL_CERT_START_DATE = "legal_cert_start_date";
public static final String LEGAL_CERT_END_DATE = "legal_cert_end_date";
public static final String LEGAL_PHONE = "legal_phone";
public static final String LEGAL_PROVINCE = "legal_province";
public static final String LEGAL_CITY = "legal_city";
public static final String LEGAL_DISTRICT = "legal_district";
public static final String LEGAL_ADDRESS = "legal_address";
public static final String CONTACT_EMAIL = "contact_email";
public static final String BANK_CARD_TYPE = "bank_card_type";
public static final String BANK_CARD_NO = "bank_card_no";
public static final String BANK_CARD_NAME = "bank_card_name";
public static final String BANK_PHONE = "bank_phone";
public static final String BANK_CERT_NO = "bank_cert_no";
public static final String BANK_CERT_TYPE = "bank_cert_type";
public static final String BANK_CERT_EXPIRE_TYPE = "bank_cert_expire_type";
public static final String BANK_CERT_START_DATE = "bank_cert_start_date";
public static final String BANK_CERT_END_DATE = "bank_cert_end_date";
public static final String BANK_BASE_DEPOSIT_NO = "bank_base_deposit_no";
public static final String BANK_CODE = "bank_code";
public static final String BANK_NAME = "bank_name";
public static final String BANK_BRANCH_NAME = "bank_branch_name";
public static final String BANK_BRANCH_CODE = "bank_branch_code";
public static final String BANK_CARD_PROVINCE = "bank_card_province";
public static final String BANK_CARD_CITY = "bank_card_city";
public static final String BANK_CARD_DISTRICT = "bank_card_district";
public static final String BANK_CARD_ADDRESS = "bank_card_address";
public static final String RESOURCE_INFO = "resource_info";
public static final String SALT = "salt"; public static final String SALT = "salt";
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, brand_id, studio_id, apply_no, apply_type, channel_no, merchant_id, merchant_no, merchant_name, short_name, company_type, open_state, open_fail_message, ali_open_state, ali_auth_state, ali_merchant_no, ali_open_fail_message, wx_offline_open_state, wx_offline_auth_state, wx_offline_merchant_no, wx_offline_open_fail_message, wx_online_open_state, wx_online_auth_state, wx_online_merchant_no, wx_online_open_fail_message, business_province, business_city, business_district, business_address, license_code, license_expire_type, license_start_date, license_end_date, license_business_scope, license_found_date, license_province, license_city, license_district, license_address, legal_name, legal_cert_no, legal_cert_type, legal_cert_expire_type, legal_cert_start_date, legal_cert_end_date, legal_phone, legal_province, legal_city, legal_district, legal_address, contact_email, bank_card_type, bank_card_no, bank_card_name, bank_phone, bank_cert_no, bank_cert_type, bank_cert_expire_type, bank_cert_start_date, bank_cert_end_date, bank_base_deposit_no, bank_code, bank_name, bank_branch_name, bank_branch_code, bank_card_province, bank_card_city, bank_card_district, bank_card_address, resource_info, salt, finish_time, create_time, update_time id, brand_id, studio_id, apply_no, apply_type, channel_no, merchant_id, merchant_no, merchant_name, short_name, company_type, open_state, open_fail_message, ali_open_state, ali_auth_state, ali_merchant_no, ali_open_fail_message, wx_offline_open_state, wx_offline_auth_state, wx_offline_merchant_no, wx_offline_open_fail_message, wx_online_open_state, wx_online_auth_state, wx_online_merchant_no, wx_online_open_fail_message, merchant_info, salt, finish_time, create_time, update_time
</sql> </sql>
<select id="getLatestOneSuccessByBrandId" <select id="getLatestOneSuccessByBrandId"
......
package com.jiejing.fitness.finance.service.merchant.convert; package com.jiejing.fitness.finance.service.merchant.convert;
import static com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums.*;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.jiejing.common.utils.convert.BeanUtil; import com.jiejing.common.utils.convert.BeanUtil;
import com.jiejing.common.utils.crypt.AesUtil; import com.jiejing.common.utils.crypt.AesUtil;
import com.jiejing.filecenter.api.resource.vo.ResourceInfoVO; import com.jiejing.filecenter.api.resource.vo.ResourceInfoVO;
import com.jiejing.fitness.finance.api.enums.ApplyTypeEnums; import com.jiejing.fitness.finance.api.enums.ApplyTypeEnums;
import com.jiejing.fitness.finance.api.enums.MerchantTypeEnums; import com.jiejing.fitness.finance.api.enums.MerchantTypeEnums;
import com.jiejing.fitness.finance.api.merchant.model.AddressInfo;
import com.jiejing.fitness.finance.api.merchant.model.BrandBankCardInfo;
import com.jiejing.fitness.finance.api.merchant.model.BrandLegalInfo;
import com.jiejing.fitness.finance.api.merchant.model.BrandLicenseInfo;
import com.jiejing.fitness.finance.api.merchant.model.BrandResourceInfo;
import com.jiejing.fitness.finance.repository.entity.BrandMerchant; import com.jiejing.fitness.finance.repository.entity.BrandMerchant;
import com.jiejing.fitness.finance.repository.entity.BrandMerchantApply; import com.jiejing.fitness.finance.repository.entity.BrandMerchantApply;
import com.jiejing.fitness.finance.service.merchant.params.ApplyBrandMerchantParams; import com.jiejing.fitness.finance.service.merchant.params.ApplyBrandMerchantParams;
...@@ -28,12 +36,14 @@ import com.jiejing.paycenter.common.model.BusinessInfo; ...@@ -28,12 +36,14 @@ import com.jiejing.paycenter.common.model.BusinessInfo;
import com.jiejing.paycenter.common.model.Contact; import com.jiejing.paycenter.common.model.Contact;
import com.jiejing.paycenter.common.model.Legal; import com.jiejing.paycenter.common.model.Legal;
import com.jiejing.paycenter.common.model.License; import com.jiejing.paycenter.common.model.License;
import com.jiejing.paycenter.common.model.ResourceInfo;
import com.jiejing.paycenter.common.model.SubChannelAuthInfo; import com.jiejing.paycenter.common.model.SubChannelAuthInfo;
import com.jiejing.paycenter.common.model.SubChannelInfo; import com.jiejing.paycenter.common.model.SubChannelInfo;
import com.jiejing.studio.api.studio.vo.StudioVO; import com.jiejing.studio.api.studio.vo.StudioVO;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
...@@ -59,7 +69,7 @@ public class MerchantConvert { ...@@ -59,7 +69,7 @@ public class MerchantConvert {
); );
public static ApplyMerchantRequest convertRequest(String channelNo, String applyNo, public static ApplyMerchantRequest convertRequest(String channelNo, String applyNo,
ApplyBrandMerchantParams params) { ApplyBrandMerchantParams params, Map<ResourceTypeEnums, ResourceInfo> resourceMap) {
return ApplyMerchantRequest.builder() return ApplyMerchantRequest.builder()
.bizCode(MerchantTypeEnums.BRAND.getCode()) .bizCode(MerchantTypeEnums.BRAND.getCode())
.applyNo(applyNo) .applyNo(applyNo)
...@@ -73,92 +83,96 @@ public class MerchantConvert { ...@@ -73,92 +83,96 @@ public class MerchantConvert {
.business(convertBusiness(params)) .business(convertBusiness(params))
.contact(convertContact(params)) .contact(convertContact(params))
.subChannels(DEFAULT_SUB_CHANNELS) .subChannels(DEFAULT_SUB_CHANNELS)
.resourceMap(params.getResourceInfo()) .resourceMap(resourceMap)
.build(); .build();
} }
private static Contact convertContact(ApplyBrandMerchantParams params) { private static Contact convertContact(ApplyBrandMerchantParams params) {
return Contact.builder() return Contact.builder()
.contactName(params.getLegalName()) .contactName(params.getLegal().getLegalName())
.contactPhone(params.getLegalPhone()) .contactPhone(params.getLegal().getLegalPhone())
.contactEmail(params.getContactEmail()) .contactEmail(params.getLegal().getLegalEmail())
.servicePhone(params.getLegalPhone()) .servicePhone(params.getLegal().getLegalPhone())
.build(); .build();
} }
private static BusinessInfo convertBusiness(ApplyBrandMerchantParams params) { private static BusinessInfo convertBusiness(ApplyBrandMerchantParams params) {
AddressInfo address = params.getLicense().getLicenseAddress();
return BusinessInfo.builder() return BusinessInfo.builder()
.mcc(MccEnums.MCC_7941) .mcc(MccEnums.MCC_7941)
.businessType(BusinessTypeEnums.REALITY) .businessType(BusinessTypeEnums.REALITY)
.sceneType(SceneTypeEnums.OFFLINE) .sceneType(SceneTypeEnums.OFFLINE)
.businessAddress(Address.builder() .businessAddress(Address.builder()
.province(params.getBusinessProvince()) .province(null == address ? null : address.getProvince())
.city(params.getBusinessCity()) .city(null == address ? null : address.getCity())
.district(params.getBusinessDistrict()) .district(null == address ? null : address.getDistrict())
.address(params.getBusinessAddress()) .address(null == address ? null : address.getAddress())
.build()) .build())
.build(); .build();
} }
private static License convertLicense(ApplyBrandMerchantParams params) { private static License convertLicense(ApplyBrandMerchantParams params) {
AddressInfo address = params.getLicense().getLicenseAddress();
return License.builder() return License.builder()
.licenseCode(params.getLicenseCode())
.licenseType(LicenseTypeEnums.NATIONAL_LEGAL_MERGE) .licenseType(LicenseTypeEnums.NATIONAL_LEGAL_MERGE)
.licenseExpireType(params.getLicenseExpireType())
.licenseStartDate(params.getLicenseStartDate())
.licenseEndDate(params.getLicenseEndDate())
.businessScope(params.getLicenseBusinessScope())
.foundDate(params.getLicenseFoundDate())
.registeredCapital("10000") .registeredCapital("10000")
.licenseCode(params.getLicense().getLicenseCode())
.licenseExpireType(params.getLicense().getLicenseExpireType())
.licenseStartDate(params.getLicense().getLicenseStartDate())
.licenseEndDate(params.getLicense().getLicenseEndDate())
.businessScope(params.getLicense().getBusinessScope())
.foundDate(params.getLicense().getFoundDate())
.licenseAddress(Address.builder() .licenseAddress(Address.builder()
.province(params.getLicenseProvince()) .province(null == address ? null : address.getProvince())
.city(params.getLicenseCity()) .city(null == address ? null : address.getCity())
.district(params.getLicenseDistrict()) .district(null == address ? null : address.getDistrict())
.address(params.getLicenseAddress()) .address(null == address ? null : address.getAddress())
.build()) .build())
.build(); .build();
} }
private static BankCard convertBankCard(ApplyBrandMerchantParams params) { private static BankCard convertBankCard(ApplyBrandMerchantParams params) {
AddressInfo address = params.getBankCard().getCardAddress();
return BankCard.builder() return BankCard.builder()
.cardType(params.getBankCardType()) .cardType(params.getBankCard().getCardType())
.cardNo(params.getBankCardNo()) .cardNo(params.getBankCard().getCardNo())
.cardName(params.getBankCardName()) .cardName(params.getBankCard().getCardName())
.phone(params.getBankPhone()) .phone(params.getBankCard().getPhone())
.certNo(params.getBankCertNo()) .certNo(params.getBankCard().getCertNo())
.certType(params.getBankCertType()) .certType(params.getBankCard().getCertType())
.baseDepositNo(params.getBankBaseDepositNo()) .baseDepositNo(params.getBankCard().getBaseDepositNo())
.certExpireType(params.getBankCertExpireType()) .certExpireType(params.getBankCard().getCertExpireType())
.certStartDate(params.getBankCertStartDate()) .certStartDate(params.getBankCard().getCertStartDate())
.certEndDate(params.getBankCertEndDate()) .certEndDate(params.getBankCard().getCertEndDate())
.bankCode(params.getBankCode()) .bankCode(params.getBankCard().getBankCode())
.bankName(params.getBankName()) .bankName(params.getBankCard().getBankName())
.branchName(params.getBankBranchName()) .branchName(params.getBankCard().getBranchName())
.branchCode(params.getBankBranchCode()) .branchCode(params.getBankCard().getBranchCode())
.cardAddress(Address.builder() .cardAddress(Address.builder()
.province(params.getBankCardProvince()) .province(null == address ? null : address.getProvince())
.city(params.getBankCardCity()) .city(null == address ? null : address.getCity())
.district(params.getBankCardDistrict()) .district(null == address ? null : address.getDistrict())
.address(params.getBankCardAddress()) .address(null == address ? null : address.getAddress())
.build()) .build())
.build(); .build();
} }
private static Legal convertLegal(ApplyBrandMerchantParams params) { private static Legal convertLegal(ApplyBrandMerchantParams params) {
AddressInfo address = params.getLegal().getLegalAddress();
return Legal.builder() return Legal.builder()
.legalName(params.getLegalName()) .legalName(params.getLegal().getLegalName())
.legalPhone(params.getLegalPhone()) .legalPhone(params.getLegal().getLegalPhone())
.legalCertNo(params.getLegalCertNo()) .legalCertNo(params.getLegal().getLegalCertNo())
.legalCertType(params.getLegalCertType()) .legalCertType(params.getLegal().getLegalCertType())
.legalCertExpireType(params.getLegalCertExpireType()) .legalCertExpireType(params.getLegal().getLegalCertExpireType())
.legalCertStartDate(params.getLegalCertStartDate()) .legalCertStartDate(params.getLegal().getLegalCertStartDate())
.legalCertEndDate(params.getLegalCertEndDate()) .legalCertEndDate(params.getLegal().getLegalCertEndDate())
.legalAddress(Address.builder() .legalAddress(Address.builder()
.province(params.getLegalProvince()) .province(null == address ? null : address.getProvince())
.city(params.getLegalCity()) .city(null == address ? null : address.getCity())
.district(params.getLegalDistrict()) .district(null == address ? null : address.getDistrict())
.address(params.getLegalAddress()) .address(null == address ? null : address.getAddress())
.build()) .build())
.build(); .build();
} }
...@@ -178,57 +192,22 @@ public class MerchantConvert { ...@@ -178,57 +192,22 @@ public class MerchantConvert {
.shortName(encrypt.getShortName()) .shortName(encrypt.getShortName())
.companyType(encrypt.getCompanyType()) .companyType(encrypt.getCompanyType())
.openState(OpenStateEnums.INIT) .openState(OpenStateEnums.INIT)
.businessProvince(encrypt.getBusinessProvince()) .merchantInfo(convertMerchantInfo(encrypt))
.businessCity(encrypt.getBusinessCity())
.businessDistrict(encrypt.getBusinessDistrict())
.businessAddress(encrypt.getBusinessAddress())
.licenseCode(encrypt.getLicenseCode())
.licenseExpireType(encrypt.getLicenseExpireType())
.licenseStartDate(encrypt.getLicenseStartDate())
.licenseEndDate(encrypt.getLicenseEndDate())
.licenseBusinessScope(encrypt.getLicenseBusinessScope())
.licenseFoundDate(encrypt.getLicenseFoundDate())
.licenseProvince(encrypt.getLicenseProvince())
.licenseCity(encrypt.getLicenseCity())
.licenseDistrict(encrypt.getLicenseDistrict())
.licenseAddress(encrypt.getLicenseAddress())
.legalName(encrypt.getLegalName())
.legalCertNo(encrypt.getLegalCertNo())
.legalCertType(encrypt.getLegalCertType())
.legalCertExpireType(encrypt.getLegalCertExpireType())
.legalCertStartDate(encrypt.getLegalCertStartDate())
.legalCertEndDate(encrypt.getLegalCertEndDate())
.legalPhone(encrypt.getLegalPhone())
.legalProvince(encrypt.getLegalProvince())
.legalCity(encrypt.getLegalCity())
.legalDistrict(encrypt.getLegalDistrict())
.legalAddress(encrypt.getLegalAddress())
.contactEmail(encrypt.getContactEmail())
.bankCardType(encrypt.getBankCardType())
.bankCardNo(encrypt.getBankCardNo())
.bankCardName(encrypt.getBankCardName())
.bankPhone(encrypt.getBankPhone())
.bankCertNo(encrypt.getBankCertNo())
.bankCertType(encrypt.getBankCertType())
.bankCertExpireType(encrypt.getBankCertExpireType())
.bankCertStartDate(encrypt.getBankCertStartDate())
.bankCertEndDate(encrypt.getBankCertEndDate())
.bankBaseDepositNo(encrypt.getBankBaseDepositNo())
.bankCode(encrypt.getBankCode())
.bankName(encrypt.getBankName())
.bankBranchName(encrypt.getBankBranchName())
.bankBranchCode(encrypt.getBankBranchCode())
.bankCardProvince(encrypt.getBankCardProvince())
.bankCardCity(encrypt.getBankCardCity())
.bankCardDistrict(encrypt.getBankCardDistrict())
.bankCardAddress(encrypt.getBankCardAddress())
.resourceInfo(JSON.toJSONString(encrypt.getResourceInfo()))
.salt(salt) .salt(salt)
.createTime(new Date()) .createTime(new Date())
.updateTime(new Date()) .updateTime(new Date())
.build(); .build();
} }
private static String convertMerchantInfo(ApplyBrandMerchantParams encrypt) {
return JSON.toJSONString(ApplyBrandMerchantParams.builder()
.legal(encrypt.getLegal())
.license(encrypt.getLicense())
.bankCard(encrypt.getBankCard())
.resource(encrypt.getResource())
.build());
}
public static UploadRequest convertUploadRequest(String channel, ResourceTypeEnums type, public static UploadRequest convertUploadRequest(String channel, ResourceTypeEnums type,
ResourceInfoVO vo) { ResourceInfoVO vo) {
return UploadRequest.builder() return UploadRequest.builder()
...@@ -271,56 +250,38 @@ public class MerchantConvert { ...@@ -271,56 +250,38 @@ public class MerchantConvert {
.wxOfflineMerchantNo(JSON.toJSONString(wxGzhOffline.getSubMerchantNos())) .wxOfflineMerchantNo(JSON.toJSONString(wxGzhOffline.getSubMerchantNos()))
.wxOfflineAuthState(convertWxOfflineAuthState(event.getSubChannelAuths())) .wxOfflineAuthState(convertWxOfflineAuthState(event.getSubChannelAuths()))
.wxOfflineOpenFailMessage(wxOfflineFailMessage) .wxOfflineOpenFailMessage(wxOfflineFailMessage)
.businessProvince(event.getBusiness().getBusinessAddress().getProvince()) .merchantInfo(convertMerchantInfo(apply, event))
.businessCity(event.getBusiness().getBusinessAddress().getCity())
.businessDistrict(event.getBusiness().getBusinessAddress().getDistrict())
.businessAddress(event.getBusiness().getBusinessAddress().getAddress())
.licenseCode(event.getLicense().getLicenseCode())
.licenseExpireType(event.getLicense().getLicenseExpireType())
.licenseStartDate(event.getLicense().getLicenseStartDate())
.licenseEndDate(event.getLicense().getLicenseEndDate())
.licenseBusinessScope(event.getLicense().getBusinessScope())
.licenseFoundDate(event.getLicense().getFoundDate())
.licenseProvince(event.getLicense().getLicenseAddress().getProvince())
.licenseCity(event.getLicense().getLicenseAddress().getCity())
.licenseDistrict(event.getLicense().getLicenseAddress().getDistrict())
.licenseAddress(event.getLicense().getLicenseAddress().getAddress())
.legalName(event.getLegal().getLegalName())
.legalCertNo(event.getLegal().getLegalCertNo())
.legalCertType(event.getLegal().getLegalCertType())
.legalCertExpireType(event.getLegal().getLegalCertExpireType())
.legalCertStartDate(event.getLegal().getLegalCertStartDate())
.legalCertEndDate(event.getLegal().getLegalCertEndDate())
.legalPhone(event.getLegal().getLegalPhone())
.legalProvince(event.getLegal().getLegalAddress().getProvince())
.legalCity(event.getLegal().getLegalAddress().getCity())
.legalDistrict(event.getLegal().getLegalAddress().getDistrict())
.legalAddress(event.getLegal().getLegalAddress().getAddress())
.contactEmail(event.getContact().getContactEmail())
.bankCardType(event.getBankCard().getCardType())
.bankCardNo(event.getBankCard().getCardNo())
.bankCardName(event.getBankCard().getCardName())
.bankPhone(event.getBankCard().getPhone())
.bankCertNo(event.getBankCard().getCertNo())
.bankCertType(event.getBankCard().getCertType())
.bankCertExpireType(event.getBankCard().getCertExpireType())
.bankCertStartDate(event.getBankCard().getCertStartDate())
.bankCertEndDate(event.getBankCard().getCertEndDate())
.bankBaseDepositNo(event.getBankCard().getBaseDepositNo())
.bankCode(event.getBankCard().getBankCode())
.bankName(event.getBankCard().getBankName())
.bankBranchName(event.getBankCard().getBranchName())
.bankBranchCode(event.getBankCard().getBranchCode())
.bankCardProvince(event.getBankCard().getCardAddress().getProvince())
.bankCardCity(event.getBankCard().getCardAddress().getCity())
.bankCardDistrict(event.getBankCard().getCardAddress().getDistrict())
.bankCardAddress(event.getBankCard().getCardAddress().getAddress())
.resourceInfo(JSON.toJSONString(event.getResourceMap()))
.finishTime(OpenStateEnums.SUCCESS == state ? new Date() : null) .finishTime(OpenStateEnums.SUCCESS == state ? new Date() : null)
.updateTime(new Date()) .updateTime(new Date())
.build(); .build();
} }
private static String convertMerchantInfo(BrandMerchantApply apply, MerchantEvent event) {
ApplyBrandMerchantParams original = JSON.parseObject(apply.getMerchantNo(),
ApplyBrandMerchantParams.class);
ApplyBrandMerchantParams info = ApplyBrandMerchantParams.builder()
.resource(original.getResource())
.bankCard(convertBankCard(event))
.legal(convertLegal(event))
.license(convertLicense(event))
.build();
return JSON.toJSONString(info);
}
private static BrandLicenseInfo convertLicense(MerchantEvent event) {
return JSON.parseObject(JSON.toJSONString(event.getLicense()), BrandLicenseInfo.class);
}
private static BrandLegalInfo convertLegal(MerchantEvent event) {
BrandLegalInfo legal = JSON.parseObject(JSON.toJSONString(event.getLegal()), BrandLegalInfo.class);
legal.setLegalEmail(event.getContact().getContactEmail());
return legal;
}
private static BrandBankCardInfo convertBankCard(MerchantEvent event) {
return JSON.parseObject(JSON.toJSONString(event.getBankCard()), BrandBankCardInfo.class);
}
private static OpenStateEnums convertWxOfflineAuthState(List<SubChannelAuthInfo> auths) { private static OpenStateEnums convertWxOfflineAuthState(List<SubChannelAuthInfo> auths) {
return auths.stream() return auths.stream()
.filter(e -> e.getAuthType() == SubChannelAuthTypeEnums.WX_OFFLINE) .filter(e -> e.getAuthType() == SubChannelAuthTypeEnums.WX_OFFLINE)
...@@ -416,4 +377,42 @@ public class MerchantConvert { ...@@ -416,4 +377,42 @@ public class MerchantConvert {
return merchant; return merchant;
} }
public static Map<ResourceTypeEnums, ResourceInfo> convertResourceMap(BrandResourceInfo resource) {
Map<ResourceTypeEnums, ResourceInfo> map = new HashMap<>(1);
if (null != resource.getLicensePicId()) {
map.put(LICENSE, convert(resource.getLicensePicId(), LICENSE));
}
if (null != resource.getStoreHeaderPicId()) {
map.put(STORE_HEADER_PIC, convert(resource.getStoreHeaderPicId(), STORE_HEADER_PIC));
}
if (null != resource.getStoreInnerPicId()) {
map.put(STORE_INNER_PIC, convert(resource.getStoreInnerPicId(), STORE_INNER_PIC));
}
if (null != resource.getStoreCashierDescPicId()) {
map.put(STORE_CASHIER_DESK_PIC, convert(resource.getStoreCashierDescPicId(), STORE_CASHIER_DESK_PIC));
}
if (null != resource.getLegalCertFrontPicId()) {
map.put(LEGAL_CERT_FRONT, convert(resource.getLegalCertFrontPicId(), LEGAL_CERT_FRONT));
}
if (null != resource.getLegalCertBackPicId()) {
map.put(LEGAL_CERT_BACK, convert(resource.getLegalCertBackPicId(), LEGAL_CERT_BACK));
}
if (null != resource.getBankCardFrontPicId()) {
map.put(BANK_CARD_FRONT, convert(resource.getBankCardFrontPicId(), BANK_CARD_FRONT));
}
if (null != resource.getBankCardBackPicId()) {
map.put(BANK_CARD_BACK, convert(resource.getBankCardBackPicId(), BANK_CARD_BACK));
}
if (null != resource.getBankCardCertFrontPicId()) {
map.put(BANK_CARD_CERT_FRONT, convert(resource.getBankCardCertFrontPicId(), BANK_CARD_CERT_FRONT));
}
if (null != resource.getBankCardCertBackPicId()) {
map.put(BANK_CARD_CERT_BACK, convert(resource.getBankCardCertBackPicId(), BANK_CARD_CERT_BACK));
}
return map;
}
private static ResourceInfo convert(Long id, ResourceTypeEnums type) {
return ResourceInfo.builder().resourceId(id).type(type).build();
}
} }
...@@ -14,7 +14,9 @@ import com.jiejing.fitness.finance.service.merchant.params.ApplyBrandMerchantPar ...@@ -14,7 +14,9 @@ import com.jiejing.fitness.finance.service.merchant.params.ApplyBrandMerchantPar
import com.jiejing.fitness.finance.service.rpc.MerchantRpcService; import com.jiejing.fitness.finance.service.rpc.MerchantRpcService;
import com.jiejing.fitness.finance.service.rpc.ResourceRpcService; import com.jiejing.fitness.finance.service.rpc.ResourceRpcService;
import com.jiejing.fitness.finance.service.rpc.StudioRpcService; import com.jiejing.fitness.finance.service.rpc.StudioRpcService;
import com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest;
import com.jiejing.paycenter.common.enums.common.OpenStateEnums; import com.jiejing.paycenter.common.enums.common.OpenStateEnums;
import com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums;
import com.jiejing.paycenter.common.event.MerchantEvent; import com.jiejing.paycenter.common.event.MerchantEvent;
import com.jiejing.paycenter.common.model.ResourceInfo; import com.jiejing.paycenter.common.model.ResourceInfo;
import com.jiejing.studio.api.studio.vo.StudioVO; import com.jiejing.studio.api.studio.vo.StudioVO;
...@@ -73,8 +75,10 @@ public class BrandMerchantServiceImpl implements BrandMerchantService { ...@@ -73,8 +75,10 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
try { try {
this.upload(params); Map<ResourceTypeEnums, ResourceInfo> resourceMap = this.upload(params);
merchantRpcService.apply(MerchantConvert.convertRequest(channel, apply.getApplyNo(), params)); ApplyMerchantRequest request = MerchantConvert.convertRequest(channel, apply.getApplyNo(), params,
resourceMap);
merchantRpcService.apply(request);
} catch (Exception e) { } catch (Exception e) {
log.error("apply brand merchant fail {}, brand id = {}, studio id = {}", id, studio.getBrandId(), log.error("apply brand merchant fail {}, brand id = {}, studio id = {}", id, studio.getBrandId(),
...@@ -122,22 +126,25 @@ public class BrandMerchantServiceImpl implements BrandMerchantService { ...@@ -122,22 +126,25 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
brandMerchantApplyRpService.updateById(applyToModify); brandMerchantApplyRpService.updateById(applyToModify);
} }
private void upload(ApplyBrandMerchantParams params) { private Map<ResourceTypeEnums, ResourceInfo> upload(ApplyBrandMerchantParams params) {
Map<ResourceTypeEnums, ResourceInfo> resourceMap = MerchantConvert.convertResourceMap(
params.getResource());
Map<Long, ResourceInfoVO> resourceIdUrlMap = resourceRpcService.getResourceMap(params.getStudioId(), Map<Long, ResourceInfoVO> resourceIdUrlMap = resourceRpcService.getResourceMap(params.getStudioId(),
getResourceIds(params)); getResourceIds(resourceMap));
params.getResourceInfo().keySet().forEach(type -> { resourceMap.keySet().forEach(type -> {
ResourceInfo info = params.getResourceInfo().get(type); ResourceInfo info = resourceMap.get(type);
ResourceInfoVO vo = resourceIdUrlMap.get(info.getResourceId()); ResourceInfoVO vo = resourceIdUrlMap.get(info.getResourceId());
String thirdId = merchantRpcService.upload(MerchantConvert.convertUploadRequest(channel, type, vo)); String thirdId = merchantRpcService.upload(MerchantConvert.convertUploadRequest(channel, type, vo));
info.setThirdId(thirdId); info.setThirdId(thirdId);
}); });
return resourceMap;
} }
private List<Long> getResourceIds(ApplyBrandMerchantParams params) { private List<Long> getResourceIds(Map<ResourceTypeEnums, ResourceInfo> resourceMap) {
return params.getResourceInfo().values().stream() return resourceMap.values().stream()
.map(ResourceInfo::getResourceId) .map(ResourceInfo::getResourceId)
.filter(Objects::nonNull) .filter(Objects::nonNull)
.distinct() .distinct()
......
package com.jiejing.fitness.finance.service.merchant.params; package com.jiejing.fitness.finance.service.merchant.params;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.jiejing.common.utils.convert.BeanUtil;
import com.jiejing.common.utils.crypt.AesUtil; import com.jiejing.common.utils.crypt.AesUtil;
import com.jiejing.paycenter.common.enums.merchant.CardTypeEnums; import com.jiejing.fitness.finance.api.merchant.model.BrandBankCardInfo;
import com.jiejing.paycenter.common.enums.merchant.CertTypeEnums; import com.jiejing.fitness.finance.api.merchant.model.BrandLegalInfo;
import com.jiejing.fitness.finance.api.merchant.model.BrandLicenseInfo;
import com.jiejing.fitness.finance.api.merchant.model.BrandResourceInfo;
import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums; import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.ExpireTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums;
import com.jiejing.paycenter.common.model.ResourceInfo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -40,195 +35,52 @@ public class ApplyBrandMerchantParams { ...@@ -40,195 +35,52 @@ public class ApplyBrandMerchantParams {
@NotNull(message = "场馆ID不能为空") @NotNull(message = "场馆ID不能为空")
private Long studioId; private Long studioId;
@ApiModelProperty(value = "企业类型", required = true)
@NotNull(message = "企业类型不能为空")
private CompanyTypeEnums companyType;
@ApiModelProperty(value = "商户名称", required = true) @ApiModelProperty(value = "商户名称", required = true)
@NotBlank(message = "商户名称不能为空") @NotBlank(message = "商户名称不能为空")
@Size(max = 32, message = "最多32个字")
private String merchantName; private String merchantName;
@ApiModelProperty(value = "商户简称", required = true) @ApiModelProperty(value = "商户简称", required = true)
@NotBlank(message = "商户简称不能为空") @NotBlank(message = "商户简称不能为空")
@Size(max = 32, message = "最多32个字")
private String shortName; private String shortName;
@ApiModelProperty(value = "企业类型", required = true) @ApiModelProperty(value = "营业执照", required = true)
@NotNull(message = "企业类型不能为空") @NotNull(message = "营业执照不能为空")
private CompanyTypeEnums companyType; @Valid
private BrandLicenseInfo license;
@ApiModelProperty(value = "经营地址:省", required = true)
@NotBlank(message = "经营地址不能为空")
private String businessProvince;
@ApiModelProperty(value = "经营地址:市", required = true)
@NotBlank(message = "经营地址不能为空")
private String businessCity;
@ApiModelProperty(value = "经营地址:区", required = true)
@NotBlank(message = "经营地址不能为空")
private String businessDistrict;
@ApiModelProperty(value = "经营详细地址", required = true)
@NotBlank(message = "经营地址不能为空")
private String businessAddress;
@ApiModelProperty(value = "营业执照编号", required = true)
@NotBlank(message = "营业执照编号不能为空")
private String licenseCode;
@ApiModelProperty(value = "营业执照有效期类型", required = true)
@NotNull(message = "营业执照有效期类型不能为空")
private ExpireTypeEnums licenseExpireType;
@ApiModelProperty(value = "营业执照有效期开始日期", required = true)
@NotNull(message = "营业执照有效期开始日期不能为空")
private Date licenseStartDate;
@ApiModelProperty(value = "营业执照有效期截止日期")
private Date licenseEndDate;
@ApiModelProperty(value = "营业护照规定的经营范围", required = true)
@NotBlank(message = "经营范围不能为空")
private String licenseBusinessScope;
@ApiModelProperty(value = "营业执照成立时间", required = true)
@NotNull(message = "成立时间不能为空")
private Date licenseFoundDate;
@ApiModelProperty(value = "商户注册地址:省", required = true)
@NotBlank(message = "注册省不能为空")
private String licenseProvince;
@ApiModelProperty(value = "商户注册地址:市", required = true)
@NotBlank(message = "注册市不能为空")
private String licenseCity;
@ApiModelProperty(value = "商户注册地址:区", required = true)
@NotBlank(message = "注册区不能为空")
private String licenseDistrict;
@ApiModelProperty(value = "营业执照注册详细地址", required = true)
@NotBlank(message = "注册地址不能为空")
private String licenseAddress;
@ApiModelProperty(value = "法人姓名", required = true)
@NotBlank(message = "法人姓名不能为空")
private String legalName;
@ApiModelProperty(value = "法人证件号码", required = true)
@NotBlank(message = "法人证件号码不能为空")
private String legalCertNo;
@ApiModelProperty(value = "法人证件类型", required = true)
@NotNull(message = "法人证件类型不能为空")
private CertTypeEnums legalCertType;
@ApiModelProperty(value = "法人证件有效期类型", required = true)
@NotNull(message = "法人证件有效期类型不能为空")
private ExpireTypeEnums legalCertExpireType;
@ApiModelProperty(value = "法人证件有效期开始日期", required = true)
@NotNull(message = "法人证件有效期开始日期不能为空")
private Date legalCertStartDate;
@ApiModelProperty(value = "法人证件有效期截止日期")
private Date legalCertEndDate;
@ApiModelProperty(value = "法人手机号")
private String legalPhone;
@ApiModelProperty(value = "法人证件地址:省")
private String legalProvince;
@ApiModelProperty(value = "法人证件地址:市")
private String legalCity;
@ApiModelProperty(value = "法人证件地址:区")
private String legalDistrict;
@ApiModelProperty(value = "法人证件详细地址")
private String legalAddress;
@ApiModelProperty(value = "联系人邮箱", required = true)
@NotBlank(message = "联系人邮箱不能为空")
private String contactEmail;
@ApiModelProperty(value = "结算卡类型", required = true)
@NotNull(message = "结算卡类型不能为空")
private CardTypeEnums bankCardType;
@ApiModelProperty(value = "结算卡卡号", required = true)
@NotBlank(message = "结算卡卡号不能为空")
private String bankCardNo;
@ApiModelProperty(value = "银行卡账户名(对私卡:持卡人姓名;对公卡:营业执照名称)", required = true)
@NotBlank(message = "结算卡账户名不能为空")
private String bankCardName;
@ApiModelProperty(value = "持卡人手机号", notes = "对私卡必填")
private String bankPhone;
@ApiModelProperty(value = "结算卡证件号码(对私卡:持卡人身份证;对公卡:营业执照号)", required = true)
@NotBlank(message = "结算卡证件号码不能为空")
private String bankCertNo;
@ApiModelProperty(value = "结算卡持卡人证件类型", required = true)
@NotNull(message = "证件类型不能为空")
private CertTypeEnums bankCertType;
@ApiModelProperty(value = "结算卡证件有效期类型", notes = "对私卡必填")
private ExpireTypeEnums bankCertExpireType;
@ApiModelProperty(value = "持卡人证件有效期开始日期", notes = "对私卡必填")
private Date bankCertStartDate;
@ApiModelProperty(value = "持卡人证件有效期截止日期")
private Date bankCertEndDate;
@ApiModelProperty(value = "基本存款账户编号|开户许可证核准号", notes = "对公卡必填")
private String bankBaseDepositNo;
@ApiModelProperty(value = "银行编码", notes = "对公卡必填")
private String bankCode;
@ApiModelProperty(value = "bankName", notes = "对公卡必填")
private String bankName;
@ApiModelProperty(value = "支行名称", notes = "对公卡必填")
private String bankBranchName;
@ApiModelProperty(value = "支行号", notes = "对公卡必填")
private String bankBranchCode;
@ApiModelProperty(value = "结算卡开卡地址:省")
private String bankCardProvince;
@ApiModelProperty(value = "结算卡开卡地址:市")
private String bankCardCity;
@ApiModelProperty(value = "结算卡开卡地址:区") @ApiModelProperty(value = "法人信息", required = true)
private String bankCardDistrict; @NotNull(message = "法人信息不能为空")
@Valid
private BrandLegalInfo legal;
@ApiModelProperty(value = "结算卡开卡详细地址") @ApiModelProperty(value = "结算卡信息", required = true)
private String bankCardAddress; @NotNull(message = "结算卡信息不能为空")
@Valid
private BrandBankCardInfo bankCard;
@ApiModelProperty(value = "资源信息", required = true) @ApiModelProperty(value = "进件所需资料", required = true)
@NotEmpty(message = "资源信息不能为空") @NotNull(message = "进件所需资料不能为空")
@Valid @Valid
private Map<ResourceTypeEnums, ResourceInfo> resourceInfo; private BrandResourceInfo resource;
public ApplyBrandMerchantParams encrypt(String salt) { public ApplyBrandMerchantParams encrypt(String salt) {
ApplyBrandMerchantParams copy = JSON.parseObject(JSON.toJSONString(this), ApplyBrandMerchantParams.class); ApplyBrandMerchantParams copy = JSON.parseObject(JSON.toJSONString(this), ApplyBrandMerchantParams.class);
if (null != copy.getBankCardNo()) { if (null != copy.getBankCard()) {
copy.setBankCardNo(AesUtil.encrypt(salt, copy.getBankCardNo())); copy.getBankCard().setCardNo(AesUtil.encrypt(salt, copy.getBankCard().getCardNo()));
} copy.getBankCard().setCertNo(AesUtil.encrypt(salt, copy.getBankCard().getCertNo()));
if (null != copy.getBankCertNo()) { copy.getBankCard().setBaseDepositNo(AesUtil.encrypt(salt, copy.getBankCard().getBaseDepositNo()));
copy.setBankCertNo(AesUtil.encrypt(salt, copy.getBankCertNo()));
}
if (null != copy.getBankBaseDepositNo()) {
copy.setBankBaseDepositNo(AesUtil.encrypt(salt, copy.getBankBaseDepositNo()));
} }
if (null != copy.getLegalCertNo()) { if (null != copy.getLegal()) {
copy.setLegalCertNo(AesUtil.encrypt(salt, copy.getLegalCertNo())); copy.getLegal().setLegalCertNo(AesUtil.encrypt(salt, copy.getLegal().getLegalCertNo()));
} }
if (null != copy.getLicenseCode()) { if (null != copy.getLicense()) {
copy.setLicenseCode(AesUtil.encrypt(salt, copy.getLicenseCode())); copy.getLicense().setLicenseCode(AesUtil.encrypt(salt, copy.getLicense().getLicenseCode()));
} }
return copy; return copy;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment