|
@@ -21,6 +21,8 @@ import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
|
|
|
import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
|
import cn.com.ctop.oa.modules.service.IWechatUserListService;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
|
+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.service.*;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -28,11 +30,13 @@ import org.apache.catalina.User;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
+import org.openqa.selenium.By;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
@@ -388,16 +392,35 @@ public class SampleTest {
|
|
|
@Autowired
|
|
|
private IRuleKuaiShouPlanService ruleKuaiShouPlanService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
|
|
|
@Test
|
|
|
public void execute() {
|
|
|
- List<UserAllocation> allocations = allocationService.getByMediaId("3");
|
|
|
+ List<UserAllocation> allocations = allocationService.listByMediaId("3",0);
|
|
|
for (UserAllocation allocation:allocations) {
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
-// load12Data(token);
|
|
|
- load12AccountData(token);
|
|
|
+ BytedanceAccountReportTaskRecord reportTaskRecord1 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(),"2020-10-01","2020-10-31");
|
|
|
+ reportTaskRecordService.save(reportTaskRecord1);
|
|
|
+ BytedanceAccountReportTaskRecord reportTaskRecord2 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(),"2020-11-01","2020-11-30");
|
|
|
+ reportTaskRecordService.save(reportTaskRecord2);
|
|
|
+ BytedanceAccountReportTaskRecord reportTaskRecord3 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(),"2020-12-01","2020-12-31");
|
|
|
+ reportTaskRecordService.save(reportTaskRecord3);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void loadBDAccoutData() {
|
|
|
+ CtopOauthToken token2 = tokenService.getTokenByAccountId(1674206482908163L);
|
|
|
+ bytedanceReportService.bytedanceMaterialReport(token2, "2020-10-14", "2020-10-14");
|
|
|
+ bytedanceReportMaterialDailyMapper.updateImageReportCode();
|
|
|
+ bytedanceReportMaterialDailyMapper.updateImageReportProjectId();
|
|
|
+ bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
|
|
|
+ bytedanceReportMaterialDailyMapper.updateImageReportPlaneId();
|
|
|
+ bytedanceReportMaterialDailyMapper.updateImageReportPlaneName();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
|
|
|
+
|
|
|
private void load12AccountData(CtopOauthToken token) {
|
|
|
reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-10-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-10-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-11-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-11-30", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
@@ -405,13 +428,10 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
private void load12Data(CtopOauthToken token) {
|
|
|
-// bytedanceReportService.bytedanceMaterialReport(token, "2020-10-01", "2020-10-05");
|
|
|
-// bytedanceReportService.bytedanceMaterialReport(token, "2020-10-06", "2020-10-10");
|
|
|
-// bytedanceReportService.bytedanceMaterialReport(token, "2020-10-11", "2020-10-15");
|
|
|
-// bytedanceReportService.bytedanceMaterialReport(token, "2020-10-16", "2020-10-20");
|
|
|
-// bytedanceReportService.bytedanceMaterialReport(token, "2020-10-21", "2020-10-25");
|
|
|
-// bytedanceReportService.bytedanceMaterialReport(token, "2020-10-26", "2020-10-31");
|
|
|
- bytedanceReportService.bytedanceMaterialReport(token, "2020-10-03", "2020-10-04");
|
|
|
+ bytedanceReportService.bytedanceMaterialReport(token, "2020-10-11", "2020-10-13");
|
|
|
+ bytedanceReportService.bytedanceMaterialReport(token, "2020-10-14", "2020-10-16");
|
|
|
+ bytedanceReportService.bytedanceMaterialReport(token, "2020-10-17", "2020-10-19");
|
|
|
+ bytedanceReportService.bytedanceMaterialReport(token, "2020-10-20", "2020-10-21");
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
@@ -481,11 +501,15 @@ public class SampleTest {
|
|
|
// if (null == accountTargetTemplates || accountTargetTemplates.isEmpty()) {
|
|
|
// return;
|
|
|
// }
|
|
|
+
|
|
|
+ AiKuaishouAccountTargetTemplate accountTargetTemplate0 = aiKuaishouAccountTargetTemplateService.getById(1);
|
|
|
+ aiKuaishouNewCreateCampaign.kuaishouAiAddNewMaterialCreativity(accountTargetTemplate0,50);
|
|
|
+
|
|
|
AiKuaishouAccountTargetTemplate accountTargetTemplate1 = aiKuaishouAccountTargetTemplateService.getById(30002);
|
|
|
- aiKuaishouNewCreateCampaign.kuaishouAiAddNewMaterialCreativity(accountTargetTemplate1);
|
|
|
+ aiKuaishouNewCreateCampaign.kuaishouAiAddNewMaterialCreativity(accountTargetTemplate1,50);
|
|
|
|
|
|
AiKuaishouAccountTargetTemplate accountTargetTemplate2 = aiKuaishouAccountTargetTemplateService.getById(30001);
|
|
|
- aiKuaishouNewCreateCampaign.kuaishouAiAddNewMaterialCreativity(accountTargetTemplate2);
|
|
|
+ aiKuaishouNewCreateCampaign.kuaishouAiAddNewMaterialCreativity(accountTargetTemplate2,50);
|
|
|
}
|
|
|
|
|
|
@Test
|