|
|
@@ -1141,9 +1141,6 @@ public class ConversionSyncService {
|
|
|
if (deductionRate <= 0) {
|
|
|
return DeductionHandling.SEND;
|
|
|
}
|
|
|
- if (!isNewTrackingLink(task.tencentBid)) {
|
|
|
- return DeductionHandling.SEND;
|
|
|
- }
|
|
|
if (!hotStore.markConversionSeen(task.callbackKey)) {
|
|
|
log.info("[ConversionSync] 腾讯转化已见过,跳过后续发送 | callbackKey={} | qk={} | accountId={}",
|
|
|
task.callbackKey, task.payment.getQk(), safe(task.tencentBid.getAccountId()));
|
|
|
@@ -1164,20 +1161,6 @@ public class ConversionSyncService {
|
|
|
return deduct ? DeductionHandling.DEDUCT : DeductionHandling.SEND;
|
|
|
}
|
|
|
|
|
|
- private static boolean isNewTrackingLink(BidRecord bid) {
|
|
|
- if (bid == null || bid.getMediaParams() == null) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- String flag = bid.getMediaParams().get(BidRecord.NEW_LINK_FLAG_KEY);
|
|
|
- if (flag != null && Boolean.parseBoolean(flag)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- String version = bid.getMediaParams().get(BidRecord.TRACKING_VERSION_KEY);
|
|
|
- return "v2".equalsIgnoreCase(version)
|
|
|
- || "v3".equalsIgnoreCase(version)
|
|
|
- || "v4".equalsIgnoreCase(version);
|
|
|
- }
|
|
|
-
|
|
|
private MediaCallbackRecord buildDeductedCallbackRecord(CallbackTask task) {
|
|
|
MediaCallbackRecord record = new MediaCallbackRecord();
|
|
|
Instant now = Instant.now();
|
|
|
@@ -1194,9 +1177,9 @@ public class ConversionSyncService {
|
|
|
record.setStatus(0);
|
|
|
record.setOk(false);
|
|
|
record.setAttempt(1);
|
|
|
- record.setErrorMessage("deducted_by_new_link_rate");
|
|
|
+ record.setErrorMessage("deducted_by_rate");
|
|
|
record.setDispatchStatus(MediaCallbackRecord.DISPATCH_STATUS_DEDUCTED);
|
|
|
- record.setTrackingVersion(String.valueOf(resolveDeductionRate(task.tencentBid, task.payment.getAct())));
|
|
|
+ record.setTrackingVersion(resolveTrackingVersion(task.tencentBid));
|
|
|
record.setCreatedAt(now);
|
|
|
int deductionRate = resolveDeductionRate(task.tencentBid, task.payment.getAct());
|
|
|
log.info("[ConversionSync] 腾讯转化扣量 | qk={} | act={} | rate={} | tagId={} | accountId={} | callbackKey={}",
|
|
|
@@ -1372,7 +1355,8 @@ public class ConversionSyncService {
|
|
|
if (bid == null || bid.getMediaParams() == null) {
|
|
|
return 0;
|
|
|
}
|
|
|
- if (act == 2001) {
|
|
|
+ String trackingVersion = resolveTrackingVersion(bid);
|
|
|
+ if (act == 2001 && "v1".equalsIgnoreCase(trackingVersion)) {
|
|
|
String rawActRate = firstParam(bid.getMediaParams(),
|
|
|
BidRecord.ACT_2001_DEDUCTION_RATE_KEY,
|
|
|
"act2001DeductionRate",
|
|
|
@@ -1383,7 +1367,10 @@ public class ConversionSyncService {
|
|
|
return actRate;
|
|
|
}
|
|
|
}
|
|
|
- String rawRate = bid.getMediaParams().get(BidRecord.DEDUCTION_RATE_KEY);
|
|
|
+ String rawRate = firstParam(bid.getMediaParams(),
|
|
|
+ BidRecord.DEDUCTION_RATE_KEY,
|
|
|
+ "deductionRate",
|
|
|
+ "rate");
|
|
|
Integer rate = parseDeductionRate(rawRate);
|
|
|
if (rate != null) {
|
|
|
return rate;
|