|
@@ -3,7 +3,6 @@ package cn.com.ctop.job.bytedance.handler;
|
|
/**
|
|
/**
|
|
* Created by JQ.bi on 2020.11.16
|
|
* Created by JQ.bi on 2020.11.16
|
|
*/
|
|
*/
|
|
-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.toutiao.modules.report.service.IRuleByteDanceAccountService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IRuleByteDanceAccountService;
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
@@ -12,8 +11,6 @@ import com.xxl.job.core.log.XxlJobLogger;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-
|
|
|
|
-import java.util.List;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
@@ -31,18 +28,12 @@ public class RuleDataAccountCleanJob {
|
|
@XxlJob("ruleDataAccountCleanJob")
|
|
@XxlJob("ruleDataAccountCleanJob")
|
|
public ReturnT<String> execute(String param) throws Exception {
|
|
public ReturnT<String> execute(String param) throws Exception {
|
|
XxlJobLogger.log("规则预警账户维度数据开始清洗");
|
|
XxlJobLogger.log("规则预警账户维度数据开始清洗");
|
|
- //查询所有头条账户
|
|
|
|
- List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
|
|
|
|
- if (null == tokens || tokens.isEmpty()) {
|
|
|
|
- XxlJobLogger.log("未获取到可用的token");
|
|
|
|
|
|
+ if (null == param || "".equals(param.trim())) {
|
|
|
|
+ XxlJobLogger.log("参数异常");
|
|
return ReturnT.FAIL;
|
|
return ReturnT.FAIL;
|
|
}
|
|
}
|
|
- tokens.forEach(token->executorPool.submit(() -> {
|
|
|
|
- ruleByteDanceAccountService.cleanRuleDataAccount(token.getAccountId());
|
|
|
|
- }));
|
|
|
|
- if(!executorPool.isShutdown()){
|
|
|
|
- executorPool.shutdown();
|
|
|
|
- }
|
|
|
|
|
|
+ Long accountId = Long.parseLong(param);
|
|
|
|
+ ruleByteDanceAccountService.cleanRuleDataAccount(accountId);
|
|
XxlJobLogger.log("规则预警账户维度数据清洗结束");
|
|
XxlJobLogger.log("规则预警账户维度数据清洗结束");
|
|
return ReturnT.SUCCESS;
|
|
return ReturnT.SUCCESS;
|
|
}
|
|
}
|