فهرست منبع

Merge #77 into master from pingkang

fix

* pingkang: (2 commits)
  fix
  fix

Signed-off-by: 黄平康 <accounts_6361eaad7b63b44dd7833e63@mail.teambition.com>
Merged-by: 黄平康 <accounts_6361eaad7b63b44dd7833e63@mail.teambition.com>

CR-link: https://codeup.aliyun.com/60c06368dbbed34fe0f0c263/job/hr_job-bytedance/change/77
huangpingkang 1 سال پیش
والد
کامیت
a4fd66d27e

+ 2 - 4
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedanceCdpProjectServiceImpl.java

@@ -152,8 +152,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                             log.info("---账户({})广告更新成功", advertiserId);
                     }*/
                 } else {
-                    //40100请求超频 (40100 == code || 40110 == code || 40130 == code) &&
-                    if (count <= 5) {
+                    if (count <= 5 && code != 40110) {
                         Thread.sleep(800);
                         getPromotionListVo(advertiserId, ids, date, page, cursor, count + 1, errorId, isLog);
                     } else {
@@ -248,8 +247,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                             log.info("---账户({})项目信息更新成功", advertiserId);
                     }
                 } else {
-                    //40100请求超频 (40100 == code || 40110 == code || 40130 == code) &&
-                    if (count <= 5) {
+                    if (count <= 5 && code != 40110) {
                         Thread.sleep(800);
                         getProjectListVo(advertiserId, ids, type, date, page, count + 1, errorId, isLog);
                     } else {

+ 2 - 2
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedanceMaterialReportServiceImpl.java

@@ -97,7 +97,7 @@ public class BytedanceMaterialReportServiceImpl implements IBytedanceMaterialRep
                     }
                 }
             } else {
-                if (retry <= 5) {
+                if (retry <= 5 && code != 40110) {
                     try {
                         Thread.sleep(800);
                     } catch (Exception ignored) {
@@ -194,7 +194,7 @@ public class BytedanceMaterialReportServiceImpl implements IBytedanceMaterialRep
                     }
                 }
             } else {
-                if (retry <= 5) {
+                if (retry <= 5 && code != 40110) {
                     try {
                         Thread.sleep(800);
                     } catch (Exception ignored) {

+ 8 - 11
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceReportRetryJob.java

@@ -93,12 +93,12 @@ public class BytedanceReportRetryJob {
                 Integer isSend = jsonObject.getInteger("isSend");
                 String msg = jsonObject.getString("msg");
                 if ("promoter".equals(dataDimension)) {
+                    promoterReportMapper.updateStatusByErrorId(id);
                     if (dataType.equals("hour")) { // 广告时报
                         hourPromoterRetrExecutorService.submit(new Runnable() {
                             @Override
                             public void run() {
                                 if (!Check.isNull(accessToken)) {
-                                    promoterReportMapper.updateStatusByErrorId(id);
                                     promoterReportService.getBytedanceRetryPromoterHourReport(id, advertiserId, accessToken, startDate, endDate, 1, isSend);
                                 }
                             }
@@ -109,7 +109,6 @@ public class BytedanceReportRetryJob {
                             @Override
                             public void run() {
                                 if (!Check.isNull(accessToken)) {
-                                    promoterReportMapper.updateStatusByErrorId(id);
                                     promoterReportService.getBytedancePromoterRetryDailyReport(id, advertiserId, accessToken, startDate, endDate, 1, isSend);
 
                                 }
@@ -117,22 +116,22 @@ public class BytedanceReportRetryJob {
                         });
                     }
                 } else if ("product".equals(dataDimension)) {
+                    promoterReportMapper.updateStatusByErrorId(id);
                     productDailyRetrExecutor.submit(new Runnable() {
                         @Override
                         public void run() {
                             if (!Check.isNull(accessToken)) {
-                                promoterReportMapper.updateStatusByErrorId(id);
                                 productReportService.getBytedanceProductDailyReport(advertiserId, accessToken, startDate, endDate, 1, id, null, isSend);
                             }
                         }
                     });
                 } else if ("account".equals(dataDimension)) {
+                    promoterReportMapper.updateStatusByErrorId(id);
                     if (dataType.equals("hour")) { // 账户时报
                         hourAccountRetrExecutorService.submit(new Runnable() {
                             @Override
                             public void run() {
                                 if (!Check.isNull(accessToken)) {
-                                    promoterReportMapper.updateStatusByErrorId(id);
                                     accountReportService.getBytedanceRetryAccountHourReport(id, advertiserId, accessToken, startDate, endDate, 1, isSend);
                                 }
                             }
@@ -144,7 +143,6 @@ public class BytedanceReportRetryJob {
                             @Override
                             public void run() {
                                 if (!Check.isNull(accessToken)) {
-                                    promoterReportMapper.updateStatusByErrorId(id);
                                     accountReportService.getBytedanceRetryAccountDailyReport(id, advertiserId, accessToken, startDate, endDate, 1, isSend);
                                 }
                             }
@@ -152,25 +150,25 @@ public class BytedanceReportRetryJob {
                     }
 
                 } else if ("flow_details".equals(dataDimension)) { //日报流水详情
+                    promoterReportMapper.updateStatusByErrorId(id);
                     flowDailyRetrExecutor.submit(new Runnable() {
-
                         @Override
                         public void run() {
-                            promoterReportMapper.updateStatusByErrorId(id);
                             byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, AccountTypeEnum.AD.getValue(), startDate, endDate, 1, id);
                         }
                     });
                 } else if ("material".equals(dataDimension)) {
+                    promoterReportMapper.updateStatusByErrorId(id);
                     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);
                             }
                         }
                     });
                 } else if ("material_video_get".equals(dataDimension)) {
+                    promoterReportMapper.updateStatusByErrorId(id);
                     HashSet<Long> materialIds = new HashSet<>();
                     JSONObject msgObject = JSONObject.parseObject(msg);
                     if (msgObject != null && msgObject.getJSONArray("material_ids") != null) {
@@ -180,27 +178,26 @@ public class BytedanceReportRetryJob {
                         @Override
                         public void run() {
                             if (!Check.isNull(accessToken)) {
-                                promoterReportMapper.updateStatusByErrorId(id);
                                 bytedanceMaterialReportService.getBytedanceMaterialVideo(advertiserId, materialIds, accessToken, startDate, endDate, 1, id, null, isSend, 1);
                             }
                         }
                     });
                 } else if ("promotion_list".equals(dataDimension)) {
+                    promoterReportMapper.updateStatusByErrorId(id);
                     productDailyRetrExecutor.submit(new Runnable() {
                         @Override
                         public void run() {
                             if (!Check.isNull(accessToken)) {
-                                promoterReportMapper.updateStatusByErrorId(id);
                                 cdpProjectService.getPromotionList(advertiserId, null, null, id, null);
                             }
                         }
                     });
                 } else if ("project_list".equals(dataDimension)) {
+                    promoterReportMapper.updateStatusByErrorId(id);
                     productDailyRetrExecutor.submit(new Runnable() {
                         @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);
                             }