|
|
@@ -129,121 +129,7 @@ public class KuaiShouRetryReportJob {
|
|
|
log.info("重试列表为空");
|
|
|
}
|
|
|
|
|
|
- List<JSONObject> dramaRetryList = retryReportService.getDramaErrorLogs();
|
|
|
- if (!Check.isNull(dramaRetryList)) {
|
|
|
- for (int i = 0; i < dramaRetryList.size(); i++) {
|
|
|
- JSONObject jsonObject = dramaRetryList.get(i);
|
|
|
- Long id = jsonObject.getLong("id");
|
|
|
- Long advertiserId = jsonObject.getLong("advertiserId");
|
|
|
- String startDate = jsonObject.getString("startDate");
|
|
|
- String endDate = jsonObject.getString("endDate");
|
|
|
- String dataDimension = jsonObject.getString("dataDimension");
|
|
|
- String accessToken = jsonObject.getString("accessToken");
|
|
|
- Integer isSend = jsonObject.getInteger("isSend");
|
|
|
- if ("drama_ad_report_detail".equals(dataDimension)) {
|
|
|
- dramaExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(accessToken)) {
|
|
|
- dramaService.queryAdReportDetail(accessToken, advertiserId, startDate, endDate, 1, null, id, isSend);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else if ("drama_order_detail".equals(dataDimension)) {
|
|
|
- dramaExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(accessToken)) {
|
|
|
- dramaService.queryOrderDetail(accessToken, advertiserId, startDate, endDate, 1, null, id, isSend);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else if ("drama_saler_cr_data".equals(dataDimension)) {
|
|
|
- JSONObject msg = jsonObject.getJSONObject("msg");
|
|
|
- Integer seriesType = msg.getInteger("seriesType");
|
|
|
- dramaExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(accessToken)) {
|
|
|
- dramaService.querySalerCopyRightData(accessToken, advertiserId, seriesType, startDate, endDate, 1, null, id, isSend);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else if ("drama_series_info".equals(dataDimension)) {
|
|
|
- dramaExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(accessToken)) {
|
|
|
- dramaService.querySeriesInfo(accessToken, advertiserId, null, id, isSend);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else if ("drama_episode_report".equals(dataDimension)) {
|
|
|
- dramaExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(accessToken)) {
|
|
|
- dramaService.queryEpisodeReport(accessToken, advertiserId, startDate, endDate, null, id, isSend);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- log.info("drama重试列表为空");
|
|
|
- }
|
|
|
|
|
|
- List<JSONObject> adSocialRetryList = kuaiShouAdSocialService.getAdSocialErrorLogs();
|
|
|
- if (!Check.isNull(adSocialRetryList)) {
|
|
|
- for (JSONObject jsonObject : adSocialRetryList) {
|
|
|
- Long id = jsonObject.getLong("id");
|
|
|
- String startDate = jsonObject.getString("startDate");
|
|
|
- String endDate = jsonObject.getString("endDate");
|
|
|
- String dataDimension = jsonObject.getString("dataDimension");
|
|
|
- Integer isSend = jsonObject.getInteger("isSend");
|
|
|
- JSONObject msg = jsonObject.getJSONObject("msg");
|
|
|
- Long advertiserId = msg.getLong("advertiserId");
|
|
|
- List<JSONObject> advertiserTokens = kuaiShouAdSocialService.queryAdSocialAdvertiserToken(advertiserId);
|
|
|
- String accessToken;
|
|
|
- if (Check.isNull(advertiserTokens)) {
|
|
|
- continue;
|
|
|
- } else {
|
|
|
- accessToken = advertiserTokens.get(0).getString("access_token");
|
|
|
- }
|
|
|
- if ("ad_social_task_list".equals(dataDimension)) {
|
|
|
- adSocialExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(accessToken)) {
|
|
|
- kuaiShouAdSocialService.getTaskList(accessToken, advertiserId, startDate, endDate, 1, null, id, isSend);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else if ("ad_social_order_list".equals(dataDimension)) {
|
|
|
- adSocialExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(accessToken)) {
|
|
|
- kuaiShouAdSocialService.getOrderList(accessToken, advertiserId, msg.getLong("taskId"), startDate, endDate, 1, null, id, isSend);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else if ("ad_social_order_daily_data".equals(dataDimension)) {
|
|
|
- adSocialExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(accessToken)) {
|
|
|
- kuaiShouAdSocialService.getOrderDailyData(accessToken, advertiserId, msg.getLong("taskId"), msg.getJSONArray("orderIds").toJavaList(String.class), startDate, endDate, null, id, isSend, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- log.info("adSocial重试列表为空");
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
|