|
@@ -1,7 +1,6 @@
|
|
|
package org.jeecg.modules.ctop.controller;
|
|
|
|
|
|
import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
|
|
|
-import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
|
|
|
import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
|
|
|
import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
|
|
|
import cn.com.ctop.bytedance.service.IReportService;
|
|
@@ -10,6 +9,7 @@ import cn.com.ctop.common.module.entity.UserAllocation;
|
|
|
import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
|
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
|
+import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
import cn.com.ctop.common.module.utils.ResultMapUtils;
|
|
|
import cn.com.ctop.common.module.utils.StatusCode;
|
|
@@ -22,6 +22,7 @@ import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
+import org.jeecg.modules.ctop.service.ICleanMaterialService;
|
|
|
import org.jeecg.modules.ctop.service.ICreateInternalService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -91,10 +92,8 @@ public class TestController {
|
|
|
|
|
|
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();
|
|
@@ -106,13 +105,9 @@ public class TestController {
|
|
|
getStartDate = DateUtils.addDay(endDate, -180 + i * 30);
|
|
|
getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
|
|
|
}
|
|
|
-
|
|
|
//3:获取广告组信息数据
|
|
|
kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getStartDate, getEndDate);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
return "Success";
|
|
|
}
|
|
@@ -139,8 +134,6 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@GetMapping(value = "/gerCreative")
|
|
|
public void gerCreative() {
|
|
|
QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
@@ -205,28 +198,27 @@ 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 {
|
|
|
- System.err.println("获取创意,accountId:" + token.getAccountId());
|
|
|
- kuaishouInterfaceService.getCreativeList(token, null, null);
|
|
|
- // kuaishouInterfaceService.getVideoList2(token, null, null,1);
|
|
|
- //3: 获取图片信息数据
|
|
|
- // kuaishouInterfaceService.getImageList2(token, null, null,1);
|
|
|
- Thread.sleep(1 * 200);
|
|
|
- // kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ System.err.println("获取创意,accountId:" + token.getAccountId());
|
|
|
+ kuaishouInterfaceService.getCreativeList(token, null, null);
|
|
|
+ // kuaishouInterfaceService.getVideoList2(token, null, null,1);
|
|
|
+ //3: 获取图片信息数据
|
|
|
+ // kuaishouInterfaceService.getImageList2(token, null, null,1);
|
|
|
+ Thread.sleep(1 * 200);
|
|
|
+ // kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@GetMapping(value = "/gerCreativeReportByAccount")
|
|
|
public void gerCreativeReportByAccount(Long accountId, String startDateStr, String endDateStr, QueryWrapper<CtopOauthToken> account_id) {
|
|
|
Thread thread = new Thread() {
|
|
@@ -261,7 +253,7 @@ public class TestController {
|
|
|
|
|
|
@GetMapping("loadBytedanceData")
|
|
|
public Map<String, Object> formatZybData(String date) {
|
|
|
- Map<String,Object>result = new HashMap<>();
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date getDate = null;
|
|
|
try {
|
|
@@ -283,20 +275,20 @@ public class TestController {
|
|
|
//清洗关于作业帮数据
|
|
|
//1:查询作业帮相关的用户数据
|
|
|
QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("project_id",215);
|
|
|
+ wrapper.eq("project_id", 215);
|
|
|
List<UserAllocation> allocations = userAllocationService.list(wrapper);
|
|
|
- if(null!=allocations&&allocations.size()>0){
|
|
|
- allocations.forEach(allocation->{
|
|
|
+ if (null != allocations && allocations.size() > 0) {
|
|
|
+ allocations.forEach(allocation -> {
|
|
|
//根据accountId和时间,查询相关的日报表信息
|
|
|
QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- String dateString = dateFormat.format(finalGetDate)+" 00:00:00";
|
|
|
- queryWrapper.eq("advertiser_id",allocation.getAccountId())
|
|
|
- .eq("stat_datetime",dateString)
|
|
|
+ String dateString = dateFormat.format(finalGetDate) + " 00:00:00";
|
|
|
+ queryWrapper.eq("advertiser_id", allocation.getAccountId())
|
|
|
+ .eq("stat_datetime", dateString)
|
|
|
;
|
|
|
- List<BytedancePlanDailyReport>bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
|
|
|
- if(null!=bytedancePlanDailyReports&&bytedancePlanDailyReports.size()>0){
|
|
|
- bytedancePlanDailyReports.forEach(report->{
|
|
|
+ List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
|
|
|
+ if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
|
|
|
+ bytedancePlanDailyReports.forEach(report -> {
|
|
|
String adName = report.getAdName();
|
|
|
String[] tags = adName.split("-");
|
|
|
report.setAdsense(tags[1]);
|
|
@@ -317,7 +309,7 @@ public class TestController {
|
|
|
report.setMaterialType("剧情");
|
|
|
} else if (materialName.contains("口播")) {
|
|
|
report.setMaterialType("口播");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
report.setMaterialType("其他");
|
|
|
}
|
|
|
planDailyReportService.updateById(report);
|
|
@@ -325,15 +317,16 @@ public class TestController {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
private IByteDanceAdvertiserDataService advertiserDataService;
|
|
|
+
|
|
|
@GetMapping("getBytedanceData")
|
|
|
public Map<String, Object> getBytedanceData() {
|
|
|
- Map<String,Object>result = new HashMap<>();
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
//1:查询当日数据
|
|
|
List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
|
if (null == tokens || tokens.size() <= 0) {
|
|
@@ -343,7 +336,7 @@ public class TestController {
|
|
|
//3:获取广告计划信息数据
|
|
|
advertiserDataService.getMaterialList(token);
|
|
|
});
|
|
|
- ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -403,7 +396,7 @@ public class TestController {
|
|
|
private IReportService reportService;
|
|
|
|
|
|
@GetMapping("bytedanceHourReport")
|
|
|
- public Map<String, Object> testReport() {
|
|
|
+ public Map<String, Object> bytedanceHourReport() {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
log.info("头条时报数据获取开始");
|
|
|
Date getDate = new Date();
|
|
@@ -435,84 +428,6 @@ public class TestController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- @GetMapping("formatYddData")
|
|
|
- public Map<String, Object> formatYddData() throws Exception {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
- //清洗关于缘多多数据
|
|
|
- //1:查询缘多多相关的用户数据
|
|
|
- QueryWrapper<UserAllocation> yddWrapper = new QueryWrapper<>();
|
|
|
- yddWrapper.eq("project_id", 113);
|
|
|
- List<UserAllocation> yddallocations = userAllocationService.list(yddWrapper);
|
|
|
- if (null != yddallocations && yddallocations.size() > 0) {
|
|
|
- yddallocations.forEach(allocation -> {
|
|
|
- //根据accountId和时间,查询相关的日报表信息
|
|
|
- QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("advertiser_id", allocation.getAccountId())
|
|
|
- //.eq("stat_datetime",dateString)
|
|
|
- ;
|
|
|
- List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
|
|
|
- if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
|
|
|
- bytedancePlanDailyReports.forEach(report -> {
|
|
|
- String adName = report.getAdName();
|
|
|
- String[] tags = adName.split("-");
|
|
|
- report.setChannelCode(tags[0]);
|
|
|
- planDailyReportService.updateById(report);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- //清洗关于缘多多数据
|
|
|
- //1:查询缘多多相关的用户数据
|
|
|
- QueryWrapper<UserAllocation> dsjyWrapper = new QueryWrapper<>();
|
|
|
- yddWrapper.eq("project_id", 112);
|
|
|
- List<UserAllocation> dsjyAllocations = userAllocationService.list(dsjyWrapper);
|
|
|
- if (null != dsjyAllocations && dsjyAllocations.size() > 0) {
|
|
|
- dsjyAllocations.forEach(allocation -> {
|
|
|
- //根据accountId和时间,查询相关的日报表信息
|
|
|
- QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("advertiser_id", allocation.getAccountId())
|
|
|
- //.eq("stat_datetime",dateString)
|
|
|
- ;
|
|
|
- List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
|
|
|
- if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
|
|
|
- bytedancePlanDailyReports.forEach(report -> {
|
|
|
- String adName = report.getAdName();
|
|
|
- String[] tags = adName.split("-");
|
|
|
- report.setChannelCode(tags[0]);
|
|
|
- planDailyReportService.updateById(report);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- //清洗关于缘多多数据
|
|
|
- //1:查询缘多多相关的用户数据
|
|
|
- QueryWrapper<UserAllocation> fjyhWrapper = new QueryWrapper<>();
|
|
|
- yddWrapper.eq("project_id", 222);
|
|
|
- List<UserAllocation> fjyhAllocations = userAllocationService.list(fjyhWrapper);
|
|
|
- if (null != fjyhAllocations && fjyhAllocations.size() > 0) {
|
|
|
- fjyhAllocations.forEach(allocation -> {
|
|
|
- //根据accountId和时间,查询相关的日报表信息
|
|
|
- QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("advertiser_id", allocation.getAccountId())
|
|
|
- //.eq("stat_datetime",dateString)
|
|
|
- ;
|
|
|
- List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
|
|
|
- if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
|
|
|
- bytedancePlanDailyReports.forEach(report -> {
|
|
|
- String adName = report.getAdName();
|
|
|
- String[] tags = adName.split("-");
|
|
|
- report.setChannelCode(tags[0]);
|
|
|
- planDailyReportService.updateById(report);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
//线程计数器
|
|
|
static CountDownLatch countDownLatch = null;
|
|
|
|
|
@@ -551,45 +466,105 @@ public class TestController {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
//清洗关于缘多多数据
|
|
|
- formatData(113, finalGetDate);
|
|
|
+ planDailyReportService.cleanYddData(113, finalGetDate);
|
|
|
//清洗关于交友数据
|
|
|
- formatData(112, finalGetDate);
|
|
|
+ planDailyReportService.cleanYddData(112, finalGetDate);
|
|
|
//清洗关于附近约会数据
|
|
|
- formatData(222, finalGetDate);
|
|
|
+ planDailyReportService.cleanYddData(222, finalGetDate);
|
|
|
log.info("头条计划时报数据获取完成");
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private void formatData(Integer projectId, Date finalGetDate) {
|
|
|
- QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("project_id", projectId);
|
|
|
- List<UserAllocation> fjyhAllocations = userAllocationService.list(queryWrapper);
|
|
|
- if (null != fjyhAllocations && fjyhAllocations.size() > 0) {
|
|
|
- fjyhAllocations.forEach(allocation -> {
|
|
|
- //根据accountId和时间,查询相关的时报报表信息
|
|
|
- QueryWrapper<BytedancePlanHourlyReport> accountWrapper = new QueryWrapper<>();
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- String dateString = dateFormat.format(finalGetDate);
|
|
|
- accountWrapper.eq("advertiser_id", allocation.getAccountId())
|
|
|
- .eq("stat_datetime", dateString)
|
|
|
- ;
|
|
|
- List<BytedancePlanHourlyReport> bytedancePlanHourlyReports = planHourlyReportService.list(accountWrapper);
|
|
|
- if (null != bytedancePlanHourlyReports && bytedancePlanHourlyReports.size() > 0) {
|
|
|
- bytedancePlanHourlyReports.forEach(report -> {
|
|
|
- String adName = report.getAdName();
|
|
|
- String[] tags = adName.split("-");
|
|
|
- report.setChannelCode(tags[0]);
|
|
|
- planHourlyReportService.updateById(report);
|
|
|
- });
|
|
|
+ @GetMapping("formatYzData")
|
|
|
+ public Map<String, Object> formatYzData() {
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ planDailyReportService.cleanYzData(151);
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBytedancePlanHourlyReportService planHourlyReportService;
|
|
|
+
|
|
|
+ @GetMapping("loadCreativeData")
|
|
|
+ public Map<String, Object> loadCreaticeData() {
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
|
+ log.info("头条创意素材数据开始获取");
|
|
|
+ //查询当日数据
|
|
|
+ if (null == tokens || tokens.size() <= 0) {
|
|
|
+ log.info("定时获取头条数据异常:wei获取到可用的token");
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SERVER_ERROR);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ executorService = Executors.newFixedThreadPool(20);
|
|
|
+ countDownLatch = new CountDownLatch(tokens.size());
|
|
|
+ tokens.forEach(token -> {
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ // 获取广告创意信息数据
|
|
|
+ try {
|
|
|
+ advertiserDataService.getAdvertiserCreative(token, null);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ countDownLatch.countDown();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ countDownLatch.await();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
+ log.info("头条创意素材数据获取完成");
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
- private IBytedancePlanHourlyReportService planHourlyReportService;
|
|
|
+ @GetMapping("loadCreaticeReportData")
|
|
|
+ public Map<String, Object> loadCreaticeReportData() {
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
|
+ for (int i = 51; i < 180; i++) {
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
+ log.info(DateUtils.formatDate(getDate) + "头条创意日报数据开始获取");
|
|
|
+ //查询当日数据
|
|
|
+ if (null == tokens || tokens.size() <= 0) {
|
|
|
+ log.info("定时获取头条数据异常:为获取到可用的token");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ executorService = Executors.newFixedThreadPool(10);
|
|
|
+ countDownLatch = new CountDownLatch(tokens.size());
|
|
|
+ tokens.forEach(token -> {
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ //获取广告创意日报信息数据
|
|
|
+ try {
|
|
|
+ reportService.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ countDownLatch.countDown();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ countDownLatch.await();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ log.info(DateUtils.formatDate(getDate) + "头条创意日报数据获取完成");
|
|
|
+ }
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
@GetMapping("loadVideoData")
|
|
|
public Map<String, Object> loadVideoData() {
|
|
@@ -623,4 +598,64 @@ public class TestController {
|
|
|
ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICleanMaterialService cleanMaterialService;
|
|
|
+
|
|
|
+ @GetMapping("testReport")
|
|
|
+ public void testReport() {
|
|
|
+ List<String> signatureList = cleanMaterialService.getSignature();
|
|
|
+ if (Check.isNull(signatureList)) {
|
|
|
+ log.error("素材数据获取为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ executorService = Executors.newFixedThreadPool(5);
|
|
|
+ for (int i = 0; i < signatureList.size(); i++) {
|
|
|
+ String signature = signatureList.get(i);
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ System.err.println(signature);
|
|
|
+ cleanMaterialService.calculationReport(signature);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @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();
|
|
|
+ }
|
|
|
+ System.err.println("获取广告主报表,accountId:" + token.getAccountId());
|
|
|
+ kuaishouInterfaceService.getAdvertiserReportDaily(token, startDate, endDate);
|
|
|
+
|
|
|
+ Thread.sleep(1 * 200);
|
|
|
+ // kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|