|
@@ -1,6 +1,8 @@
|
|
|
package cn.com.ctop.toutiao.modules.report.service.impl;
|
|
|
|
|
|
import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
|
|
|
+import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
|
+import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
|
|
|
import cn.com.ctop.toutiao.modules.report.DTO.AccountVideoDTO;
|
|
|
import cn.com.ctop.toutiao.modules.report.entity.ByteDanceVideoReportDaily;
|
|
|
import cn.com.ctop.toutiao.modules.report.mapper.ByteDanceVideoReportDailyMapper;
|
|
@@ -35,6 +37,9 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
@Resource
|
|
|
private ByteDanceVideoReportDailyMapper byteDanceVideoReportDailyMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private CtopOauthTokenMapper ctopOauthTokenMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public void videoInfoList(String startDate, String endDate){
|
|
|
//华南
|
|
@@ -51,23 +56,26 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
wrapper.le("stat_datetime",endDate);
|
|
|
wrapper.eq("company_id", companyId);
|
|
|
byteDanceVideoReportDailyMapper.delete(wrapper);
|
|
|
-
|
|
|
- List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoList(startDate, endDate, companyId, null);
|
|
|
- if(null!=mList&&!mList.isEmpty()){
|
|
|
- List<ByteDanceVideoReportDaily> reports = new ArrayList<>();
|
|
|
- for(ByteDanceVideoReportDaily report :mList){
|
|
|
- if(null == report.getMaterialName()|| "".equals(report.getMaterialName().trim())){
|
|
|
- report.setMaterialName("-");
|
|
|
- }
|
|
|
- if(null == report.getProjectName()|| "".equals(report.getProjectName().trim())){
|
|
|
- report.setProjectName("-");
|
|
|
- }
|
|
|
- if(null == report.getAdvertiserName()|| "".equals(report.getAdvertiserName().trim())){
|
|
|
- report.setAdvertiserName("-");
|
|
|
+ //获取所有头条账户
|
|
|
+ List<CtopOauthToken> listToken = ctopOauthTokenMapper.selectToutiaoToken();
|
|
|
+ for (CtopOauthToken token : listToken) {
|
|
|
+ List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoList(startDate, endDate, companyId, token.getAccountId());
|
|
|
+ if(null!=mList&&!mList.isEmpty()){
|
|
|
+ List<ByteDanceVideoReportDaily> reports = new ArrayList<>();
|
|
|
+ for(ByteDanceVideoReportDaily report :mList){
|
|
|
+ if(null == report.getMaterialName()|| "".equals(report.getMaterialName().trim())){
|
|
|
+ report.setMaterialName("-");
|
|
|
+ }
|
|
|
+ if(null == report.getProjectName()|| "".equals(report.getProjectName().trim())){
|
|
|
+ report.setProjectName("-");
|
|
|
+ }
|
|
|
+ if(null == report.getAdvertiserName()|| "".equals(report.getAdvertiserName().trim())){
|
|
|
+ report.setAdvertiserName("-");
|
|
|
+ }
|
|
|
+ reports.add(report);
|
|
|
}
|
|
|
- reports.add(report);
|
|
|
+ byteDanceVideoReportDailyMapper.insertBatch(reports);
|
|
|
}
|
|
|
- byteDanceVideoReportDailyMapper.insertBatch(reports);
|
|
|
}
|
|
|
}
|
|
|
|