Commit 45f94f6a authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 14007a04 9868dd55
...@@ -288,12 +288,12 @@ export default { ...@@ -288,12 +288,12 @@ export default {
{ label: "核查人员", prop: "checkPerson", formatter: this.formatter }, { label: "核查人员", prop: "checkPerson", formatter: this.formatter },
{ // {
label: "核查时间", // label: "核查时间",
prop: "checkTime", // prop: "checkTime",
width: 150, // width: 150,
formatter: this.formatterDate, // formatter: this.formatterDate,
}, // },
{ label: "分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
......
...@@ -2,12 +2,14 @@ package com.mortals.xhx.common.pdu; ...@@ -2,12 +2,14 @@ package com.mortals.xhx.common.pdu;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
/** /**
* 权重pdu * 权重pdu
*/ */
@Data @Data
public class WeightPdu { public class WeightPdu {
private static BigDecimal NUMBER_100 = new BigDecimal(100);
/** /**
* 自评权重 * 自评权重
*/ */
...@@ -34,4 +36,20 @@ public class WeightPdu { ...@@ -34,4 +36,20 @@ public class WeightPdu {
private Integer reviewWeight=20; 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; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -10,7 +11,9 @@ import com.mortals.framework.util.DateUtils; ...@@ -10,7 +11,9 @@ import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.system.message.MessageService; 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.code.*;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.AttendPostServiceThread; import com.mortals.xhx.common.utils.AttendPostServiceThread;
import com.mortals.xhx.common.utils.AuditUtil; import com.mortals.xhx.common.utils.AuditUtil;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
...@@ -48,6 +51,8 @@ import java.util.Calendar; ...@@ -48,6 +51,8 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/** /**
* CheckAttendRecordService * CheckAttendRecordService
* 考勤绩效记录核查信息 service实现 * 考勤绩效记录核查信息 service实现
...@@ -79,6 +84,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -79,6 +84,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
@Autowired @Autowired
private PerformRulesService rulesService; private PerformRulesService rulesService;
@Autowired
private ParamService paramService;
@Override @Override
protected void saveBefore(CheckAttendRecordEntity entity, Context context) throws AppException { protected void saveBefore(CheckAttendRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity); updateStaffRuleNames(entity);
...@@ -205,6 +213,13 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -205,6 +213,13 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
} }
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query); List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if (CollectionUtils.isNotEmpty(summaryVoList)) { 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) { for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity(); StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue(); staffPerformSummaryEntity.initAttrValue();
...@@ -239,8 +254,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -239,8 +254,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
erro = erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); // BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro)); // staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -251,8 +267,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -251,8 +267,9 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0)); staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); // BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); // staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
...@@ -406,4 +423,26 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -406,4 +423,26 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
totalScore = totalScore.subtract(totalSubScore); totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore); 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; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -9,7 +10,9 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; ...@@ -9,7 +10,9 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService; 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.code.*;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.AuditUtil; import com.mortals.xhx.common.utils.AuditUtil;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckEffectRecordDao; import com.mortals.xhx.module.check.dao.CheckEffectRecordDao;
...@@ -48,6 +51,8 @@ import java.util.Calendar; ...@@ -48,6 +51,8 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/** /**
* CheckEffectRecordService * CheckEffectRecordService
* 效能绩效核查信息 service实现 * 效能绩效核查信息 service实现
...@@ -78,6 +83,8 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -78,6 +83,8 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
@Autowired @Autowired
private PerformRulesService rulesService; private PerformRulesService rulesService;
@Autowired
private ParamService paramService;
@Override @Override
protected void saveBefore(CheckEffectRecordEntity entity, Context context) throws AppException { protected void saveBefore(CheckEffectRecordEntity entity, Context context) throws AppException {
...@@ -200,6 +207,13 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -200,6 +207,13 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
} }
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query); List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){ 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){ for(StaffCheckSummaryVo vo:summaryVoList){
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity(); StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue(); staffPerformSummaryEntity.initAttrValue();
...@@ -234,8 +248,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -234,8 +248,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
erro = erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); // BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro)); // staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -249,8 +264,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -249,8 +264,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0)); staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); // BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); // staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
...@@ -404,4 +420,26 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -404,4 +420,26 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
totalScore = totalScore.subtract(totalSubScore); totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore); 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; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -9,7 +10,9 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; ...@@ -9,7 +10,9 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService; 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.code.*;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.AuditUtil; import com.mortals.xhx.common.utils.AuditUtil;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckGoworkRecordDao; import com.mortals.xhx.module.check.dao.CheckGoworkRecordDao;
...@@ -48,6 +51,8 @@ import java.util.Calendar; ...@@ -48,6 +51,8 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/** /**
* CheckGoworkRecordService * CheckGoworkRecordService
* 办件绩效核查信息 service实现 * 办件绩效核查信息 service实现
...@@ -78,6 +83,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -78,6 +83,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
@Autowired @Autowired
private PerformRulesService rulesService; private PerformRulesService rulesService;
@Autowired
private ParamService paramService;
@Override @Override
protected void saveBefore(CheckGoworkRecordEntity entity, Context context) throws AppException { protected void saveBefore(CheckGoworkRecordEntity entity, Context context) throws AppException {
...@@ -197,6 +204,13 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -197,6 +204,13 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
} }
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query); List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){ 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){ for(StaffCheckSummaryVo vo:summaryVoList){
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity(); StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue(); staffPerformSummaryEntity.initAttrValue();
...@@ -231,8 +245,9 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -231,8 +245,9 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
erro = erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); // BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro)); // staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -246,8 +261,9 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -246,8 +261,9 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0)); staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); // BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); // staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
...@@ -402,4 +418,25 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -402,4 +418,25 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
statEntity.setTotalScore(totalScore); 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; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService; 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.code.*;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.AuditUtil; import com.mortals.xhx.common.utils.AuditUtil;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckOtherRecordEntity; import com.mortals.xhx.module.check.model.CheckOtherRecordEntity;
...@@ -50,6 +53,8 @@ import java.util.Calendar; ...@@ -50,6 +53,8 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/** /**
* CheckReviewRecordService * CheckReviewRecordService
* 评价差评绩效核查信息 service实现 * 评价差评绩效核查信息 service实现
...@@ -81,6 +86,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -81,6 +86,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
@Autowired @Autowired
private PerformRulesService rulesService; private PerformRulesService rulesService;
@Autowired
private ParamService paramService;
@Override @Override
protected void saveBefore(CheckReviewRecordEntity entity, Context context) throws AppException { protected void saveBefore(CheckReviewRecordEntity entity, Context context) throws AppException {
...@@ -202,6 +209,13 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -202,6 +209,13 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
} }
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query); List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if (CollectionUtils.isNotEmpty(summaryVoList)) { 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) { for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity(); StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue(); staffPerformSummaryEntity.initAttrValue();
...@@ -236,8 +250,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -236,8 +250,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
erro = erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); // BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(erro)); // staffPerformSummaryEntity.setTotalScore(total.add(erro));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -251,8 +266,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -251,8 +266,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0)); staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); // BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); // staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
...@@ -406,4 +422,26 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -406,4 +422,26 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
totalScore = totalScore.subtract(totalSubScore); totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore); 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; package com.mortals.xhx.module.check.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.StringUtils; 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.code.CheckStatusEnum;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity; import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
...@@ -25,6 +28,7 @@ import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao; ...@@ -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.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService; import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -32,6 +36,8 @@ import java.util.Calendar; ...@@ -32,6 +36,8 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/** /**
* CheckWindowWorkmanPerformService * CheckWindowWorkmanPerformService
* 窗口人员考核汇总核查 service实现 * 窗口人员考核汇总核查 service实现
...@@ -45,6 +51,8 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp ...@@ -45,6 +51,8 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
@Autowired @Autowired
private StaffPerformSummaryService staffPerformSummaryService; private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private ParamService paramService;
@Override @Override
public void examine(CheckWindowWorkmanPerformEntity entity, Context context) throws AppException { public void examine(CheckWindowWorkmanPerformEntity entity, Context context) throws AppException {
...@@ -75,6 +83,13 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp ...@@ -75,6 +83,13 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
private List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException { private List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException {
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query); List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if (CollectionUtils.isNotEmpty(summaryVoList)) { 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) { for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity(); StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue(); staffPerformSummaryEntity.initAttrValue();
...@@ -104,13 +119,12 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp ...@@ -104,13 +119,12 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
BigDecimal erro = new BigDecimal(0); BigDecimal erro = new BigDecimal(0);
erro = erro.add(staffPerformSummaryEntity.getReviewScore()); erro = erro.add(staffPerformSummaryEntity.getReviewScore());
erro = erro.add(staffPerformSummaryEntity.getAttendScore()); erro = erro.add(staffPerformSummaryEntity.getAttendScore());
erro = erro.add(staffPerformSummaryEntity.getOtherScore()); //erro = erro.add(staffPerformSummaryEntity.getOtherScore());
erro = erro.add(staffPerformSummaryEntity.getGoworkScore()); erro = erro.add(staffPerformSummaryEntity.getGoworkScore());
erro = erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setTotalScore(total.add(erro));
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -124,8 +138,7 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp ...@@ -124,8 +138,7 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0)); staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
...@@ -136,4 +149,26 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp ...@@ -136,4 +149,26 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
return summaryVoList; 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