Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

zhaotx 1 tahun lalu
induk
melakukan
797e00629a

+ 25 - 14
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceController.java

@@ -6,7 +6,6 @@ import cn.com.ctop.job.bytedance.data.service.*;
 import cn.com.ctop.job.bytedance.data.utils.Check;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.google.common.collect.Lists;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,7 +31,8 @@ public class BytedanceController {
     @Autowired
     private IBytedanceProductReportService productReportService;
 
-    private static final ExecutorService dailyRetrExecutorService = Executors.newFixedThreadPool(10);
+    private static final ExecutorService executor10Service1 = Executors.newFixedThreadPool(10);
+    private static final ExecutorService executor10Service2 = Executors.newFixedThreadPool(10);
 
     @Autowired
     private IAdminAdvertiserListService adminAdvertiserListService;
@@ -66,7 +66,7 @@ public class BytedanceController {
             Long advertiserId = adminAdvertiserJson.getLong("advertiserId");
             List<Long> ids = new ArrayList<>();
             ids.add(advertiserId);
-            dailyRetrExecutorService.submit(new Runnable() {
+            executor10Service1.submit(new Runnable() {
                 @Override
                 public void run() {
                     if (!Check.isNull(accessToken)) {
@@ -95,7 +95,7 @@ public class BytedanceController {
             Long advertiserId = jsonObject.getLong("advertiserId");
             String accessToken = jsonObject.getString("accessToken");
 
-            dailyRetrExecutorService.submit(new Runnable() {
+            executor10Service1.submit(new Runnable() {
                 @Override
                 public void run() {
                     if (!Check.isNull(accessToken)) {
@@ -123,7 +123,7 @@ public class BytedanceController {
             Long adverId = jsonObject.getLong("advertiserId");
             String accessToken = jsonObject.getString("accessToken");
 
-            dailyRetrExecutorService.submit(new Runnable() {
+            executor10Service1.submit(new Runnable() {
                 @Override
                 public void run() {
                     if (!Check.isNull(accessToken)) {
@@ -168,7 +168,7 @@ public class BytedanceController {
     public void generateFlowDetailsReport(String startDate, String endDate) {
         List<AdvertiserAccount> adAccount = byteDanceFlowDetailsReportService.getAdAccount();
         adAccount.forEach(advertiserAccount -> {
-            dailyRetrExecutorService.submit(new Runnable() {
+            executor10Service1.submit(new Runnable() {
 
                 @Override
                 public void run() {
@@ -188,10 +188,21 @@ public class BytedanceController {
     public void costProject(@RequestParam(required = false) Long advertiserId, String startDate, String endDate) {
         List<JSONObject> costAccount = productReportService.getCostAccount(advertiserId, startDate, endDate);
         for (JSONObject jsonObject : costAccount) {
-            dailyRetrExecutorService.submit(() -> {
+            executor10Service1.submit(() -> {
                 Long adverId = jsonObject.getLong("advertiserId");
-                cdpProjectService.getProjectList(adverId, null, null, null);
-                cdpProjectService.getProjectList(adverId, null, "del", null);
+                cdpProjectService.getProjectList(adverId, null, null, null,null,1);
+                cdpProjectService.getProjectList(adverId, null, "del", null,null,1);
+            });
+        }
+    }
+
+    @GetMapping("/costPromotion")
+    public void costPromotion(@RequestParam(required = false) Long advertiserId, String startDate, String endDate) {
+        List<JSONObject> costAccount = productReportService.getCostAccount(advertiserId, startDate, endDate);
+        for (JSONObject jsonObject : costAccount) {
+            executor10Service2.submit(() -> {
+                Long adverId = jsonObject.getLong("advertiserId");
+                cdpProjectService.getPromotionList(adverId,null,null,null,1);
             });
         }
     }
@@ -217,8 +228,8 @@ public class BytedanceController {
                 log.info("项目ID数不能超过100");
                 return;
             }
-            cdpProjectService.getProjectList(advertiserId, ids, null, null);
-            cdpProjectService.getProjectList(advertiserId, ids, "del", null);
+            cdpProjectService.getProjectList(advertiserId, ids, null, null,null,1);
+            cdpProjectService.getProjectList(advertiserId, ids, "del", null,null,1);
         }
     }
 
@@ -243,7 +254,7 @@ public class BytedanceController {
                 log.info("项目ID数不能超过100");
                 return;
             }
-            cdpProjectService.getpromotionList(advertiserId, ids, null);
+            cdpProjectService.getPromotionList(advertiserId, ids, null,null,1);
         }
     }
 
@@ -265,7 +276,7 @@ public class BytedanceController {
             for (JSONObject iid : iids) {
                 Long pageId = iid.getLong("page_id");
                 Long advertiserId = iid.getLong("advertiser_id");
-                dailyRetrExecutorService.submit(() -> cdpProjectService.getAdqWechatPages(advertiserId, pageId));
+                executor10Service1.submit(() -> cdpProjectService.getAdqWechatPages(advertiserId, pageId));
             }
         }
     }
@@ -280,7 +291,7 @@ public class BytedanceController {
     public void materialDaily(@RequestParam(required = false) Long advertiserId, String startDate, String endDate) {
         List<JSONObject> costAccount = productReportService.getCostAccount(advertiserId, startDate, endDate);
         for (JSONObject jsonObject : costAccount) {
-            dailyRetrExecutorService.submit(() -> {
+            executor10Service1.submit(() -> {
                 Long adverId = jsonObject.getLong("advertiserId");
                 String accessToken = jsonObject.getString("accessToken");
                 bytedanceMaterialReportService.getBytedanceMaterialDailyReport(adverId, accessToken, startDate, endDate, 1, null, 1, 0);

+ 4 - 4
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceXingTuController.java

@@ -40,8 +40,8 @@ public class BytedanceXingTuController {
     }
 
     @GetMapping("/taskInfo")
-    public void taskInfo() {
-        List<JSONObject> xingTuTasks = bytedanceXingTuService.getXingTuActiveTask(null);
+    public void taskInfo(@RequestParam(required = false) Long advertiserId) {
+        List<JSONObject> xingTuTasks = bytedanceXingTuService.getXingTuActiveTask(advertiserId);
         for (JSONObject taskJson : xingTuTasks) {
             Long advId = taskJson.getLong("advertiser_id");
             Long taskId = taskJson.getLong("task_id");
@@ -52,8 +52,8 @@ public class BytedanceXingTuController {
     }
 
     @GetMapping("/taskReport")
-    public void taskReport() {
-        List<JSONObject> xingTuTasks = bytedanceXingTuService.getXingTuReportTask(null);
+    public void taskReport(@RequestParam(required = false) Long advertiserId) {
+        List<JSONObject> xingTuTasks = bytedanceXingTuService.getXingTuReportTask(advertiserId);
         for (JSONObject taskJson : xingTuTasks) {
             Integer taskStatus = taskJson.getInteger("task_status");
             Long advId = taskJson.getLong("advertiser_id");

+ 26 - 4
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/entity/BytedanceCdpProject.java

@@ -152,13 +152,25 @@ public class BytedanceCdpProject {
     private String deliveryMode;
     private String bidType;
     private String deepExternalAction;
-    private String deepBidType ;
+    private String deepBidType;
     private Double bid;
-    private Double cpaBid ;
-    private Double deepCpabid ;
+    private Double cpaBid;
+    private Double deepCpabid;
     private Double searchBidRatio;
     private Double roiGoal;
 
+    private String budgetOptimizeSwitch;
+    private String audience;
+    private String scheduleType;
+    private String budgetMode;
+    private String budget;
+    private String aigcDynamicCreativeSwitch;
+    private String scheduleTime;
+    private String status;
+    private String statusFirst;
+    private String statusSecond;
+    private String projectList;
+
 
     /**
      * 创建时间
@@ -171,11 +183,11 @@ public class BytedanceCdpProject {
      */
     //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     //private Date updateTime;
-
     public BytedanceCdpProject() {
     }
 
     public BytedanceCdpProject(JSONObject o) {
+        this.projectList = o.toString();
         this.advertiserId = o.getLong("advertiser_id");
         this.projectId = o.getLong("project_id");
         this.projectName = o.getString("name");
@@ -222,6 +234,16 @@ public class BytedanceCdpProject {
             this.cpaBid = deliverySetting.getDouble("cpa_bid");
             this.deepCpabid = deliverySetting.getDouble("deep_cpabid");
             this.roiGoal = deliverySetting.getDouble("roi_goal");
+            this.budgetOptimizeSwitch = deliverySetting.getString("budget_optimize_switch");
+            this.scheduleType = deliverySetting.getString("schedule_type");
+            this.budgetMode = deliverySetting.getString("budget_mode");
+            this.budget = deliverySetting.getString("budget");
+            this.scheduleTime = deliverySetting.getString("schedule_time");
         }
+        this.audience = o.getString("audience");
+        this.aigcDynamicCreativeSwitch = o.getString("aigc_dynamic_creative_switch");
+        this.status = o.getString("status");
+        this.statusFirst = o.getString("status_first");
+        this.statusSecond = o.getString("status_second");
     }
 }

+ 1 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/BytedanceProductReportMapper.xml

@@ -22,6 +22,7 @@
         ) t1
         LEFT JOIN tidb.deepthink.bytedance_advertiser_list t2 ON t1.advertiser_id = t2.advertiser_id
         LEFT JOIN tidb.deepthink.bytedance_auth_list t3 ON t2.admin_advertiser_id = t3.admin_advertiser_id
+        order by 1
     </select>
 
     <insert id="replaceProductReportDailies">

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

@@ -13,9 +13,9 @@ import java.util.List;
  */
 public interface IBytedanceCdpProjectService {
 
-    void getpromotionList(Long advertiserId, JSONArray ids, String date);
+    void getPromotionList(Long advertiserId, JSONArray ids, String date, Long errorId, Integer isLog);
 
-    void getProjectList(Long advertiserId, JSONArray ids,String type, String date);
+    void getProjectList(Long advertiserId, JSONArray ids,String type, String date, Long errorId, Integer isLog);
 
     List<Long> queryAllAdverIdList(String type);
 

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

@@ -1,7 +1,9 @@
 package cn.com.ctop.job.bytedance.data.service.impl;
 
 import cn.com.ctop.job.bytedance.data.entity.BytedanceCdpProject;
+import cn.com.ctop.job.bytedance.data.entity.BytedanceErrorLog;
 import cn.com.ctop.job.bytedance.data.mapper.BytedanceCdpProjectMapper;
+import cn.com.ctop.job.bytedance.data.mapper.BytedancePromoterReportMapper;
 import cn.com.ctop.job.bytedance.data.mapper.BytedanceRefreshTokenMapper;
 import cn.com.ctop.job.bytedance.data.service.IBytedanceCdpProjectService;
 import cn.com.ctop.job.bytedance.data.utils.*;
@@ -39,6 +41,9 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
     @Autowired
     private BytedanceRefreshTokenMapper tokenMapper;
 
+    @Autowired
+    private BytedancePromoterReportMapper promoterReportMapper;
+
     @Override
     public List<Long> queryAllAdverIdList(String type) {
         return bytedanceCdpProjectMapper.queryAllAdverIdList(type);
@@ -75,11 +80,11 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
     }
 
     @Override
-    public void getpromotionList(Long advertiserId, JSONArray ids, String date) {
-        this.getpromotionListVo(advertiserId, ids, date, 1, 1);
+    public void getPromotionList(Long advertiserId, JSONArray ids, String date, Long errorId, Integer isLog) {
+        this.getPromotionListVo(advertiserId, ids, date, 1, 1, errorId, isLog);
     }
 
-    private void getpromotionListVo(Long advertiserId, JSONArray ids, String date, Integer page, int count) {
+    private void getPromotionListVo(Long advertiserId, JSONArray ids, String date, Integer page, int count, Long errorId, Integer isLog) {
         try {
             log.info("执行id:{}", advertiserId);
             boolean nextPage = false;
@@ -126,18 +131,21 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                             log.info("---账户({})广告更新成功", advertiserId);
                     }*/
                 } else {
-                    //40100请求超频
-                    if (40100 == code && count <= 5) {
+                    //40100请求超频 (40100 == code || 40110 == code || 40130 == code) &&
+                    if (count <= 5) {
                         Thread.sleep(800);
-                        getpromotionListVo(advertiserId, ids, date, page, count + 1);
+                        getPromotionListVo(advertiserId, ids, date, page, count + 1, errorId, isLog);
                     } else {
+                        insertErrorLog(isLog, advertiserId, "-", "-", "promotion_list", results);
                         log.error("获取广告列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                     }
                     return;
                 }
             }
             if (nextPage) {
-                getpromotionListVo(advertiserId, ids, date, page + 1, 1);
+                getPromotionListVo(advertiserId, ids, date, page + 1, 1, errorId, isLog);
+            } else if (errorId != null) {
+                promoterReportMapper.deleteInfoByErrorId(errorId);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -149,6 +157,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
         entity.put("advertiser_id", advertiserId);
         JSONObject promotionMaterials = entity.getJSONObject("promotion_materials");
         if (!Check.isNull(promotionMaterials)) {
+            entity.put("external_url_material_list", promotionMaterials.getString("external_url_material_list"));
             entity.put("playlet_series_url_list", promotionMaterials.getString("playlet_series_url_list"));
             JSONObject miniProgramInfo = promotionMaterials.getJSONObject("mini_program_info");
             if (!Check.isNull(miniProgramInfo)) {
@@ -164,12 +173,11 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
     }
 
     @Override
-    public void getProjectList(Long advertiserId, JSONArray ids, String type, String date) {
-        this.getProjectListVo(advertiserId, ids, type, date, 1, 1);
-//        this.getProjectListVo(advertiserId, "del", date, 1, 1);
+    public void getProjectList(Long advertiserId, JSONArray ids, String type, String date, Long errorId, Integer isLog) {
+        this.getProjectListVo(advertiserId, ids, type, date, 1, 1, errorId, isLog);
     }
 
-    private void getProjectListVo(Long advertiserId, JSONArray ids, String type, String date, Integer page, int count) {
+    private void getProjectListVo(Long advertiserId, JSONArray ids, String type, String date, Integer page, int count, Long errorId, Integer isLog) {
         try {
             boolean nextPage = false;
             String accessToken = tokenMapper.onlyGetToken(advertiserId);
@@ -219,18 +227,21 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                             log.info("---账户({})项目信息更新成功", advertiserId);
                     }
                 } else {
-                    //40100请求超频
-                    if (40100 == code && count <= 5) {
+                    //40100请求超频 (40100 == code || 40110 == code || 40130 == code) &&
+                    if (count <= 5) {
                         Thread.sleep(800);
-                        getProjectListVo(advertiserId, ids, type, date, page, count + 1);
+                        getProjectListVo(advertiserId, ids, type, date, page, count + 1, errorId, isLog);
                     } else {
+                        insertErrorLog(isLog, advertiserId, "-", "-", "project_list", results);
                         log.error("获取项目列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                     }
                     return;
                 }
             }
             if (nextPage) {
-                getProjectListVo(advertiserId, ids, type, date, page + 1, 1);
+                getProjectListVo(advertiserId, ids, type, date, page + 1, 1, errorId, isLog);
+            } else if (errorId != null) {
+                promoterReportMapper.deleteInfoByErrorId(errorId);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -543,7 +554,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
         }
         if (nextPage) {
             rebackadqCreativesVo(accountId, accessToken, startDate, endDate, page + 1, isDeleted, 1);
-        }else{
+        } else {
             log.info("账户({})获取动态创意完成", accountId);
         }
     }
@@ -651,7 +662,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
             List<String> imageIds = new ArrayList<>();
             List<String> videoIds = new ArrayList<>();
             JSONArray videoArr = creativeComponents.getJSONArray("video");
-            if(!Check.isNull(videoArr)) {
+            if (!Check.isNull(videoArr)) {
                 for (int i = 0; i < videoArr.size(); i++) {
                     JSONObject obj = videoArr.getJSONObject(i);
                     JSONObject value = obj.getJSONObject("value");
@@ -662,7 +673,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                 }
             }
             JSONArray imageArr = creativeComponents.getJSONArray("image");
-            if(!Check.isNull(imageArr)) {
+            if (!Check.isNull(imageArr)) {
                 for (int i = 0; i < imageArr.size(); i++) {
                     JSONObject obj = imageArr.getJSONObject(i);
                     JSONObject value = obj.getJSONObject("value");
@@ -673,7 +684,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                 }
             }
             JSONArray imageListArr = creativeComponents.getJSONArray("image_list");
-            if(!Check.isNull(imageListArr)) {
+            if (!Check.isNull(imageListArr)) {
                 for (int i = 0; i < imageListArr.size(); i++) {
                     JSONObject obj = imageListArr.getJSONObject(i);
                     JSONObject value = obj.getJSONObject("value");
@@ -691,10 +702,10 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                     }
                 }
             }
-            if (!Check.isNull(videoIds)){
+            if (!Check.isNull(videoIds)) {
                 object.put("video_list", StringUtils.join(videoIds, ","));
             }
-            if (!Check.isNull(imageIds)){
+            if (!Check.isNull(imageIds)) {
                 object.put("image_list", StringUtils.join(imageIds, ","));
             }
 
@@ -766,4 +777,17 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
             }
         }
     }
+
+    private void insertErrorLog(Integer isLog, Long advertiserId, String startDate, String endDate, String dataDimension, String msg) {
+        if (isLog != null && 1 == isLog) {
+            BytedanceErrorLog errorInfo = new BytedanceErrorLog();
+            errorInfo.setAdvertiserId(advertiserId);
+            errorInfo.setStartDate(startDate);
+            errorInfo.setEndDate(endDate);
+            errorInfo.setMsg(msg);
+            errorInfo.setDataDimension(dataDimension);
+            errorInfo.setDataType("daily");
+            promoterReportMapper.replaceErrorInfo(errorInfo);
+        }
+    }
 }

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

@@ -48,8 +48,8 @@ public class BytedanceCdpProjectJob {
 
             List<String> days = DateUtils.getDays("2025-06-01", "2025-07-22");
             for (String day : days) {
-                ids.forEach(id -> projectExecutorService.submit(() -> cdpProjectService.getProjectList(id, null, null, day)));
-                ids.forEach(id -> promExecutorService.submit(() -> cdpProjectService.getpromotionList(id, null, day)));
+                ids.forEach(id -> projectExecutorService.submit(() -> cdpProjectService.getProjectList(id, null, null, day,null,1)));
+                ids.forEach(id -> promExecutorService.submit(() -> cdpProjectService.getPromotionList(id, null, day,null,1)));
             }
         }
     }
@@ -80,8 +80,8 @@ public class BytedanceCdpProjectJob {
             String today = DateUtils.getNowDate("yyyy-MM-dd");
             List<Long> nowAdIds = cdpProjectService.queryAdvertiserIds("bytedance_advertiser_report_hour", DateUtils.getYYMMDDTime(today));
             if (!Check.isNull(nowAdIds)) {
-                nowAdIds.forEach(id -> projectExecutorService.submit(() -> cdpProjectService.getProjectList(id, null, null, today)));
-                nowAdIds.forEach(id -> promExecutorService.submit(() -> cdpProjectService.getpromotionList(id, null, today)));
+                nowAdIds.forEach(id -> projectExecutorService.submit(() -> cdpProjectService.getProjectList(id, null, null, today,null,1)));
+                nowAdIds.forEach(id -> promExecutorService.submit(() -> cdpProjectService.getPromotionList(id, null, today,null,1)));
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -97,15 +97,15 @@ public class BytedanceCdpProjectJob {
             String yesterday = DateUtils.getNowAddDate("yyyy-MM-dd", -1);
             List<Long> adIds = cdpProjectService.queryAdvertiserIds("bytedance_advertiser_report_daily", DateUtils.getYYMMDDTime(yesterday));
             if (!Check.isNull(adIds)) {
-                adIds.forEach(id -> projectExecutorService.submit(() -> cdpProjectService.getProjectList(id, null, null, yesterday)));
-                adIds.forEach(id -> promExecutorService.submit(() -> cdpProjectService.getpromotionList(id, null, yesterday)));
+                adIds.forEach(id -> projectExecutorService.submit(() -> cdpProjectService.getProjectList(id, null, null, yesterday,null,1)));
+                adIds.forEach(id -> promExecutorService.submit(() -> cdpProjectService.getPromotionList(id, null, yesterday,null,1)));
             }
             //拉取前天数据
             String yesterday2 = DateUtils.getNowAddDate("yyyy-MM-dd", -2);
             List<Long> adIds2 = cdpProjectService.queryAdvertiserIds("bytedance_advertiser_report_daily", DateUtils.getYYMMDDTime(yesterday2));
             if (!Check.isNull(adIds2)) {
-                adIds2.forEach(id -> projectExecutorService.submit(() -> cdpProjectService.getProjectList(id, null, null, yesterday2)));
-                adIds2.forEach(id -> promExecutorService.submit(() -> cdpProjectService.getpromotionList(id, null, yesterday2)));
+                adIds2.forEach(id -> projectExecutorService.submit(() -> cdpProjectService.getProjectList(id, null, null, yesterday2,null,1)));
+                adIds2.forEach(id -> promExecutorService.submit(() -> cdpProjectService.getPromotionList(id, null, yesterday2,null,1)));
             }
         } catch (Exception e) {
             e.printStackTrace();

+ 22 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceReportRetryJob.java

@@ -52,6 +52,9 @@ public class BytedanceReportRetryJob {
     @Autowired
     private IDianZhongService dianZhongService;
 
+    @Autowired
+    private IBytedanceCdpProjectService cdpProjectService;
+
     @Resource
     private DianZhongConfig dianZhongConfig;
 
@@ -153,6 +156,25 @@ public class BytedanceReportRetryJob {
                             }
                         }
                     });
+                } else if ("promotion_list".equals(dataDimension)) {
+                    productDailyRetrExecutor.submit(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (!Check.isNull(accessToken)) {
+                                cdpProjectService.getPromotionList(advertiserId, null, null, id, null);
+                            }
+                        }
+                    });
+                } else if ("project_list".equals(dataDimension)) {
+                    productDailyRetrExecutor.submit(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (!Check.isNull(accessToken)) {
+                                cdpProjectService.getProjectList(advertiserId, null, null, null, id, null);
+                                cdpProjectService.getProjectList(advertiserId, null, "del", null, id, null);
+                            }
+                        }
+                    });
                 }
 
 

+ 27 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/utils/doris/sink/SimpleHttpDorisSinkClient.java

@@ -1,10 +1,12 @@
 package cn.com.ctop.job.bytedance.utils.doris.sink;
 
 import cn.com.ctop.job.bytedance.data.utils.JsonUtils;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.HttpEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpPut;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
@@ -75,6 +77,7 @@ public class SimpleHttpDorisSinkClient implements DorisSinkClient {
 
         put.setEntity(new StringEntity(jsonBody, StandardCharsets.UTF_8));
 
+
         try (CloseableHttpClient httpClient = HttpClients.custom()
                 .setRedirectStrategy(new StrictRedirectStrategy())  // 支持 307/301 重定向
                 .build();
@@ -82,14 +85,37 @@ public class SimpleHttpDorisSinkClient implements DorisSinkClient {
             int code = response.getStatusLine().getStatusCode();
             HttpEntity entity = response.getEntity();
             String responseBody = EntityUtils.toString(entity, "UTF-8");
+            String fsWebhookUrl = "https://open.feishu.cn/open-apis/bot/v2/hook/371e7945-7258-4574-a2eb-d7cd0490f86c";
             if (code != 200 && code != 201) {
+                sendFsMessage(fsWebhookUrl, "stream load 异常 " + label, "Doris stream load failed. Status: " + code + ", response: " + responseBody);
                 throw new RuntimeException("Doris stream load failed. Status: " + code + ", response: " + responseBody);
             }
             // 可选: 解析返回内容判断 success
-            if (!responseBody.contains("\"Status\": \"Success\"")) {
+            if (!responseBody.contains("\"Status\": \"Success\"") || responseBody.contains("ErrorURL")) {
+                sendFsMessage(fsWebhookUrl, "stream load 异常 " + label, responseBody);
                 throw new RuntimeException("Stream load returned non-success: " + responseBody);
             }
             log.info("Doris stream load success: {}", responseBody);
         }
     }
+
+    //发送飞书消息
+    private static void sendFsMessage(String url, String head, String message) {
+        JSONObject body = new JSONObject();
+        body.put("msg_type", "interactive");
+        JSONArray elements = new JSONArray();
+        elements.add(new JSONObject()
+                .fluentPut("tag", "div")
+                .fluentPut("text", new JSONObject().fluentPut("content", message).fluentPut("tag", "lark_md")));
+        JSONObject header = new JSONObject().fluentPut("title", new JSONObject().fluentPut("content", head).fluentPut("tag", "plain_text"));
+        body.put("card", new JSONObject().fluentPut("elements", elements).fluentPut("header", header));
+        HttpPost httpPost = new HttpPost(url);
+        httpPost.setEntity(new StringEntity(body.toString(), StandardCharsets.UTF_8));
+        try (CloseableHttpClient httpClient = HttpClients.custom().build();
+             CloseableHttpResponse response = httpClient.execute(httpPost)) {
+            response.getStatusLine().getStatusCode();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }