|
@@ -63,6 +63,9 @@ public class BytedanceReportRetryJob {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BytedancePromoterReportMapper promoterReportMapper;
|
|
private BytedancePromoterReportMapper promoterReportMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICustomReportService customReportService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
private static ExecutorService hourAccountRetrExecutorService = Executors.newFixedThreadPool(2);
|
|
private static ExecutorService hourAccountRetrExecutorService = Executors.newFixedThreadPool(2);
|
|
|
private static ExecutorService dailyAccountRetrExecutorService = Executors.newFixedThreadPool(2);
|
|
private static ExecutorService dailyAccountRetrExecutorService = Executors.newFixedThreadPool(2);
|
|
@@ -92,8 +95,17 @@ public class BytedanceReportRetryJob {
|
|
|
String accessToken = jsonObject.getString("accessToken");
|
|
String accessToken = jsonObject.getString("accessToken");
|
|
|
Integer isSend = jsonObject.getInteger("isSend");
|
|
Integer isSend = jsonObject.getInteger("isSend");
|
|
|
String msg = jsonObject.getString("msg");
|
|
String msg = jsonObject.getString("msg");
|
|
|
- if ("promoter".equals(dataDimension)) {
|
|
|
|
|
- promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
|
|
+ promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
+ if ("custom".equals(dataDimension)) {
|
|
|
|
|
+ dailyPromoterRetrExecutorService.submit(new Runnable() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ if (!Check.isNull(accessToken)) {
|
|
|
|
|
+ customReportService.getCustomReport(dataType, advertiserId, accessToken, startDate, endDate, 0, id);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if ("promoter".equals(dataDimension)) {
|
|
|
if (dataType.equals("hour")) { // 广告时报
|
|
if (dataType.equals("hour")) { // 广告时报
|
|
|
hourPromoterRetrExecutorService.submit(new Runnable() {
|
|
hourPromoterRetrExecutorService.submit(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
@@ -116,7 +128,6 @@ public class BytedanceReportRetryJob {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
} else if ("product".equals(dataDimension)) {
|
|
} else if ("product".equals(dataDimension)) {
|
|
|
- promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
productDailyRetrExecutor.submit(new Runnable() {
|
|
productDailyRetrExecutor.submit(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -126,7 +137,6 @@ public class BytedanceReportRetryJob {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else if ("account".equals(dataDimension)) {
|
|
} else if ("account".equals(dataDimension)) {
|
|
|
- promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
if (dataType.equals("hour")) { // 账户时报
|
|
if (dataType.equals("hour")) { // 账户时报
|
|
|
hourAccountRetrExecutorService.submit(new Runnable() {
|
|
hourAccountRetrExecutorService.submit(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
@@ -150,7 +160,6 @@ public class BytedanceReportRetryJob {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} else if ("flow_details".equals(dataDimension)) { //日报流水详情
|
|
} else if ("flow_details".equals(dataDimension)) { //日报流水详情
|
|
|
- promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
flowDailyRetrExecutor.submit(new Runnable() {
|
|
flowDailyRetrExecutor.submit(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -158,7 +167,6 @@ public class BytedanceReportRetryJob {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else if ("material".equals(dataDimension)) {
|
|
} else if ("material".equals(dataDimension)) {
|
|
|
- promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
materialRetrExecutor.submit(new Runnable() {
|
|
materialRetrExecutor.submit(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -168,7 +176,6 @@ public class BytedanceReportRetryJob {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else if ("material_video_get".equals(dataDimension)) {
|
|
} else if ("material_video_get".equals(dataDimension)) {
|
|
|
- promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
HashSet<Long> materialIds = new HashSet<>();
|
|
HashSet<Long> materialIds = new HashSet<>();
|
|
|
JSONObject msgObject = JSONObject.parseObject(msg);
|
|
JSONObject msgObject = JSONObject.parseObject(msg);
|
|
|
if (msgObject != null && msgObject.getJSONArray("material_ids") != null) {
|
|
if (msgObject != null && msgObject.getJSONArray("material_ids") != null) {
|
|
@@ -183,7 +190,6 @@ public class BytedanceReportRetryJob {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else if ("promotion_list".equals(dataDimension)) {
|
|
} else if ("promotion_list".equals(dataDimension)) {
|
|
|
- promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
productDailyRetrExecutor.submit(new Runnable() {
|
|
productDailyRetrExecutor.submit(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -193,7 +199,6 @@ public class BytedanceReportRetryJob {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else if ("project_list".equals(dataDimension)) {
|
|
} else if ("project_list".equals(dataDimension)) {
|
|
|
- promoterReportMapper.updateStatusByErrorId(id);
|
|
|
|
|
productDailyRetrExecutor.submit(new Runnable() {
|
|
productDailyRetrExecutor.submit(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -204,10 +209,7 @@ public class BytedanceReportRetryJob {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
} else {
|
|
} else {
|
|
|
log.info("重试列表为空");
|
|
log.info("重试列表为空");
|
|
|
}
|
|
}
|