浏览代码

fix : 全面兼容腾讯APP直投的归因, 回传

bilingfeng 10 小时之前
父节点
当前提交
ce1dac4281

+ 5 - 0
game-back/game-back-base/src/main/java/com/zanxiang/game/back/base/pojo/dto/TencentOrderAppRpcDTO.java

@@ -90,4 +90,9 @@ public class TencentOrderAppRpcDTO implements Serializable {
      * IOS设备CAID
      */
     private String caid;
+
+    /**
+     * 数据源ID
+     */
+    private Long userActionSetId;
 }

+ 5 - 0
game-back/game-back-base/src/main/java/com/zanxiang/game/back/base/pojo/dto/TencentRoleRegisterAppRpcDTO.java

@@ -78,4 +78,9 @@ public class TencentRoleRegisterAppRpcDTO implements Serializable {
      * IOS设备CAID
      */
     private String caid;
+
+    /**
+     * 数据源ID
+     */
+    private Long userActionSetId;
 }

+ 5 - 0
game-back/game-back-base/src/main/java/com/zanxiang/game/back/base/pojo/dto/TencentUserAppRpcDTO.java

@@ -79,4 +79,9 @@ public class TencentUserAppRpcDTO implements Serializable {
      * 注册ip
      */
     private String regIp;
+
+    /**
+     * 数据源ID
+     */
+    private Long userActionSetId;
 }

+ 1 - 1
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/GameBackApplication.java

