Commit 72bd19ac authored by 廖旭伟's avatar 廖旭伟

绩效分数汇总问题修改

parent ee6f93c4
...@@ -261,7 +261,8 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -261,7 +261,8 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
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()); BigDecimal Score100 = new BigDecimal(100);
erro = erro.add(Score100.subtract(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());
...@@ -436,13 +437,16 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -436,13 +437,16 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
statEntity.setTotalScore(totalScore); statEntity.setTotalScore(totalScore);
} }
private void computeSummary(StaffPerformSummaryEntity staffPerformSummaryEntity, WeightPdu weightPdu){ private static void computeSummary(StaffPerformSummaryEntity staffPerformSummaryEntity, WeightPdu weightPdu){
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
BigDecimal reviewScore = total.add(staffPerformSummaryEntity.getReviewScore()); //评价 BigDecimal reviewScore = total.add(staffPerformSummaryEntity.getReviewScore()); //评价
reviewScore = reviewScore.multiply(weightPdu.reviewWeight()); reviewScore = reviewScore.multiply(weightPdu.reviewWeight());
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤 BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight()); attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100 BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
if(otherScore.compareTo(BigDecimal.ZERO)==0){
otherScore = new BigDecimal(100);
}
otherScore = otherScore.multiply(weightPdu.selfWeight()); otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件 BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight()); goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
...@@ -457,4 +461,21 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -457,4 +461,21 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
summary = summary.add(effectScore); summary = summary.add(effectScore);
staffPerformSummaryEntity.setTotalScore(summary); staffPerformSummaryEntity.setTotalScore(summary);
} }
public static void main(String[] args) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
staffPerformSummaryEntity.setAttendScore(new BigDecimal(-0.4));
String ss = "{\"attendWeight\":10,\"effectWeight\":20,\"goworkWeight\":20,\"reviewWeight\":0,\"selfWeight\":50}";
WeightPdu weightPdu = JSONObject.parseObject(ss,WeightPdu.class);
System.out.println(JSONObject.toJSONString(weightPdu));
// BigDecimal total = new BigDecimal(100);
// BigDecimal reviewScore = total.add(staffPerformSummaryEntity.getReviewScore()); //评价
// System.out.println(reviewScore);
// reviewScore = reviewScore.multiply(weightPdu.attendWeight());
// System.out.println(weightPdu.reviewWeight());
// System.out.println(reviewScore);
computeSummary(staffPerformSummaryEntity,weightPdu);
System.out.println(JSONObject.toJSONString(staffPerformSummaryEntity));
}
} }
\ No newline at end of file
...@@ -228,7 +228,8 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -228,7 +228,8 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
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()); BigDecimal Score100 = new BigDecimal(100);
erro = erro.add(Score100.subtract(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());
......
...@@ -253,7 +253,8 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -253,7 +253,8 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
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()); BigDecimal Score100 = new BigDecimal(100);
erro = erro.add(Score100.subtract(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());
...@@ -438,6 +439,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -438,6 +439,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤 BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight()); attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100 BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
if(otherScore.compareTo(BigDecimal.ZERO)==0){
otherScore = new BigDecimal(100);
}
otherScore = otherScore.multiply(weightPdu.selfWeight()); otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件 BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight()); goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
......
...@@ -250,7 +250,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -250,7 +250,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
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()); BigDecimal Score100 = new BigDecimal(100);
erro = erro.add(Score100.subtract(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());
...@@ -435,6 +436,9 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -435,6 +436,9 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤 BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight()); attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100 BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
if(otherScore.compareTo(BigDecimal.ZERO)==0){
otherScore = new BigDecimal(100);
}
otherScore = otherScore.multiply(weightPdu.selfWeight()); otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件 BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight()); goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
......
...@@ -234,7 +234,8 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -234,7 +234,8 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
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()); BigDecimal Score100 = new BigDecimal(100);
erro = erro.add(Score100.subtract(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());
......
...@@ -255,7 +255,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -255,7 +255,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
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()); BigDecimal Score100 = new BigDecimal(100);
erro = erro.add(Score100.subtract(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());
...@@ -440,6 +441,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -440,6 +441,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤 BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight()); attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100 BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
if(otherScore.compareTo(BigDecimal.ZERO)==0){
otherScore = new BigDecimal(100);
}
otherScore = otherScore.multiply(weightPdu.selfWeight()); otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件 BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight()); goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
......
...@@ -127,7 +127,8 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp ...@@ -127,7 +127,8 @@ 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()); BigDecimal Score100 = new BigDecimal(100);
erro = erro.add(Score100.subtract(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());
...@@ -145,7 +146,8 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp ...@@ -145,7 +146,8 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0)); staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); BigDecimal Score100 = new BigDecimal(100);
staffPerformSummaryEntity.setErrorScore(Score100.subtract(vo.getSumScore()));
computeSummary(staffPerformSummaryEntity,weightPdu); computeSummary(staffPerformSummaryEntity,weightPdu);
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
...@@ -164,6 +166,9 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp ...@@ -164,6 +166,9 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤 BigDecimal attendScore = total.add(staffPerformSummaryEntity.getAttendScore()); //考勤
attendScore = attendScore.multiply(weightPdu.attendWeight()); attendScore = attendScore.multiply(weightPdu.attendWeight());
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100 BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //自评不用加100
if(otherScore.compareTo(BigDecimal.ZERO)==0){
otherScore = new BigDecimal(100);
}
otherScore = otherScore.multiply(weightPdu.selfWeight()); otherScore = otherScore.multiply(weightPdu.selfWeight());
BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件 BigDecimal goworkScore = total.add(staffPerformSummaryEntity.getGoworkScore()); //办件
goworkScore = goworkScore.multiply(weightPdu.goworkWeight()); goworkScore = goworkScore.multiply(weightPdu.goworkWeight());
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!-- 汇总已审核的核查记录 --> <!-- 汇总已审核的核查记录 -->
<select id="getSummaryCheckList" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo"> <select id="getSummaryCheckList" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo">
SELECT SELECT
p.`year`,p.`month`,d.staffId,d.staffName,s.deptId,s.deptName,sum(d.sumScore) as sumScore p.`year`,p.`month`,d.staffId,d.staffName,s.salaId,s.salaName,s.deptId,s.deptName,sum(d.sumScore) as sumScore
FROM FROM
mortals_xhx_check_window_workman_perform p, mortals_xhx_check_window_workman_perform p,
mortals_xhx_window_workman_perform w, mortals_xhx_window_workman_perform w,
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<if test="recordId != null and recordId!=''"> AND p.recordId = #{recordId} </if> <if test="recordId != null and recordId!=''"> AND p.recordId = #{recordId} </if>
<if test="year != null and year!=''"> AND p.`year` = #{year} </if> <if test="year != null and year!=''"> AND p.`year` = #{year} </if>
<if test="month != null and month!=''"> AND p.`month` = #{month} </if> <if test="month != null and month!=''"> AND p.`month` = #{month} </if>
GROUP BY p.`year`,p.`month`,d.staffId,d.staffName,s.deptId,s.deptName GROUP BY p.`year`,p.`month`,d.staffId,d.staffName,s.salaId,s.salaName,s.deptId,s.deptName
</select> </select>
</mapper> </mapper>
\ 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