|
|
@@ -3,6 +3,7 @@ package cn.com.ctop.job.bytedance.handler;
|
|
|
|
|
|
import cn.com.ctop.job.bytedance.config.DianZhongConfig;
|
|
|
import cn.com.ctop.job.bytedance.data.enums.AccountTypeEnum;
|
|
|
+import cn.com.ctop.job.bytedance.data.mapper.BytedancePromoterReportMapper;
|
|
|
import cn.com.ctop.job.bytedance.data.service.*;
|
|
|
import cn.com.ctop.job.bytedance.data.utils.Check;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@@ -59,6 +60,9 @@ public class BytedanceReportRetryJob {
|
|
|
@Resource
|
|
|
private DianZhongConfig dianZhongConfig;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BytedancePromoterReportMapper promoterReportMapper;
|
|
|
+
|
|
|
|
|
|
private static ExecutorService hourAccountRetrExecutorService = Executors.newFixedThreadPool(2);
|
|
|
private static ExecutorService dailyAccountRetrExecutorService = Executors.newFixedThreadPool(2);
|
|
|
@@ -67,6 +71,7 @@ public class BytedanceReportRetryJob {
|
|
|
private static ExecutorService hourPromoterRetrExecutorService = Executors.newFixedThreadPool(2);
|
|
|
|
|
|
private static ExecutorService productDailyRetrExecutor = Executors.newFixedThreadPool(2);
|
|
|
+ private static ExecutorService materialRetrExecutor = Executors.newFixedThreadPool(3);
|
|
|
|
|
|
private static ExecutorService flowDailyRetrExecutor = Executors.newFixedThreadPool(2);
|
|
|
private static ExecutorService changduExecutorService = Executors.newFixedThreadPool(1);
|
|
|
@@ -93,6 +98,7 @@ public class BytedanceReportRetryJob {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
promoterReportService.getBytedanceRetryPromoterHourReport(id, advertiserId, accessToken, startDate, endDate, 1, isSend);
|
|
|
}
|
|
|
}
|
|
|
@@ -103,6 +109,7 @@ public class BytedanceReportRetryJob {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
promoterReportService.getBytedancePromoterRetryDailyReport(id, advertiserId, accessToken, startDate, endDate, 1, isSend);
|
|
|
|
|
|
}
|
|
|
@@ -114,6 +121,7 @@ public class BytedanceReportRetryJob {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
productReportService.getBytedanceProductDailyReport(advertiserId, accessToken, startDate, endDate, 1, id, null, isSend);
|
|
|
}
|
|
|
}
|
|
|
@@ -124,6 +132,7 @@ public class BytedanceReportRetryJob {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
accountReportService.getBytedanceRetryAccountHourReport(id, advertiserId, accessToken, startDate, endDate, 1, isSend);
|
|
|
}
|
|
|
}
|
|
|
@@ -135,6 +144,7 @@ public class BytedanceReportRetryJob {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
accountReportService.getBytedanceRetryAccountDailyReport(id, advertiserId, accessToken, startDate, endDate, 1, isSend);
|
|
|
}
|
|
|
}
|
|
|
@@ -146,14 +156,16 @@ public class BytedanceReportRetryJob {
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, AccountTypeEnum.AD.getValue(), startDate, endDate, 1, id);
|
|
|
}
|
|
|
});
|
|
|
} else if ("material".equals(dataDimension)) {
|
|
|
- productDailyRetrExecutor.submit(new Runnable() {
|
|
|
+ materialRetrExecutor.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
bytedanceMaterialReportService.getBytedanceMaterialDailyReport(advertiserId, accessToken, startDate, endDate, 1, id, null, isSend, 1);
|
|
|
}
|
|
|
}
|
|
|
@@ -164,10 +176,11 @@ public class BytedanceReportRetryJob {
|
|
|
if (msgObject != null && msgObject.getJSONArray("material_ids") != null) {
|
|
|
materialIds.addAll(msgObject.getJSONArray("material_ids").toJavaList(Long.class));
|
|
|
}
|
|
|
- productDailyRetrExecutor.submit(new Runnable() {
|
|
|
+ materialRetrExecutor.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
bytedanceMaterialReportService.getBytedanceMaterialVideo(advertiserId, materialIds, accessToken, startDate, endDate, 1, id, null, isSend, 1);
|
|
|
}
|
|
|
}
|
|
|
@@ -177,6 +190,7 @@ public class BytedanceReportRetryJob {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
cdpProjectService.getPromotionList(advertiserId, null, null, id, null);
|
|
|
}
|
|
|
}
|
|
|
@@ -186,6 +200,7 @@ public class BytedanceReportRetryJob {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(accessToken)) {
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
cdpProjectService.getProjectList(advertiserId, null, null, null, id, null);
|
|
|
cdpProjectService.getProjectList(advertiserId, null, "del", null, id, null);
|
|
|
}
|
|
|
@@ -242,7 +257,7 @@ public class BytedanceReportRetryJob {
|
|
|
changduExecutorService.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- miniAppService.getMaEcpm(startDate, endDate, appId, 1, id, isSend);
|
|
|
+ miniAppService.getMaEcpm(startDate, endDate, appId, 0, id, isSend);
|
|
|
}
|
|
|
});
|
|
|
}
|