|
@@ -421,26 +421,6 @@ public class TestController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @GetMapping(value = "/getGroupReport")
|
|
|
- public void getGroupReport() throws ParseException {
|
|
|
- List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date parse1 = simpleDateFormat.parse("2020-09-12");
|
|
|
- Date parse2 = simpleDateFormat.parse("2020-09-17");
|
|
|
- for (CtopOauthToken token : tokens) {
|
|
|
-
|
|
|
- suzhaoService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- //1: 获取广告主信息数据
|
|
|
- kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, parse1, parse2);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
@GetMapping(value = "/syncDouyinMusicAsc")
|
|
|
public String syncDouyinMusicAsc() {
|
|
@@ -671,8 +651,6 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@GetMapping(value = "/getAccountList")
|
|
|
public void getAccountList(String startDate, String endDate) throws JobExecutionException {
|
|
|
Thread thread = new Thread() {
|
|
@@ -711,7 +689,6 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@GetMapping(value = "/createCutTask")
|
|
|
public String createCutTask(String startDate, String endDate) throws IOException {
|
|
|
List<MaterialInfo> materialInfos = materialInfoService.getListByDate(startDate, endDate);
|
|
@@ -741,44 +718,6 @@ public class TestController {
|
|
|
}*/
|
|
|
|
|
|
|
|
|
- @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 = oauthTokenMapper.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 = "/getAccountReportList")
|
|
|
- public String getAccountReportList(String startDate, String endDate) {
|
|
|
- Result<String> result = new Result<>();
|
|
|
- try {
|
|
|
- SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date date1 = sim.parse(startDate);
|
|
|
- Date date2 = sim.parse(endDate);
|
|
|
- QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
|
- tokenQueryWrapper.eq("media_id", 2);
|
|
|
- List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(tokenQueryWrapper);
|
|
|
- if (!Check.isNull(ctopOauthTokens)) {
|
|
|
- for (CtopOauthToken token : ctopOauthTokens) {
|
|
|
- kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2);
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- result.setSuccess(false);
|
|
|
- }
|
|
|
- return "success";
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
@GetMapping(value = "/updateCode")
|
|
|
public String updateCode() {
|
|
|
List<MaterialInfo> list = materialInfoService.list();
|
|
@@ -915,38 +854,6 @@ public class TestController {
|
|
|
return "success";
|
|
|
}
|
|
|
|
|
|
- @GetMapping(value = "/getGroupData")
|
|
|
- public String getGroupData() {
|
|
|
-
|
|
|
-
|
|
|
- Date endDate = new Date();
|
|
|
- QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
|
- tokenQueryWrapper.eq("media_id", 2);
|
|
|
- List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
|
|
|
- for (CtopOauthToken token : ctopOauthTokens) {
|
|
|
-
|
|
|
- for (int i = 0; i < 7; i++) {
|
|
|
- Date getStartDate = DateUtils.addDay(endDate, -i);
|
|
|
- //3:获取广告组信息数据
|
|
|
- kuaishouInterfaceService.getAdvertiserGroupReportHourly(token, getStartDate, getStartDate);
|
|
|
- }
|
|
|
- for (int i = 0; i < 6; i++) {
|
|
|
- Date getStartDate = new Date();
|
|
|
- Date getEndDate = new Date();
|
|
|
- if (i == 0) {
|
|
|
- getStartDate = DateUtils.addDay(endDate, -175 + i * 30);
|
|
|
- getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
|
|
|
- } else {
|
|
|
- getStartDate = DateUtils.addDay(endDate, -180 + i * 30);
|
|
|
- getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
|
|
|
- }
|
|
|
- //3:获取广告组信息数据
|
|
|
- kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getStartDate, getEndDate);
|
|
|
- }
|
|
|
- }
|
|
|
- return "Success";
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
@GetMapping(value = "/gerCreative")
|
|
|
public void gerCreative() {
|
|
@@ -1072,38 +979,6 @@ public class TestController {
|
|
|
private IBytedancePlanHourlyReportService planHourlyReportService;
|
|
|
|
|
|
|
|
|
- @GetMapping(value = "/AccountReportByAccount")
|
|
|
- public void AccountReportByAccount(Long accountId, String startDateStr, String endDateStr) {
|
|
|
- QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
- oauthTokenQueryWrapper.eq("media_id", 2);
|
|
|
- oauthTokenQueryWrapper.eq("account_id", accountId);
|
|
|
- oauthTokenQueryWrapper.last("limit 1");
|
|
|
- CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
- executorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- try {
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date startDate = null;
|
|
|
- Date endDate = null;
|
|
|
- try {
|
|
|
- startDate = simpleDateFormat.parse(startDateStr);
|
|
|
- endDate = simpleDateFormat.parse(endDateStr);
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- kuaishouInterfaceService.getAdvertiserReportDaily(token, startDate, endDate);
|
|
|
-
|
|
|
- Thread.sleep(1 * 200);
|
|
|
- // kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
@GetMapping(value = "/getAllCreativeList")
|
|
|
public void getAllCreativeList() {
|
|
|
|
|
@@ -1162,27 +1037,6 @@ public class TestController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @GetMapping(value = "/KuaishouDailyAccountReportLoadJob")
|
|
|
- public void KuaishouDailyAccountReportLoadJob() {
|
|
|
- Date getDate = DateUtils.addDay(new Date(), -2);
|
|
|
- //1:查询当日数据
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
- if (null == tokens || tokens.size() <= 0) {
|
|
|
- log.info("定时获取快手数据异常:未获取到可用的token");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- executorService = Executors.newFixedThreadPool(3);
|
|
|
- tokens.forEach(token -> {
|
|
|
- executorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- //1: 获取广告主信息数据
|
|
|
- kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
@Autowired
|
|
|
private IBytedanceEffectVideoInfoService effectVideoInfoService;
|