From db3c1f464e80458a1b6ccbe31b0355775df8e574 Mon Sep 17 00:00:00 2001 From: jiangqs <jiangqs> Date: 星期三, 23 八月 2023 20:45:34 +0800 Subject: [PATCH] bug --- ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/util/WechatPayUtils.java | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/util/WechatPayUtils.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/util/WechatPayUtils.java index dc63d0f..0ad0886 100644 --- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/util/WechatPayUtils.java +++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/util/WechatPayUtils.java @@ -1,9 +1,11 @@ package com.ruoyi.shop.util; +import com.alibaba.fastjson.JSONObject; import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsRequest; import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult; import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsStatusResult; import com.github.binarywang.wxpay.bean.media.ImageUploadResult; +import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingReceiver; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.EcommerceService; import com.github.binarywang.wxpay.service.MerchantMediaService; @@ -56,7 +58,13 @@ business_license_info.setMerchantName(shopAuthentication.getBlShopName()); business_license_info.setLegalPerson(shopAuthentication.getBlCorporateName()); business_license_info.setCompanyAddress(shopAuthentication.getBlRegisteredAddress()); - business_license_info.setBusinessTime("[\"2023-05-08\",\"长期\"]"); + List<String> businessTimeList = new ArrayList<>(); + businessTimeList.add(0,shopAuthentication.getBlBusinessStartTime()); + businessTimeList.add(1,shopAuthentication.getBlBusinessDeanline()); + if(businessTimeList!=null&&businessTimeList.size()>1){ + String businessTime = JSONObject.toJSONString(businessTimeList); + business_license_info.setBusinessTime(businessTime); + } request.setBusinessLicenseInfo(business_license_info); //法人证件 request.setIdDocType("IDENTIFICATION_TYPE_MAINLAND_IDCARD"); @@ -71,7 +79,9 @@ lpIcBackIO.close(); id_card_info.setIdCardName(shopAuthentication.getLpCorporateName()); id_card_info.setIdCardNumber(shopAuthentication.getLpIdCard()); - id_card_info.setIdCardAddress("四川省泸州市江阳区桃园路1号2号楼4单元1号"); + if(shopAuthentication.getMainType()==2){ + id_card_info.setIdCardAddress(shopAuthentication.getLpIdAddress()); + } id_card_info.setIdCardValidTimeBegin(shopAuthentication.getLpIcStartDate()); id_card_info.setIdCardValidTime(shopAuthentication.getLpIcEndDate()); request.setIdCardInfo(id_card_info); @@ -118,8 +128,8 @@ contactInfo.setContactType("65"); contactInfo.setContactName(shopAuthentication.getLpCorporateName()); contactInfo.setContactIdCardNumber(shopAuthentication.getLpIdCard()); - contactInfo.setMobilePhone("13882237106"); - contactInfo.setContactEmail("343695869@qq.com"); + contactInfo.setMobilePhone(shopAuthentication.getLpMobilePhone()); + contactInfo.setContactEmail(shopAuthentication.getLpContactEmail()); request.setContactInfo(contactInfo); //店铺信息 ApplymentsRequest.SalesSceneInfo salesSceneInfo = new ApplymentsRequest.SalesSceneInfo(); @@ -127,6 +137,7 @@ InputStream storeQrCodeIO = OBSUploadUtils.getOSSInputStream(shop.getShopCode().replace("https://hongruitang.oss-cn-beijing.aliyuncs.com/","")); ImageUploadResult storeQrCodeIR = merchantMediaService.imageUploadV3(storeQrCodeIO,applyNumber+"storeQrCode.jpg"); salesSceneInfo.setStoreQrCode(storeQrCodeIR.getMediaId()); + storeQrCodeIO.close(); request.setSalesSceneInfo(salesSceneInfo); request.setMerchantShortname(shop.getShopName()); request.setBusinessAdditionPics(shopAuthentication.getBaPics()); @@ -146,4 +157,11 @@ return wxService.getEcommerceService().queryApplyStatusByApplymentId(applymentId); } + public ProfitSharingReceiver addProfitSharingReceiver(ProfitSharingReceiver profitSharingReceiver) throws WxPayException { + profitSharingReceiver.setAppid("wxb7f0ea286fc4e535"); + profitSharingReceiver.setType("MERCHANT_ID"); + profitSharingReceiver.setRelationType("SERVICE_PROVIDER"); + ProfitSharingReceiver result = wxService.getProfitSharingV3Service().addProfitSharingReceiver(profitSharingReceiver); + return result; + } } -- Gitblit v1.7.1