瀏覽代碼

添加无参构造器

syh 4 年之前
父節點
當前提交
886aec252b

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/RuleDataAccount.java

@@ -62,4 +62,7 @@ public class RuleDataAccount {
 	/**updateTime*/
     @ApiModelProperty(value = "updateTime")
 	private Date updateTime;
+
+	public RuleDataAccount() {
+	}
 }

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/RuleDataCreative.java

@@ -35,4 +35,7 @@ public class RuleDataCreative {
 	private Integer status;
 	private Date createTime;
 	private Date updateTime;
+
+	public RuleDataCreative() {
+	}
 }

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/entity/RuleDataPlan.java

@@ -45,8 +45,8 @@ public class RuleDataPlan {
 	private Date updateTime;
 
 	public RuleDataPlan() {
-
 	}
+
 	public RuleDataPlan(JSONObject data, Long accountId) {
 		Long nextDayOpen = data.getLong("attribution_next_day_open_cnt");
 		if (null != nextDayOpen) {

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/RuleDataTarget.java

@@ -71,4 +71,7 @@ public class RuleDataTarget {
 	private Integer status;
 	private Date createTime;
 	private Date updateTime;
+
+	public RuleDataTarget() {
+	}
 }

+ 40 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDancePlanRuleDataJob.java

@@ -0,0 +1,40 @@
+package cn.com.ctop.job.bytedance.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class ByteDancePlanRuleDataJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IReportService reportService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(10);
+
+    @XxlJob("bytedancePlanLoadJob")
+    public ReturnT<String> execute(String param) throws Exception {
+        Date date = new Date();
+        if(null!=param&&!"".equals(param.trim())){
+            Long accountId = Long.parseLong(param);
+            CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+            reportService.getAdvertiserPlanRuleData(token,date,date,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        }else{
+            List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+            tokens.forEach(token -> executorService.submit(() -> reportService.getAdvertiserPlanRuleData(token,date,date, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY)));
+        }
+        XxlJobLogger.log("头条全量计划数据获取完成");
+        return ReturnT.SUCCESS;
+    }
+}