|
@@ -505,9 +505,17 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
//新总视频计算开始
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
- public void kuaishouNewVideo(Date calcDate, int thisYear, int thisQuarter, int thisMonth,String friday, String thursday){
|
|
|
+ public void kuaishouNewVideo(Date calcDate, int thisYear, int thisQuarter, int thisMonth, String friday, String thursday){
|
|
|
+ log.info("设计师周总视频计算开始");
|
|
|
List<String> videoMd5s = userEfficientVideoMapMapper.getVideoByDates(friday,thursday);
|
|
|
for(String md5:videoMd5s){
|
|
|
+ //去重
|
|
|
+ Integer signatureCount = userEfficientVideoMapMapper.getVideoCountByCode(md5);
|
|
|
+ if(signatureCount > 0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //
|
|
|
+
|
|
|
//获取该视频的编导、剪辑、拍摄、平面等信息
|
|
|
EffiVideoDTO effiVideoDTO = userEfficientVideoMapMapper.getDesignerInfoByCode(md5);
|
|
|
if(effiVideoDTO == null){
|
|
@@ -584,6 +592,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
clip.setCompanyId(companyId);
|
|
|
userVideoMapMapper.insert(clip);
|
|
|
}
|
|
|
+ log.info("设计师周总视频计算结束");
|
|
|
}
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
//新总视频计算结束
|
|
@@ -2178,24 +2187,22 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouDepartUserInfo();
|
|
|
//2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
|
|
|
for (UserDto2 userDto : userDto2List) {
|
|
|
- String roleCode = userDto.getRoleCode();
|
|
|
//2.1 获取有效视频数量
|
|
|
Integer effiVideoCount = userEfficientVideoMapMapper.getEffiVideoCountByCalcDate(startDate, endDate, userDto.getRoleId(), userDto.getUserId(), 2);
|
|
|
- //2.2 获取有效视频总数
|
|
|
- Integer videoCount = userEfficientVideoMapMapper.getQuarterMaterialCountByUserId(userDto.getRoleCode(), startDate, endDate, userDto.getUserId());
|
|
|
+ //2.2 获取视频总数
|
|
|
+ Integer videoCount = userEfficientVideoMapMapper.getVideoCountByUserId(userDto.getUserId(), startDate, endDate);
|
|
|
//2.3 总消耗
|
|
|
- BigDecimal cost = null;
|
|
|
- if ("clip".equals(roleCode)) {
|
|
|
- cost = userEfficientVideoMapMapper.getTotalCostByClipId(userDto.getUserId(), startDate, endDate);
|
|
|
- } else if ("plan".equals(roleCode)) {
|
|
|
- cost = userEfficientVideoMapMapper.getTotalCostByPlanId(userDto.getUserId(), startDate, endDate);
|
|
|
- } else if ("shot".equals(roleCode)) {
|
|
|
- cost = userEfficientVideoMapMapper.getTotalCostByShotId(userDto.getUserId(), startDate, endDate);
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
+ List<String> md5s = userEfficientVideoMapMapper.getTotalSignatureByUserId(userDto.getUserId(), startDate, endDate);
|
|
|
+ for(String md5:md5s){
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getSumChargeBySignature(md5, startDate, endDate);
|
|
|
+ if(cost== null){
|
|
|
+ cost = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ totalCost = totalCost.add(cost);
|
|
|
}
|
|
|
- if(cost == null){
|
|
|
- cost = BigDecimal.ZERO;
|
|
|
- }
|
|
|
- userDto.setCost(cost);
|
|
|
+
|
|
|
+ userDto.setCost(totalCost);
|
|
|
userDto.setVideoCount(videoCount);
|
|
|
userDto.setEffiVideoCount(effiVideoCount);
|
|
|
}
|
|
@@ -2213,16 +2220,9 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
//2.1 获取有效视频数量
|
|
|
Integer effiVideoCount = userEfficientVideoMapMapper.getEffiVideoCountByCalcDate(startDate, endDate, userDto.getRoleId(), userDto.getUserId(), 1);
|
|
|
//2.2 获取视频总数
|
|
|
- Integer videoCount = userEfficientVideoMapMapper.getQuarterMaterialCountByUserId(userDto.getRoleCode(), startDate, endDate, userDto.getUserId());
|
|
|
+ Integer videoCount = userEfficientVideoMapMapper.getVideoCountByUserId(userDto.getUserId(), startDate, endDate);
|
|
|
//2.3 总消耗
|
|
|
- BigDecimal cost = null;
|
|
|
- if ("clip".equals(roleCode)) {
|
|
|
- cost = userEfficientVideoMapMapper.toutiaoGetTotalCostByClipId(userDto.getUserId(), startDate, endDate);
|
|
|
- } else if ("plan".equals(roleCode)) {
|
|
|
- cost = userEfficientVideoMapMapper.toutiaoGetTotalCostByPlanId(userDto.getUserId(), startDate, endDate);
|
|
|
- } else if ("shot".equals(roleCode)) {
|
|
|
- cost = userEfficientVideoMapMapper.toutiaoGetTotalCostByShotId(userDto.getUserId(), startDate, endDate);
|
|
|
- }
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getTotalCostByUserId(userDto.getUserId(), startDate, endDate);
|
|
|
|
|
|
if(cost == null){
|
|
|
cost = BigDecimal.ZERO;
|
|
@@ -2316,6 +2316,12 @@ 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);
|
|
|
+ return materialInfoList;
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据userid,appType,年度,季度查询有效视频列表
|
|
|
public List<MaterialInfo> getEffiWeekVideoList(Integer appType, String startDate, String endDate, String userId){
|
|
|
List<MaterialInfo> materialInfoList = userEfficientVideoMapMapper.getEffiWeekVideoList(appType, startDate, endDate, userId);
|
|
|
return materialInfoList;
|