|
@@ -1,8 +1,6 @@
|
|
package org.jeecg.modules.ctop.job;
|
|
package org.jeecg.modules.ctop.job;
|
|
|
|
|
|
-import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
-import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.quartz.Job;
|
|
import org.quartz.Job;
|
|
@@ -10,9 +8,7 @@ import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionException;
|
|
import org.quartz.JobExecutionException;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
-import java.util.concurrent.Executors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取文件状态并下载入库
|
|
* 获取文件状态并下载入库
|
|
@@ -32,22 +28,9 @@ public class KuaishouHistoryLoadFileJob implements Job {
|
|
Thread thread = new Thread() {
|
|
Thread thread = new Thread() {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
- // 查询快手token
|
|
|
|
- List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
|
|
|
|
- if (null == tokens || tokens.size() <= 0) {
|
|
|
|
- log.info("定时获取快手数据异常:未获取到可用的token");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- executorService = Executors.newFixedThreadPool(3);
|
|
|
|
- for (CtopOauthToken token : tokens) {
|
|
|
|
- executorService.submit(new Runnable() {
|
|
|
|
- @Override
|
|
|
|
- public void run() {
|
|
|
|
- historyReportTaskService.getTaskList();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ historyReportTaskService.getTaskList();
|
|
}
|
|
}
|
|
|
|
+
|
|
};
|
|
};
|
|
thread.start();
|
|
thread.start();
|
|
|
|
|