|
|
@@ -46,6 +46,10 @@ public class BindAppErrorWarnServiceImpl implements IBindAppErrorWarnService {
|
|
|
Long last30DayLong = Long.parseLong(last30Day.substring(0, 10).replaceAll("-", ""));
|
|
|
|
|
|
List<Map<String, String>> bindAppErrorWarnList = reportsPushMapper.bindAppErrorData(last30DayLong);
|
|
|
+ if (Check.isNull(bindAppErrorWarnList)){
|
|
|
+ log.info(">>>> 没有绑定错误的广告账号,任务结束");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
long lastUserId = 0L;
|
|
|
ErrorBind lastBind = null;
|
|
|
@@ -123,6 +127,40 @@ public class BindAppErrorWarnServiceImpl implements IBindAppErrorWarnService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ JSONObject template_variable = new JSONObject();
|
|
|
+ template_variable.put("unbindNum", bindAppErrorWarnList.size());
|
|
|
+ template_variable.put("alarm_time", alarm_time);
|
|
|
+ JSONArray object_list_1 = new JSONArray();
|
|
|
+ int index = 0;
|
|
|
+ for (Map<String, String> map : bindAppErrorWarnList){
|
|
|
+ if (++index > 20){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
+ object.put("advertiserName", map.get("advertiser_name"));
|
|
|
+ object.put("advertiserId", String.valueOf(map.get("advertiser_id")));
|
|
|
+ object.put("errorApp", String.valueOf(map.get("error_app_name")));
|
|
|
+ object.put("rightApp", String.valueOf(map.get("right_app_name")));
|
|
|
+ object_list_1.add(object);
|
|
|
+ }
|
|
|
+ template_variable.put("object_list_1", object_list_1);
|
|
|
+
|
|
|
+ JSONObject content = new JSONObject();
|
|
|
+ JSONObject contentData = new JSONObject();
|
|
|
+ contentData.put("template_id",TEMPLATE_ID);
|
|
|
+ contentData.put("template_version_name", TEMPLATE_VERSION);
|
|
|
+ contentData.put("template_variable", template_variable);
|
|
|
+ content.put("type", "template");
|
|
|
+ content.put("data", contentData);
|
|
|
+
|
|
|
+ JSONObject request = new JSONObject();
|
|
|
+ request.put("receive_id", "44fbaed6");
|
|
|
+ request.put("msg_type", "interactive");
|
|
|
+ request.put("content", content.toJSONString());
|
|
|
+ sendToFeishu(token, request);
|
|
|
+ request.put("receive_id", "58e7a98a");
|
|
|
+ sendToFeishu(token, request);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void sendToFeishu(String token, JSONObject requestBody){
|