|
@@ -18,6 +18,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
@@ -113,13 +114,14 @@ public class CallBackServiceImpl implements ICallBackService {
|
|
|
if (!Objects.equals(gameExt.getAdCallBackSwitch(), Boolean.TRUE)) {
|
|
|
return;
|
|
|
}
|
|
|
- //查询用户渠道信息
|
|
|
- Agent agent = agentService.getById(platformOrderDTO.getAgentId());
|
|
|
+ //用户信息
|
|
|
+ User user = userService.getById(platformOrderDTO.getUserId());
|
|
|
+ //用户渠道信息
|
|
|
+ Agent agent = agentService.getAgentByChannel(user.getChannel());
|
|
|
if (agent == null) {
|
|
|
log.error("订单回传不存在渠道信息, orderId : {}", platformOrderDTO.getOrderId());
|
|
|
return;
|
|
|
}
|
|
|
- User user = userService.getById(platformOrderDTO.getUserId());
|
|
|
//查询小游戏信息或者H5游戏相关公众号信息
|
|
|
GameApplet gameApplet = gameAppletService.getOne(new LambdaQueryWrapper<GameApplet>()
|
|
|
.eq(GameApplet::getGameId, user.getGameId()));
|
|
@@ -145,7 +147,7 @@ public class CallBackServiceImpl implements ICallBackService {
|
|
|
//判断游戏类型
|
|
|
Game game = gameService.getById(platformOrderDTO.getGameId());
|
|
|
if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getId())) {
|
|
|
- TtOrderRpcDTO ttOrderRpcDTO = this.transform(platformOrderDTO, user.getOpenId(), agent, gameApplet);
|
|
|
+ TtOrderRpcDTO ttOrderRpcDTO = this.transform(platformOrderDTO, user.getOpenId(), agent, gameApplet, user.getCreateTime());
|
|
|
log.error("用户下单 --> 头条回传提交, orderReportRpcDTO : {}", JsonUtil.toString(ttOrderRpcDTO));
|
|
|
ttMiniGameBackRpc.orderReport(ttOrderRpcDTO);
|
|
|
}
|
|
@@ -207,7 +209,7 @@ public class CallBackServiceImpl implements ICallBackService {
|
|
|
.build();
|
|
|
}
|
|
|
|
|
|
- private TtOrderRpcDTO transform(PlatformOrderDTO platformOrderDTO, String openId, Agent agent, GameApplet gameApplet) {
|
|
|
+ private TtOrderRpcDTO transform(PlatformOrderDTO platformOrderDTO, String openId, Agent agent, GameApplet gameApplet, LocalDateTime regTime) {
|
|
|
TtAccountRpcDTO ttAccountRpcDTO = TtAccountRpcDTO.builder()
|
|
|
.accountId(agent.getAccountId())
|
|
|
.reportToken(agent.getReportToken())
|
|
@@ -225,6 +227,7 @@ public class CallBackServiceImpl implements ICallBackService {
|
|
|
.orderStatus(platformOrderDTO.getStatus())
|
|
|
.createTime(platformOrderDTO.getCreateTime())
|
|
|
.payTime(platformOrderDTO.getPayTime())
|
|
|
+ .regTime(regTime)
|
|
|
.build();
|
|
|
}
|
|
|
}
|