From 7c0f65f4ce925b5a591816922d439335e8f0049a Mon Sep 17 00:00:00 2001 From: 13233904609 <13233904609@163.cm> Date: Tue, 3 Sep 2024 09:33:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/util/alipay/KeyContent.java | 6 +- .../BrokerageWithdrawController.java | 5 +- .../brokerage/AppBrokerageUserController.java | 6 + .../AppBrokerageUserChildSummaryRespVO.java | 6 + .../brokerage/BrokerageWithdrawService.java | 3 +- .../BrokerageWithdrawServiceImpl.java | 15 +- .../mapper/brokerage/BrokerageUserMapper.xml | 4 +- .../vo/DistributionConfigPageReqVO.java | 6 + .../vo/DistributionConfigRespVO.java | 6 + .../vo/DistributionConfigSaveReqVO.java | 5 + .../DistributionConfigDO.java | 4 + .../service/user/MemberUserServiceImpl.java | 146 +++++++++--------- .../resources/alipayCertPublicKey_RSA2.crt | 43 ++++++ .../src/main/resources/alipayRootCert.crt | 88 +++++++++++ .../appCertPublicKey_2021004170631369.crt | 24 +++ .../src/main/resources/application-dev.yaml | 2 +- .../src/main/resources/application-local.yaml | 2 +- .../src/main/resources/application.yaml | 2 +- 18 files changed, 284 insertions(+), 89 deletions(-) diff --git a/ruoyi-vue-pro-master/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/alipay/KeyContent.java b/ruoyi-vue-pro-master/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/alipay/KeyContent.java index 9949f3d..d120ae9 100644 --- a/ruoyi-vue-pro-master/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/alipay/KeyContent.java +++ b/ruoyi-vue-pro-master/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/alipay/KeyContent.java @@ -46,11 +46,11 @@ public class KeyContent { * @param fileName 文件的名称,用于定位静态文件位置 * @return 返回Base64编码的字符串,用于后续处理或传输 */ - public static String getKeyContentByFileName(String fileName) { + public static String getKeyContentByFileName(String fileName) throws IOException { + ClassPathResource classPathResource = new ClassPathResource(fileName); + InputStream inputStream = classPathResource.getInputStream(); String base64Encoded = ""; try { - ClassPathResource classPathResource = new ClassPathResource(fileName); - InputStream inputStream = classPathResource.getInputStream(); // 读取 文件的内容 byte[] p12Bytes = IOUtils.toByteArray(inputStream); diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/BrokerageWithdrawController.java b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/BrokerageWithdrawController.java index 609cfa4..01d41cc 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/BrokerageWithdrawController.java +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/BrokerageWithdrawController.java @@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.io.IOException; import java.util.Map; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -40,7 +41,7 @@ public class BrokerageWithdrawController { @PutMapping("/approve") @Operation(summary = "通过申请") @PreAuthorize("@ss.hasPermission('trade:brokerage-withdraw:audit')") - public CommonResult approveBrokerageWithdraw(@RequestParam("id") Integer id) { + public CommonResult approveBrokerageWithdraw(@RequestParam("id") Integer id) throws IOException { brokerageWithdrawService.auditBrokerageWithdraw(id, BrokerageWithdrawStatusEnum.AUDIT_SUCCESS, ""); return success(true); } @@ -48,7 +49,7 @@ public class BrokerageWithdrawController { @PutMapping("/reject") @Operation(summary = "驳回申请") @PreAuthorize("@ss.hasPermission('trade:brokerage-withdraw:audit')") - public CommonResult rejectBrokerageWithdraw(@Valid @RequestBody BrokerageWithdrawRejectReqVO reqVO) { + public CommonResult rejectBrokerageWithdraw(@Valid @RequestBody BrokerageWithdrawRejectReqVO reqVO) throws IOException { brokerageWithdrawService.auditBrokerageWithdraw(reqVO.getId(), BrokerageWithdrawStatusEnum.AUDIT_FAIL, reqVO.getAuditReason()); return success(true); } diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageUserController.java b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageUserController.java index ad75fca..899b7db 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageUserController.java +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageUserController.java @@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; +import cn.iocoder.yudao.module.member.api.level.MemberLevelApi; +import cn.iocoder.yudao.module.member.api.level.dto.MemberLevelRespDTO; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.pay.api.wallet.PayWalletApi; @@ -32,6 +34,7 @@ import javax.annotation.Resource; import javax.validation.Valid; import java.time.LocalDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; import java.util.Optional; @@ -60,6 +63,9 @@ public class AppBrokerageUserController { @Resource private PayWalletApi payWalletApi; +// @Resource +// private MemberLevelApi memberLevelApi; + @GetMapping("/get") @Operation(summary = "获得个人钱包信息") @PreAuthenticated diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/vo/user/AppBrokerageUserChildSummaryRespVO.java b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/vo/user/AppBrokerageUserChildSummaryRespVO.java index 6bc4184..1d094ef 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/vo/user/AppBrokerageUserChildSummaryRespVO.java +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/vo/user/AppBrokerageUserChildSummaryRespVO.java @@ -12,6 +12,12 @@ public class AppBrokerageUserChildSummaryRespVO { @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") private Long id; + @Schema(description = "会员等级id", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") + private Long levelId; + + @Schema(description = "会员等级名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") + private String levelName; + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小王") private String nickname; diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawService.java b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawService.java index 4fd3296..5daee47 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawService.java +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawService.java @@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageWithdrawD import cn.iocoder.yudao.module.trade.enums.brokerage.BrokerageWithdrawStatusEnum; import cn.iocoder.yudao.module.trade.service.brokerage.bo.BrokerageWithdrawSummaryRespBO; +import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.Map; @@ -28,7 +29,7 @@ public interface BrokerageWithdrawService { * @param status 审核状态 * @param auditReason 驳回原因 */ - void auditBrokerageWithdraw(Integer id, BrokerageWithdrawStatusEnum status, String auditReason); + void auditBrokerageWithdraw(Integer id, BrokerageWithdrawStatusEnum status, String auditReason) throws IOException; /** * 获得佣金提现 diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawServiceImpl.java b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawServiceImpl.java index 7531614..6a938f9 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawServiceImpl.java +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawServiceImpl.java @@ -30,7 +30,6 @@ import cn.iocoder.yudao.module.trade.service.brokerage.bo.BrokerageWithdrawSumma import cn.iocoder.yudao.module.trade.service.config.TradeConfigService; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; @@ -42,11 +41,9 @@ import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.time.LocalDateTime; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; - +import java.util.*; +import org.springframework.core.io.ResourceLoader; +import org.springframework.beans.factory.annotation.Value; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum.RECHARGE; import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.*; @@ -95,10 +92,12 @@ public class BrokerageWithdrawServiceImpl implements BrokerageWithdrawService { @Value("${alipay.alipayRootCertPath}") private String alipayRootCertPath; + @Resource + private ResourceLoader resourceLoader; @Override @Transactional(rollbackFor = Exception.class) - public void auditBrokerageWithdraw(Integer id, BrokerageWithdrawStatusEnum status, String auditReason) { + public void auditBrokerageWithdraw(Integer id, BrokerageWithdrawStatusEnum status, String auditReason) throws IOException { // 1.1 校验存在 BrokerageWithdrawDO withdraw = validateBrokerageWithdrawExists(id); // 1.2 校验状态为审核中 @@ -139,7 +138,7 @@ public class BrokerageWithdrawServiceImpl implements BrokerageWithdrawService { paramMap.put("account", "13233904609");//账号 paramMap.put("name", "马腾达"); paramMap.put("amount", "0.1"); - String result= HttpUtil.post(gateway, JSON.toJSONString(paramMap)); + String result= HttpUtil.post(gateway, paramMap); System.out.println(result); } // TODO 疯狂:调用转账接口 diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/resources/mapper/brokerage/BrokerageUserMapper.xml b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/resources/mapper/brokerage/BrokerageUserMapper.xml index aa2353f..6e8caed 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/resources/mapper/brokerage/BrokerageUserMapper.xml +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/resources/mapper/brokerage/BrokerageUserMapper.xml @@ -5,7 +5,7 @@