|
@@ -4,16 +4,11 @@ import cn.com.ctop.common.module.entity.BindAccountLogin;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
|
|
import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
|
|
-import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
|
|
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
|
-import cn.com.ctop.common.module.service.IOauthConfigService;
|
|
|
|
-import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
|
|
-import cn.com.ctop.common.module.utils.Check;
|
|
|
|
|
|
+import cn.com.ctop.common.module.service.*;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountTargetTemplateService;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountTargetTemplateService;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
|
|
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
|
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
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.service.IKuaishouReportDailyAgentService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
|
|
@@ -26,14 +21,10 @@ import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataServ
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
|
|
import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
|
|
import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
-import com.xxl.job.core.context.XxlJobHelper;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.apache.catalina.User;
|
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
import org.junit.runner.RunWith;
|
|
-import org.openqa.selenium.By;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
@@ -45,7 +36,6 @@ import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Map;
|
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
@@ -77,13 +67,22 @@ public class SampleTest {
|
|
private IOauthConfigService configService;
|
|
private IOauthConfigService configService;
|
|
@Autowired
|
|
@Autowired
|
|
private CtopOauthTokenMapper oauthTokenMapper;
|
|
private CtopOauthTokenMapper oauthTokenMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaishouInterfaceService iKuaishouInterfaceService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IRefreshTokenService refreshTokenService;
|
|
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void loadBytedanceCreativeData() throws ParseException {
|
|
public void loadBytedanceCreativeData() throws ParseException {
|
|
|
|
+ CtopOauthToken token = oauthTokenMapper.selectByAccountId(9784689L);
|
|
|
|
+
|
|
|
|
+ refreshTokenService.getKuaiShouRefresh();
|
|
|
|
+
|
|
|
|
|
|
|
|
+ // iKuaishouInterfaceService.getVideoList(token, null, null);
|
|
|
|
|
|
- List<CtopOauthToken> oauthTokens = oauthTokenMapper.selectKuaiShouTokens(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
|
|
|
|
|
|
+ /* List<CtopOauthToken> oauthTokens = oauthTokenMapper.selectKuaiShouTokens(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
|
|
if (!Check.isNull(oauthTokens)) {
|
|
if (!Check.isNull(oauthTokens)) {
|
|
Map<Long, String> configMap = configService.getConfigMapByMediaId(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
|
|
Map<Long, String> configMap = configService.getConfigMapByMediaId(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
|
|
for (CtopOauthToken oauthToken : oauthTokens) {
|
|
for (CtopOauthToken oauthToken : oauthTokens) {
|
|
@@ -97,7 +96,7 @@ public class SampleTest {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
XxlJobHelper.log("----------------------刷新token获取数据返回结果为空----------------------------------");
|
|
XxlJobHelper.log("----------------------刷新token获取数据返回结果为空----------------------------------");
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
|
/* Map<Long, String> configMap = configService.getConfigMapByMediaId(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
|
|
/* Map<Long, String> configMap = configService.getConfigMapByMediaId(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
|
|
@@ -423,15 +422,16 @@ public class SampleTest {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
|
|
private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void execute() {
|
|
public void execute() {
|
|
- List<UserAllocation> allocations = allocationService.listByMediaId("3",0);
|
|
|
|
- for (UserAllocation allocation:allocations) {
|
|
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord1 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(),"2020-10-01","2020-10-31");
|
|
|
|
|
|
+ List<UserAllocation> allocations = allocationService.listByMediaId("3", 0);
|
|
|
|
+ for (UserAllocation allocation : allocations) {
|
|
|
|
+ BytedanceAccountReportTaskRecord reportTaskRecord1 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-10-01", "2020-10-31");
|
|
reportTaskRecordService.save(reportTaskRecord1);
|
|
reportTaskRecordService.save(reportTaskRecord1);
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord2 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(),"2020-11-01","2020-11-30");
|
|
|
|
|
|
+ BytedanceAccountReportTaskRecord reportTaskRecord2 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-11-01", "2020-11-30");
|
|
reportTaskRecordService.save(reportTaskRecord2);
|
|
reportTaskRecordService.save(reportTaskRecord2);
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord3 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(),"2020-12-01","2020-12-31");
|
|
|
|
|
|
+ BytedanceAccountReportTaskRecord reportTaskRecord3 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-12-01", "2020-12-31");
|
|
reportTaskRecordService.save(reportTaskRecord3);
|
|
reportTaskRecordService.save(reportTaskRecord3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -538,15 +538,15 @@ public class SampleTest {
|
|
// }
|
|
// }
|
|
|
|
|
|
AiKuaishouAccountTargetTemplate accountTargetTemplate2 = aiKuaishouAccountTargetTemplateService.getById(120001);
|
|
AiKuaishouAccountTargetTemplate accountTargetTemplate2 = aiKuaishouAccountTargetTemplateService.getById(120001);
|
|
- aiKuaishouNewCreateCampaign.kuaishouAiAddNewMaterialCreativity(accountTargetTemplate2,1);
|
|
|
|
|
|
+ aiKuaishouNewCreateCampaign.kuaishouAiAddNewMaterialCreativity(accountTargetTemplate2, 1);
|
|
}
|
|
}
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IBytedancePlanDailyReportService planDailyReportService;
|
|
private IBytedancePlanDailyReportService planDailyReportService;
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- public void etlKuaishouProjectData(){
|
|
|
|
|
|
+ public void etlKuaishouProjectData() {
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(1660666858777607L);
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(1660666858777607L);
|
|
- reportService.getAdvertiserPlanReport(token,DateUtils.parseDate("2021-01-25","yyyy-MM-dd"),DateUtils.parseDate("2021-01-25","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
|
|
+ reportService.getAdvertiserPlanReport(token, DateUtils.parseDate("2021-01-25", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-25", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
}
|
|
}
|
|
}
|
|
}
|