|
@@ -94,22 +94,11 @@ public class TestController {
|
|
private IKuaishouInterfaceService2 kuaishouInterfaceService2;
|
|
private IKuaishouInterfaceService2 kuaishouInterfaceService2;
|
|
@Autowired
|
|
@Autowired
|
|
private IUserAllocationService userAllocationService;
|
|
private IUserAllocationService userAllocationService;
|
|
- @Autowired
|
|
|
|
- private DouyinMusicService douyinMusicService;
|
|
|
|
- @Autowired
|
|
|
|
- private CrawlerDouyinMusicTaskService crawlerDouyinMusicTaskService;
|
|
|
|
- @Autowired
|
|
|
|
- private MusicInfoService musicInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
|
|
|
|
-
|
|
|
|
static ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
static ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaiShouDailyAgentService dailyAgentService;
|
|
private IKuaiShouDailyAgentService dailyAgentService;
|
|
@Autowired
|
|
@Autowired
|
|
- private IKuaishouTemplateService templateService;
|
|
|
|
- @Autowired
|
|
|
|
private ICtopOauthTokenService ctopOauthTokenService;
|
|
private ICtopOauthTokenService ctopOauthTokenService;
|
|
@Autowired
|
|
@Autowired
|
|
private IBindAccountAuthService bindAccountAuthService;
|
|
private IBindAccountAuthService bindAccountAuthService;
|
|
@@ -125,7 +114,6 @@ public class TestController {
|
|
private IKuaiShouProjectDataService kuaiShouProjectDataService;
|
|
private IKuaiShouProjectDataService kuaiShouProjectDataService;
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
|
|
private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaiShouCreativeService creativeService;
|
|
private IKuaiShouCreativeService creativeService;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -134,7 +122,6 @@ public class TestController {
|
|
private MailLogMapper mailLogMapper;
|
|
private MailLogMapper mailLogMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private CorpWexinUtils corpWexinUtils;
|
|
private CorpWexinUtils corpWexinUtils;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IBatchService batchService;
|
|
private IBatchService batchService;
|
|
static ExecutorService videoService = Executors.newFixedThreadPool(8);
|
|
static ExecutorService videoService = Executors.newFixedThreadPool(8);
|
|
@@ -144,30 +131,29 @@ public class TestController {
|
|
private IKuaishouProgramCreativeService kuaishouProgramCreativeService;
|
|
private IKuaishouProgramCreativeService kuaishouProgramCreativeService;
|
|
@Autowired
|
|
@Autowired
|
|
private IEtlKuaishouVideoInfoService etlKuaishouVideoInfoService;
|
|
private IEtlKuaishouVideoInfoService etlKuaishouVideoInfoService;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IByteDanceAdvertiserDataService advertiserDataService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IReportService reportService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IBytedanceEffectVideoInfoService effectVideoInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ public IBytedanceInterfaceService bytedanceInterfaceService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaiShouCommentService kuaiShouCommentService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IBytedanceVideoReportService bytedanceVideoReportService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IETLReportBytedanceVideoService etlReportBytedanceVideoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaishouAudienceReportDailyService kuaishouAudienceReportDailyService;
|
|
|
|
+ static ExecutorService executorServic1e = Executors.newFixedThreadPool(5);
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaiShouDailyReportTaskService dailyReportTaskService;
|
|
|
|
|
|
@Value("${xxl-job.requestUrl}")
|
|
@Value("${xxl-job.requestUrl}")
|
|
private String jobUrl;
|
|
private String jobUrl;
|
|
|
|
|
|
-//
|
|
|
|
-// @PostConstruct
|
|
|
|
-// public void haha(){
|
|
|
|
-// System.out.println("开始拉取数据~~~~~");
|
|
|
|
-// CtopOauthToken token = tokenService.getTokenByAccountId(9556431l);
|
|
|
|
-// JSONArray types = new JSONArray();
|
|
|
|
-// // province: 省级地域分布, city: 地级地域分布,gender: 性别分布,ageSegment: 年龄分布, clientId: 系统分布 businessInterestTags: 商业兴趣分布
|
|
|
|
-//
|
|
|
|
-// types.add("province");
|
|
|
|
-// types.add("city");
|
|
|
|
-// types.add("gender");
|
|
|
|
-// types.add("ageSegment");
|
|
|
|
-// types.add("businessInterestTags");
|
|
|
|
-// types.add("clientId");
|
|
|
|
-// kuaishouAudienceReportDailyService.crowdAnalysisReport3(token, "2021-05-01", types, 50293820l, 216264247l, 1, 2000);
|
|
|
|
-// System.out.println("开始拉取完毕~~~~~");
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/cleanData")
|
|
@GetMapping(value = "/cleanData")
|
|
public void cleanData() {
|
|
public void cleanData() {
|
|
List<String> dateList = videoGetService.getDateList();
|
|
List<String> dateList = videoGetService.getDateList();
|
|
@@ -175,14 +161,11 @@ public class TestController {
|
|
String s = dateList.get(i);
|
|
String s = dateList.get(i);
|
|
etlKuaishouVideoInfoService.etlKuaishouVideoInfo(s);
|
|
etlKuaishouVideoInfoService.etlKuaishouVideoInfo(s);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/getProgramCreative")
|
|
@GetMapping(value = "/getProgramCreative")
|
|
public void getProgramCreative() {
|
|
public void getProgramCreative() {
|
|
List<Long> list = new ArrayList();
|
|
List<Long> list = new ArrayList();
|
|
-
|
|
|
|
list.add(10344460L);
|
|
list.add(10344460L);
|
|
list.add(10344415L);
|
|
list.add(10344415L);
|
|
list.add(10344390L);
|
|
list.add(10344390L);
|
|
@@ -251,7 +234,6 @@ public class TestController {
|
|
list.add(9549313L);
|
|
list.add(9549313L);
|
|
list.add(9549277L);
|
|
list.add(9549277L);
|
|
|
|
|
|
-
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
Long accountId = list.get(i);
|
|
Long accountId = list.get(i);
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
@@ -278,8 +260,6 @@ public class TestController {
|
|
list.add(10299210L);
|
|
list.add(10299210L);
|
|
list.add(10299221L);
|
|
list.add(10299221L);
|
|
list.add(10299241L);
|
|
list.add(10299241L);
|
|
-
|
|
|
|
-
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
Long accountId = list.get(i);
|
|
Long accountId = list.get(i);
|
|
CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
|
|
CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
|
|
@@ -328,8 +308,6 @@ public class TestController {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -343,7 +321,6 @@ public class TestController {
|
|
list.add(9767717L);
|
|
list.add(9767717L);
|
|
list.add(9549313L);
|
|
list.add(9549313L);
|
|
|
|
|
|
-
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
Long accountId = list.get(i);
|
|
Long accountId = list.get(i);
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
@@ -434,9 +411,6 @@ public class TestController {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IKuaiShouUpdateService kuaiShouUpdateService;
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/updateCreative")
|
|
@GetMapping(value = "/updateCreative")
|
|
public void updateCreative() {
|
|
public void updateCreative() {
|
|
List<Long> list = new ArrayList();
|
|
List<Long> list = new ArrayList();
|
|
@@ -737,103 +711,10 @@ public class TestController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- @GetMapping(value = "/getMd5")
|
|
|
|
- public void getMd5() {
|
|
|
|
- kuaiShouHistoryReportTaskService.getMd5(null, null);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @GetMapping(value = "/syncDouyinMusicAsc")
|
|
|
|
- public String syncDouyinMusicAsc() {
|
|
|
|
- QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
|
|
|
|
- queryWrapper.eq("status", "init").orderByAsc("id").last(" limit 20");
|
|
|
|
-
|
|
|
|
- List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
|
-
|
|
|
|
- while (list != null && list.size() > 0) {
|
|
|
|
- for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
|
|
|
|
- MusicInfo musicInfo = new MusicInfo();
|
|
|
|
- musicInfo.setExtId(crawlerDouyinMusicTask.getId());
|
|
|
|
- musicInfo = douyinMusicService.getMusicInfo(musicInfo);
|
|
|
|
- musicInfoService.save(musicInfo);
|
|
|
|
- crawlerDouyinMusicTask.setStatus("done");
|
|
|
|
- crawlerDouyinMusicTaskService.updateById(crawlerDouyinMusicTask);
|
|
|
|
- }
|
|
|
|
- list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
|
- }
|
|
|
|
- return "success";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping(value = "/syncDouyinMusic")
|
|
|
|
- public String syncDouyinMusic() {
|
|
|
|
- for (int i = 0; i < 10; i++) {
|
|
|
|
- final int j = i;
|
|
|
|
- Thread thread = new Thread() {
|
|
|
|
- @Override
|
|
|
|
- public void run() {
|
|
|
|
- QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
|
|
|
|
- queryWrapper.eq("status", "init").likeLeft("id", j).orderByDesc("id").last(" limit 20");
|
|
|
|
- List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
|
- while (list != null && list.size() > 0) {
|
|
|
|
- log.info("【同步歌曲】第" + j + "线程正在处理:" + list.size() + "条数据");
|
|
|
|
- for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
|
|
|
|
- MusicInfo musicInfo = new MusicInfo();
|
|
|
|
- musicInfo.setExtId(crawlerDouyinMusicTask.getId());
|
|
|
|
- douyinMusicService.getMusicInfo(musicInfo);
|
|
|
|
- }
|
|
|
|
- list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- thread.start();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return "success";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping(value = "/parseDouyinMusic")
|
|
|
|
- public String parseDouyinMusic() {
|
|
|
|
- for (int i = 0; i < 10; i++) {
|
|
|
|
- final int j = i;
|
|
|
|
- Thread thread = new Thread() {
|
|
|
|
- @Override
|
|
|
|
- public void run() {
|
|
|
|
- QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
|
|
|
|
- queryWrapper.eq("status", "done").likeLeft("id", j).orderByDesc("id").last(" limit 20");
|
|
|
|
- List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
|
- while (list != null && list.size() > 0) {
|
|
|
|
- log.info("【解析分类】第" + j + "线程正在处理:" + list.size() + "条数据");
|
|
|
|
- for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
|
|
|
|
- QueryWrapper<MusicInfo> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
- queryWrapper1.eq("ext_id", crawlerDouyinMusicTask.getId()).last(" limit 1");
|
|
|
|
- MusicInfo musicInfo = musicInfoService.getOne(queryWrapper1);
|
|
|
|
- if (musicInfo != null) {
|
|
|
|
- douyinMusicService.parseTag(musicInfo);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- thread.start();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return "success";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping(value = "/testdouyinmusic")
|
|
|
|
- public String testDouyinMusic() {
|
|
|
|
- douyinMusicService.getHotMusicList();
|
|
|
|
- return "success";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/getDailyDataByProjectId")
|
|
@GetMapping(value = "/getDailyDataByProjectId")
|
|
public String getDailyDataByProjectId(Long projectId, String startDate, String endDate) {
|
|
public String getDailyDataByProjectId(Long projectId, String startDate, String endDate) {
|
|
Result<String> result = new Result<>();
|
|
Result<String> result = new Result<>();
|
|
try {
|
|
try {
|
|
-
|
|
|
|
QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
userAllocationQueryWrapper.eq("project_id", projectId);
|
|
userAllocationQueryWrapper.eq("project_id", projectId);
|
|
List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
|
|
List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
|
|
@@ -849,10 +730,7 @@ public class TestController {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
result.setSuccess(false);
|
|
result.setSuccess(false);
|
|
@@ -865,7 +743,6 @@ public class TestController {
|
|
public String getHistoryDataByProjectId(Long projectId, String startDate, String endDate) {
|
|
public String getHistoryDataByProjectId(Long projectId, String startDate, String endDate) {
|
|
Result<String> result = new Result<>();
|
|
Result<String> result = new Result<>();
|
|
try {
|
|
try {
|
|
-
|
|
|
|
QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
userAllocationQueryWrapper.eq("project_id", projectId);
|
|
userAllocationQueryWrapper.eq("project_id", projectId);
|
|
// userAllocationQueryWrapper.eq("account_status", 0);
|
|
// userAllocationQueryWrapper.eq("account_status", 0);
|
|
@@ -879,13 +756,9 @@ public class TestController {
|
|
CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
|
|
CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
|
|
if (!Check.isNull(ctopOauthTokens)) {
|
|
if (!Check.isNull(ctopOauthTokens)) {
|
|
historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDate, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
|
|
historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDate, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
result.setSuccess(false);
|
|
result.setSuccess(false);
|
|
@@ -893,7 +766,6 @@ public class TestController {
|
|
return "success";
|
|
return "success";
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/getDailyDataByAccountId")
|
|
@GetMapping(value = "/getDailyDataByAccountId")
|
|
public String getDailyDataByAccountId(Long accountId) {
|
|
public String getDailyDataByAccountId(Long accountId) {
|
|
Result<String> result = new Result<>();
|
|
Result<String> result = new Result<>();
|
|
@@ -906,7 +778,6 @@ public class TestController {
|
|
CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
|
|
CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
|
|
if (!Check.isNull(ctopOauthTokens)) {
|
|
if (!Check.isNull(ctopOauthTokens)) {
|
|
historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), statDate, statDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY);
|
|
historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), statDate, statDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY);
|
|
-
|
|
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -947,9 +818,6 @@ public class TestController {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // InputStream in, String fileName, String fileType, long fileSize, String fileSavePath
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -994,22 +862,6 @@ public class TestController {
|
|
return "Success";
|
|
return "Success";
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- @GetMapping(value = "/getAccountReport")
|
|
|
|
- public String getAccountReport(Long accountId, String startDate, String endDate) throws ParseException {
|
|
|
|
- QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
|
- oauthTokenQueryWrapper.eq("media_id", 2);
|
|
|
|
- oauthTokenQueryWrapper.eq("account_id", accountId);
|
|
|
|
- oauthTokenQueryWrapper.last("limit 1");
|
|
|
|
- CtopOauthToken token = tokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
|
- SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- Date date1 = sim.parse(startDate);
|
|
|
|
- Date date2 = sim.parse(endDate);
|
|
|
|
- // kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2);
|
|
|
|
- return "Success";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/updateCode")
|
|
@GetMapping(value = "/updateCode")
|
|
public String updateCode() {
|
|
public String updateCode() {
|
|
List<MaterialInfo> list = materialInfoService.list();
|
|
List<MaterialInfo> list = materialInfoService.list();
|
|
@@ -1070,7 +922,6 @@ public class TestController {
|
|
public String getHistoryData(String startDate, String endDate) {
|
|
public String getHistoryData(String startDate, String endDate) {
|
|
Result<String> result = new Result<>();
|
|
Result<String> result = new Result<>();
|
|
try {
|
|
try {
|
|
-
|
|
|
|
QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
tokenQueryWrapper.eq("media_id", 2);
|
|
tokenQueryWrapper.eq("media_id", 2);
|
|
List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
|
|
List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
|
|
@@ -1092,14 +943,12 @@ public class TestController {
|
|
public String getHistoryDataByAccountId(Long accountId, String startDte, String endDate) {
|
|
public String getHistoryDataByAccountId(Long accountId, String startDte, String endDate) {
|
|
Result<String> result = new Result<>();
|
|
Result<String> result = new Result<>();
|
|
try {
|
|
try {
|
|
-
|
|
|
|
QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
tokenQueryWrapper.eq("media_id", 2);
|
|
tokenQueryWrapper.eq("media_id", 2);
|
|
tokenQueryWrapper.eq("account_id", accountId);
|
|
tokenQueryWrapper.eq("account_id", accountId);
|
|
CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
|
|
CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
|
|
if (!Check.isNull(ctopOauthTokens)) {
|
|
if (!Check.isNull(ctopOauthTokens)) {
|
|
historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDte, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
|
|
historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDte, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
|
|
-
|
|
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -1123,7 +972,6 @@ public class TestController {
|
|
return "success";
|
|
return "success";
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/gerCreative")
|
|
@GetMapping(value = "/gerCreative")
|
|
public void gerCreative() {
|
|
public void gerCreative() {
|
|
QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
@@ -1166,8 +1014,6 @@ public class TestController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IKuaiShouDailyReportTaskService dailyReportTaskService;
|
|
|
|
|
|
|
|
@GetMapping("loadBytedanceHistoryData")
|
|
@GetMapping("loadBytedanceHistoryData")
|
|
public Map<String, Object> loadBytedanceHistoryData() {
|
|
public Map<String, Object> loadBytedanceHistoryData() {
|
|
@@ -1208,8 +1054,6 @@ public class TestController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IByteDanceAdvertiserDataService advertiserDataService;
|
|
|
|
|
|
|
|
@GetMapping("getBytedanceData")
|
|
@GetMapping("getBytedanceData")
|
|
public Map<String, Object> getBytedanceData() {
|
|
public Map<String, Object> getBytedanceData() {
|
|
@@ -1228,8 +1072,6 @@ public class TestController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IReportService reportService;
|
|
|
|
|
|
|
|
@GetMapping(value = "/getAllCreativeList")
|
|
@GetMapping(value = "/getAllCreativeList")
|
|
public void getAllCreativeList() {
|
|
public void getAllCreativeList() {
|
|
@@ -1290,8 +1132,6 @@ public class TestController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IBytedanceEffectVideoInfoService effectVideoInfoService;
|
|
|
|
|
|
|
|
@GetMapping("/bytedance/effectVideo/get")
|
|
@GetMapping("/bytedance/effectVideo/get")
|
|
public Map<String, Object> effectVideoGet(String date) {
|
|
public Map<String, Object> effectVideoGet(String date) {
|
|
@@ -1398,8 +1238,6 @@ public class TestController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- public IBytedanceInterfaceService bytedanceInterfaceService;
|
|
|
|
|
|
|
|
@GetMapping(value = "/searchLog")
|
|
@GetMapping(value = "/searchLog")
|
|
public Result searchLog(@Param("accountId") Long accountId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("operationTarget") Integer operationTarget) {
|
|
public Result searchLog(@Param("accountId") Long accountId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("operationTarget") Integer operationTarget) {
|
|
@@ -1447,8 +1285,6 @@ public class TestController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IKuaiShouCommentService kuaiShouCommentService;
|
|
|
|
|
|
|
|
@GetMapping("deleteComment")
|
|
@GetMapping("deleteComment")
|
|
public Map<String, Object> deleteComment(Long accountId) {
|
|
public Map<String, Object> deleteComment(Long accountId) {
|
|
@@ -1481,16 +1317,6 @@ public class TestController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- IBytedanceVideoReportService bytedanceVideoReportService;
|
|
|
|
- @Autowired
|
|
|
|
- IETLReportBytedanceVideoService etlReportBytedanceVideoService;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IKuaishouAudienceReportDailyService kuaishouAudienceReportDailyService;
|
|
|
|
- static ExecutorService executorServic1e = Executors.newFixedThreadPool(5);
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 勿动勿删,煜一人群报表数据拉取接口。
|
|
* 勿动勿删,煜一人群报表数据拉取接口。
|
|
*
|
|
*
|
|
@@ -1534,10 +1360,12 @@ public class TestController {
|
|
@Resource
|
|
@Resource
|
|
AiKuaishouUnitLevelOperationRecordMapper kuaishouUnitLevelOperationRecordMapper;
|
|
AiKuaishouUnitLevelOperationRecordMapper kuaishouUnitLevelOperationRecordMapper;
|
|
@GetMapping(value = "/getAudienceDataNew")
|
|
@GetMapping(value = "/getAudienceDataNew")
|
|
- public void getAudienceData() throws Exception {
|
|
|
|
|
|
+ public void getAudienceData(@RequestParam(required = false,defaultValue = "2019-01-01") String date) throws Exception {
|
|
int page = 1;
|
|
int page = 1;
|
|
int pageSize = 2000;
|
|
int pageSize = 2000;
|
|
- String mulDate = DateUtils.formatDate(DateUtils.addDay(DateUtils.getNowDate(), -1), "yyyy-MM-dd");
|
|
|
|
|
|
+ if(date.equals("2019-01-01")){
|
|
|
|
+ date = DateUtils.formatDate(DateUtils.addDay(DateUtils.getNowDate(), -1), "yyyy-MM-dd");
|
|
|
|
+ }
|
|
List<CtopOauthToken> tokens = tokenService.getByProjectId(458L); //淘特项目
|
|
List<CtopOauthToken> tokens = tokenService.getByProjectId(458L); //淘特项目
|
|
for (CtopOauthToken token : tokens) {
|
|
for (CtopOauthToken token : tokens) {
|
|
Date startDate = DateUtils.getNowDate();
|
|
Date startDate = DateUtils.getNowDate();
|
|
@@ -1550,15 +1378,16 @@ public class TestController {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
countDownLatch = new CountDownLatch(planIdsAndUnitIds.size());
|
|
countDownLatch = new CountDownLatch(planIdsAndUnitIds.size());
|
|
|
|
+ String finalDate = date;
|
|
planIdsAndUnitIds.forEach(planIdAndUnitId -> executorService.submit(() -> {
|
|
planIdsAndUnitIds.forEach(planIdAndUnitId -> executorService.submit(() -> {
|
|
try {
|
|
try {
|
|
// province: 省级地域分布, city: 地级地域分布,gender: 性别分布,ageSegment: 年龄分布clientId: 系统分布 businessInterestTags: 商业兴趣分布
|
|
// province: 省级地域分布, city: 地级地域分布,gender: 性别分布,ageSegment: 年龄分布clientId: 系统分布 businessInterestTags: 商业兴趣分布
|
|
- kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, mulDate, "province", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
- kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, mulDate, "city", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
- kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, mulDate, "gender", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
- kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, mulDate, "clientId", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
- kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, mulDate, "ageSegment", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
- kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, mulDate, "businessInterestTags", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
|
|
+ kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, finalDate, "province", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
+ kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, finalDate, "city", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
+ kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, finalDate, "gender", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
+ kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, finalDate, "clientId", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
+ kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, finalDate, "ageSegment", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
+ kuaishouAudienceReportDailyService.crowdAnalysisReport2(token, finalDate, "businessInterestTags", planIdAndUnitId.getCampaignId(), planIdAndUnitId.getUnitId(), page, pageSize);
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
} finally {
|
|
} finally {
|