فهرست منبع

adq定时任务

yumeng 13 ساعت پیش
والد
کامیت
eee2c98137

+ 2 - 2
job-adq/src/main/java/cn/com/ctop/job/adq/controller/AdqController.java

@@ -46,8 +46,8 @@ public class AdqController {
         String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
        /* accountReportService.getAdqAccountHour(advertiserId, accessToken, nowDate, nowDate, 1, 1);
         accountReportService.getAdqAccountDaily(advertiserId, accessToken, nowDate, nowDate, 1, 1);*/
-     //   adqMaterialReportService.getAdqMaterialDailyReport(advertiserId, accessToken, "2026-06-03", "2026-06-03", 1, 1, null, 0);
-        adqMediaInfoService.getVideoListIncrement(advertiserId, accessToken);
+        adqMaterialReportService.getAdqMaterialDailyReport(advertiserId, accessToken, "2026-06-03", "2026-06-03", 1, 1, null, 0);
+        // adqMediaInfoService.getVideoListIncrement(advertiserId, accessToken);
 
    /*     adqMediaInfoService.getVideoListAll(advertiserId, accessToken);
         adqMediaInfoService.getImageListAll(advertiserId, accessToken);*/

+ 4 - 33
job-adq/src/main/java/cn/com/ctop/job/adq/data/service/impl/AdqMaterialReportServiceImpl.java

@@ -33,14 +33,14 @@ public class AdqMaterialReportServiceImpl implements IAdqMaterialReportService {
 
     @Override
     public void getAdqMaterialDailyReport(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Integer isLog, Long errId, Integer isSend) {
-        getAdqMaterialDailyReport(advertiserId, accessToken, "REPORT_LEVEL_MATERIAL_IMAGE", startDate, endDate, page, isLog, errId, isSend);
-        getAdqMaterialDailyReport(advertiserId, accessToken, "REPORT_LEVEL_MATERIAL_VIDEO", startDate, endDate, page, isLog, errId, isSend);
+        getAdqMaterialDailyReport(advertiserId, accessToken, "REPORT_LEVEL_MATERIAL_IMAGE", startDate, endDate, page);
+        getAdqMaterialDailyReport(advertiserId, accessToken, "REPORT_LEVEL_MATERIAL_VIDEO", startDate, endDate, page);
     }
 
     /*
     level  REPORT_LEVEL_MATERIAL_IMAGE REPORT_LEVEL_MATERIAL_VIDEO
      */
-    private void getAdqMaterialDailyReport(Long advertiserId, String accessToken, String level, String startDate, String endDate, Integer page, Integer isLog, Long errId, Integer isSend) {
+    private void getAdqMaterialDailyReport(Long advertiserId, String accessToken, String level, String startDate, String endDate, Integer page) {
         try {
             Map<String, Object> paramsMap = new HashMap<>();
             paramsMap.put("access_token", accessToken);
@@ -58,7 +58,6 @@ public class AdqMaterialReportServiceImpl implements IAdqMaterialReportService {
             paramsMap.put("time_line", "REPORTING_TIME");
             JSONArray group_by = new JSONArray();
             group_by.add("date");
-            //group_by.add("adgroup_id");
             JSONArray fieldsList = FieldsConfig.getMaterialDailyFieldsList();
             if ("REPORT_LEVEL_MATERIAL_IMAGE".equals(level)) {
                 group_by.add("image_id");
@@ -75,16 +74,6 @@ public class AdqMaterialReportServiceImpl implements IAdqMaterialReportService {
             List<AdqMaterialReportDaily> reportList = new ArrayList<>();
             if (Check.isNull(jsonObject)) {
                 log.error("请求素材日报失败,account_id:{},返回为空。", advertiserId);
-                if (isLog == 1) {
-                    AdqErrorLog errorInfo = new AdqErrorLog();
-                    errorInfo.setAdvertiserId(advertiserId);
-                    errorInfo.setStartDate(startDate);
-                    errorInfo.setEndDate(endDate);
-                    errorInfo.setDataDimension("material");
-                    errorInfo.setDataType("daily");
-                    adqErrorLogMapper.replaceErrorInfo(errorInfo);
-                }
-
                 return;
             } else {
                 Integer code = jsonObject.getInteger("code");
@@ -131,33 +120,15 @@ public class AdqMaterialReportServiceImpl implements IAdqMaterialReportService {
                             }
                         }
                     }
-                } else {
-                    log.error("请求素材日报失败,account_id:{},返回信息:{}", advertiserId, jsonObject);
-                    if (isLog == 1) {
-                        AdqErrorLog errorInfo = new AdqErrorLog();
-                        errorInfo.setAdvertiserId(advertiserId);
-                        errorInfo.setStartDate(startDate);
-                        errorInfo.setEndDate(endDate);
-                        errorInfo.setDataDimension("material");
-                        errorInfo.setDataType("daily");
-                        adqErrorLogMapper.replaceErrorInfo(errorInfo);
-                    }
-                    return;
                 }
             }
             if (!Check.isNull(reportList)) {
                 adqMaterialReportMapper.addsMaterialDailyList(reportList);
             }
             if (page < totalPage) {
-                getAdqMaterialDailyReport(advertiserId, accessToken, level, startDate, endDate, page + 1, isLog, errId, isSend);
+                getAdqMaterialDailyReport(advertiserId, accessToken, level, startDate, endDate, page + 1);
             } else {
                 log.info("请求素材日报完成,account_id:{},开始日期:{},结束日期:{} totalPage:{}", advertiserId, startDate, endDate, totalPage);
-                if (errId != null) {
-                    adqErrorLogMapper.deleteInfoByErrorId(errId);
-                }
-                if (isSend != null && isSend == 1) {
-                    AlertUtils.sendMessage(advertiserId, startDate, endDate, 3, "daily", 1, "asset");
-                }
             }
         } catch (Exception e) {
             e.printStackTrace();