|
@@ -23,6 +23,7 @@ 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;
|
|
@@ -1230,4 +1231,50 @@ public class TestController {
|
|
|
IETLReportBytedanceVideoService etlReportBytedanceVideoService;
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IKuaishouAudienceReportDailyService kuaishouAudienceReportDailyService;
|
|
|
+ @Autowired
|
|
|
+ private IKuaiShouGroupService kuaiShouGroupService;
|
|
|
+ @Autowired
|
|
|
+ private IKuaishouStrategyService kuaishouStrategyService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 勿动勿删,煜一人群报表数据拉取接口。
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return void
|
|
|
+ * @throws
|
|
|
+ * @author ZHAOXA
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/getAudienceData")
|
|
|
+ public Result getAudienceData(@RequestBody JSONObject request) throws Exception {
|
|
|
+ Long accountId = request.getLong("accountId");
|
|
|
+ Long planId = request.getLong("planId");
|
|
|
+ Long unitId = request.getLong("unitId");
|
|
|
+ String type = request.getString("type");
|
|
|
+ String startTime = request.getString("startTime");
|
|
|
+ String endTime = request.getString("endTime");
|
|
|
+ if (Check.isNull(accountId) || Check.isNull(planId) || Check.isNull(unitId) || Check.isNull(type) || Check.isNull(endTime) || Check.isNull(startTime)) {
|
|
|
+ return Result.error("缺少参数");
|
|
|
+ }
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
|
|
|
+ List<String> dayList = new ArrayList<>();
|
|
|
+ if (startTime.equals(endTime)) {
|
|
|
+ dayList.add(startTime);
|
|
|
+ } else {
|
|
|
+ dayList = DateUtils.getDays(startTime, endTime);
|
|
|
+ }
|
|
|
+ ExecutorService executorServic1e = Executors.newFixedThreadPool(8);
|
|
|
+ int page = 1;
|
|
|
+ int pageSize = 2000;
|
|
|
+ dayList.forEach(date -> executorServic1e.submit(() -> {
|
|
|
+ try {
|
|
|
+ kuaishouAudienceReportDailyService.crowdAnalysisReport(token, date, type, planId, unitId, page, pageSize);
|
|
|
+ Thread.sleep(500);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ log.error("获取人群消息异常", e);
|
|
|
+ }
|
|
|
+ }));
|
|
|
+ return Result.ok("success");
|
|
|
+ }
|
|
|
}
|