|
@@ -1,5 +1,7 @@
|
|
package org.jeecg.modules.system.service.impl;
|
|
package org.jeecg.modules.system.service.impl;
|
|
|
|
|
|
|
|
+import cn.com.ctop.accountvideoquarterinfo.entity.AccountVideoQuarterInfo;
|
|
|
|
+import cn.com.ctop.accountvideoquarterinfo.mapper.AccountVideoQuarterInfoMapper;
|
|
import cn.com.ctop.common.module.entity.MaterialInfo;
|
|
import cn.com.ctop.common.module.entity.MaterialInfo;
|
|
import cn.com.ctop.performanceaccount.entity.PerformanceAccount;
|
|
import cn.com.ctop.performanceaccount.entity.PerformanceAccount;
|
|
import cn.com.ctop.performanceappraisal.entity.Performance;
|
|
import cn.com.ctop.performanceappraisal.entity.Performance;
|
|
@@ -49,6 +51,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
private PlaneProjectCostMapper planeProjectCostMapper;
|
|
private PlaneProjectCostMapper planeProjectCostMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private UserVideoMapMapper userVideoMapMapper;
|
|
private UserVideoMapMapper userVideoMapMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private AccountVideoQuarterInfoMapper accountVideoQuarterInfoMapper;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//有效视频计算开始
|
|
//有效视频计算开始
|
|
@@ -704,7 +708,16 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
for (int i = 0; i <= top30 - 1; i++) {
|
|
for (int i = 0; i <= top30 - 1; i++) {
|
|
//总消耗--获取这个人的总消耗
|
|
//总消耗--获取这个人的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"plan",planList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"plan",planList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "plan",planList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(编导40%)
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(编导40%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -727,12 +740,20 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
}
|
|
}
|
|
|
|
|
|
//去掉list中前30的数据
|
|
//去掉list中前30的数据
|
|
- planList.subList(0, top30 - 1).clear();
|
|
|
|
|
|
+ planList.subList(0, top30).clear();
|
|
|
|
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
for (int i = 0; i <= middle50 - 1; i++) {
|
|
for (int i = 0; i <= middle50 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"plan",planList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"plan",planList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "plan",planList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(编导40%)
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(编导40%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null){
|
|
if(totalCost != null){
|
|
@@ -793,7 +814,15 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
for (int i = 0; i <= shotTop30 - 1; i++) {
|
|
for (int i = 0; i <= shotTop30 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"shot",shotList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"shot",shotList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "shot",shotList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(拍摄10%)
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(拍摄10%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -816,12 +845,20 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
}
|
|
}
|
|
|
|
|
|
//去掉list中前30的数据
|
|
//去掉list中前30的数据
|
|
- shotList.subList(0, shotTop30 - 1).clear();
|
|
|
|
|
|
+ shotList.subList(0, shotTop30).clear();
|
|
|
|
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
for (int i = 0; i <= shotMiddle50 - 1; i++) {
|
|
for (int i = 0; i <= shotMiddle50 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"shot",shotList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"shot",shotList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "shot",shotList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(拍摄10%)
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(拍摄10%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -881,7 +918,15 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
for (int i = 0; i <= clipTop30 - 1; i++) {
|
|
for (int i = 0; i <= clipTop30 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"clip",clipList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"clip",clipList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "clip",clipList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(剪辑30%)
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(剪辑30%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -904,12 +949,19 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
}
|
|
}
|
|
|
|
|
|
//去掉list中前30的数据
|
|
//去掉list中前30的数据
|
|
- clipList.subList(0, clipTop30 - 1).clear();
|
|
|
|
|
|
+ clipList.subList(0, clipTop30).clear();
|
|
|
|
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
for (int i = 0; i <= clipMiddle50 - 1; i++) {
|
|
for (int i = 0; i <= clipMiddle50 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"clip",clipList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getQuarterTotalCostByRoleCode(thisYear, thisQuarter,startTime, endTime,"clip",clipList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "clip",clipList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(剪辑30%)
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(剪辑30%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -1009,6 +1061,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
//增加平面人数、和项目单独的绩效
|
|
//增加平面人数、和项目单独的绩效
|
|
planeProjectCost.setProjectPlaneCount(planeList.size());
|
|
planeProjectCost.setProjectPlaneCount(planeList.size());
|
|
planeProjectCost.setProjectPerformance(averageQuarterCost.multiply(new BigDecimal("0.05")).multiply(new BigDecimal("0.003")).setScale(4,BigDecimal.ROUND_HALF_UP));
|
|
planeProjectCost.setProjectPerformance(averageQuarterCost.multiply(new BigDecimal("0.05")).multiply(new BigDecimal("0.003")).setScale(4,BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ planeProjectCost.setType(1);
|
|
if (null == planeMap.get(plane.getUserId())) {
|
|
if (null == planeMap.get(plane.getUserId())) {
|
|
plane.setEffiRate(averageQuarterCost);
|
|
plane.setEffiRate(averageQuarterCost);
|
|
planeMap.put(plane.getUserId(), plane);
|
|
planeMap.put(plane.getUserId(), plane);
|
|
@@ -1029,7 +1082,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
planeProjectCost.setUserId(designLeader.getUserId());
|
|
planeProjectCost.setUserId(designLeader.getUserId());
|
|
//增加平面人数、和项目单独的绩效
|
|
//增加平面人数、和项目单独的绩效
|
|
planeProjectCost.setProjectPlaneCount(1);
|
|
planeProjectCost.setProjectPlaneCount(1);
|
|
- planeProjectCost.setProjectPerformance(quarterCost.multiply(new BigDecimal("0.2")).multiply(new BigDecimal("0.003")));
|
|
|
|
|
|
+ planeProjectCost.setProjectPerformance(quarterCost.multiply(new BigDecimal("0.15")).multiply(new BigDecimal("0.003")).setScale(4,BigDecimal.ROUND_HALF_UP));
|
|
planeProjectCost.setType(2);
|
|
planeProjectCost.setType(2);
|
|
|
|
|
|
if (null == designLeaderMap.get(designLeader.getUserId())) {
|
|
if (null == designLeaderMap.get(designLeader.getUserId())) {
|
|
@@ -1117,7 +1170,16 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
for (int i = 0; i <= top30 - 1; i++) {
|
|
for (int i = 0; i <= top30 - 1; i++) {
|
|
//头条编导总消耗
|
|
//头条编导总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "plan", planList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "plan", planList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "plan",planList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(编导40%)
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(编导40%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -1140,12 +1202,21 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
}
|
|
}
|
|
|
|
|
|
//去掉list中前30的数据
|
|
//去掉list中前30的数据
|
|
- planList.subList(0, top30 - 1).clear();
|
|
|
|
|
|
+ planList.subList(0, top30).clear();
|
|
|
|
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
for (int i = 0; i <= middle50 - 1; i++) {
|
|
for (int i = 0; i <= middle50 - 1; i++) {
|
|
//这个编导的总消耗
|
|
//这个编导的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "plan", planList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "plan", planList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "plan",planList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(2‰)*提成比例(编导40%)
|
|
//总绩效=总消耗*提点比例(2‰)*提成比例(编导40%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -1202,7 +1273,15 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
for (int i = 0; i <= shotTop30 - 1; i++) {
|
|
for (int i = 0; i <= shotTop30 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "shot", shotList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "shot", shotList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "shot",shotList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(拍摄10%)
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(拍摄10%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -1225,12 +1304,20 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
}
|
|
}
|
|
|
|
|
|
//去掉list中前30的数据
|
|
//去掉list中前30的数据
|
|
- shotList.subList(0, shotTop30 - 1).clear();
|
|
|
|
|
|
+ shotList.subList(0, shotTop30).clear();
|
|
|
|
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
for (int i = 0; i <= shotMiddle50 - 1; i++) {
|
|
for (int i = 0; i <= shotMiddle50 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "shot", shotList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "shot", shotList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "shot",shotList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(拍摄10%)
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(拍摄10%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -1265,7 +1352,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
//有效视频数量 //1头条 2快手
|
|
//有效视频数量 //1头条 2快手
|
|
int effiVideoCount = userEfficientVideoMapMapper.getEffiVideoCountByUserId(1, thisYear, thisQuarter, userDto.getUserId(), "clip");
|
|
int effiVideoCount = userEfficientVideoMapMapper.getEffiVideoCountByUserId(1, thisYear, thisQuarter, userDto.getUserId(), "clip");
|
|
//总视频数量
|
|
//总视频数量
|
|
- int videoCount = userEfficientVideoMapMapper.getQuarterVideoCountByRoleCodeAndUserId(thisYear, thisQuarter, 2, userDto.getUserId(), "clip");
|
|
|
|
|
|
+ int videoCount = userEfficientVideoMapMapper.getQuarterVideoCountByRoleCodeAndUserId(thisYear, thisQuarter, 1, userDto.getUserId(), "clip");
|
|
//视频有效率
|
|
//视频有效率
|
|
BigDecimal effiRate=BigDecimal.ZERO;
|
|
BigDecimal effiRate=BigDecimal.ZERO;
|
|
if (videoCount != 0){
|
|
if (videoCount != 0){
|
|
@@ -1287,7 +1374,15 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
//循环前30%有绩效的人数并计算其绩效,并入库
|
|
for (int i = 0; i <= clipTop30 - 1; i++) {
|
|
for (int i = 0; i <= clipTop30 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "clip", clipList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "clip", clipList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "clip",clipList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(剪辑30%)
|
|
//总绩效=总消耗*提点比例(5‰)*提成比例(剪辑30%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -1310,12 +1405,20 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
}
|
|
}
|
|
|
|
|
|
//去掉list中前30的数据
|
|
//去掉list中前30的数据
|
|
- clipList.subList(0, clipTop30 - 1).clear();
|
|
|
|
|
|
+ clipList.subList(0, clipTop30).clear();
|
|
|
|
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
//循环中间50%有绩效的人,计算绩效并入库
|
|
for (int i = 0; i <= clipMiddle50 - 1; i++) {
|
|
for (int i = 0; i <= clipMiddle50 - 1; i++) {
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
//总消耗--获取这个人所在项目的总消耗
|
|
- BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "clip", clipList.get(i).getUserId());
|
|
|
|
|
|
+ //BigDecimal totalCost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByRoleCode(thisYear, thisQuarter, startTime, endTime, "clip", clipList.get(i).getUserId());
|
|
|
|
+ BigDecimal totalCost = BigDecimal.ZERO;
|
|
|
|
+
|
|
|
|
+ List<String> codeList = userEfficientVideoMapMapper.getQuarterSignature(thisYear, thisQuarter, "clip",clipList.get(i).getUserId());
|
|
|
|
+ for(String code : codeList){
|
|
|
|
+ BigDecimal cost = userEfficientVideoMapMapper.getToutiaoQuarterTotalCostByCode(startTime, endTime,code);
|
|
|
|
+ totalCost = totalCost.add(cost==null?BigDecimal.ZERO:cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(剪辑30%)
|
|
//总绩效=总消耗*提点比例(3‰)*提成比例(剪辑30%)
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
BigDecimal totalPerformance = BigDecimal.ZERO;
|
|
if(totalCost != null) {
|
|
if(totalCost != null) {
|
|
@@ -1364,7 +1467,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
|
|
|
|
UserDto2 designLeader = userEfficientVideoMapMapper.getProjectDesignResponsibleInfo(projectDTO.getProjectId());
|
|
UserDto2 designLeader = userEfficientVideoMapMapper.getProjectDesignResponsibleInfo(projectDTO.getProjectId());
|
|
List<UserDto2> planeList = userEfficientVideoMapMapper.getPlaneByProjectId(projectDTO.getProjectId());
|
|
List<UserDto2> planeList = userEfficientVideoMapMapper.getPlaneByProjectId(projectDTO.getProjectId());
|
|
- BigDecimal quarterCost = userEfficientVideoMapMapper.getProjectQuarterCostById(startTime, endTime, projectDTO.getProjectId());
|
|
|
|
|
|
+ BigDecimal quarterCost = userEfficientVideoMapMapper.getToutiaoProjectQuarterCostById(startTime, endTime, projectDTO.getProjectId());
|
|
quarterCost = quarterCost==null?BigDecimal.ZERO:quarterCost;
|
|
quarterCost = quarterCost==null?BigDecimal.ZERO:quarterCost;
|
|
//此项目当中平面数量,平面数量为0的时候说明此project当中没有平面设计师;项目没有平面的情况下,项目leader绩效提成为20%
|
|
//此项目当中平面数量,平面数量为0的时候说明此project当中没有平面设计师;项目没有平面的情况下,项目leader绩效提成为20%
|
|
int size = planeList.size();
|
|
int size = planeList.size();
|
|
@@ -1415,7 +1518,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
planeProjectCost.setUserId(plane.getUserId());
|
|
planeProjectCost.setUserId(plane.getUserId());
|
|
//增加平面人数、和项目单独的绩效
|
|
//增加平面人数、和项目单独的绩效
|
|
planeProjectCost.setProjectPlaneCount(planeList.size());
|
|
planeProjectCost.setProjectPlaneCount(planeList.size());
|
|
- planeProjectCost.setProjectPerformance(averageQuarterCost.multiply(new BigDecimal("0.05")));
|
|
|
|
|
|
+ planeProjectCost.setProjectPerformance(averageQuarterCost.multiply(new BigDecimal("0.05")).multiply(new BigDecimal("0.002")).setScale(4,BigDecimal.ROUND_HALF_UP));
|
|
planeProjectCost.setType(1);
|
|
planeProjectCost.setType(1);
|
|
|
|
|
|
if (null == planeMap.get(plane.getUserId())) {
|
|
if (null == planeMap.get(plane.getUserId())) {
|
|
@@ -2553,6 +2656,98 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
|
|
return userEfficientVideoMapMapper.getToutiaoQuarterVideoInfoByAccountId(startDate, endDate, accountId);
|
|
return userEfficientVideoMapMapper.getToutiaoQuarterVideoInfoByAccountId(startDate, endDate, accountId);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //获取快手、头条下各账户下视频的季度消耗
|
|
|
|
+ public void getQuarterVideoInfoByAccountId(Integer year, Integer quarter){
|
|
|
|
+ Map<String,String> dateMap = DateUtils.quarterStartEndDate(year, quarter);
|
|
|
|
+ String startDate = dateMap.get("startDate");
|
|
|
|
+ String endDate = dateMap.get("endDate");
|
|
|
|
+
|
|
|
|
+ getToutiaoQuarterVideoInfoByAccountId2(startDate, endDate);
|
|
|
|
+ getKuaishouQuarterVideoInfoByAccountId2(startDate, endDate);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //TODO 根据accountId获取季度视频信息
|
|
|
|
+ public void getKuaishouQuarterVideoInfoByAccountId2(String startDate, String endDate){
|
|
|
|
+ Integer appType = 2;
|
|
|
|
+ List<AccountDTO> accountList = userEfficientVideoMapMapper.getAccountInfoByAppType(appType);
|
|
|
|
+ for (AccountDTO accountDTO:accountList){
|
|
|
|
+ List<VideoDTO> videoDTOList= userEfficientVideoMapMapper.getKuaishouQuarterVideoInfoByAccountId(startDate, endDate, Long.parseLong(accountDTO.getAccountId()));
|
|
|
|
+
|
|
|
|
+ for(VideoDTO video:videoDTOList){
|
|
|
|
+ AccountVideoQuarterInfo info = new AccountVideoQuarterInfo();
|
|
|
|
+ info.setAccountId(Long.parseLong(accountDTO.getAccountId()));
|
|
|
|
+ info.setProjectId(accountDTO.getProjectId());
|
|
|
|
+ info.setProjectName(accountDTO.getProjectName());
|
|
|
|
+ info.setSignature(video.getSignature());
|
|
|
|
+ info.setPlanId(video.getPlanId());
|
|
|
|
+ info.setPlanName(video.getPlan());
|
|
|
|
+ info.setClipId(video.getClipId());
|
|
|
|
+ info.setClipName(video.getClip());
|
|
|
|
+ info.setShotId(video.getShotId());
|
|
|
|
+ info.setShotName(video.getShot());
|
|
|
|
+ info.setPlaneId(video.getPlaneId());
|
|
|
|
+ info.setPlaneName(video.getPlane());
|
|
|
|
+ info.setVideoCost(video.getCharge());
|
|
|
|
+ info.setAppType(appType);
|
|
|
|
+ info.setYear(2020);
|
|
|
|
+ info.setQuarter(1);
|
|
|
|
+ if(video.getClipId() != null){
|
|
|
|
+ SysUser user = userEfficientVideoMapMapper.getDesignLeaderInfoByDesignUserId(video.getClipId());
|
|
|
|
+ info.setDesignResponsibleId(user==null?null:user.getId());
|
|
|
|
+ info.setDesignResponsibleName(user==null?null:user.getRealname());
|
|
|
|
+ }else{
|
|
|
|
+ SysUser user = userEfficientVideoMapMapper.getDesignLeaderInfoByDesignUserId(video.getPlaneId());
|
|
|
|
+ info.setDesignResponsibleId(user==null?null:user.getId());
|
|
|
|
+ info.setDesignResponsibleName(user==null?null:user.getRealname());
|
|
|
|
+ }
|
|
|
|
+ accountVideoQuarterInfoMapper.insert(info);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //TODO 根据accountId获取季度视频信息
|
|
|
|
+ public void getToutiaoQuarterVideoInfoByAccountId2(String startDate, String endDate){
|
|
|
|
+ Integer appType = 1;
|
|
|
|
+ List<AccountDTO> accountList = userEfficientVideoMapMapper.getAccountInfoByAppType(appType);
|
|
|
|
+ for (AccountDTO accountDTO:accountList){
|
|
|
|
+ List<VideoDTO> videoDTOList= userEfficientVideoMapMapper.getToutiaoQuarterVideoInfoByAccountId(startDate, endDate, Long.parseLong(accountDTO.getAccountId()));
|
|
|
|
+
|
|
|
|
+ for(VideoDTO video:videoDTOList){
|
|
|
|
+ AccountVideoQuarterInfo info = new AccountVideoQuarterInfo();
|
|
|
|
+ info.setAccountId(Long.parseLong(accountDTO.getAccountId()));
|
|
|
|
+ info.setProjectId(accountDTO.getProjectId());
|
|
|
|
+ info.setProjectName(accountDTO.getProjectName());
|
|
|
|
+ info.setSignature(video.getSignature());
|
|
|
|
+ info.setPlanId(video.getPlanId());
|
|
|
|
+ info.setPlanName(video.getPlan());
|
|
|
|
+ info.setClipId(video.getClipId());
|
|
|
|
+ info.setClipName(video.getClip());
|
|
|
|
+ info.setShotId(video.getShotId());
|
|
|
|
+ info.setShotName(video.getShot());
|
|
|
|
+ info.setPlaneId(video.getPlaneId());
|
|
|
|
+ info.setPlaneName(video.getPlane());
|
|
|
|
+ info.setVideoCost(video.getCharge());
|
|
|
|
+ info.setAppType(appType);
|
|
|
|
+ info.setYear(2020);
|
|
|
|
+ info.setQuarter(1);
|
|
|
|
+ if(video.getClipId() != null){
|
|
|
|
+ SysUser user = userEfficientVideoMapMapper.getDesignLeaderInfoByDesignUserId(video.getClipId());
|
|
|
|
+ info.setDesignResponsibleId(user==null?null:user.getId());
|
|
|
|
+ info.setDesignResponsibleName(user==null?null:user.getRealname());
|
|
|
|
+ }else{
|
|
|
|
+ SysUser user = userEfficientVideoMapMapper.getDesignLeaderInfoByDesignUserId(video.getPlaneId());
|
|
|
|
+ info.setDesignResponsibleId(user==null?null:user.getId());
|
|
|
|
+ info.setDesignResponsibleName(user==null?null:user.getRealname());
|
|
|
|
+ }
|
|
|
|
+ accountVideoQuarterInfoMapper.insert(info);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public List<VideoDTO> getUserQuarterVideo(Integer year, Integer quarter, String userId){
|
|
public List<VideoDTO> getUserQuarterVideo(Integer year, Integer quarter, String userId){
|
|
return userEfficientVideoMapMapper.getUserQuarterVideo(userId, year, quarter);
|
|
return userEfficientVideoMapMapper.getUserQuarterVideo(userId, year, quarter);
|
|
}
|
|
}
|