@@ -18,7 +18,7 @@ public class GameBackApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(GameBackApplication.class, args);
-        System.out.println("新增腾讯APP回传业务逻辑-增加查询接口 (´・・)ノ(._.`)  \n" +
+        System.out.println("新增腾讯APP回传业务逻辑-补充参数, 数据源id (´・・)ノ(._.`)  \n" +
                 " ______  __     __     \n" +
                 "/_____/\\/__/\\ /__/\\    \n" +
                 "\\:::__\\/\\ \\::\\\\:.\\ \\   \n" +

+ 7 - 1
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/rpc/impl/TencentAppBackRpcImpl.java

@@ -9,7 +9,10 @@ import com.zanxiang.game.back.base.pojo.dto.TencentUserAppRpcDTO;
 import com.zanxiang.game.back.base.pojo.enums.OrderStatusEnum;
 import com.zanxiang.game.back.base.pojo.vo.OrderBackQueryRpcVO;
 import com.zanxiang.game.back.base.rpc.ITencentAppBackRpc;
-import com.zanxiang.game.back.serve.pojo.entity.*;
+import com.zanxiang.game.back.serve.pojo.entity.GameTencentAppOrder;
+import com.zanxiang.game.back.serve.pojo.entity.GameTencentAppOrderSplitLog;
+import com.zanxiang.game.back.serve.pojo.entity.GameTencentAppRoleRegister;
+import com.zanxiang.game.back.serve.pojo.entity.GameTencentAppUser;
 import com.zanxiang.game.back.serve.pojo.enums.BackStatusEnum;
 import com.zanxiang.game.back.serve.service.IGameTencentAppOrderService;
 import com.zanxiang.game.back.serve.service.IGameTencentAppOrderSplitLogService;
@@ -93,6 +96,7 @@ public class TencentAppBackRpcImpl implements ITencentAppBackRpc {
                 .ip(dto.getRegIp())
                 .backStatus(BackStatusEnum.NO.getBackStatus())
                 .createTime(LocalDateTime.now())
+                .userActionSetId(dto.getUserActionSetId())
                 .build();
         gameTencentAppUserService.save(userLog);
         return ResultVO.ok(gameTencentAppUserService.userBack(userLog, Boolean.FALSE));
@@ -165,6 +169,7 @@ public class TencentAppBackRpcImpl implements ITencentAppBackRpc {
                     .registerTime(dto.getRegisterTime())
                     .backStatus(BackStatusEnum.NO.getBackStatus())
                     .createTime(LocalDateTime.now())
+                    .userActionSetId(dto.getUserActionSetId())
                     .build();
             gameTencentAppRoleRegisterService.save(roleRegisterLog);
         }
@@ -229,6 +234,7 @@ public class TencentAppBackRpcImpl implements ITencentAppBackRpc {
                     .backStatus(BackStatusEnum.NO.getBackStatus())
                     .roleId(dto.getRoleId())
                     .roleName(dto.getRoleName())
+                    .userActionSetId(dto.getUserActionSetId())
                     .build();
             boolean isFirstOrder = gameTencentAppOrderService.getOne(new LambdaQueryWrapper<GameTencentAppOrder>()
                     .eq(GameTencentAppOrder::getGameId, orderLog.getGameId())

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -25,7 +25,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <封禁新增设备信息封禁, 实名信息封禁> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <全面兼容腾讯APP直投归因回传> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 38 - 21
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/AgentServiceImpl.java

@@ -208,12 +208,22 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
     }
 
     private Tuple3<Long, Map<String, String>, String> appChannelTransform(Game game, UserData userData) {
-        //游戏拓展信息
-        GameExt gameExt = gameExtService.getByGameId(userData.getGameId());
         //直投的APP, 必定兼容了媒体的回传sdk
         if (Strings.isNotBlank(game.getAdSdkConfig())) {
-            Agent agent = super.getOne(new LambdaQueryWrapper<Agent>().eq(Agent::getAgentKey, userData.getChannel()));
-            return Tuples.of(agent == null ? 0 : agent.getId(), Collections.singletonMap("agentKey", userData.getChannel()), Strings.EMPTY);
+            //头条巨量引擎
+            if (Objects.equals(game.getPutType(), 1)) {
+                Agent agent = super.getOne(new LambdaQueryWrapper<Agent>().eq(Agent::getAgentKey, userData.getChannel()));
+                return Tuples.of(agent == null ? 0 : agent.getId(), Collections.singletonMap("agentKey", userData.getChannel()), Strings.EMPTY);
+            }
+            //腾讯广点通
+            if (Objects.equals(game.getPutType(), 2)) {
+                Map<String, String> channelMap = JsonUtil.toMap(userData.getChannel(), Map.class, String.class);
+                if (channelMap == null || !channelMap.containsKey("agentKey")) {
+                    return Tuples.of(0L, Collections.emptyMap(), Strings.EMPTY);
+                }
+                Agent agent = super.getOne(new LambdaQueryWrapper<Agent>().eq(Agent::getAgentKey, channelMap.get("agentKey")));
+                return Tuples.of(agent == null ? 0 : agent.getId(), channelMap, Strings.EMPTY);
+            }
         }
         //头条私域, 虚拟游戏方式
         if (Objects.equals(game.getPutType(), 3)) {
@@ -232,29 +242,22 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         }
         //腾讯私域, 直接加企微方式
         if (Objects.equals(game.getPutType(), 4)) {
-            TencentAppApiUserAgentQueryRpcDTO tencentAppApiUserAgentQueryRpcDTO = TencentAppApiUserAgentQueryRpcDTO.builder()
-                    .gameId(game.getId())
-                    .regIp(userData.getIp())
-                    .registerTime(LocalDateTime.now())
-                    .imei(userData.getImei())
-                    .oaid(userData.getOaid())
-                    .androidId(userData.getAndroidId())
-                    .idfa(userData.getIdfa())
-                    .caid(userData.getCaid())
-                    .build();
-            Tuple2<String, Long> tuple2 = tencentAppApiBackRpc.queryUserAgentFromCallback(tencentAppApiUserAgentQueryRpcDTO).getData();
+            Tuple2<String, Long> tuple2 = this.queryUserAgentFromCallback(game, userData);
             Map<String, String> map = new HashMap<>(2);
             map.put("agentKey", tuple2.first);
             map.put("callbackId", tuple2.second.toString());
             Agent agent = super.getOne(new LambdaQueryWrapper<Agent>().eq(Agent::getAgentKey, tuple2.first));
             return Tuples.of(agent == null ? 0 : agent.getId(), map, Strings.EMPTY);
         }
-        //不投放, 不回传, 只归因渠道, -- 不投放, 且回传只存在于导量情况, 导量无注册行为
-        if (Objects.equals(game.getIsPut(), Boolean.FALSE) && Objects.equals(gameExt.getAdCallBackSwitch(), Boolean.FALSE)) {
-            //查询访问记录
-            UserVisitLog userVisitLog = this.getUserVisitLog(userData);
-            //返回渠道信息
-            return Tuples.of(userVisitLog == null ? 0L : userVisitLog.getAgentId(), Collections.emptyMap(), Strings.EMPTY);
+        //不投放, 不回传, 只归因渠道, -- 不投放, 且回传只存在于导量情况, 无注册行为
+        if (Objects.equals(game.getIsPut(), Boolean.FALSE)) {
+            GameExt gameExt = gameExtService.getByGameId(userData.getGameId());
+            if (gameExt != null && Objects.equals(gameExt.getAdCallBackSwitch(), Boolean.FALSE)) {
+                //查询访问记录
+                UserVisitLog userVisitLog = this.getUserVisitLog(userData);
+                //返回渠道信息
+                return Tuples.of(userVisitLog == null ? 0L : userVisitLog.getAgentId(), Collections.emptyMap(), Strings.EMPTY);
+            }
         }
         //默认返回自然量
         return Tuples.of(0L, Collections.emptyMap(), Strings.EMPTY);
@@ -273,6 +276,20 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         return Tuples.of(agent == null ? 0L : agent.getId(), urlParamMap, Strings.EMPTY);
     }
 
+    private Tuple2<String, Long> queryUserAgentFromCallback(Game game, UserData userData) {
+        TencentAppApiUserAgentQueryRpcDTO tencentAppApiUserAgentQueryRpcDTO = TencentAppApiUserAgentQueryRpcDTO.builder()
+                .gameId(game.getId())
+                .regIp(userData.getIp())
+                .registerTime(LocalDateTime.now())
+                .imei(userData.getImei())
+                .oaid(userData.getOaid())
+                .androidId(userData.getAndroidId())
+                .idfa(userData.getIdfa())
+                .caid(userData.getCaid())
+                .build();
+        return tencentAppApiBackRpc.queryUserAgentFromCallback(tencentAppApiUserAgentQueryRpcDTO).getData();
+    }
+
     private UserVisitLog getUserVisitLog(UserData userData) {
         //当前时间
         LocalDateTime regTime = LocalDateTime.now();

+ 81 - 21
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/CallBackServiceImpl.java

@@ -46,6 +46,9 @@ public class CallBackServiceImpl implements ICallBackService {
     @DubboReference(providedBy = ServerInfo.SERVER_DUBBO_NAME)
     private ITtAppBackRpc ttAppBackRpc;
 
+    @DubboReference(providedBy = ServerInfo.SERVER_DUBBO_NAME)
+    private ITencentAppBackRpc tencentAppBackRpc;
+
     @Autowired
     private IAgentService agentService;
 
@@ -118,6 +121,12 @@ public class CallBackServiceImpl implements ICallBackService {
                 ttAppBackRpc.userActiveReport(ttUserActiveAppRpcDTO);
                 gameBackLogService.addLog(user.getId(), null, "头条APP用户回传提交", JsonUtil.toString(ttUserActiveAppRpcDTO));
             }
+            //腾讯APP直投回传
+            if (CollectionUtils.isNotEmpty(urlParamMap) && Objects.equals(agent.getAccountType(), AccountTypeEnum.TENCENT_APP.getValue())) {
+                TencentUserAppRpcDTO tencentUserAppRpcDTO = this.transform(agent, user);
+                tencentAppBackRpc.backUser(tencentUserAppRpcDTO);
+                gameBackLogService.addLog(user.getId(), null, "腾讯APP用户回传提交", JsonUtil.toString(tencentUserAppRpcDTO));
+            }
         } catch (Exception e) {
             log.error("用户回传异常, userId : {}, e : {}", user.getId(), e.getMessage());
         }
@@ -196,6 +205,12 @@ public class CallBackServiceImpl implements ICallBackService {
                 ttAppBackRpc.roleRegisterReport(ttRoleRegisterAppRpcDTO);
                 gameBackLogService.addLog(user.getId(), gameUserRole.getRoleId(), "头条APP创角回传提交", JsonUtil.toString(ttRoleRegisterAppRpcDTO));
             }
+            //腾讯APP直投回传
+            if (Objects.equals(agent.getAccountType(), AccountTypeEnum.TENCENT_APP.getValue())) {
+                TencentRoleRegisterAppRpcDTO tencentRoleRegisterAppRpcDTO = this.transform(agent, user, gameUserRole);
+                tencentAppBackRpc.backRoleRegister(tencentRoleRegisterAppRpcDTO);
+                gameBackLogService.addLog(user.getId(), gameUserRole.getRoleId(), "腾讯APP创角回传提交", JsonUtil.toString(tencentRoleRegisterAppRpcDTO));
+            }
         } catch (Exception e) {
             log.error("创角回传异常, userId : {}, e : {}", user.getId(), e.getMessage());
         }
@@ -271,6 +286,12 @@ public class CallBackServiceImpl implements ICallBackService {
                 ttAppBackRpc.orderReport(ttOrderAppRpcDTO);
                 gameBackLogService.addLog(user.getId(), platformOrderDTO.getOrderId(), "头条APP订单回传提交", JsonUtil.toString(ttOrderAppRpcDTO));
             }
+            //腾讯APP直投回传
+            if (Objects.equals(agent.getAccountType(), AccountTypeEnum.TENCENT_APP.getValue())) {
+                TencentOrderAppRpcDTO tencentOrderAppRpcDTO = this.transform(platformOrderDTO, agent, user);
+                tencentAppBackRpc.backOrder(tencentOrderAppRpcDTO);
+                gameBackLogService.addLog(user.getId(), platformOrderDTO.getOrderId(), "腾讯APP订单回传提交", JsonUtil.toString(tencentOrderAppRpcDTO));
+            }
         } catch (Exception e) {
             log.error("订单回传异常, orderId : {}, e : {}", platformOrderDTO.getOrderId(), e.getMessage());
         }
@@ -422,6 +443,25 @@ public class CallBackServiceImpl implements ICallBackService {
                 .build();
     }
 
+    private TencentUserAppRpcDTO transform(Agent agent, User user) {
+        return TencentUserAppRpcDTO.builder()
+                .gameId(agent.getGameId())
+                .accountId(agent.getAccountId())
+                .agentKey(agent.getAgentKey())
+                .activeTime(user.getCreateTime())
+                .backPolicyId(agent.getBackPolicyId())
+                .userId(user.getId().toString())
+                .mac(user.getMac())
+                .imei(user.getImei())
+                .oaid(user.getOaid())
+                .androidId(user.getAndroidId())
+                .idfa(user.getIdfa())
+                .caid(user.getCaid())
+                .regIp(user.getIp())
+                .userActionSetId(agent.getUserActionSetId())
+                .build();
+    }
+
     private TtOrderAppRpcDTO transform(PlatformOrderDTO platformOrderDTO, User user, Agent agent) {
         return TtOrderAppRpcDTO.builder()
                 .gameId(agent.getGameId())
@@ -446,6 +486,31 @@ public class CallBackServiceImpl implements ICallBackService {
                 .build();
     }
 
+    private TencentOrderAppRpcDTO transform(PlatformOrderDTO platformOrderDTO, Agent agent, User user) {
+        return TencentOrderAppRpcDTO.builder()
+                .gameId(agent.getGameId())
+                .accountId(agent.getAccountId())
+                .userId(user.getId().toString())
+                .orderId(platformOrderDTO.getOrderId())
+                .agentKey(agent.getAgentKey())
+                .backPolicyId(agent.getBackPolicyId())
+                .rechargeMoney(platformOrderDTO.getAmount().multiply(new BigDecimal(100)).longValue())
+                .orderStatus(platformOrderDTO.getStatus())
+                .regTime(user.getCreateTime())
+                .createTime(platformOrderDTO.getCreateTime())
+                .payTime(platformOrderDTO.getPayTime())
+                .roleId(platformOrderDTO.getRoleId())
+                .roleName(platformOrderDTO.getRoleName())
+                .mac(user.getMac())
+                .imei(user.getImei())
+                .oaid(user.getOaid())
+                .androidId(user.getAndroidId())
+                .idfa(user.getIdfa())
+                .caid(user.getCaid())
+                .userActionSetId(agent.getUserActionSetId())
+                .build();
+    }
+
     private TtRoleRegisterAppRpcDTO transform(User user, Agent agent, GameUserRole gameUserRole) {
         return TtRoleRegisterAppRpcDTO.builder()
                 .gameId(agent.getGameId())
@@ -466,29 +531,24 @@ public class CallBackServiceImpl implements ICallBackService {
                 .build();
     }
 
-    private TtAppUserBackQueryRpcDTO transform(Long userId, Agent agent) {
-        return TtAppUserBackQueryRpcDTO.builder()
-                .gameId(agent.getGameId())
-                .userId(userId.toString())
-                .agentKey(agent.getAgentKey())
-                .build();
-    }
-
-    private TtAppOrderBackQueryRpcDTO transform(Long userId, String orderId, Agent agent) {
-        return TtAppOrderBackQueryRpcDTO.builder()
-                .gameId(agent.getGameId())
-                .userId(userId.toString())
-                .orderId(orderId)
-                .agentKey(agent.getAgentKey())
-                .build();
-    }
-
-    private TtAppRoleRegisterBackQueryRpcDTO transform(Long userId, Agent agent, String roleId) {
-        return TtAppRoleRegisterBackQueryRpcDTO.builder()
+    private TencentRoleRegisterAppRpcDTO transform(Agent agent, User user, GameUserRole gameUserRole) {
+        return TencentRoleRegisterAppRpcDTO.builder()
                 .gameId(agent.getGameId())
-                .userId(userId.toString())
+                .userId(user.getId().toString())
+                .backPolicyId(agent.getBackPolicyId())
+                .accountId(agent.getAccountId())
                 .agentKey(agent.getAgentKey())
-                .roleId(roleId)
+                .roleId(gameUserRole.getRoleId())
+                .roleName(gameUserRole.getRoleName())
+                .roleLevel(gameUserRole.getRoleLevel())
+                .registerTime(gameUserRole.getCreateTime())
+                .mac(user.getMac())
+                .imei(user.getImei())
+                .oaid(user.getOaid())
+                .androidId(user.getAndroidId())
+                .idfa(user.getIdfa())
+                .caid(user.getCaid())
+                .userActionSetId(agent.getUserActionSetId())
                 .build();
     }
 

+ 28 - 7
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameBackLogMediaSdkServiceImpl.java

@@ -6,12 +6,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.sd4324530.jtuple.Tuple2;
 import com.github.sd4324530.jtuple.Tuple3;
 import com.zanxiang.game.back.base.ServerInfo;
-import com.zanxiang.game.back.base.pojo.dto.TencentMiniGameOrderBackQueryRpcDTO;
+import com.zanxiang.game.back.base.pojo.dto.TencentAppOrderBackQueryRpcDTO;
 import com.zanxiang.game.back.base.pojo.dto.TtAppOrderBackQueryRpcDTO;
 import com.zanxiang.game.back.base.pojo.enums.OrderStatusEnum;
 import com.zanxiang.game.back.base.pojo.vo.GameBackPolicyRpcVO;
 import com.zanxiang.game.back.base.pojo.vo.OrderBackQueryRpcVO;
 import com.zanxiang.game.back.base.rpc.IGameBackPolicyRpc;
+import com.zanxiang.game.back.base.rpc.ITencentAppBackRpc;
 import com.zanxiang.game.back.base.rpc.ITencentMiniGameBackRpc;
 import com.zanxiang.game.back.base.rpc.ITtAppBackRpc;
 import com.zanxiang.game.module.base.pojo.enums.AccountTypeEnum;
@@ -60,6 +61,9 @@ public class GameBackLogMediaSdkServiceImpl extends ServiceImpl<GameBackLogMedia
     @DubboReference(providedBy = ServerInfo.SERVER_DUBBO_NAME)
     private ITencentMiniGameBackRpc tencentMiniGameBackRpc;
 
+    @DubboReference(providedBy = ServerInfo.SERVER_DUBBO_NAME)
+    private ITencentAppBackRpc tencentAppBackRpc;
+
     @Autowired
     private IUserService userService;
 
@@ -241,11 +245,19 @@ public class GameBackLogMediaSdkServiceImpl extends ServiceImpl<GameBackLogMedia
         //判断是否订单付费回传, 添加回传金额
         if (Objects.equals(callBackTypeEnum, CallBackTypeEnum.CALL_BACK_PAY_ORDER) && Strings.isNotBlank(param.getOrderId())) {
             PlatformOrderDTO platformOrderDTO = orderService.getByOrderId(param.getOrderId());
-            //头条APP媒体回传, 返回的单位是元
+            //APP直投回传
             if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_APP.getId())) {
-                resultMap.put("amount", Collections.singletonList(platformOrderDTO.getAmount().intValue()));
+                //头条APP媒体回传, 返回的单位是元
+                if (Objects.equals(game.getPutType(), 1)) {
+                    resultMap.put("amount", Collections.singletonList(platformOrderDTO.getAmount().intValue()));
+                }
+                //腾讯APP媒体回传, 返回的单位是分
+                if (Objects.equals(game.getPutType(), 2)) {
+                    int amount = platformOrderDTO.getAmount().multiply(new BigDecimal(100)).intValue();
+                    resultMap.put("amount", Collections.singletonList(amount));
+                }
             }
-            //腾讯小游戏媒体SDK回传, 返回的单位是分, 乘以100
+            //腾讯小游戏媒体, 腾讯广点通SDK回传, 返回的单位是分, 乘以100
             if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getId())) {
                 if (this.orderPayAndBackCheck(platformOrderDTO, param.getMipeiSuces())) {
                     resultMap.put("callBack", Boolean.FALSE);
@@ -522,6 +534,15 @@ public class GameBackLogMediaSdkServiceImpl extends ServiceImpl<GameBackLogMedia
             doBack = orderBackQueryRpcVO.getDoBack();
             backMsg = orderBackQueryRpcVO.getBackMsg();
         }
+        //腾讯APP直投回传
+        if (Objects.equals(agent.getAccountType(), AccountTypeEnum.TENCENT_APP.getValue())) {
+            TencentAppOrderBackQueryRpcDTO orderQuery = this.transform(agent, user.getId(), orderId);
+            OrderBackQueryRpcVO orderBackQueryRpcVO = tencentAppBackRpc.orderBackQuery(orderQuery).getData();
+            //腾讯回传金额单位为分, 不需要处理
+            amount = orderBackQueryRpcVO.getBackMoney();
+            doBack = orderBackQueryRpcVO.getDoBack();
+            backMsg = orderBackQueryRpcVO.getBackMsg();
+        }
         //微信小游戏投放腾讯广告或巨量广告 (坑逼腾讯要其他渠道的订单数据)
         if (Objects.equals(agent.getAccountType(), AccountTypeEnum.TENCENT_MINI_GAME.getValue())
                 || Objects.equals(agent.getAccountType(), AccountTypeEnum.BYTE.getValue())) {
@@ -578,10 +599,10 @@ public class GameBackLogMediaSdkServiceImpl extends ServiceImpl<GameBackLogMedia
                 .build();
     }
 
-    private TencentMiniGameOrderBackQueryRpcDTO transform(String wechatOpenid, String orderId, Agent agent) {
-        return TencentMiniGameOrderBackQueryRpcDTO.builder()
+    private TencentAppOrderBackQueryRpcDTO transform(Agent agent, Long userId, String orderId) {
+        return TencentAppOrderBackQueryRpcDTO.builder()
                 .gameId(agent.getGameId())
-                .wechatOpenid(wechatOpenid)
+                .userId(userId.toString())
                 .orderId(orderId)
                 .agentKey(agent.getAgentKey())
                 .build();