瀏覽代碼

fix : 游戏聊天消息对接武哥接口

bilingfeng 11 月之前
父節點
當前提交
92858e69a9

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

@@ -23,7 +23,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <添加日志, 定位CP方的问题01> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <解决导量玩家重回小程序充值userId不正确的问题> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 8 - 2
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/PerformOrderServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.zanxiang.game.module.base.pojo.enums.CpStatusEnum;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.base.util.DateUtils;
 import com.zanxiang.game.module.mybatis.entity.*;
 import com.zanxiang.game.module.sdk.enums.OrderStateEnum;
@@ -69,6 +70,9 @@ public class PerformOrderServiceImpl implements IPerformOrderService {
     @Autowired
     private IGameAppletService gameAppletService;
 
+    @Autowired
+    private IGameService gameService;
+
     @Override
     @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
     public Boolean pushCp(PlatformOrderDTO orderInfo) {
@@ -82,12 +86,14 @@ public class PerformOrderServiceImpl implements IPerformOrderService {
             log.error("充值回调CP失败, 游戏拓展信息中的回调地址为空!");
             return false;
         }
+        //游戏信息
+        Game game = gameService.getById(orderInfo.getGameId());
         //用户信息
         User user = userService.getById(orderInfo.getUserId());
         //回调CP
         Map<String, String> map = new HashMap<>(9);
-        //用户存在关联用户id, 且游戏存在导量游戏id, 判定为导量用户, 提交CP原始用户id
-        if (user.getRelationUserId() != null) {
+        //用户存在关联用户id, 且不是微信小程序, 则判定为导量用户, 提交CP原始用户id
+        if (user.getRelationUserId() != null && !Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getId())) {
             map.put("userId", String.valueOf(user.getRelationUserId()));
         } else {
             map.put("userId", String.valueOf(orderInfo.getUserId()));