|
@@ -127,20 +127,20 @@ public class SampleTest {
|
|
|
|
|
|
@Test
|
|
|
public void testLoadBytedanceData() {
|
|
|
- List<UserAllocation>allocations = allocationService.getByParams(633L,null,0);
|
|
|
- if(null!=allocations&&!allocations.isEmpty()){
|
|
|
- for(UserAllocation allocation:allocations){
|
|
|
+ List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
|
|
|
+ if (null != allocations && !allocations.isEmpty()) {
|
|
|
+ for (UserAllocation allocation : allocations) {
|
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
String startDate = "2020-11-10";
|
|
|
String endDate = "2020-11-10";
|
|
|
- reportService.getAdvertiserReport(token, DateUtils.parseDate(startDate,"yyyy-MM-dd"), DateUtils.parseDate(endDate,"yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
+ reportService.getAdvertiserReport(token, DateUtils.parseDate(startDate, "yyyy-MM-dd"), DateUtils.parseDate(endDate, "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
}
|
|
|
}
|
|
|
System.out.println("任务结束");
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void loadBytedancePlanData(){
|
|
|
+ public void loadBytedancePlanData() {
|
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(100198696723L);
|
|
|
// advertiserDataService.getAdvertiserPlan(token, "", null, null);
|
|
|
Date getDate = DateUtils.addDay(new Date(), 0);
|
|
@@ -149,15 +149,16 @@ public class SampleTest {
|
|
|
|
|
|
@Autowired
|
|
|
private IBytedanceFundDailyService bytedanceFundDailyService;
|
|
|
+
|
|
|
@Test
|
|
|
public void loadFoudData() {
|
|
|
List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
|
for (CtopOauthToken token : tokens) {
|
|
|
- System.out.println(token.getAccountId()+"############################");
|
|
|
- for(int i=20;i<130;i++){
|
|
|
- Date date = DateUtils.addDay(new Date(),-i);
|
|
|
- bytedanceFundDailyService.loadFundDataByPage(token, DateUtils.formatDate(date), DateUtils.formatDate(date),1);
|
|
|
- System.out.println(i+"############################");
|
|
|
+ System.out.println(token.getAccountId() + "############################");
|
|
|
+ for (int i = 20; i < 130; i++) {
|
|
|
+ Date date = DateUtils.addDay(new Date(), -i);
|
|
|
+ bytedanceFundDailyService.loadFundDataByPage(token, DateUtils.formatDate(date), DateUtils.formatDate(date), 1);
|
|
|
+ System.out.println(i + "############################");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -169,9 +170,9 @@ public class SampleTest {
|
|
|
* 测试获取快手图片消耗数据任务
|
|
|
*/
|
|
|
@Test
|
|
|
- public void loadKuaishouImageTask(){
|
|
|
+ public void loadKuaishouImageTask() {
|
|
|
List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
- for(int i=1;i<130;i++) {
|
|
|
+ for (int i = 1; i < 130; i++) {
|
|
|
Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
String getDateStr = DateUtils.formatDate(getDate);
|
|
|
tokens.forEach(token -> reportTaskService.createTask(token.getAccountId(), token.getAccessToken(), getDateStr, getDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY));
|
|
@@ -180,14 +181,15 @@ public class SampleTest {
|
|
|
|
|
|
@Autowired
|
|
|
private IKuaiShouDailyReportTaskService dailyReportTaskService;
|
|
|
+
|
|
|
/**
|
|
|
* 测试获取快手图片消耗数据入库
|
|
|
*/
|
|
|
@Test
|
|
|
- public void loadKuaishouImageTaskFile(){
|
|
|
+ public void loadKuaishouImageTaskFile() {
|
|
|
String nowDate = DateUtils.getDate("yyyy-MM-dd");
|
|
|
List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
- for(int i=1;i<15;i++){
|
|
|
+ for (int i = 1; i < 15; i++) {
|
|
|
String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -i);
|
|
|
tokens.forEach(token -> dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate));
|
|
|
}
|
|
@@ -195,15 +197,15 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void testLoadBytedanceImageData(){
|
|
|
- List<CtopOauthToken>tokens = tokenService.selectToutiaoToken();
|
|
|
+ public void testLoadBytedanceImageData() {
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
|
countDownLatch = new CountDownLatch(tokens.size());
|
|
|
executorService = Executors.newFixedThreadPool(8);
|
|
|
- tokens.forEach(token->executorService.submit(()->{
|
|
|
+ tokens.forEach(token -> executorService.submit(() -> {
|
|
|
try {
|
|
|
advertiserDataService.getMaterialList(token);
|
|
|
- }catch (Exception e){
|
|
|
- }finally {
|
|
|
+ } catch (Exception e) {
|
|
|
+ } finally {
|
|
|
countDownLatch.countDown();
|
|
|
}
|
|
|
}));
|
|
@@ -215,12 +217,14 @@ public class SampleTest {
|
|
|
System.out.println("素材数据获取完成");
|
|
|
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private KuaishouAgentAccountMapper kuaishouAgentAccountMapper;
|
|
|
@Autowired
|
|
|
private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
|
|
|
+
|
|
|
@Test
|
|
|
- public void loadKuaishouAgentData() throws Exception{
|
|
|
+ public void loadKuaishouAgentData() throws Exception {
|
|
|
kuaishouReportDailyAgentService.loginAgent();
|
|
|
// for (int i = 0; i < 20; i++) {
|
|
|
// String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
|
|
@@ -242,12 +246,13 @@ public class SampleTest {
|
|
|
|
|
|
@Autowired
|
|
|
private ISendMessageService sendMessageService;
|
|
|
+
|
|
|
@Test
|
|
|
- public void testSendMessage(){
|
|
|
- sendMessageService.sendMessage("c445fec9a80347aea54e8db66692ec03","测试信息发送!");
|
|
|
+ public void testSendMessage() {
|
|
|
+ sendMessageService.sendMessage("c445fec9a80347aea54e8db66692ec03", "测试信息发送!");
|
|
|
}
|
|
|
|
|
|
- private void loadData(String result)throws Exception{
|
|
|
+ private void loadData(String result) throws Exception {
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
|
|
|
JsonNode resultNode = mapper.readTree(result);
|
|
@@ -276,6 +281,7 @@ public class SampleTest {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private IKuaishouInterfaceService kuaishouInterfaceService;
|
|
|
|
|
@@ -290,16 +296,15 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Test
|
|
|
public void loadAccountData() {
|
|
|
// List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
|
|
|
// for (UserAllocation allocation:allocations) {
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
|
|
|
- for(int i=92;i<100;i++){
|
|
|
- Date getDate = DateUtils.addDay(new Date(),-i);
|
|
|
- reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- }
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
|
|
|
+ for (int i = 92; i < 100; i++) {
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
+ reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
+ }
|
|
|
// }
|
|
|
}
|
|
|
|
|
@@ -327,16 +332,5 @@ public class SampleTest {
|
|
|
@Autowired
|
|
|
private IWechatNoListService wechatNoListService;
|
|
|
|
|
|
- @Test
|
|
|
- public void checkinData() {
|
|
|
- //更新员工打卡明细表 1604160000
|
|
|
-// wechatCheckinDataService.getCheckinData("1600531200", "1601136000");
|
|
|
-// XxlJobLogger.log("--------考勤数据入库 end ");
|
|
|
-// //更新人员信息表oa/wechatNoList
|
|
|
-//// wechatUserInfoService.getUserList();
|
|
|
-//// XxlJobLogger.log("--------人员数据入库 end ");
|
|
|
-
|
|
|
- wechatNoListService.getNoDateByNo("1601481600", "1604160000");
|
|
|
- XxlJobLogger.log("--------异常考勤审批数据入库 end ");
|
|
|
- }
|
|
|
+
|
|
|
}
|