|
@@ -94,9 +94,9 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
log.info("统计时间所在年" + thisYear + "月" + thisMonth + "季" + thisQuarter);
|
|
|
|
|
|
//快手有效视频(新)
|
|
|
- kuaishouNewEffiVideo(calcDate, effiCalcStart, effiFirstWeekCalcEnd, thisYear, thisMonth, thisQuarter, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
|
|
|
+ //kuaishouNewEffiVideo(calcDate, effiCalcStart, effiFirstWeekCalcEnd, thisYear, thisMonth, thisQuarter, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
|
|
|
//头条有效视频
|
|
|
- //toutiaoEffiVideo(calcDate, effiCalcStart, effiCalcEnd, effiStart, effiEnd, thisYear, thisMonth, thisQuarter);
|
|
|
+ toutiaoNewEffiVideo(calcDate, effiCalcStart, effiFirstWeekCalcEnd, thisYear, thisMonth, thisQuarter, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
|
|
|
}
|
|
|
|
|
|
//快手有效视频统计
|
|
@@ -259,13 +259,13 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
List<String> md5List = userEfficientVideoMapMapper.getWeekCostMd5(effiCalcStart, effiFirstWeekCalcEnd);
|
|
|
//2.排除第一周之前产生消耗的md5以及14天内消耗<5000的md5
|
|
|
for (String md5:md5List){
|
|
|
- //有效视频表格去重
|
|
|
+ //有效视频去重--如果之前在对应的媒体中存在的话就跳过
|
|
|
int signatureCount = userEfficientVideoMapMapper.getEffiVideoCountBySignature(md5, appType);//1头条 2快手
|
|
|
if (signatureCount != 0) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- Integer count = userEfficientVideoMapMapper.BeforeWeekCostCount(md5, effiCalcStart);
|
|
|
+ Integer count = userEfficientVideoMapMapper.beforeWeekCostCount(md5, effiCalcStart);
|
|
|
//如果第一周之前就有消耗的话排除
|
|
|
if(count>0){
|
|
|
continue;
|
|
@@ -363,6 +363,121 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
}
|
|
|
log.info("快手有效视频统计结束,统计时间为 " + calcDate);
|
|
|
}
|
|
|
+
|
|
|
+ //toutiao新有效视频统计
|
|
|
+ private void toutiaoNewEffiVideo(Date calcDate, String effiCalcStart, String effiFirstWeekCalcEnd, int thisYear, int thisMonth, int thisQuarter, String friday, String thursday) {
|
|
|
+ log.info("toutiao有效视频统计开始,统计时间为 " + calcDate);
|
|
|
+ //List<EffiVideoDTO> effiList = new ArrayList<>();
|
|
|
+ Integer appType = 1;
|
|
|
+
|
|
|
+ //1.计算第一周(周五-下周周四)所有有消耗得md5
|
|
|
+ List<String> md5List = userEfficientVideoMapMapper.toutiaoGetWeekCostMd5(effiCalcStart, effiFirstWeekCalcEnd);
|
|
|
+ //2.排除第一周之前产生消耗的md5以及14天内消耗<5000的md5
|
|
|
+ for (String md5:md5List){
|
|
|
+ //有效视频去重--如果之前在对应的媒体中存在的话就跳过
|
|
|
+ int signatureCount = userEfficientVideoMapMapper.getEffiVideoCountBySignature(md5, appType);//1头条 2快手
|
|
|
+ if (signatureCount != 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer count = userEfficientVideoMapMapper.toutiaoBeforeWeekCostCount(md5, effiCalcStart);
|
|
|
+ //如果第一周之前就有消耗的话排除
|
|
|
+ if(count>0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String videoEarlistCostDate = userEfficientVideoMapMapper.getToutiaoVideoEarlistCostDate(md5);
|
|
|
+ String videoEndCostDate = null;
|
|
|
+ try {
|
|
|
+ videoEndCostDate = DateUtils.formatDate(DateUtils.addDay(videoEarlistCostDate, 13)); //有效视频发布开始时间
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ //如果从产生消耗开始时间14天内总消耗<5000,则排除掉
|
|
|
+ BigDecimal videoTotalCost = userEfficientVideoMapMapper.toutiaoVideoTotalCostInDates(md5, videoEarlistCostDate, videoEndCostDate);
|
|
|
+ if( (videoTotalCost.subtract(new BigDecimal("5000"))).compareTo(BigDecimal.ZERO) < 0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取该视频的编导、剪辑、拍摄、平面等信息
|
|
|
+ EffiVideoDTO effiVideoDTO = userEfficientVideoMapMapper.getDesignerInfoByCode(md5);
|
|
|
+ if(effiVideoDTO == null){
|
|
|
+ effiVideoDTO = new EffiVideoDTO();
|
|
|
+ }
|
|
|
+ effiVideoDTO.setSignature(md5);
|
|
|
+ effiVideoDTO.setCharge(videoTotalCost);
|
|
|
+
|
|
|
+ String companyId = null;
|
|
|
+ //根据编导id获取视频所属分公司
|
|
|
+ if(StringUtils.isNotBlank(effiVideoDTO.getPlanId())) {
|
|
|
+ companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId(effiVideoDTO.getPlanId());
|
|
|
+ }
|
|
|
+
|
|
|
+ UserEfficientVideoMap shot = new UserEfficientVideoMap();
|
|
|
+ UserEfficientVideoMap plane = new UserEfficientVideoMap();
|
|
|
+ UserEfficientVideoMap plan = new UserEfficientVideoMap();
|
|
|
+ UserEfficientVideoMap clip = new UserEfficientVideoMap();
|
|
|
+
|
|
|
+ //拍摄
|
|
|
+ shot.setUserId(effiVideoDTO.getShotId());
|
|
|
+ shot.setEfficientVideoSignature(effiVideoDTO.getSignature());
|
|
|
+ shot.setQuarter(thisQuarter);
|
|
|
+ shot.setAppType(appType); //1头条 2快手
|
|
|
+ shot.setYear(thisYear);
|
|
|
+ shot.setMonth(thisMonth);
|
|
|
+ shot.setCalcDate(calcDate);
|
|
|
+ shot.setRoleId("7bff9afed625aeeabca6bffe3c189183");
|
|
|
+ shot.setWeekStart(friday);
|
|
|
+ shot.setWeekEnd(thursday);
|
|
|
+ shot.setCompanyId(companyId);
|
|
|
+ userEfficientVideoMapMapper.insert(shot);
|
|
|
+
|
|
|
+ //平面
|
|
|
+ plane.setUserId(effiVideoDTO.getPlaneId());
|
|
|
+ plane.setEfficientVideoSignature(effiVideoDTO.getSignature());
|
|
|
+ plane.setQuarter(thisQuarter);
|
|
|
+ plane.setAppType(appType); //1头条 2快手
|
|
|
+ plane.setYear(thisYear);
|
|
|
+ plane.setMonth(thisMonth);
|
|
|
+ plane.setCalcDate(calcDate);
|
|
|
+ plane.setRoleId("8dc30cb9810bde89bdc3fa8a85b830b0");
|
|
|
+ plane.setWeekStart(friday);
|
|
|
+ plane.setWeekEnd(thursday);
|
|
|
+ plane.setCompanyId(companyId);
|
|
|
+ userEfficientVideoMapMapper.insert(plane);
|
|
|
+
|
|
|
+ //编导
|
|
|
+ plan.setUserId(effiVideoDTO.getPlanId());
|
|
|
+ plan.setEfficientVideoSignature(effiVideoDTO.getSignature());
|
|
|
+ plan.setQuarter(thisQuarter);
|
|
|
+ plan.setAppType(appType); //1头条 2快手
|
|
|
+ plan.setYear(thisYear);
|
|
|
+ plan.setMonth(thisMonth);
|
|
|
+ plan.setCalcDate(calcDate);
|
|
|
+ plan.setRoleId("0214283aa16f943efbb149ea4bb18f18");
|
|
|
+ plan.setWeekStart(friday);
|
|
|
+ plan.setWeekEnd(thursday);
|
|
|
+ plan.setCompanyId(companyId);
|
|
|
+ userEfficientVideoMapMapper.insert(plan);
|
|
|
+
|
|
|
+ //剪辑
|
|
|
+ clip.setUserId(effiVideoDTO.getClipId());
|
|
|
+ clip.setEfficientVideoSignature(effiVideoDTO.getSignature());
|
|
|
+ clip.setQuarter(thisQuarter);
|
|
|
+ clip.setAppType(appType); //1头条 2快手
|
|
|
+ clip.setYear(thisYear);
|
|
|
+ clip.setMonth(thisMonth);
|
|
|
+ clip.setCalcDate(calcDate);
|
|
|
+ clip.setRoleId("f38d8d70cf7ec50d5357a749e4dbf8ee");
|
|
|
+ clip.setWeekStart(friday);
|
|
|
+ clip.setWeekEnd(thursday);
|
|
|
+ clip.setCompanyId(companyId);
|
|
|
+ userEfficientVideoMapMapper.insert(clip);
|
|
|
+
|
|
|
+ //有效视频同步到有效视频素材库--测试的时候不打开,生产打开
|
|
|
+ //userEfficientVideoMapMapper.updateToutiaoEffiType(2, effiVideoDTO.getSignature());
|
|
|
+ }
|
|
|
+ log.info("toutiao有效视频统计结束,统计时间为 " + calcDate);
|
|
|
+ }
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
//新有效视频计算结束
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|