Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

zhaotx 1 rok temu
rodzic
commit
3c30d4b251

+ 22 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceController.java

@@ -32,7 +32,7 @@ public class BytedanceController {
     @Autowired
     @Autowired
     private IBytedanceProductReportService productReportService;
     private IBytedanceProductReportService productReportService;
 
 
-    private static final ExecutorService dailyRetrExecutorService = Executors.newFixedThreadPool(3);
+    private static final ExecutorService dailyRetrExecutorService = Executors.newFixedThreadPool(10);
 
 
     @Autowired
     @Autowired
     private IAdminAdvertiserListService adminAdvertiserListService;
     private IAdminAdvertiserListService adminAdvertiserListService;
@@ -182,6 +182,21 @@ public class BytedanceController {
     }
     }
 
 
     /**
     /**
+     * 补全有消耗字节项目数据
+     */
+    @GetMapping("/costProject")
+    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(() -> {
+                Long adverId = jsonObject.getLong("advertiserId");
+                cdpProjectService.getProjectList(adverId, null, null, null);
+                cdpProjectService.getProjectList(adverId, null, "del", null);
+            });
+        }
+    }
+
+    /**
      * 回调补全字节项目数据
      * 回调补全字节项目数据
      */
      */
     @RequestMapping("/rebackProjectInfo")
     @RequestMapping("/rebackProjectInfo")
@@ -273,4 +288,10 @@ public class BytedanceController {
         }
         }
     }
     }
 
 
+
+    @GetMapping("/getWxAppInfo")
+    public void getWxAppInfo(Long advertiserId) {
+        cdpProjectService.getWxAppInfo(advertiserId);
+    }
+
 }
 }

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

@@ -156,6 +156,8 @@ public class BytedanceCdpProject {
     private Double bid;
     private Double bid;
     private Double cpaBid ;
     private Double cpaBid ;
     private Double deepCpabid ;
     private Double deepCpabid ;
+    private Double searchBidRatio;
+    private Double roiGoal;
 
 
 
 
     /**
     /**
@@ -205,6 +207,7 @@ public class BytedanceCdpProject {
         this.microPromotionType = o.getString("micro_promotion_type");
         this.microPromotionType = o.getString("micro_promotion_type");
         this.quickAppId = o.getLong("quick_app_id");
         this.quickAppId = o.getLong("quick_app_id");
         this.microAppInstanceId = o.getLong("micro_app_instance_id");
         this.microAppInstanceId = o.getLong("micro_app_instance_id");
+        this.searchBidRatio = o.getDouble("search_bid_ratio");
         JSONObject optimizeGoal = o.getJSONObject("optimize_goal");
         JSONObject optimizeGoal = o.getJSONObject("optimize_goal");
         if (!Check.isNull(optimizeGoal)) {
         if (!Check.isNull(optimizeGoal)) {
             this.externalAction = optimizeGoal.getString("external_action");
             this.externalAction = optimizeGoal.getString("external_action");
@@ -218,6 +221,7 @@ public class BytedanceCdpProject {
             this.bid = deliverySetting.getDouble("bid");
             this.bid = deliverySetting.getDouble("bid");
             this.cpaBid = deliverySetting.getDouble("cpa_bid");
             this.cpaBid = deliverySetting.getDouble("cpa_bid");
             this.deepCpabid = deliverySetting.getDouble("deep_cpabid");
             this.deepCpabid = deliverySetting.getDouble("deep_cpabid");
+            this.roiGoal = deliverySetting.getDouble("roi_goal");
         }
         }
     }
     }
 }
 }

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

@@ -133,6 +133,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                     } else {
                     } else {
                         log.error("获取广告列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                         log.error("获取广告列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                     }
                     }
+                    return;
                 }
                 }
             }
             }
             if (nextPage) {
             if (nextPage) {
@@ -225,6 +226,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                     } else {
                     } else {
                         log.error("获取项目列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                         log.error("获取项目列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                     }
                     }
+                    return;
                 }
                 }
             }
             }
             if (nextPage) {
             if (nextPage) {
@@ -403,9 +405,13 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
 
 
                         for (Object o : list) {
                         for (Object o : list) {
                             JSONObject json = (JSONObject) o;
                             JSONObject json = (JSONObject) o;
-                            json.put("advertiser_id", advertiserId);
-                            json.put("app_name", json.getString("name"));
-                            dorisLoadManager.add("media_api", "bytedance_wx_app_info", json);
+                            JSONObject jsonObject = new JSONObject();
+                            jsonObject.put("advertiser_id", advertiserId);
+                            jsonObject.put("app_name", json.getString("name"));
+                            jsonObject.put("instance_id", json.getString("instance_id"));
+                            jsonObject.put("user_nme", json.getString("user_name"));
+                            jsonObject.put("path", json.getString("path"));
+                            dorisLoadManager.add("media_api", "bytedance_wx_app_info", jsonObject);
                         }
                         }
                     }
                     }