zhaotx 1 год назад
Родитель
Сommit
9ad484a4d6

+ 3 - 0
.gitignore

@@ -32,3 +32,6 @@ gen
 hs_err_pid*
 **/target/
 #application.yml
+
+
+/http

+ 14 - 2
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/FeishuController.java

@@ -42,13 +42,15 @@ public class FeishuController {
     IDianzhongConfigService dianzhongConfigService;
     @Autowired
     IFeishuService feishuService;
+    @Autowired
+    private ICPSReportService cpsReportService;
 
     @Autowired
     IUserLoginRecordService userLoginRecordService;
     @PostMapping("/test")
     public void test(@RequestBody String str) throws Exception {
 //        bytedanceProductUpdateService.initNew();
-//        bytedanceProductUpdateService.run();
+        bytedanceProductUpdateService.run();
 //        reportsAdPushService.test();
 //        totalRankPushService.test();
 //        dateReportsPushService.preSend();
@@ -56,7 +58,7 @@ public class FeishuController {
 //        unbindWarnPushService.send();
 //        cutGroupRankPushService.send();
 //        reportsByBusinessPushService.test();
-        feishuService.uploadAvatar();
+//        feishuService.uploadAvatar();
 //        csjResoureJob.csjResourceOssJob();
 //    dianzhongConfigService.pullMovieInfo("2025-08-08", 78012L);
 //        dianzhongConfigService.pullChannelInfo();
@@ -64,6 +66,16 @@ public class FeishuController {
 //        dianzhongConfigService.pullMovie();
 //        dianzhongConfigService.movieImageToOss();
 //    dianzhongConfigService.syncPromoteLinkInfo();
+
+//        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        //2025-08-01 ~ 2025-08-31 foreach
+//        String nowDate = "2025-09-01";
+//        for (int i = 1; i <= 16; i++) {
+//            String date = "2025-09-" + (i < 10 ? "0" + i : i);
+//            System.out.println("处理日期:" + date);
+//            cpsReportService.runCPSSettlementData(date);
+//            System.out.println("\n\n");
+//        }
     }
 
 

+ 15 - 5
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedanceProductUpdateServiceImpl.java

@@ -100,7 +100,7 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
                     continue;
                 }
                 if (!productTypeMap.containsKey(album.getTheme())){
-                    errors.add("上传商品:没有找到对应的产品类型:" + album.getTheme());
+//                    errors.add("上传商品:没有找到对应的产品类型:" + album.getTheme());
                     System.out.println(">>>>没有找到对应的产品类型:" + album.getTheme());
                     System.out.println("\n\n\n");
                     continue;
@@ -108,7 +108,7 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
                 String schemaLink = null;
                 if (platform.getIsBytedance()==1){
                     if (!albumIdToLinkMap.containsKey(album.getAlbumId())){
-                        errors.add("上传商品:没有找到对应的推广链接,无法上传商品,剧目ID:" + album.getAlbumId() + ", 剧目名称:" + album.getName());
+//                        errors.add("上传商品:没有找到对应的推广链接,无法上传商品,剧目ID:" + album.getAlbumId() + ", 剧目名称:" + album.getName());
                         System.out.println(">>>>没有找到对应的推广链接,无法上传商品,剧目ID:" + album.getAlbumId() + ", 剧目名称:" + album.getName());
                         System.out.println("\n\n\n");
                         continue;
@@ -468,9 +468,19 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
                 JSONObject jsonObject = JSONObject.parseObject(rr);
                 int code = jsonObject.getIntValue("code");
                 if (code != 0) {
-                    errorBlanket.add("创建字节小程序推广链接失败,code: " + code + ", msg: " + jsonObject.getString("message") + ", 广告账号ID:" + advertiserId + ", 小程序资产ID:" + instanceId);
-                    System.out.println("创建字节小程序推广链接失败,code: " + code + ", msg: " + jsonObject.getString("message"));
-                    continue;
+                    String message = jsonObject.getString("message");
+                    if (message.contains("资产非审核成功")){
+                        errorBlanket.add("字节小程序"+instanceId+"未通过审核,等待下次再试");
+                        break;
+                    }else if (message.contains("请求频率超限")){
+                        errorBlanket.add("广告账号"+advertiserId+"请求频率超限");
+                        continue;
+                    } else {
+                        errorBlanket.add("创建字节小程序推广链接失败,code: " + code + ", msg: " + jsonObject.getString("message") + ", 广告账号ID:" + advertiserId + ", 小程序资产ID:" + instanceId);
+                        System.out.println("创建字节小程序推广链接失败,code: " + code + ", msg: " + jsonObject.getString("message"));
+                        continue;
+                    }
+
                 }else {
 
                 }