|
@@ -12,6 +12,7 @@ import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
|
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
|
|
|
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
@@ -39,24 +40,29 @@ public class SampleTest {
|
|
|
private IByteDanceVideoReportDailyService byteDanceVideoReportDailyService;
|
|
|
@Autowired
|
|
|
private ICtopOauthTokenService oauthTokenService;
|
|
|
+ @Autowired
|
|
|
+ private IReportService reportService;
|
|
|
|
|
|
@Test
|
|
|
public void testOceanEngineJob() {
|
|
|
try {
|
|
|
- CtopOauthToken byId = oauthTokenService.getById(303094936123368L);
|
|
|
- String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
- String endDate = DateUtils.addDay(nowDate, -180);
|
|
|
+ CtopOauthToken byId = oauthTokenService.getById(1654059015242756L);
|
|
|
+
|
|
|
+ /* SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Date start = simpleDateFormat.parse("2020-01-01");
|
|
|
+ Date end = simpleDateFormat.parse("2020-06-03");*/
|
|
|
+
|
|
|
+
|
|
|
+ String nowDate = "2020-06-03";
|
|
|
+ String endDate = "2020-01-01";
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date start = simpleDateFormat.parse(nowDate);
|
|
|
Date end = simpleDateFormat.parse(endDate);
|
|
|
- List<Date> dates = DateUtils.findDates(end,start);
|
|
|
+ List<Date> dates = DateUtils.findDates(end, start);
|
|
|
for (int i = 0; i < dates.size(); i++) {
|
|
|
String formatDate = simpleDateFormat.format(dates.get(i));
|
|
|
- int code = bytedanceReportService.bytedanceMaterialReport(byId, formatDate, formatDate);
|
|
|
- //如果成功的话跑视频清洗数据方法,失败会进入重试库,重试成功后再清洗数据
|
|
|
- if (code == 200 || code == 1) {
|
|
|
- byteDanceVideoReportDailyService.videoInfoListByAccountId(formatDate, formatDate, byId.getAccountId());
|
|
|
- }
|
|
|
+ Date parse = simpleDateFormat.parse(formatDate);
|
|
|
+ reportService.getAdvertiserReport(byId, parse, parse, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
@@ -126,21 +132,23 @@ public class SampleTest {
|
|
|
Long end = System.currentTimeMillis();
|
|
|
log.info("总用时:{}毫秒", end - start);
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private PangolinLoginService pangolinLoginService;
|
|
|
@Autowired
|
|
|
private PangolinCrawlerService pangolinCrawlerService;
|
|
|
@Autowired
|
|
|
private PangolinAppService pangolinAppService;
|
|
|
+
|
|
|
@Test
|
|
|
- public void testPangolinLogin(){
|
|
|
+ public void testPangolinLogin() {
|
|
|
QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("login_type","pangolin");
|
|
|
- queryWrapper.eq("status",1);
|
|
|
+ queryWrapper.eq("login_type", "pangolin");
|
|
|
+ queryWrapper.eq("status", 1);
|
|
|
List<BindAccountLogin> list = bindAccountLoginService.list(queryWrapper);
|
|
|
- if(list!=null&&!list.isEmpty()){
|
|
|
- for (BindAccountLogin login:list) {
|
|
|
- if(null==login.getCookie()||"".equals(login.getCookie().trim())){
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ for (BindAccountLogin login : list) {
|
|
|
+ if (null == login.getCookie() || "".equals(login.getCookie().trim())) {
|
|
|
pangolinLoginService.pangolinLogin(login.getAccountName(), login.getPassword());
|
|
|
}
|
|
|
}
|
|
@@ -148,7 +156,7 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void testPangolinData(){
|
|
|
+ public void testPangolinData() {
|
|
|
QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("login_type", "pangolin");
|
|
|
queryWrapper.eq("status", 1);
|