Forráskód Böngészése

feat : 对接调试修改

bilingfeng 2 éve
szülő
commit
0839f96680

+ 4 - 16
game-module/game-sdk/src/main/java/com/zanxiang/sdk/domain/vo/PayParamVO.java

@@ -5,8 +5,6 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import java.math.BigDecimal;
-
 /**
  * @author : lingfeng
  * @time : 2023-01-05
@@ -19,24 +17,14 @@ import java.math.BigDecimal;
 public class PayParamVO {
 
     /**
-     * 订单id
-     */
-    private String orderId;
-
-    /**
-     * 货物总价
-     */
-    private BigDecimal amount;
-
-    /**
-     * 描述
+     * 应用appId
      */
-    private String describe;
+    private String appId;
 
     /**
-     * 应用appId
+     * 订单id
      */
-    private String appId;
+    private String orderId;
 
     /**
      * 下单支付参数

+ 5 - 8
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/GameAppletServiceImpl.java

@@ -3,6 +3,7 @@ package com.zanxiang.sdk.service.Impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.exception.BaseException;
+import com.zanxiang.common.utils.URIUtil;
 import com.zanxiang.module.util.JsonUtil;
 import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.mybatis.entity.GameApplet;
@@ -119,25 +120,21 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
         Map<String, Object> paramMap = new HashMap<>(4);
         paramMap.put("touser", user.getOpenId());
         paramMap.put("msgtype", "link");
-
+        //link参数
         Map<String, Object> linkMap = new HashMap<>(4);
         linkMap.put("title", "点我充值");
         linkMap.put("description", "点我充值" + order.getAmount() + "元,用于购买" + order.getAmount() + "元档充值");
-        //linkMap.put("url", "http://corp.complaint.zanxiangnet.com/html/wechatPay/index.html?orderId=" + order.getId() + "&appId=wx91208c6c8651a97d");
-
+        //构造url
         URI url = UriComponentsBuilder.fromHttpUrl("http://corp.complaint.zanxiangnet.com/html/wechatPay/index.html")
                 .queryParam("appId", "wx91208c6c8651a97d")
                 .queryParam("orderId", order.getOrderId())
                 .queryParam("amount", order.getAmount())
-                .queryParam("description", "购买" + order.getAmount() + "元档充值")
+                .queryParam("description", URIUtil.decodeURIComponent("购买" + order.getAmount() + "元档充值"))
                 .build().toUri();
-
+        //添加参数
         linkMap.put("url", url);
-
         linkMap.put("thumb_url", "https://book.zanxiangnet.com/qc-tip/1.jpg");
-
         paramMap.put("link", linkMap);
-
         log.error("客服消息发送参数, paramMap : {}", JsonUtil.toString(paramMap));
         // 发送请求
         String result = restTemplate.postForObject(uri, paramMap, String.class);

+ 0 - 4
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/OrderPayServiceImpl.java

@@ -58,8 +58,6 @@ public class OrderPayServiceImpl implements OrderPayService {
         if (orderPayParam != null) {
             return PayParamVO.builder()
                     .orderId(orderPayParam.getOrderId())
-                    .amount(orderPayParam.getAmount())
-                    .describe("购买" + orderPayParam.getAmount() + "元档充值")
                     .appId(orderPayParam.getAppId())
                     .payParam(orderPayParam.getPayParam())
                     .build();
@@ -87,8 +85,6 @@ public class OrderPayServiceImpl implements OrderPayService {
         }
         return PayParamVO.builder()
                 .orderId(orderPayParam.getOrderId())
-                .amount(orderPayParam.getAmount())
-                .describe("购买" + orderPayParam.getAmount() + "元档充值")
                 .appId(orderPayParam.getAppId())
                 .payParam(orderPayParam.getPayParam())
                 .build();