ソースを参照

头条-监测链接

yangzian 3 年 前
コミット
45c8847f6d

+ 3 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedancePlanLoadJob.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -13,6 +14,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
 @Component
+@Slf4j
 public class BytedancePlanLoadJob {
     @Autowired
     private ICtopOauthTokenService tokenService;
@@ -27,6 +29,7 @@ public class BytedancePlanLoadJob {
     @XxlJob("bytedancePlanLoadJob")
     public void execute() throws Exception {
         //1:查询当日数据
+        log.info("============获取头条全量计划=================");
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         tokens.forEach(token -> executorService.submit(() -> advertiserDataService.getAdvertiserPlan(token, "", null, null)));
         XxlJobHelper.log("头条全量计划数据获取完成");

+ 11 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.toutiao.modules.material.entity;
 
 import cn.com.ctop.common.module.annotation.Dict;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -216,6 +217,12 @@ public class ByteDanceAdvertisePlan {
     @TableField(exist=false)
     private String useOpenUrl;
 
+
+    //点击监测链接
+    private String actionTrackUrl;
+
+
+
     public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
         this.id = dataObject.getLong("id");
         this.accountId = accountId;
@@ -391,6 +398,10 @@ public class ByteDanceAdvertisePlan {
         if (null != externalUrl && !"".equals(externalUrl.trim())) {
             this.externalUrl = externalUrl;
         }
+        JSONArray action_track_url = dataObject.getJSONArray("action_track_url");
+        if (!Check.isNull(action_track_url)){
+            this.actionTrackUrl = action_track_url.getString(0);
+        }
     }
 
     public ByteDanceAdvertisePlan(String advertiserId, Long adId, JSONObject params) {

+ 1 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -242,6 +242,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
                 advertisePlan.setDeepCpaBid(deepCpabid);
             }
             advertisePlanService.saveOrUpdate(advertisePlan);
+            log.info("============保存头条计划=================");
         }
         getAd(token, pageNum + 1, ids, date, updateDate);
     }