|
@@ -1,11 +1,11 @@
|
|
package cn.com.ctop.toutiao.modules.link.service.impl;
|
|
package cn.com.ctop.toutiao.modules.link.service.impl;
|
|
|
|
|
|
|
|
+import cn.com.ctop.common.module.utils.Check;
|
|
import cn.com.ctop.toutiao.modules.link.entity.BaseReportBytedanceVideoDaily;
|
|
import cn.com.ctop.toutiao.modules.link.entity.BaseReportBytedanceVideoDaily;
|
|
import cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo;
|
|
import cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo;
|
|
import cn.com.ctop.toutiao.modules.link.mapper.ETLReportBytedanceVideoMapper;
|
|
import cn.com.ctop.toutiao.modules.link.mapper.ETLReportBytedanceVideoMapper;
|
|
import cn.com.ctop.toutiao.modules.link.service.IBaseReportBytedanceVideoDailyService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IBaseReportBytedanceVideoDailyService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -30,32 +30,32 @@ public class ETLReportBytedanceVideoServiceImpl extends ServiceImpl<ETLReportByt
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<BaseReportBytedanceVideoDaily> listByStatDate(String statDate) {
|
|
public List<BaseReportBytedanceVideoDaily> listByStatDate(String statDate) {
|
|
- QueryWrapper<BaseReportBytedanceVideoDaily> queryWrapper= new QueryWrapper<>();
|
|
|
|
- queryWrapper.eq("stat_datetime",statDate);
|
|
|
|
|
|
+ QueryWrapper<BaseReportBytedanceVideoDaily> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("stat_datetime", statDate);
|
|
return baseReportBytedanceVideoDailyService.list(queryWrapper);
|
|
return baseReportBytedanceVideoDailyService.list(queryWrapper);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void cleanETL(String statDate) {
|
|
public void cleanETL(String statDate) {
|
|
List<ETLReportBytedanceVideo> etlReportBytedanceVideos = etlReportBytedanceVideoMapper.queryETLData(statDate);
|
|
List<ETLReportBytedanceVideo> etlReportBytedanceVideos = etlReportBytedanceVideoMapper.queryETLData(statDate);
|
|
- System.out.println(statDate+":"+etlReportBytedanceVideos.size());
|
|
|
|
- if(etlReportBytedanceVideos.isEmpty()){
|
|
|
|
- log.warn("{},头条etl报表清洗异常,base数据源为空",statDate);
|
|
|
|
|
|
+ System.out.println(statDate + ":" + etlReportBytedanceVideos.size());
|
|
|
|
+ if (etlReportBytedanceVideos.isEmpty()) {
|
|
|
|
+ log.warn("{},头条etl报表清洗异常,base数据源为空", statDate);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
boolean result = this.saveBatch(etlReportBytedanceVideos);
|
|
boolean result = this.saveBatch(etlReportBytedanceVideos);
|
|
- if(result){
|
|
|
|
- log.info("{},头条etl报表清洗完成,数量:{}",statDate,etlReportBytedanceVideos.size());
|
|
|
|
- } else{
|
|
|
|
- log.error("{},头条etl报表清洗失败,请重试",statDate);
|
|
|
|
|
|
+ if (result) {
|
|
|
|
+ log.info("{},头条etl报表清洗完成,数量:{}", statDate, etlReportBytedanceVideos.size());
|
|
|
|
+ } else {
|
|
|
|
+ log.error("{},头条etl报表清洗失败,请重试", statDate);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void cleanData(String date){
|
|
|
|
|
|
+ public void cleanData(String date) {
|
|
List<ETLReportBytedanceVideo> videos = etlReportBytedanceVideoMapper.getDuplicateVideoInfo(date);
|
|
List<ETLReportBytedanceVideo> videos = etlReportBytedanceVideoMapper.getDuplicateVideoInfo(date);
|
|
- if(null!=videos&&!videos.isEmpty()){
|
|
|
|
- videos.forEach(video->{
|
|
|
|
|
|
+ if (null != videos && !videos.isEmpty()) {
|
|
|
|
+ videos.forEach(video -> {
|
|
etlReportBytedanceVideoMapper.deleteDuplicateVideoInfo(video);
|
|
etlReportBytedanceVideoMapper.deleteDuplicateVideoInfo(video);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -63,32 +63,40 @@ public class ETLReportBytedanceVideoServiceImpl extends ServiceImpl<ETLReportByt
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void etlBytedanceVideoClipIdJob(String date) {
|
|
public void etlBytedanceVideoClipIdJob(String date) {
|
|
- List <ETLReportBytedanceVideo> clipInfos = etlReportBytedanceVideoMapper.getBytedanceVideoClipInfo(date);
|
|
|
|
- if(null!=clipInfos&&!clipInfos.isEmpty()){
|
|
|
|
- clipInfos.forEach(clipInfo->{
|
|
|
|
- etlReportBytedanceVideoMapper.updateClipInfo(clipInfo.getClipId(),clipInfo.getClipName(),clipInfo.getMd5());
|
|
|
|
|
|
+ List<ETLReportBytedanceVideo> clipInfos = etlReportBytedanceVideoMapper.getBytedanceVideoClipInfo(date);
|
|
|
|
+ if (null != clipInfos && !clipInfos.isEmpty()) {
|
|
|
|
+ clipInfos.forEach(clipInfo -> {
|
|
|
|
+
|
|
|
|
+ String teamLeader = clipInfo.getTeamLeader();
|
|
|
|
+ if (Check.isNull(teamLeader)) {
|
|
|
|
+ String leaderName = etlReportBytedanceVideoMapper.getLeaderNameById(clipInfo.getClipId());
|
|
|
|
+ clipInfo.setTeamLeader(leaderName);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ etlReportBytedanceVideoMapper.updateClipInfo(clipInfo.getClipId(), clipInfo.getClipName(), clipInfo.getTeamLeader(), clipInfo.getMd5());
|
|
|
|
+
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- etlReportBytedanceVideoMapper.updateDesignTeamLeader(date);
|
|
|
|
- etlReportBytedanceVideoMapper.updateTeamLeader(date);
|
|
|
|
|
|
+ /* etlReportBytedanceVideoMapper.updateDesignTeamLeader(date);
|
|
|
|
+ etlReportBytedanceVideoMapper.updateTeamLeader(date);*/
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void etlBytedanceVideoPlanInfoJob() {
|
|
public void etlBytedanceVideoPlanInfoJob() {
|
|
- List <ETLReportBytedanceVideo> planInfos = etlReportBytedanceVideoMapper.getBytedanceVideoPlanInfo();
|
|
|
|
- if(null!=planInfos&&!planInfos.isEmpty()){
|
|
|
|
- planInfos.forEach(planInfo->{
|
|
|
|
- etlReportBytedanceVideoMapper.updatePlanInfo(planInfo.getPlanId(),planInfo.getPlanName(),planInfo.getMd5());
|
|
|
|
|
|
+ List<ETLReportBytedanceVideo> planInfos = etlReportBytedanceVideoMapper.getBytedanceVideoPlanInfo();
|
|
|
|
+ if (null != planInfos && !planInfos.isEmpty()) {
|
|
|
|
+ planInfos.forEach(planInfo -> {
|
|
|
|
+ etlReportBytedanceVideoMapper.updatePlanInfo(planInfo.getPlanId(), planInfo.getPlanName(), planInfo.getMd5());
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void etlBytedanceVideoShotInfoJob() {
|
|
public void etlBytedanceVideoShotInfoJob() {
|
|
- List <ETLReportBytedanceVideo> shotInfos = etlReportBytedanceVideoMapper.getBytedanceVideoShotInfo();
|
|
|
|
- if(null!=shotInfos&&!shotInfos.isEmpty()){
|
|
|
|
- shotInfos.forEach(shotInfo->{
|
|
|
|
- etlReportBytedanceVideoMapper.updateShotInfo(shotInfo.getShotId(),shotInfo.getShotName(),shotInfo.getMd5());
|
|
|
|
|
|
+ List<ETLReportBytedanceVideo> shotInfos = etlReportBytedanceVideoMapper.getBytedanceVideoShotInfo();
|
|
|
|
+ if (null != shotInfos && !shotInfos.isEmpty()) {
|
|
|
|
+ shotInfos.forEach(shotInfo -> {
|
|
|
|
+ etlReportBytedanceVideoMapper.updateShotInfo(shotInfo.getShotId(), shotInfo.getShotName(), shotInfo.getMd5());
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|