Parcourir la source

企业微信思域回传

wcc il y a 9 mois
Parent
commit
56af627488

+ 17 - 5
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameTencentAppApiOrderServiceImpl.java

@@ -219,6 +219,22 @@ implements IGameTencentAppApiOrderService {
         }
         GameTencentAppCallback callback = gameTencentAppCallbackService.getById(user.getCallbackId());
 
+        UserActionRpcDTO.UserIdRpcDTO userId = UserActionRpcDTO.UserIdRpcDTO.builder().build();
+        if ("android".equalsIgnoreCase(callback.getDeviceOsType()))  {
+            if(StringUtils.isNotBlank(callback.getMuid())) {
+                userId.setHashImei(callback.getMuid());
+            }
+            if(StringUtils.isNotBlank(callback.getHashOaid())) {
+                userId.setHashOaid(callback.getHashOaid());
+            }
+            if(StringUtils.isNotBlank(callback.getHashAndroidId())) {
+                userId.setHashAndroidId(callback.getHashAndroidId());
+            }
+        } else {
+            if(StringUtils.isNotBlank(callback.getMuid())) {
+                userId.setHashIdfa(callback.getMuid());
+            }
+        }
         Map<String, Object> actionParams = new HashMap<>();
         actionParams.put("value", backMoney);
         DataReportOfAccountIdRpcDTO dataReportOfAccountIdRpcDTO = DataReportOfAccountIdRpcDTO.builder()
@@ -227,11 +243,7 @@ implements IGameTencentAppApiOrderService {
                 .action(UserActionRpcDTO.builder()
                         .actionTime(backTime)
                         .actionType(ActionTypeEnum.PURCHASE.getActionType())
-                        .userId(UserActionRpcDTO.UserIdRpcDTO.builder()
-                                .hashImei(StringUtils.isBlank(user.getImei()) ? null : Md5Util.encrypt32(user.getImei().toLowerCase()).toLowerCase())
-                                .hashIdfa(StringUtils.isBlank(user.getOaid()) ? null : Md5Util.encrypt32(user.getIdfa().toLowerCase()).toLowerCase())
-                                .hashOaid(StringUtils.isBlank(user.getOaid()) ? null : Md5Util.encrypt32(user.getOaid().toLowerCase()).toLowerCase())
-                                .build())
+                        .userId(userId)
                         .trace(UserActionRpcDTO.TraceRpcDTO.builder()
                                 .clickId(callback.getClickId())
                                 .build())

+ 17 - 5
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameTencentAppApiRoleRegisterServiceImpl.java

@@ -90,17 +90,29 @@ implements IGameTencentAppApiRoleRegisterService {
 
         GameTencentAppCallback callback = gameTencentAppCallbackService.getById(user.getCallbackId());
 
+        UserActionRpcDTO.UserIdRpcDTO userId = UserActionRpcDTO.UserIdRpcDTO.builder().build();
+        if ("android".equalsIgnoreCase(callback.getDeviceOsType()))  {
+            if(StringUtils.isNotBlank(callback.getMuid())) {
+                userId.setHashImei(callback.getMuid());
+            }
+            if(StringUtils.isNotBlank(callback.getHashOaid())) {
+                userId.setHashOaid(callback.getHashOaid());
+            }
+            if(StringUtils.isNotBlank(callback.getHashAndroidId())) {
+                userId.setHashAndroidId(callback.getHashAndroidId());
+            }
+        } else {
+            if(StringUtils.isNotBlank(callback.getMuid())) {
+                userId.setHashIdfa(callback.getMuid());
+            }
+        }
         DataReportOfAccountIdRpcDTO dataReportOfAccountIdRpcDTO = DataReportOfAccountIdRpcDTO.builder()
                 .accountId(user.getAdAccountId())
                 .userActionSetId(user.getUserActionSetId())
                 .action(UserActionRpcDTO.builder()
                         .actionTime(roleRegisterLog.getRegisterTime())
                         .actionType(ActionTypeEnum.CREATE_ROLE.getActionType())
-                        .userId(UserActionRpcDTO.UserIdRpcDTO.builder()
-                                .hashImei(StringUtils.isBlank(user.getImei()) ? null : Md5Util.encrypt32(user.getImei().toLowerCase()).toLowerCase())
-                                .hashIdfa(StringUtils.isBlank(user.getOaid()) ? null : Md5Util.encrypt32(user.getIdfa().toLowerCase()).toLowerCase())
-                                .hashOaid(StringUtils.isBlank(user.getOaid()) ? null : Md5Util.encrypt32(user.getOaid().toLowerCase()).toLowerCase())
-                                .build())
+                        .userId(userId)
                         .trace(UserActionRpcDTO.TraceRpcDTO.builder()
                                 .clickId(callback.getClickId())
                                 .build())

+ 17 - 5
game-back/game-back-serve/src/main/java/com/zanxiang/game/back/serve/service/impl/GameTencentAppApiUserServiceImpl.java

@@ -84,17 +84,29 @@ implements IGameTencentAppApiUserService {
 
         GameTencentAppCallback callback = gameTencentAppCallbackService.getById(userLog.getCallbackId());
 
+        UserActionRpcDTO.UserIdRpcDTO userId = UserActionRpcDTO.UserIdRpcDTO.builder().build();
+        if ("android".equalsIgnoreCase(callback.getDeviceOsType()))  {
+            if(StringUtils.isNotBlank(callback.getMuid())) {
+                userId.setHashImei(callback.getMuid());
+            }
+            if(StringUtils.isNotBlank(callback.getHashOaid())) {
+                userId.setHashOaid(callback.getHashOaid());
+            }
+            if(StringUtils.isNotBlank(callback.getHashAndroidId())) {
+                userId.setHashAndroidId(callback.getHashAndroidId());
+            }
+        } else {
+            if(StringUtils.isNotBlank(callback.getMuid())) {
+                userId.setHashIdfa(callback.getMuid());
+            }
+        }
         DataReportOfAccountIdRpcDTO dataReportOfAccountIdRpcDTO = DataReportOfAccountIdRpcDTO.builder()
                 .accountId(userLog.getAdAccountId())
                 .userActionSetId(userLog.getUserActionSetId())
                 .action(UserActionRpcDTO.builder()
                         .actionTime(userLog.getRegisterTime())
                         .actionType(ActionTypeEnum.ACTIVATE_APP.getActionType())
-                        .userId(UserActionRpcDTO.UserIdRpcDTO.builder()
-                                .hashImei(StringUtils.isBlank(userLog.getImei()) ? null : Md5Util.encrypt32(userLog.getImei().toLowerCase()).toLowerCase())
-                                .hashIdfa(StringUtils.isBlank(userLog.getOaid()) ? null : Md5Util.encrypt32(userLog.getIdfa().toLowerCase()).toLowerCase())
-                                .hashOaid(StringUtils.isBlank(userLog.getOaid()) ? null : Md5Util.encrypt32(userLog.getOaid().toLowerCase()).toLowerCase())
-                                .build())
+                        .userId(userId)
                         .trace(UserActionRpcDTO.TraceRpcDTO.builder()
                                 .clickId(callback.getClickId())
                                 .build())