|
@@ -230,6 +230,7 @@ public class TestController {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (!Check.isNull(allocation)) {
|
|
|
+ log.info("账号id:{}", allocation.getAccountId());
|
|
|
|
|
|
QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
oauthTokenQueryWrapper.eq("media_id", 2);
|
|
@@ -238,18 +239,22 @@ public class TestController {
|
|
|
if (!Check.isNull(ctopOauthToken)) {
|
|
|
deleteMap.put("account_id", allocation.getAccountId());
|
|
|
deleteMap.put("stat_date", anotherDay);
|
|
|
- reportDailyCreativeStatisticMapper.deleteByMap(deleteMap);
|
|
|
- reportDailyCreativeMapper.deleteByMap(deleteMap);
|
|
|
+ // reportDailyCreativeStatisticMapper.deleteByMap(deleteMap);
|
|
|
+ // reportDailyCreativeMapper.deleteByMap(deleteMap);
|
|
|
|
|
|
// 1.计划数据
|
|
|
+ log.info("获取计划,账号id:{}", allocation.getAccountId());
|
|
|
kuaishouInterfaceService.getCampaignList(ctopOauthToken, null, null);
|
|
|
// 2:广告组数据
|
|
|
+ log.info("获取广告组,账号id:{}", allocation.getAccountId());
|
|
|
kuaishouInterfaceService.getGroupList(ctopOauthToken, null, null);
|
|
|
// 3:创意数据
|
|
|
+ log.info("获取创意,账号id:{}", allocation.getAccountId());
|
|
|
kuaishouInterfaceService.getCreativeList(ctopOauthToken, null, null);
|
|
|
|
|
|
QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
|
|
|
campaignQueryWrapper.eq("account_id", ctopOauthToken.getAccountId());
|
|
|
+ log.info("获取创意报表,账号id:{}", allocation.getAccountId());
|
|
|
List<KuaiShouCampaign> campaigns = campaignService.list(campaignQueryWrapper);
|
|
|
if (!Check.isNull(list)) {
|
|
|
for (KuaiShouCampaign campaign : campaigns) {
|
|
@@ -271,6 +276,12 @@ public class TestController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) throws ParseException {
|
|
|
+ String date = DateUtils.getDate("yyyy-MM-dd");
|
|
|
+ String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
|
|
|
+ System.err.println(anotherDay);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@GetMapping(value = "/getPlanAndGroupByAccount")
|
|
|
public void getPlanAndGroupByAccount(Long accountId) {
|
|
@@ -279,51 +290,35 @@ public class TestController {
|
|
|
oauthTokenQueryWrapper.eq("account_id", accountId);
|
|
|
oauthTokenQueryWrapper.last("limit 1");
|
|
|
CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
- executorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- try {
|
|
|
-
|
|
|
- kuaishouInterfaceService.getCampaignList(token, null, null);
|
|
|
- //1:获取全量广告组数据
|
|
|
- kuaishouInterfaceService.getGroupList(token, null, null);
|
|
|
-
|
|
|
- Thread.sleep(1 * 200);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ try {
|
|
|
+ System.err.println("获取计划,广告组:" + accountId);
|
|
|
+ kuaishouInterfaceService.getCampaignList(token, null, null);
|
|
|
+ //1:获取全量广告组数据
|
|
|
+ kuaishouInterfaceService.getGroupList(token, null, null);
|
|
|
+ System.err.println("获取计划,广告组:" + accountId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- @GetMapping(value = "/gerCreativeByAccount")
|
|
|
+ @GetMapping(value = "/getCreativeByAccount")
|
|
|
public void gerCreative(Long accountId) {
|
|
|
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 {
|
|
|
- System.err.println("获取创意,accountId:" + token.getAccountId());
|
|
|
- // 1.计划数据
|
|
|
- kuaishouInterfaceService.getCampaignList(token, null, null);
|
|
|
- // 2:广告组数据
|
|
|
- kuaishouInterfaceService.getGroupList(token, null, null);
|
|
|
- // 3:创意数据
|
|
|
- kuaishouInterfaceService.getCreativeList(token, null, null);
|
|
|
|
|
|
- Thread.sleep(1 * 200);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ try {
|
|
|
+ System.err.println("获取创意,accountId:" + token.getAccountId());
|
|
|
+ kuaishouInterfaceService.getCreativeList(token, null, null);
|
|
|
+ System.err.println("获取创意结束,accountId:" + token.getAccountId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|
|
@@ -346,8 +341,6 @@ public class TestController {
|
|
|
CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
System.err.println("创意报表accountId:" + ctopOauthToken.getAccountId());
|
|
|
kuaishouInterfaceService.getAdvertiserCreativeReportDaily(ctopOauthToken, startDate, endDate);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
};
|
|
|
thread.start();
|