yumeng 3 semanas atrás
pai
commit
a11b02f79a

+ 2 - 0
src/main/java/com/adx/tencent/storage/model/BidRecord.java

@@ -97,6 +97,8 @@ public class BidRecord {
         hot.media = this.media;
         hot.mediaTraceId = this.mediaTraceId;
         hot.platform = this.platform;
+        hot.adId = this.adId;
+        hot.accountId = this.accountId;
         hot.clickUrls = this.clickUrls;
         hot.landingPage = this.landingPage;
         hot.appStoreLink = this.appStoreLink;

+ 7 - 3
src/main/java/com/adx/tencent/tencent/TencentClient.java

@@ -119,11 +119,15 @@ public class TencentClient {
         UserAction action = buildUserAction(bid, payment, actionType, eventTimeMs);
 
         long actionSetId = getUserActionSetId(platform);
-        // account_id: 从监测链接传入
+        // account_id: 优先顶层字段,兜底从 mediaParams 读取(兼容旧数据)
         long finalAccountId = 0;
-        if (bid.getAccountId() != null && !bid.getAccountId().isBlank()) {
+        String accountIdStr = bid.getAccountId();
+        if (accountIdStr == null || accountIdStr.isBlank()) {
+            accountIdStr = bid.getMediaParams() != null ? bid.getMediaParams().get("account_id") : null;
+        }
+        if (accountIdStr != null && !accountIdStr.isBlank()) {
             try {
-                finalAccountId = Long.parseLong(bid.getAccountId());
+                finalAccountId = Long.parseLong(accountIdStr);
             } catch (NumberFormatException ignored) {}
         }
         if (finalAccountId == 0) {