|
@@ -23,7 +23,6 @@ import cn.com.ctop.toutiao.modules.report.service.*;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.xxl.job.core.context.XxlJobHelper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
@@ -1367,35 +1366,16 @@ public class TestController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private ExecutorService executor = Executors.newFixedThreadPool(10);
|
|
|
- private CountDownLatch countDownLatch;
|
|
|
@Autowired
|
|
|
IBytedanceVideoReportService bytedanceVideoReportService;
|
|
|
@Autowired
|
|
|
IETLReportBytedanceVideoService etlReportBytedanceVideoService;
|
|
|
@GetMapping("execute")
|
|
|
- public Map<String,Object> execute(String date) throws Exception {
|
|
|
+ public Map<String,Object> execute(Long accountId) throws Exception {
|
|
|
Map<String,Object>result = new HashMap<>();
|
|
|
-// List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
|
|
|
-// countDownLatch = new CountDownLatch(tokens.size());
|
|
|
-// tokens.forEach(token -> executor.submit(() -> {
|
|
|
-// try {
|
|
|
-// bytedanceVideoReportService.pullVideoReport(token,date,date,1);
|
|
|
-// } catch (Exception e) {
|
|
|
-// XxlJobHelper.log("头条视频报表基础数据拉取异常:{}",e.getMessage());
|
|
|
-// } finally {
|
|
|
-// countDownLatch.countDown();
|
|
|
-// }
|
|
|
-// }));
|
|
|
-// try {
|
|
|
-// countDownLatch.await();
|
|
|
-// } catch (InterruptedException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
- Map<String,Object> params = new HashMap<>();
|
|
|
- params.put("stat_datetime",date);
|
|
|
- etlReportBytedanceVideoService.removeByMap(params);
|
|
|
- etlReportBytedanceVideoService.cleanETL(date);
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
|
|
|
+ kuaishouInterfaceService.getGroupList(token,new Date(),new Date());
|
|
|
+ kuaishouInterfaceService.getAdvertiserGroupReportDaily(token,new Date(),new Date());
|
|
|
ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|