|
@@ -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();
|
|
|
}
|
|
|
|