|
@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.security.Signature;
|
|
|
import java.text.ParseException;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -98,12 +99,14 @@ 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));
|
|
|
//头条有效视频(新)
|
|
|
- toutiaoNewEffiVideo(calcDate, effiCalcStart, effiFirstWeekCalcEnd, thisYear, thisMonth, thisQuarter, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
|
|
|
+ //toutiaoNewEffiVideo(calcDate, effiCalcStart, effiFirstWeekCalcEnd, thisYear, thisMonth, thisQuarter, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
|
|
|
|
|
|
- //总视频
|
|
|
- kuaishouNewVideo( calcDate, thisYear, thisQuarter, thisMonth, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
|
|
|
+ //快手总视频
|
|
|
+ //newKuaishouVideo( calcDate, thisYear, thisQuarter, thisMonth, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
|
|
|
+ //头条总视频
|
|
|
+ newToutiaoVideo( calcDate, thisYear, thisQuarter, thisMonth, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
|
|
|
}
|
|
|
|
|
|
//快手有效视频统计
|
|
@@ -327,6 +330,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
shot.setWeekStart(friday);
|
|
|
shot.setWeekEnd(thursday);
|
|
|
shot.setCompanyId(companyId);
|
|
|
+ shot.setCost(effiVideoDTO.getCharge());
|
|
|
userEfficientVideoMapMapper.insert(shot);
|
|
|
|
|
|
//平面
|
|
@@ -341,6 +345,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
plane.setWeekStart(friday);
|
|
|
plane.setWeekEnd(thursday);
|
|
|
plane.setCompanyId(companyId);
|
|
|
+ plane.setCost(effiVideoDTO.getCharge());
|
|
|
userEfficientVideoMapMapper.insert(plane);
|
|
|
|
|
|
//编导
|
|
@@ -355,6 +360,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
plan.setWeekStart(friday);
|
|
|
plan.setWeekEnd(thursday);
|
|
|
plan.setCompanyId(companyId);
|
|
|
+ plan.setCost(effiVideoDTO.getCharge());
|
|
|
userEfficientVideoMapMapper.insert(plan);
|
|
|
|
|
|
//剪辑
|
|
@@ -369,6 +375,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
clip.setWeekStart(friday);
|
|
|
clip.setWeekEnd(thursday);
|
|
|
clip.setCompanyId(companyId);
|
|
|
+ clip.setCost(effiVideoDTO.getCharge());
|
|
|
userEfficientVideoMapMapper.insert(clip);
|
|
|
|
|
|
//有效视频同步到有效视频素材库--测试的时候不打开,生产打开
|
|
@@ -449,6 +456,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
shot.setWeekStart(friday);
|
|
|
shot.setWeekEnd(thursday);
|
|
|
shot.setCompanyId(companyId);
|
|
|
+ shot.setCost(effiVideoDTO.getCharge());
|
|
|
userEfficientVideoMapMapper.insert(shot);
|
|
|
|
|
|
//平面
|
|
@@ -463,6 +471,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
plane.setWeekStart(friday);
|
|
|
plane.setWeekEnd(thursday);
|
|
|
plane.setCompanyId(companyId);
|
|
|
+ plane.setCost(effiVideoDTO.getCharge());
|
|
|
userEfficientVideoMapMapper.insert(plane);
|
|
|
|
|
|
//编导
|
|
@@ -477,6 +486,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
plan.setWeekStart(friday);
|
|
|
plan.setWeekEnd(thursday);
|
|
|
plan.setCompanyId(companyId);
|
|
|
+ plan.setCost(effiVideoDTO.getCharge());
|
|
|
userEfficientVideoMapMapper.insert(plan);
|
|
|
|
|
|
//剪辑
|
|
@@ -491,6 +501,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
clip.setWeekStart(friday);
|
|
|
clip.setWeekEnd(thursday);
|
|
|
clip.setCompanyId(companyId);
|
|
|
+ clip.setCost(effiVideoDTO.getCharge());
|
|
|
userEfficientVideoMapMapper.insert(clip);
|
|
|
|
|
|
//有效视频同步到有效视频素材库--测试的时候不打开,生产打开
|
|
@@ -505,16 +516,24 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
//新总视频计算开始
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
- public void kuaishouNewVideo(Date calcDate, int thisYear, int thisQuarter, int thisMonth, String friday, String thursday){
|
|
|
+ public void newKuaishouVideo(Date calcDate, int thisYear, int thisQuarter, int thisMonth, String friday, String thursday){
|
|
|
log.info("设计师周总视频计算开始");
|
|
|
+ Integer appType = 2;
|
|
|
+ //获取创建时间在计算周时间范围内的创意
|
|
|
List<String> videoMd5s = userEfficientVideoMapMapper.getVideoByDates(friday,thursday);
|
|
|
for(String md5:videoMd5s){
|
|
|
//去重
|
|
|
- Integer signatureCount = userEfficientVideoMapMapper.getVideoCountByCode(md5);
|
|
|
+ Integer signatureCount = userEfficientVideoMapMapper.getVideoCountByCode(md5, appType);
|
|
|
if(signatureCount > 0){
|
|
|
continue;
|
|
|
}
|
|
|
//
|
|
|
+ //去除其中的视频的最早创建时间早于创建周的创意
|
|
|
+ Integer count = userEfficientVideoMapMapper.kuaishouCreativeLtCount(md5,friday);
|
|
|
+ if (count >0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //
|
|
|
|
|
|
//获取该视频的编导、剪辑、拍摄、平面等信息
|
|
|
EffiVideoDTO effiVideoDTO = userEfficientVideoMapMapper.getDesignerInfoByCode(md5);
|
|
@@ -535,6 +554,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getPlaneId() );
|
|
|
}
|
|
|
|
|
|
+ String creativeDate = userEfficientVideoMapMapper.kuaishouCreativeEarlistDate(md5);
|
|
|
+
|
|
|
UserVideoMap shot = new UserVideoMap();
|
|
|
UserVideoMap plane = new UserVideoMap();
|
|
|
UserVideoMap plan = new UserVideoMap();
|
|
@@ -551,6 +572,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
shot.setWeekStart(friday);
|
|
|
shot.setWeekEnd(thursday);
|
|
|
shot.setCompanyId(companyId);
|
|
|
+ shot.setAppType(appType);
|
|
|
+ shot.setCreativeDate(creativeDate);
|
|
|
userVideoMapMapper.insert(shot);
|
|
|
|
|
|
//平面
|
|
@@ -564,6 +587,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
plane.setWeekStart(friday);
|
|
|
plane.setWeekEnd(thursday);
|
|
|
plane.setCompanyId(companyId);
|
|
|
+ plane.setAppType(appType);
|
|
|
+ plane.setCreativeDate(creativeDate);
|
|
|
userVideoMapMapper.insert(plane);
|
|
|
|
|
|
//编导
|
|
@@ -577,6 +602,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
plan.setWeekStart(friday);
|
|
|
plan.setWeekEnd(thursday);
|
|
|
plan.setCompanyId(companyId);
|
|
|
+ plan.setAppType(appType);
|
|
|
+ plan.setCreativeDate(creativeDate);
|
|
|
userVideoMapMapper.insert(plan);
|
|
|
|
|
|
//剪辑
|
|
@@ -590,10 +617,121 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
clip.setWeekStart(friday);
|
|
|
clip.setWeekEnd(thursday);
|
|
|
clip.setCompanyId(companyId);
|
|
|
+ clip.setAppType(appType);
|
|
|
+ clip.setCreativeDate(creativeDate);
|
|
|
userVideoMapMapper.insert(clip);
|
|
|
}
|
|
|
- log.info("设计师周总视频计算结束");
|
|
|
+ log.info("快手设计师周总视频计算结束");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public void newToutiaoVideo(Date calcDate, int thisYear, int thisQuarter, int thisMonth, String friday, String thursday){
|
|
|
+ log.info("设计师周总视频计算开始");
|
|
|
+ Integer appType = 1;
|
|
|
+ //获取创建时间在计算周时间范围内的创意
|
|
|
+ List<String> videoMd5s = userEfficientVideoMapMapper.getToutiaoVideoByDates(friday,thursday);
|
|
|
+ for(String md5:videoMd5s){
|
|
|
+ //去重
|
|
|
+ Integer signatureCount = userEfficientVideoMapMapper.getVideoCountByCode(md5, appType);
|
|
|
+ if(signatureCount > 0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //
|
|
|
+ //去除其中的视频的最早创建时间早于创建周的创意
|
|
|
+ Integer count = userEfficientVideoMapMapper.toutiaoCreativeLtCount(md5,friday);
|
|
|
+ if (count >0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //
|
|
|
+
|
|
|
+ //获取该视频的编导、剪辑、拍摄、平面等信息
|
|
|
+ EffiVideoDTO effiVideoDTO = userEfficientVideoMapMapper.getDesignerInfoByCode(md5);
|
|
|
+ if(effiVideoDTO == null){
|
|
|
+ effiVideoDTO = new EffiVideoDTO();
|
|
|
+ }
|
|
|
+ effiVideoDTO.setSignature(md5);
|
|
|
+
|
|
|
+ String companyId = null;
|
|
|
+ //根据编导id获取视频所属分公司
|
|
|
+ if( StringUtils.isNotBlank(effiVideoDTO.getPlanId()) ) {
|
|
|
+ companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId(effiVideoDTO.getPlanId());
|
|
|
+ }else if( StringUtils.isNotBlank(effiVideoDTO.getClipId()) ){
|
|
|
+ companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getClipId() );
|
|
|
+ }else if( StringUtils.isNotBlank(effiVideoDTO.getShotId()) ){
|
|
|
+ companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getShotId() );
|
|
|
+ }else if ( StringUtils.isNotBlank(effiVideoDTO.getPlaneId()) ){
|
|
|
+ companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getPlaneId() );
|
|
|
+ }
|
|
|
+
|
|
|
+ String creativeDate = userEfficientVideoMapMapper.toutiaoCreativeEarlistDate(md5);
|
|
|
+
|
|
|
+ UserVideoMap shot = new UserVideoMap();
|
|
|
+ UserVideoMap plane = new UserVideoMap();
|
|
|
+ UserVideoMap plan = new UserVideoMap();
|
|
|
+ UserVideoMap clip = new UserVideoMap();
|
|
|
+
|
|
|
+ //拍摄
|
|
|
+ shot.setUserId(effiVideoDTO.getShotId());
|
|
|
+ shot.setVideoSignature(effiVideoDTO.getSignature());
|
|
|
+ shot.setQuarter(thisQuarter);
|
|
|
+ shot.setYear(thisYear);
|
|
|
+ shot.setMonth(thisMonth);
|
|
|
+ shot.setCalcDate(calcDate);
|
|
|
+ shot.setRoleId("shot");
|
|
|
+ shot.setWeekStart(friday);
|
|
|
+ shot.setWeekEnd(thursday);
|
|
|
+ shot.setCompanyId(companyId);
|
|
|
+ shot.setAppType(appType);
|
|
|
+ shot.setCreativeDate(creativeDate);
|
|
|
+ userVideoMapMapper.insert(shot);
|
|
|
+
|
|
|
+ //平面
|
|
|
+ plane.setUserId(effiVideoDTO.getPlaneId());
|
|
|
+ plane.setVideoSignature(effiVideoDTO.getSignature());
|
|
|
+ plane.setQuarter(thisQuarter);
|
|
|
+ plane.setYear(thisYear);
|
|
|
+ plane.setMonth(thisMonth);
|
|
|
+ plane.setCalcDate(calcDate);
|
|
|
+ plane.setRoleId("plane");
|
|
|
+ plane.setWeekStart(friday);
|
|
|
+ plane.setWeekEnd(thursday);
|
|
|
+ plane.setCompanyId(companyId);
|
|
|
+ plane.setAppType(appType);
|
|
|
+ plane.setCreativeDate(creativeDate);
|
|
|
+ userVideoMapMapper.insert(plane);
|
|
|
+
|
|
|
+ //编导
|
|
|
+ plan.setUserId(effiVideoDTO.getPlanId());
|
|
|
+ plan.setVideoSignature(effiVideoDTO.getSignature());
|
|
|
+ plan.setQuarter(thisQuarter);
|
|
|
+ plan.setYear(thisYear);
|
|
|
+ plan.setMonth(thisMonth);
|
|
|
+ plan.setCalcDate(calcDate);
|
|
|
+ plan.setRoleId("plan");
|
|
|
+ plan.setWeekStart(friday);
|
|
|
+ plan.setWeekEnd(thursday);
|
|
|
+ plan.setCompanyId(companyId);
|
|
|
+ plan.setAppType(appType);
|
|
|
+ plan.setCreativeDate(creativeDate);
|
|
|
+ userVideoMapMapper.insert(plan);
|
|
|
+
|
|
|
+ //剪辑
|
|
|
+ clip.setUserId(effiVideoDTO.getClipId());
|
|
|
+ clip.setVideoSignature(effiVideoDTO.getSignature());
|
|
|
+ clip.setQuarter(thisQuarter);
|
|
|
+ clip.setYear(thisYear);
|
|
|
+ clip.setMonth(thisMonth);
|
|
|
+ clip.setCalcDate(calcDate);
|
|
|
+ clip.setRoleId("clip");
|
|
|
+ clip.setWeekStart(friday);
|
|
|
+ clip.setWeekEnd(thursday);
|
|
|
+ clip.setCompanyId(companyId);
|
|
|
+ clip.setAppType(appType);
|
|
|
+ clip.setCreativeDate(creativeDate);
|
|
|
+ userVideoMapMapper.insert(clip);
|
|
|
+ }
|
|
|
+ log.info("快手设计师周总视频计算结束");
|
|
|
+ }
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
//新总视频计算结束
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -2227,6 +2365,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
for(String md5:md5s){
|
|
|
BigDecimal cost = userEfficientVideoMapMapper.getToutiaoSumChargeBySignature(md5, startDate, endDate);
|
|
|
if(cost== null){
|
|
|
+
|
|
|
cost = BigDecimal.ZERO;
|
|
|
}
|
|
|
totalCost = totalCost.add(cost);
|
|
@@ -2320,8 +2459,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
}
|
|
|
|
|
|
//根据userid,appType,年度,季度查询有效视频列表
|
|
|
- public List<MaterialInfo> getVideoList(String userId, String startDate, String endDate){
|
|
|
- List<MaterialInfo> materialInfoList = userEfficientVideoMapMapper.getVideoList(userId, startDate, endDate);
|
|
|
+ public List<MaterialInfo> getVideoList(Integer appType, String userId, String startDate, String endDate){
|
|
|
+ List<MaterialInfo> materialInfoList = userEfficientVideoMapMapper.getVideoList(appType, userId, startDate, endDate);
|
|
|
return materialInfoList;
|
|
|
}
|
|
|
|