|
@@ -12,10 +12,10 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskServic
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
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.mapper.KuaishouReportDailyAccountMapper;
|
|
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouCostGroupService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouCostGroupService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
|
|
import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
|
|
import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
|
|
|
|
+import cn.com.ctop.oa.modules.service.IWechatDepartmentService;
|
|
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.oa.modules.service.IWechatUserListService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
@@ -55,11 +55,8 @@ public class SampleTest {
|
|
private IByteDanceAdvertiserDataService advertiserDataService;
|
|
private IByteDanceAdvertiserDataService advertiserDataService;
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
|
|
private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ICtopOauthTokenService tokenService;
|
|
private ICtopOauthTokenService tokenService;
|
|
- @Autowired
|
|
|
|
- private KuaishouReportDailyAccountMapper reportDailyAccountMapper;
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void loadBytedanceCreativeData() {
|
|
public void loadBytedanceCreativeData() {
|
|
@@ -78,10 +75,7 @@ public class SampleTest {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void loadKuaishouCookie() {
|
|
public void loadKuaishouCookie() {
|
|
- reportDailyAccountMapper.loadAccountDailyReport(23212L, "D://report2//8206288_1.csv");
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /* List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
|
|
|
|
|
|
+ List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
|
|
if (list != null && !list.isEmpty()) {
|
|
if (list != null && !list.isEmpty()) {
|
|
int i = 0;
|
|
int i = 0;
|
|
for (BindAccountLogin login : list) {
|
|
for (BindAccountLogin login : list) {
|
|
@@ -90,11 +84,10 @@ public class SampleTest {
|
|
i++;
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static ExecutorService executorService = null;
|
|
static ExecutorService executorService = null;
|
|
- //线程计数器/bytedance/bytedanceMaterialReport
|
|
|
|
static CountDownLatch countDownLatch = null;
|
|
static CountDownLatch countDownLatch = null;
|
|
|
|
|
|
@Test
|
|
@Test
|
|
@@ -141,11 +134,11 @@ public class SampleTest {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- public void loadBytedancePlanData() {
|
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(100198696723L);
|
|
|
|
-// advertiserDataService.getAdvertiserPlan(token, "", null, null);
|
|
|
|
- Date getDate = DateUtils.addDay(new Date(), 0);
|
|
|
|
- reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
|
|
|
+ public void loadKuaishouPlanData() {
|
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), -1);
|
|
|
|
+ //1:查询当日数据
|
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
|
+ tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate));
|
|
}
|
|
}
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -218,20 +211,22 @@ public class SampleTest {
|
|
System.out.println("素材数据获取完成");
|
|
System.out.println("素材数据获取完成");
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
|
|
private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
- public void testData(){
|
|
|
|
|
|
+ public void testData() {
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
executorService = Executors.newFixedThreadPool(10);
|
|
executorService = Executors.newFixedThreadPool(10);
|
|
countDownLatch = new CountDownLatch(tokens.size());
|
|
countDownLatch = new CountDownLatch(tokens.size());
|
|
- tokens.forEach(token -> executorService.submit(()->{
|
|
|
|
|
|
+ tokens.forEach(token -> executorService.submit(() -> {
|
|
try {
|
|
try {
|
|
- reportService.getAdvertiserPlanRuleData(token,date,date,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ reportService.getAdvertiserPlanRuleData(token, date, date, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
|
- }finally {
|
|
|
|
|
|
+ } finally {
|
|
countDownLatch.countDown();
|
|
countDownLatch.countDown();
|
|
}
|
|
}
|
|
}));
|
|
}));
|
|
@@ -241,6 +236,7 @@ public class SampleTest {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void loadKuaishouAgentData() {
|
|
public void loadKuaishouAgentData() {
|
|
kuaishouReportDailyAgentService.loginAgent();
|
|
kuaishouReportDailyAgentService.loginAgent();
|
|
@@ -253,6 +249,19 @@ public class SampleTest {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ public void loadKuaishouHourlyReportData(){
|
|
|
|
+ Date getDate = new Date();
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
|
|
|
|
+ String hour = simpleDateFormat.format(getDate);
|
|
|
|
+ if ("00".equals(hour)) {
|
|
|
|
+ getDate = DateUtils.addDay(getDate, -1);
|
|
|
|
+ }
|
|
|
|
+ //1:查询当日数据
|
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
|
+ Date finalGetDate = getDate;
|
|
|
|
+ tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserReportHourly(token, finalGetDate, finalGetDate));
|
|
|
|
+ }
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaishouInterfaceService kuaishouInterfaceService;
|
|
private IKuaishouInterfaceService kuaishouInterfaceService;
|
|
|
|
|
|
@@ -296,12 +305,29 @@ public class SampleTest {
|
|
alarmEventSendService.matchAlarmRules("HOUR");
|
|
alarmEventSendService.matchAlarmRules("HOUR");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IWechatCheckinDataService wechatCheckinDataService;
|
|
private IWechatCheckinDataService wechatCheckinDataService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private IWechatDepartmentService wechatDepartmentService;
|
|
|
|
+ @Autowired
|
|
private IWechatUserListService wechatUserInfoService;
|
|
private IWechatUserListService wechatUserInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private IWechatNoListService wechatNoListService;
|
|
private IWechatNoListService wechatNoListService;
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ public void getData() {
|
|
|
|
+ //汇创 人员
|
|
|
|
+// wechatUserInfoService.getUserList();
|
|
|
|
+// //考勤记录
|
|
|
|
+// wechatCheckinDataService.getCheckinData("2020-11-01 00:00:00", "2020-12-01 23:59:59");
|
|
|
|
+ //异常记录
|
|
|
|
+// wechatNoListService.getNoDateByNo("2020-11-01 00:00:00", "2020-12-01 23:59:59", "0");
|
|
|
|
+ //优容
|
|
|
|
+ wechatUserInfoService.getYRUserList();
|
|
|
|
+ wechatCheckinDataService.getYRCheckinData("2020-11-01 00:00:00", "2020-11-30 23:59:59");
|
|
|
|
+ wechatNoListService.getNoDateByNo("2020-11-01 00:00:00", "2020-12-01 23:59:59", "1");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|