|
|
@@ -23,6 +23,7 @@ import com.adx.tencent.storage.TiDBColdStore;
|
|
|
import com.adx.tencent.storage.model.BidRecord;
|
|
|
import com.adx.tencent.storage.model.ConversionRecord;
|
|
|
import com.adx.tencent.storage.model.MediaCallbackRecord;
|
|
|
+import com.adx.tencent.storage.model.AccountTagEventRecord;
|
|
|
import com.adx.tencent.tagsync.AccountTagEventResolver;
|
|
|
import com.adx.tencent.tagsync.TagEventResolver;
|
|
|
import com.adx.tencent.tencent.TencentClient;
|
|
|
@@ -410,12 +411,25 @@ public class ConversionSyncService {
|
|
|
|
|
|
private CallbackTask buildTencentCallbackTask(PaymentInfo payment, BidRecord bid) {
|
|
|
String actionType = null;
|
|
|
+ String customAction = null;
|
|
|
if (accountTagEventResolver != null) {
|
|
|
- actionType = accountTagEventResolver.resolveActionType(bid.getTagId(), bid.getAccountId(), payment.getAct());
|
|
|
+ AccountTagEventRecord accountMapping = accountTagEventResolver.resolveAction(
|
|
|
+ bid.getTagId(), bid.getAccountId(), payment.getAct());
|
|
|
+ if (accountMapping != null) {
|
|
|
+ actionType = accountMapping.getTencentActionType();
|
|
|
+ customAction = accountMapping.getTencentCustomAction();
|
|
|
+ if ("CUSTOM".equals(actionType) && (customAction == null || customAction.isBlank())) {
|
|
|
+ log.warn("[ConversionSync] 账户级 CUSTOM 回传缺少 custom_action, 忽略账户级配置并回退广告位配置 | qk={} | tagId={} | accountId={} | act={}",
|
|
|
+ payment.getQk(), bid.getTagId(), bid.getAccountId(), payment.getAct());
|
|
|
+ actionType = null;
|
|
|
+ customAction = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (tagEventResolver != null) {
|
|
|
if (actionType == null || actionType.isBlank()) {
|
|
|
actionType = tagEventResolver.resolveActionType(bid.getTagId(), payment.getAct());
|
|
|
+ customAction = null;
|
|
|
}
|
|
|
}
|
|
|
if (actionType == null || actionType.isBlank()) {
|
|
|
@@ -435,7 +449,8 @@ public class ConversionSyncService {
|
|
|
payment,
|
|
|
bid,
|
|
|
callbackDedupeKey(payment, bid, actionType),
|
|
|
- actionType
|
|
|
+ actionType,
|
|
|
+ customAction
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -844,7 +859,7 @@ public class ConversionSyncService {
|
|
|
}
|
|
|
String platform = resolvePlatform(task.tencentBid);
|
|
|
MediaCallbackRecord callbackRecord = tencentClient.sendConversionEvent(
|
|
|
- task.tencentBid, task.payment, platform, task.tencentActionType);
|
|
|
+ task.tencentBid, task.payment, platform, task.tencentActionType, task.tencentCustomAction);
|
|
|
callbackRecord.setDedupeKey(task.callbackKey);
|
|
|
return CallbackDispatchResult.tencent(task, callbackRecord);
|
|
|
}
|
|
|
@@ -1525,6 +1540,7 @@ public class ConversionSyncService {
|
|
|
private final String callbackKey;
|
|
|
private final BidRecord tencentBid;
|
|
|
private final String tencentActionType;
|
|
|
+ private final String tencentCustomAction;
|
|
|
private final HonorBidRecord honorBid;
|
|
|
private final Integer honorConversionId;
|
|
|
private final KuaishouBidRecord kuaishouBid;
|
|
|
@@ -1538,6 +1554,7 @@ public class ConversionSyncService {
|
|
|
String callbackKey,
|
|
|
BidRecord tencentBid,
|
|
|
String tencentActionType,
|
|
|
+ String tencentCustomAction,
|
|
|
HonorBidRecord honorBid,
|
|
|
Integer honorConversionId,
|
|
|
KuaishouBidRecord kuaishouBid,
|
|
|
@@ -1550,6 +1567,7 @@ public class ConversionSyncService {
|
|
|
this.callbackKey = callbackKey;
|
|
|
this.tencentBid = tencentBid;
|
|
|
this.tencentActionType = tencentActionType;
|
|
|
+ this.tencentCustomAction = tencentCustomAction;
|
|
|
this.honorBid = honorBid;
|
|
|
this.honorConversionId = honorConversionId;
|
|
|
this.kuaishouBid = kuaishouBid;
|
|
|
@@ -1561,29 +1579,30 @@ public class ConversionSyncService {
|
|
|
private static CallbackTask tencent(PaymentInfo payment,
|
|
|
BidRecord bid,
|
|
|
String callbackKey,
|
|
|
- String actionType) {
|
|
|
- return new CallbackTask("tencent", payment, bid.getTagId(), callbackKey, bid, actionType, null, null, null, null, null, null);
|
|
|
+ String actionType,
|
|
|
+ String customAction) {
|
|
|
+ return new CallbackTask("tencent", payment, bid.getTagId(), callbackKey, bid, actionType, customAction, null, null, null, null, null, null);
|
|
|
}
|
|
|
|
|
|
private static CallbackTask honor(PaymentInfo payment,
|
|
|
HonorBidRecord bid,
|
|
|
String callbackKey,
|
|
|
Integer conversionId) {
|
|
|
- return new CallbackTask("honor", payment, bid.getTagId(), callbackKey, null, null, bid, conversionId, null, null, null, null);
|
|
|
+ return new CallbackTask("honor", payment, bid.getTagId(), callbackKey, null, null, null, bid, conversionId, null, null, null, null);
|
|
|
}
|
|
|
|
|
|
private static CallbackTask kuaishou(PaymentInfo payment,
|
|
|
KuaishouBidRecord bid,
|
|
|
String callbackKey,
|
|
|
KuaishouTagEventRecord tagEvent) {
|
|
|
- return new CallbackTask("kuaishou", payment, bid.getTagId(), callbackKey, null, null, null, null, bid, tagEvent, null, null);
|
|
|
+ return new CallbackTask("kuaishou", payment, bid.getTagId(), callbackKey, null, null, null, null, null, bid, tagEvent, null, null);
|
|
|
}
|
|
|
|
|
|
private static CallbackTask vivo(PaymentInfo payment,
|
|
|
VivoBidRecord bid,
|
|
|
String callbackKey,
|
|
|
VivoTagEventRecord tagEvent) {
|
|
|
- return new CallbackTask("vivo", payment, bid.getTagId(), callbackKey, null, null, null, null, null, null, bid, tagEvent);
|
|
|
+ return new CallbackTask("vivo", payment, bid.getTagId(), callbackKey, null, null, null, null, null, null, null, bid, tagEvent);
|
|
|
}
|
|
|
|
|
|
private boolean isTencent() {
|