|
@@ -5,6 +5,7 @@ import cn.com.ctop.job.adq.data.mapper.AdqAccountReportMapper;
|
|
|
import cn.com.ctop.job.adq.data.mapper.AdqCreativeReportMapper;
|
|
import cn.com.ctop.job.adq.data.mapper.AdqCreativeReportMapper;
|
|
|
import cn.com.ctop.job.adq.data.mapper.AdqErrorLogMapper;
|
|
import cn.com.ctop.job.adq.data.mapper.AdqErrorLogMapper;
|
|
|
import cn.com.ctop.job.adq.data.service.IAdqRetryReportService;
|
|
import cn.com.ctop.job.adq.data.service.IAdqRetryReportService;
|
|
|
|
|
+import cn.com.ctop.job.adq.data.utils.AlertUtils;
|
|
|
import cn.com.ctop.job.adq.data.utils.Check;
|
|
import cn.com.ctop.job.adq.data.utils.Check;
|
|
|
import cn.com.ctop.job.adq.data.utils.FieldsConfig;
|
|
import cn.com.ctop.job.adq.data.utils.FieldsConfig;
|
|
|
import cn.com.ctop.job.adq.data.utils.HttpUtils;
|
|
import cn.com.ctop.job.adq.data.utils.HttpUtils;
|
|
@@ -91,7 +92,7 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
log.error("请求创意时报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
log.error("请求创意时报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
|
adqErrorLogMapper.deleteInfoByErrorId(errorId);
|
|
adqErrorLogMapper.deleteInfoByErrorId(errorId);
|
|
|
if (isSend == 1) {
|
|
if (isSend == 1) {
|
|
|
- sendMessage(advertiserId, startDate, endDate, 3, "hour", 1, "creative");
|
|
|
|
|
|
|
+ AlertUtils.sendMessage(advertiserId, startDate, endDate, 3, "hour", 1, "creative");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -153,7 +154,7 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
log.error("请求创意日报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
log.error("请求创意日报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
|
adqErrorLogMapper.deleteInfoByErrorId(errorId);
|
|
adqErrorLogMapper.deleteInfoByErrorId(errorId);
|
|
|
if (isSend == 1) {
|
|
if (isSend == 1) {
|
|
|
- sendMessage(advertiserId, startDate, endDate, 3, "daily", 1, "creative");
|
|
|
|
|
|
|
+ AlertUtils.sendMessage(advertiserId, startDate, endDate, 3, "daily", 1, "creative");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -216,7 +217,7 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
log.info("请求账户时报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
log.info("请求账户时报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
|
adqErrorLogMapper.deleteInfoByErrorId(errorId);
|
|
adqErrorLogMapper.deleteInfoByErrorId(errorId);
|
|
|
if (isSend == 1) {
|
|
if (isSend == 1) {
|
|
|
- sendMessage(advertiserId, startDate, endDate, 3, "daily", 1, "account");
|
|
|
|
|
|
|
+ AlertUtils.sendMessage(advertiserId, startDate, endDate, 3, "daily", 1, "account");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -278,7 +279,7 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
log.error("请求账户日报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
log.error("请求账户日报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
|
adqErrorLogMapper.deleteInfoByErrorId(errorId);
|
|
adqErrorLogMapper.deleteInfoByErrorId(errorId);
|
|
|
if (isSend == 1) {
|
|
if (isSend == 1) {
|
|
|
- sendMessage(advertiserId, startDate, endDate, 3, "daily", 1, "account");
|
|
|
|
|
|
|
+ AlertUtils.sendMessage(advertiserId, startDate, endDate, 3, "daily", 1, "account");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -286,34 +287,4 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- private static void sendMessage(Long account_id, String start_date, String end_date, Integer media_type, String type, Integer count, String dimension) {
|
|
|
|
|
- if (count > 5) {
|
|
|
|
|
- log.error("超过最大次数,account_id:{}", count);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- sendExecutorService.submit(new Runnable() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void run() {
|
|
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
|
|
- param.put("account_id", account_id);
|
|
|
|
|
- param.put("start_date", start_date);
|
|
|
|
|
- param.put("end_date", end_date);
|
|
|
|
|
- param.put("media_type", media_type);
|
|
|
|
|
- param.put("type", type);
|
|
|
|
|
- param.put("dimension", dimension);
|
|
|
|
|
- String s = HttpUtils.httpPostRequest(sendUrl, param, new HashMap<>());
|
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
|
|
- if (!Check.isNull(jsonObject)) {
|
|
|
|
|
- Integer code = jsonObject.getInteger("code");
|
|
|
|
|
- if (code == 200) {
|
|
|
|
|
- log.info("请求数据清洗服务成功,account_id:{}", account_id);
|
|
|
|
|
- } else {
|
|
|
|
|
- sendMessage(account_id, start_date, end_date, media_type, type, count + 1, dimension);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|