Prechádzať zdrojové kódy

fix : 发码器在角色检测成时更新角色操作表

bilingfeng 5 mesiacov pred
rodič
commit
3067d85e74

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -23,7 +23,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 < (角色名检测判断 ・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (发码器在角色检测成时更新角色操作表 ・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 2 - 2
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameGiftPackCodeLogServiceImpl.java

@@ -139,13 +139,13 @@ public class GameGiftPackCodeLogServiceImpl extends ServiceImpl<GameGiftPackCode
     private Tuple2<Boolean, String> getRandomCode(String randomCode, String userPhone, GameGiftPackLinkLog linkLog) {
         //手机验证码校验
         smsService.randomCodeCheck(userPhone, randomCode);
+        //异步更新角色操作表
+        roleOperateService.roleOperateUpdate(userPhone, linkLog);
         //查询记录, 判断是否重复领取, 重复领取直接返回之前领取的礼包码
         Tuple2<Boolean, String> repeatCheck = this.repeatCheck(linkLog);
         if (repeatCheck.first) {
             return Tuple2.with(Boolean.TRUE, repeatCheck.second);
         }
-        //异步更新角色操作表
-        roleOperateService.roleOperateUpdate(userPhone, linkLog);
         //构造记录
         GameGiftPackCodeLog gameGiftPackCodeLog = this.transform(linkLog, userPhone);
         //判断礼包码是否存在, 缓存不存在, 或者长度为零, 没有礼包码可领取

+ 9 - 7
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameGiftPackLinkLogServiceImpl.java

@@ -157,13 +157,6 @@ public class GameGiftPackLinkLogServiceImpl extends ServiceImpl<GameGiftPackLink
                 .eq(RoleOperate::getServerId, gameUserRole.getServerId())
                 .eq(RoleOperate::getRoleId, gameUserRole.getRoleId()));
         String userPhone = roleOperate == null || Strings.isBlank(roleOperate.getUserPhone()) ? null : roleOperate.getUserPhone();
-        //返回结果
-        resultMap.put("result", Boolean.TRUE);
-        resultMap.put("msg", "角色名称检测成功");
-        resultMap.put("roleId", gameUserRole.getRoleId());
-        if (Strings.isNotBlank(userPhone)) {
-            resultMap.put("userPhone", userPhone.substring(0, 3) + " **** " + userPhone.substring(userPhone.length() - 4));
-        }
         //更新链接访问记录
         gameGiftPackLinkLog.setUserPhone(userPhone);
         gameGiftPackLinkLog.setUserId(gameUserRole.getUserId());
@@ -172,6 +165,15 @@ public class GameGiftPackLinkLogServiceImpl extends ServiceImpl<GameGiftPackLink
         gameGiftPackLinkLog.setRoleName(gameUserRole.getRoleName());
         gameGiftPackLinkLog.setUpdateTime(LocalDateTime.now());
         super.updateById(gameGiftPackLinkLog);
+        //更新角色操作表
+        roleOperateService.roleOperateUpdate(userPhone, gameGiftPackLinkLog);
+        //返回结果
+        resultMap.put("result", Boolean.TRUE);
+        resultMap.put("msg", "角色名称检测成功");
+        resultMap.put("roleId", gameUserRole.getRoleId());
+        if (Strings.isNotBlank(userPhone)) {
+            resultMap.put("userPhone", userPhone.substring(0, 3) + " **** " + userPhone.substring(userPhone.length() - 4));
+        }
         return resultMap;
     }