|
@@ -33,14 +33,14 @@ public class AdqMaterialReportServiceImpl implements IAdqMaterialReportService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void getAdqMaterialDailyReport(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Integer isLog, Long errId, Integer isSend) {
|
|
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
|
|
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 {
|
|
try {
|
|
|
Map<String, Object> paramsMap = new HashMap<>();
|
|
Map<String, Object> paramsMap = new HashMap<>();
|
|
|
paramsMap.put("access_token", accessToken);
|
|
paramsMap.put("access_token", accessToken);
|
|
@@ -58,7 +58,6 @@ public class AdqMaterialReportServiceImpl implements IAdqMaterialReportService {
|
|
|
paramsMap.put("time_line", "REPORTING_TIME");
|
|
paramsMap.put("time_line", "REPORTING_TIME");
|
|
|
JSONArray group_by = new JSONArray();
|
|
JSONArray group_by = new JSONArray();
|
|
|
group_by.add("date");
|
|
group_by.add("date");
|
|
|
- //group_by.add("adgroup_id");
|
|
|
|
|
JSONArray fieldsList = FieldsConfig.getMaterialDailyFieldsList();
|
|
JSONArray fieldsList = FieldsConfig.getMaterialDailyFieldsList();
|
|
|
if ("REPORT_LEVEL_MATERIAL_IMAGE".equals(level)) {
|
|
if ("REPORT_LEVEL_MATERIAL_IMAGE".equals(level)) {
|
|
|
group_by.add("image_id");
|
|
group_by.add("image_id");
|
|
@@ -75,16 +74,6 @@ public class AdqMaterialReportServiceImpl implements IAdqMaterialReportService {
|
|
|
List<AdqMaterialReportDaily> reportList = new ArrayList<>();
|
|
List<AdqMaterialReportDaily> reportList = new ArrayList<>();
|
|
|
if (Check.isNull(jsonObject)) {
|
|
if (Check.isNull(jsonObject)) {
|
|
|
log.error("请求素材日报失败,account_id:{},返回为空。", advertiserId);
|
|
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;
|
|
return;
|
|
|
} else {
|
|
} else {
|
|
|
Integer code = jsonObject.getInteger("code");
|
|
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)) {
|
|
if (!Check.isNull(reportList)) {
|
|
|
adqMaterialReportMapper.addsMaterialDailyList(reportList);
|
|
adqMaterialReportMapper.addsMaterialDailyList(reportList);
|
|
|
}
|
|
}
|
|
|
if (page < totalPage) {
|
|
if (page < totalPage) {
|
|
|
- getAdqMaterialDailyReport(advertiserId, accessToken, level, startDate, endDate, page + 1, isLog, errId, isSend);
|
|
|
|
|
|
|
+ getAdqMaterialDailyReport(advertiserId, accessToken, level, startDate, endDate, page + 1);
|
|
|
} else {
|
|
} else {
|
|
|
log.info("请求素材日报完成,account_id:{},开始日期:{},结束日期:{} totalPage:{}", advertiserId, startDate, endDate, totalPage);
|
|
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) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|