From 5eb61b4ee44c9eb2394793d436310edbe917db59 Mon Sep 17 00:00:00 2001
From: Hentua <wangdoubleone@gmail.com>
Date: Thu, 24 Aug 2023 00:23:42 +0800
Subject: [PATCH] fix

---
 src/main/java/cc/mrbird/febs/pay/service/impl/XcxPayServiceImpl.java |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/pay/service/impl/XcxPayServiceImpl.java b/src/main/java/cc/mrbird/febs/pay/service/impl/XcxPayServiceImpl.java
index 1ab4486..8813345 100644
--- a/src/main/java/cc/mrbird/febs/pay/service/impl/XcxPayServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/pay/service/impl/XcxPayServiceImpl.java
@@ -79,8 +79,12 @@
         String productNames = "小程序充值";
         MallMember mallMember = mallMemberMapper.selectById(apiRechargeWalletDto.getMemberId());
         String rechargeNo = apiRechargeWalletDto.getRechargeNo();
+        Long agentApplyId = apiRechargeWalletDto.getAgentApplyId() == null ? 0L : apiRechargeWalletDto.getAgentApplyId();
         Boolean debug = xcxProperties.getDebug();
-        String attrStr = "{'rechargeNo':"+rechargeNo+",'memberId':"+mallMember.getId()+",'type':"+apiRechargeWalletDto.getType()+"}";
+        String attrStr = "{'rechargeNo':"+rechargeNo
+                +",'memberId':"+mallMember.getId()
+                +",'agentApplyId':"+agentApplyId
+                +",'type':"+apiRechargeWalletDto.getType()+"}";
         if (debug) {
             payData = weixinServiceUtil.createRechargeWallet("[测试]" + productNames, rechargeNo,
                     1, mallMember.getOpenId(), attrStr);
@@ -388,9 +392,9 @@
      * @return
      */
     //图片上传路径
-    public  static  final String IMG_UPLOAD_PATH="/mnt/sdc/webresource/qianayi/wxcode";
+    public  static  final String IMG_UPLOAD_PATH="/mnt/sdc/webresource/blnka/wxcode";
     public  String generateAcode(String scene,String path,String imgName,String width, Integer type){
-        String urlPrefix="https://hwfile.csxuncong.com/qianayi/wxcode";
+        String urlPrefix="https://hwfile.csxuncong.com/blnka/wxcode";
         String imgPath=IMG_UPLOAD_PATH+imgName;
         if(!FileUtil.exist(imgPath)){
 
@@ -399,12 +403,12 @@
             String url = null;
             if (type == null) {
                 // 该接口无数量限制,但是 scene 传参最大字符长度为32个字符
-                url = StrFormatter.format("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token={}",redisUtils.get(WechatConfigure.WX_ACCESS_TOKEN_REDIS_KEY).toString());
+                url = StrUtil.format("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token={}",redisUtils.get(WechatConfigure.WX_ACCESS_TOKEN_REDIS_KEY).toString());
                 obj.set("scene", scene);
                 obj.set("page", path);
             } else {
                 // 该接口存在数量限制, 总共可生成10w个, 但参数是接在path后面
-                url = StrFormatter.format("https://api.weixin.qq.com/wxa/getwxacode?access_token={}", redisUtils.get(WechatConfigure.WX_ACCESS_TOKEN_REDIS_KEY).toString());
+                url = StrUtil.format("https://api.weixin.qq.com/wxa/getwxacode?access_token={}", redisUtils.get(WechatConfigure.WX_ACCESS_TOKEN_REDIS_KEY).toString());
                 obj.set("page", path + "?" + scene );
             }
 
@@ -420,6 +424,7 @@
             obj.set("is_hyaline", false);
             try {
                 HttpResponse execute = HttpRequest.post(url).body(obj.toString(), "application/json").execute();
+                log.error("微信返回值:{}", execute.body());
                 InputStream inputStream = execute.bodyStream();
                 File file = new File(imgPath);
                 FileUtil.writeFromStream(inputStream, file);

--
Gitblit v1.9.1