jiangqs
2023-08-06 cfeca361311321474e2ed147db874946c652fc92
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package com.ruoyi.shop.util;
 
import com.github.binarywang.wxpay.exception.WxPayException;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
 
/**
 * 微信支付
 */
@Component
@AllArgsConstructor
public class WechatPayUtils {
 
    /*private final WxPayService wxService;
 
    *//**
     * 电商二级商户进件(提交申请单)
     *//*
    public ApplymentsResult ecommerceApply(ShopAuthentication shopAuthentication, String applyNumber, Shop shop) throws WxPayException {
        EcommerceService ecommerceService = wxService.getEcommerceService();
        ApplymentsRequest request = new ApplymentsRequest();
        //生成提交类
        request.setOutRequestNo(applyNumber);
        if(shopAuthentication.getMainType()==2){
            request.setOrganizationType("2");
        }else{
            request.setOrganizationType("4");
        }
        //营业执照
        ApplymentsRequest.BusinessLicenseInfo business_license_info = new ApplymentsRequest.BusinessLicenseInfo();
        business_license_info.setBusinessLicenseCopy(shopAuthentication.getBlImage());
        business_license_info.setBusinessLicenseNumber(shopAuthentication.getBlNumber());
        business_license_info.setMerchantName(shopAuthentication.getBlShopName());
        business_license_info.setLegalPerson(shopAuthentication.getBlCorporateName());
        business_license_info.setCompanyAddress(shopAuthentication.getBlRegisteredAddress());
        business_license_info.setBusinessTime(shopAuthentication.getBlBusinessDeanline());
        request.setBusinessLicenseInfo(business_license_info);
        //法人证件
        request.setIdDocType("IDENTIFICATION_TYPE_MAINLAND_IDCARD");
        ApplymentsRequest.IdCardInfo id_card_info = new ApplymentsRequest.IdCardInfo();
        id_card_info.setIdCardCopy(shopAuthentication.getLpIcFront());
        id_card_info.setIdCardNational(shopAuthentication.getLpIcBack());
        id_card_info.setIdCardName(shopAuthentication.getLpCorporateName());
        id_card_info.setIdCardNumber(shopAuthentication.getLpIdCard());
        id_card_info.setIdCardValidTimeBegin(shopAuthentication.getLpIcStartDate());
        id_card_info.setIdCardValidTime(shopAuthentication.getLpIcEndDate());
        request.setIdCardInfo(id_card_info);
        //企业填写
        if(shopAuthentication.getMainType()==2){
            //受益人
            if(shopAuthentication.getOwner()==1){
                request.setOwner(true);
            }else{
                request.setOwner(false);
                List<ApplymentsRequest.UboInfo> ubo_info_list = new ArrayList<>();
                ApplymentsRequest.UboInfo uboInfo = new ApplymentsRequest.UboInfo();
                uboInfo.setUboIdDocType("IDENTIFICATION_TYPE_MAINLAND_IDCARD");
                uboInfo.setUboIdDocCopy(shopAuthentication.getUboIcFront());
                uboInfo.setUboIdDocCopyBack(shopAuthentication.getUboIcBack());
                uboInfo.setUboIdDocName(shopAuthentication.getUboName());
                uboInfo.setUboIdDocNumber(shopAuthentication.getUboIdCard());
                uboInfo.setUboIdDocAddress(shopAuthentication.getUboIcAddress());
                uboInfo.setUboIdDocPeriodBegin(shopAuthentication.getUboIcStartDate());
                uboInfo.setUboIdDocCopyBack(shopAuthentication.getUboIcEndDate());
                ubo_info_list.add(uboInfo);
                request.setUboInfoList(ubo_info_list);
            }
        }
        //结算账户信息
        ApplymentsRequest.AccountInfo accountInfo = new ApplymentsRequest.AccountInfo();
        if(shopAuthentication.getSettlementAccountType().equals("1")){
            accountInfo.setBankAccountType("74");
        }else{
            accountInfo.setBankAccountType("75");
        }
        accountInfo.setAccountBank(shopAuthentication.getSaBank());
        accountInfo.setAccountName(shopAuthentication.getSaAccountName());
        accountInfo.setBankAddressCode(shopAuthentication.getSaBankCityCode());
        accountInfo.setBankName(shopAuthentication.getSaBankName());
        accountInfo.setAccountNumber(shopAuthentication.getSaNumber());
        request.setAccountInfo(accountInfo);
        ApplymentsRequest.ContactInfo contactInfo = new ApplymentsRequest.ContactInfo();
        contactInfo.setContactType("65");
        contactInfo.setContactName(shopAuthentication.getLpCorporateName());
        contactInfo.setContactIdCardNumber(shopAuthentication.getLpIdCard());
        contactInfo.setMobilePhone(shopAuthentication.getLpMobilePhone());
        contactInfo.setContactEmail(shopAuthentication.getLpContactEmail());
        request.setContactInfo(contactInfo);
        //店铺信息
        ApplymentsRequest.SalesSceneInfo salesSceneInfo = new ApplymentsRequest.SalesSceneInfo();
        salesSceneInfo.setStoreName(shop.getShopName());
        salesSceneInfo.setStoreUrl("");
        salesSceneInfo.setStoreQrCode("");
        request.setSalesSceneInfo(salesSceneInfo);
        request.setMerchantShortname(shop.getShopName());
        request.setBusinessAdditionPics(shopAuthentication.getBaPics());
        request.setBusinessAdditionDesc(shopAuthentication.getBaDesc());
 
        return ecommerceService.createApply(request);
    }
 
 
    *//**
     * 通过查询申请状态API查询二级商户入驻申请结果
     * @param applymentId 微信支付申请单号
     * @return 申请状态
     * @throws WxPayException
     *//*
    public ApplymentsStatusResult queryApplyStatusByApplymentId(String applymentId) throws WxPayException {
        return wxService.getEcommerceService().queryApplyStatusByApplymentId(applymentId);
    }*/
 
}