Commit 7c26068f authored by 廖旭伟's avatar 廖旭伟

绩效分数汇总引入权重计算

parent 4a8a506e
......@@ -2,12 +2,14 @@ package com.mortals.xhx.common.pdu;
import lombok.Data;
import java.math.BigDecimal;
/**
* 权重pdu
*/
@Data
public class WeightPdu {
private static BigDecimal NUMBER_100 = new BigDecimal(100);
/**
* 自评权重
*/
......@@ -34,4 +36,20 @@ public class WeightPdu {
private Integer reviewWeight=20;
public BigDecimal selfWeight(){
return new BigDecimal(this.selfWeight).divide(NUMBER_100);
}
public BigDecimal attendWeight(){
return new BigDecimal(this.attendWeight).divide(NUMBER_100);
}
public BigDecimal effectWeight(){
return new BigDecimal(this.effectWeight).divide(NUMBER_100);
}
public BigDecimal goworkWeight(){
return new BigDecimal(this.goworkWeight).divide(NUMBER_100);
}
public BigDecimal reviewWeight(){
return new BigDecimal(this.reviewWeight).divide(NUMBER_100);
}
}
package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -10,7 +11,9 @@ import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.AttendPostServiceThread;
import com.mortals.xhx.common.utils.AuditUtil;
import com.mortals.xhx.common.utils.BeanUtil;
......@@ -48,6 +51,8 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/**
* CheckAttendRecordService
* 考勤绩效记录核查信息 service实现
......@@ -79,6 +84,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
@Autowired
private PerformRulesService rulesService;
@Autowired
private ParamService paramService;
@Override
protected void saveBefore(CheckAttendRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
......@@ -205,6 +213,13 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if (CollectionUtils.isNotEmpty(summaryVoList)) {
String value = paramService.getValueByKey(SYS_PARAM_WEIGHT);
WeightPdu weightPdu;
if (ObjectUtils.isEmpty(value)){
weightPdu = new WeightPdu();
}else {
weightPdu = JSONObject.parseObject(value,WeightPdu.class);
}
for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
......@@ -239,8 +254,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro));
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
......@@ -251,8 +267,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity);
......@@ -406,4 +423,26 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeSummary(StaffPerformSummaryEntity staffPerformSummaryEntity, WeightPdu weightPdu){
BigDecimal total = new BigDecimal(100);
BigDecimal reviewScore = total.add(staffPerformSummaryEntity.getReviewScore()); //评价
reviewScore = reviewScore.multiply(weightPdu.reviewWeight());
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
BigDecimal effectScore = total.add(staffPerformSummaryEntity.getEffectScore()); //效能
effectScore = effectScore.multiply(weightPdu.effectWeight());
// BigDecimal complainScore = complainScore = total.add(staffPerformSummaryEntity.getComplainScore()); //投诉
BigDecimal summary = new BigDecimal(0);
summary = summary.add(reviewScore);
summary = summary.add(attendScore);
summary = summary.add(otherScore);
summary = summary.add(goworkScore);
summary = summary.add(effectScore);
staffPerformSummaryEntity.setTotalScore(summary);
}
}
\ No newline at end of file
package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -9,7 +10,9 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.AuditUtil;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckEffectRecordDao;
......@@ -48,6 +51,8 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/**
* CheckEffectRecordService
* 效能绩效核查信息 service实现
......@@ -78,6 +83,8 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
@Autowired
private PerformRulesService rulesService;
@Autowired
private ParamService paramService;
@Override
protected void saveBefore(CheckEffectRecordEntity entity, Context context) throws AppException {
......@@ -200,6 +207,13 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){
String value = paramService.getValueByKey(SYS_PARAM_WEIGHT);
WeightPdu weightPdu;
if (ObjectUtils.isEmpty(value)){
weightPdu = new WeightPdu();
}else {
weightPdu = JSONObject.parseObject(value,WeightPdu.class);
}
for(StaffCheckSummaryVo vo:summaryVoList){
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
......@@ -234,8 +248,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro));
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
......@@ -249,8 +264,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity);
......@@ -404,4 +420,26 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeSummary(StaffPerformSummaryEntity staffPerformSummaryEntity, WeightPdu weightPdu){
BigDecimal total = new BigDecimal(100);
BigDecimal reviewScore = total.add(staffPerformSummaryEntity.getReviewScore()); //评价
reviewScore = reviewScore.multiply(weightPdu.reviewWeight());
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
BigDecimal effectScore = total.add(staffPerformSummaryEntity.getEffectScore()); //效能
effectScore = effectScore.multiply(weightPdu.effectWeight());
// BigDecimal complainScore = complainScore = total.add(staffPerformSummaryEntity.getComplainScore()); //投诉
BigDecimal summary = new BigDecimal(0);
summary = summary.add(reviewScore);
summary = summary.add(attendScore);
summary = summary.add(otherScore);
summary = summary.add(goworkScore);
summary = summary.add(effectScore);
staffPerformSummaryEntity.setTotalScore(summary);
}
}
\ No newline at end of file
package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -9,7 +10,9 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.AuditUtil;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckGoworkRecordDao;
......@@ -48,6 +51,8 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/**
* CheckGoworkRecordService
* 办件绩效核查信息 service实现
......@@ -78,6 +83,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
@Autowired
private PerformRulesService rulesService;
@Autowired
private ParamService paramService;
@Override
protected void saveBefore(CheckGoworkRecordEntity entity, Context context) throws AppException {
......@@ -197,6 +204,13 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){
String value = paramService.getValueByKey(SYS_PARAM_WEIGHT);
WeightPdu weightPdu;
if (ObjectUtils.isEmpty(value)){
weightPdu = new WeightPdu();
}else {
weightPdu = JSONObject.parseObject(value,WeightPdu.class);
}
for(StaffCheckSummaryVo vo:summaryVoList){
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
......@@ -231,8 +245,9 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro));
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
......@@ -246,8 +261,9 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity);
......@@ -402,4 +418,25 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
statEntity.setTotalScore(totalScore);
}
private void computeSummary(StaffPerformSummaryEntity staffPerformSummaryEntity, WeightPdu weightPdu){
BigDecimal total = new BigDecimal(100);
BigDecimal reviewScore = total.add(staffPerformSummaryEntity.getReviewScore()); //评价
reviewScore = reviewScore.multiply(weightPdu.reviewWeight());
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
BigDecimal effectScore = total.add(staffPerformSummaryEntity.getEffectScore()); //效能
effectScore = effectScore.multiply(weightPdu.effectWeight());
// BigDecimal complainScore = complainScore = total.add(staffPerformSummaryEntity.getComplainScore()); //投诉
BigDecimal summary = new BigDecimal(0);
summary = summary.add(reviewScore);
summary = summary.add(attendScore);
summary = summary.add(otherScore);
summary = summary.add(goworkScore);
summary = summary.add(effectScore);
staffPerformSummaryEntity.setTotalScore(summary);
}
}
\ No newline at end of file
package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.AuditUtil;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckOtherRecordEntity;
......@@ -50,6 +53,8 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/**
* CheckReviewRecordService
* 评价差评绩效核查信息 service实现
......@@ -81,6 +86,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
@Autowired
private PerformRulesService rulesService;
@Autowired
private ParamService paramService;
@Override
protected void saveBefore(CheckReviewRecordEntity entity, Context context) throws AppException {
......@@ -202,6 +209,13 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if (CollectionUtils.isNotEmpty(summaryVoList)) {
String value = paramService.getValueByKey(SYS_PARAM_WEIGHT);
WeightPdu weightPdu;
if (ObjectUtils.isEmpty(value)){
weightPdu = new WeightPdu();
}else {
weightPdu = JSONObject.parseObject(value,WeightPdu.class);
}
for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
......@@ -236,8 +250,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro));
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
......@@ -251,8 +266,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity);
......@@ -406,4 +422,26 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeSummary(StaffPerformSummaryEntity staffPerformSummaryEntity, WeightPdu weightPdu){
BigDecimal total = new BigDecimal(100);
BigDecimal reviewScore = total.add(staffPerformSummaryEntity.getReviewScore()); //评价
reviewScore = reviewScore.multiply(weightPdu.reviewWeight());
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
BigDecimal effectScore = total.add(staffPerformSummaryEntity.getEffectScore()); //效能
effectScore = effectScore.multiply(weightPdu.effectWeight());
// BigDecimal complainScore = complainScore = total.add(staffPerformSummaryEntity.getComplainScore()); //投诉
BigDecimal summary = new BigDecimal(0);
summary = summary.add(reviewScore);
summary = summary.add(attendScore);
summary = summary.add(otherScore);
summary = summary.add(goworkScore);
summary = summary.add(effectScore);
staffPerformSummaryEntity.setTotalScore(summary);
}
}
\ No newline at end of file
package com.mortals.xhx.module.check.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
......@@ -25,6 +28,7 @@ import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -32,6 +36,8 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/**
* CheckWindowWorkmanPerformService
* 窗口人员考核汇总核查 service实现
......@@ -45,6 +51,8 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private ParamService paramService;
@Override
public void examine(CheckWindowWorkmanPerformEntity entity, Context context) throws AppException {
......@@ -75,6 +83,13 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
private List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException {
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if (CollectionUtils.isNotEmpty(summaryVoList)) {
String value = paramService.getValueByKey(SYS_PARAM_WEIGHT);
WeightPdu weightPdu;
if (ObjectUtils.isEmpty(value)){
weightPdu = new WeightPdu();
}else {
weightPdu = JSONObject.parseObject(value,WeightPdu.class);
}
for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
......@@ -104,13 +119,12 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
BigDecimal erro = new BigDecimal(0);
erro = erro.add(staffPerformSummaryEntity.getReviewScore());
erro = erro.add(staffPerformSummaryEntity.getAttendScore());
erro = erro.add(staffPerformSummaryEntity.getOtherScore());
//erro = erro.add(staffPerformSummaryEntity.getOtherScore());
erro = erro.add(staffPerformSummaryEntity.getGoworkScore());
erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
......@@ -124,8 +138,7 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity);
......@@ -136,4 +149,26 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
return summaryVoList;
}
private void computeSummary(StaffPerformSummaryEntity staffPerformSummaryEntity,WeightPdu weightPdu){
BigDecimal total = new BigDecimal(100);
BigDecimal reviewScore = total.add(staffPerformSummaryEntity.getReviewScore()); //评价
reviewScore = reviewScore.multiply(weightPdu.reviewWeight());
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
BigDecimal effectScore = total.add(staffPerformSummaryEntity.getEffectScore()); //效能
effectScore = effectScore.multiply(weightPdu.effectWeight());
// BigDecimal complainScore = complainScore = total.add(staffPerformSummaryEntity.getComplainScore()); //投诉
BigDecimal summary = new BigDecimal(0);
summary = summary.add(reviewScore);
summary = summary.add(attendScore);
summary = summary.add(otherScore);
summary = summary.add(goworkScore);
summary = summary.add(effectScore);
staffPerformSummaryEntity.setTotalScore(summary);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment