|
@@ -5,21 +5,18 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouAccountMaterialReportDaily;
|
|
import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
|
|
import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
|
|
import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
-import cn.com.ctop.oa.modules.service.IWechatUserListService;
|
|
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
|
|
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceCheckReportTaskInfo;
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceCheckReportTaskInfo;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
-import org.jeecg.common.util.RedisUtil;
|
|
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
import org.junit.runner.RunWith;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -58,8 +55,6 @@ public class SampleTest {
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
|
|
private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
|
|
@Autowired
|
|
@Autowired
|
|
- private IWechatUserListService wechatUserInfoService;
|
|
|
|
- @Autowired
|
|
|
|
private IByteDanceAdvertiserDataService advertiserDataService;
|
|
private IByteDanceAdvertiserDataService advertiserDataService;
|
|
@Autowired
|
|
@Autowired
|
|
private IWechatNoListService wechatNoListService;
|
|
private IWechatNoListService wechatNoListService;
|
|
@@ -70,78 +65,27 @@ public class SampleTest {
|
|
@Resource
|
|
@Resource
|
|
private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
|
|
private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
|
|
@Autowired
|
|
@Autowired
|
|
- private IByteDanceCampaignService campaignService;
|
|
|
|
- @Autowired
|
|
|
|
private IReportService reportService;
|
|
private IReportService reportService;
|
|
@Resource
|
|
@Resource
|
|
private IBytedanceCheckReportTaskInfoService checkReportTaskInfoService;
|
|
private IBytedanceCheckReportTaskInfoService checkReportTaskInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private IEtlBytedanceReportVideoDailyService etlBytedanceReportVideoDailyService;
|
|
private IEtlBytedanceReportVideoDailyService etlBytedanceReportVideoDailyService;
|
|
- // @Autowired
|
|
|
|
- // private IAppchatCreateService appchatCreateService;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ static ExecutorService executorService = null;
|
|
|
|
+ static CountDownLatch countDownLatch = null;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IBytedanceReportService bytedanceReportService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void loadKuaishouCookie() throws ParseException {
|
|
public void loadKuaishouCookie() throws ParseException {
|
|
-
|
|
|
|
CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1700996735138951L);
|
|
CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1700996735138951L);
|
|
advertiserDataService.getMaterialList(tokenByAccountId);
|
|
advertiserDataService.getMaterialList(tokenByAccountId);
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
CtopOauthToken tokenByAccountId1 = tokenService.getTokenByAccountId(1700996735589383L);
|
|
CtopOauthToken tokenByAccountId1 = tokenService.getTokenByAccountId(1700996735589383L);
|
|
advertiserDataService.getMaterialList(tokenByAccountId1);
|
|
advertiserDataService.getMaterialList(tokenByAccountId1);
|
|
-
|
|
|
|
-/*
|
|
|
|
- wechatUserInfoService.getUserList();*/
|
|
|
|
-
|
|
|
|
- // appchatCreateService.createAppChat(null, null, null);
|
|
|
|
- // appchatCreateService.getChatInfo(null);
|
|
|
|
-// appchatCreateService.getChatInfo(null);
|
|
|
|
- /* redisUtil.set("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1","hahahaha",5);
|
|
|
|
- Object o = redisUtil.get("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1");
|
|
|
|
- System.err.println(o);*/
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /*try {
|
|
|
|
- // 用来保存数据
|
|
|
|
- ArrayList<String[]> csvFileList = new ArrayList<String[]>();
|
|
|
|
- // 定义一个CSV路径
|
|
|
|
- String csvFilePath = "D:\\test\\123.csv";
|
|
|
|
- // 创建CSV读对象 例如:CsvReader(文件路径,分隔符,编码格式);
|
|
|
|
- CsvReader reader = new CsvReader(csvFilePath, ',', Charset.forName("UTF-8"));
|
|
|
|
- // 跳过表头 如果需要表头的话,这句可以忽略
|
|
|
|
- reader.readHeaders();
|
|
|
|
- // 逐行读入除表头的数据
|
|
|
|
- while (reader.readRecord()) {
|
|
|
|
- System.out.println(reader.getRawRecord());
|
|
|
|
- csvFileList.add(reader.getValues());
|
|
|
|
- }
|
|
|
|
- reader.close();
|
|
|
|
-
|
|
|
|
- // 遍历读取的CSV文件
|
|
|
|
- for (int row = 0; row < csvFileList.size(); row++) {
|
|
|
|
- // 取得第row行第0列的数据
|
|
|
|
- String cell = csvFileList.get(row)[0];
|
|
|
|
- System.out.println("------------>" + cell);
|
|
|
|
- }
|
|
|
|
- } catch (IOException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /* CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(9792526L);
|
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- Date parse = dateFormat.parse("2021-04-02");
|
|
|
|
- kuaishouInterfaceService.getAdvertiserReportDaily(tokenByAccountId, parse, parse, null);*/
|
|
|
|
}
|
|
}
|
|
- static ExecutorService executorService = null;
|
|
|
|
- static CountDownLatch countDownLatch = null;
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -228,8 +172,6 @@ public class SampleTest {
|
|
etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
|
|
etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IBytedanceReportService bytedanceReportService;
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void testLoadBytedanceCampaign() {
|
|
public void testLoadBytedanceCampaign() {
|
|
@@ -245,12 +187,6 @@ public class SampleTest {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void loadBytedanceAccountReport() {
|
|
public void loadBytedanceAccountReport() {
|
|
- /**
|
|
|
|
- * 1692555408132110
|
|
|
|
- * 1692555631713287
|
|
|
|
- * 1696734332089352
|
|
|
|
- * 1696734333251598
|
|
|
|
- */
|
|
|
|
CtopOauthToken token1 = tokenService.getTokenByAccountId(1693648201498637L);
|
|
CtopOauthToken token1 = tokenService.getTokenByAccountId(1693648201498637L);
|
|
reportService.getAdvertiserReport(token1, DateUtils.parseDate("2021-04-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-04-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
reportService.getAdvertiserReport(token1, DateUtils.parseDate("2021-04-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-04-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
}
|
|
}
|
|
@@ -271,7 +207,24 @@ public class SampleTest {
|
|
log.info("{}:数据获取完成",getDate);
|
|
log.info("{}:数据获取完成",getDate);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// 3:重复异常数据
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void reloadKuaishouData(){
|
|
|
|
+ String formatDate = "2021-06-01";
|
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
|
+ tokens.forEach(token -> {
|
|
|
|
+ try {
|
|
|
|
+ List<EtlKuaishouAccountMaterialReportDaily> getList = etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyList(formatDate,token.getAccountId());
|
|
|
|
+ if(null!=getList&&!getList.isEmpty()){
|
|
|
|
+ getList.forEach(report->etlKuaishouAccountMaterialReportDailyMapper.replace(report));
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ log.info("{}数据获取完成",formatDate);
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
@@ -300,7 +253,4 @@ public class SampleTest {
|
|
etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
|
|
etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
|
|
etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
|
|
etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
|
|
}
|
|
}
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
|
|
|
|
}
|
|
}
|