Commit 83437813 by tangzhaoqian Committed by chenzg

绩效bug修复+1

parent 47aa359f
......@@ -1459,10 +1459,10 @@ public class JxglController {
}
/**
* 上级评价 -驳回目标
* 评价 -驳回目标
*/
@PostMapping(value = "/update_superior_score_reject")
@ApiOperation(value = "19.上级评价 -驳回目标", httpMethod = "POST", notes = "上级评价 -驳回目标")
@ApiOperation(value = "19.评价 -驳回目标", httpMethod = "POST", notes = "评价 -驳回目标")
@ApiOperationSupport(order = 19)
public Result<Object> updateSSR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject) {
......@@ -1489,53 +1489,52 @@ public class JxglController {
return ResultUtil.error("流程不存在");
}
if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限操作该流程");
}
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限操作该流程");
}
// 修改 目标确认 状态
JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()).in(JxglProcessNode::getProcessType,
ProcessType.TARGET_CONFIRMED.getType(), ProcessType.SELF_ASSESSMENT.getType()));
// 修改 目标确认 状态
JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()).in(JxglProcessNode::getProcessType,
ProcessType.TARGET_CONFIRMED.getType(),
ProcessType.SELF_ASSESSMENT.getType(),
ProcessType.SUPERIOR_SCORE.getType()
));
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType()));
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType()));
// 删除 考核评定-自评
jxglAppraisalAssessmentMapper.delete(new QueryWrapper<JxglAppraisalAssessment>().lambda()
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
// 删除 考核评定-自评
jxglAppraisalAssessmentMapper.delete(new QueryWrapper<JxglAppraisalAssessment>().lambda()
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(
new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
List<Integer> listAIId = CollectionUtil.isNotEmpty(listAI)
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
// 删除 考核指标评定-自评
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>()
.lambda().in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
.eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(
new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
List<Integer> listAIId = CollectionUtil.isNotEmpty(listAI)
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
// 删除 考核指标评定-自评
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>()
.lambda().in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
.eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(
JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
jxglAppraisalMapper.updateById(
JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason());
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert();
} else {
return ResultUtil.error("流程状态异常");
}
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason());
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert();
return ResultUtil.success();
......@@ -1631,6 +1630,7 @@ public class JxglController {
@PostMapping(value = "/save_score")
@ApiOperation(value = "22.评分提交", httpMethod = "POST", notes = "评分提交")
@ApiOperationSupport(order = 22)
@Log(title = "评分提交")
public Result<Object> saveScore(@CurrentUser UserBean userBean,
@Validated @RequestBody ValidList<AppraisalAssessment> appraisalAssessments) throws Exception{
......@@ -1674,9 +1674,7 @@ public class JxglController {
for (AppraisalAssessment a : appraisalAssessments) {
Integer type = ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType()
? AssessmentType.SELF_ASSESSMENT.getType()
: AssessmentType.SUPERIOR_SCORE.getType();
Integer type = processNode.getProcessType();
if (Double.valueOf(a.getScore()) > maxScore) {
......@@ -1734,20 +1732,23 @@ public class JxglController {
}
// 算 总评分 ---- 自评权重*自评分 + 上级评分权重*上级评分 = 总评分
// 算 总评分 ---- 自评权重*自评综合分 + 上级评分权重*上级综合评分 = 总评分
List<JxglProcessNode> listProcessNode = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda()
.select(JxglProcessNode::getWeight,JxglProcessNode::getProcessType)
.orderByAsc(JxglProcessNode::getProcessType)
.in(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType(),ProcessType.SUPERIOR_SCORE.getType()));
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.in(JxglProcessNode::getProcessType,
ProcessType.SELF_ASSESSMENT.getType()
,ProcessType.SUPERIOR_SCORE.getType()));
List<JxglAppraisalAssessment> listAppraisalAssessment = jxglAppraisalAssessmentMapper.selectList(new QueryWrapper<JxglAppraisalAssessment>().lambda()
.select(JxglAppraisalAssessment::getType,JxglAppraisalAssessment::getComprehensiveScore)
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.orderByAsc(JxglAppraisalAssessment::getType)
);
Double selfAssessment = 0D;
Double superiorAssessment = 0D;
Integer aWeights = 0;
Integer bWeights = 0;
Double total = 0D;
......@@ -1769,17 +1770,18 @@ public class JxglController {
Integer min = 0;
Integer max = 0;
// System.out.println(aWeights);
// System.out.println(selfAssessment);
// System.out.println(bWeights);
// System.out.println(superiorAssessment);
total = aWeights*0.01*selfAssessment + bWeights*0.01*superiorAssessment;
System.out.println(total);
System.out.println(aWeights);
System.out.println(selfAssessment);
System.out.println(bWeights);
System.out.println(superiorAssessment);
List<JxglPerformanceRating> listPR = bS.getPerformanceRatings();
for (JxglPerformanceRating pR : listPR) {
min = min > pR.getSectionMinScore() ? pR.getSectionMinScore() : min;
max = max < pR.getSectionMaxScore() ? pR.getSectionMaxScore() : max;
level = pR.getSectionMaxScore() <= total && pR.getSectionMinScore() < total ? pR.getName() : null;
min = min >= pR.getSectionMinScore() ? pR.getSectionMinScore() : min;
max = max <= pR.getSectionMaxScore() ? pR.getSectionMaxScore() : max;
level = pR.getSectionMaxScore() >= total && pR.getSectionMinScore() < total ? pR.getName() : null;
}
if (level == null) {
for (JxglPerformanceRating pR : listPR) {
......
......@@ -237,7 +237,7 @@
(SELECT name FROM yggl_main_emp WHERE emp_num = c.executor_id AND org_code = #{param.orgCode}) as executor_name
FROM jxgl_appraisal a
LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode}
LEFT JOIN jxgl_process_node c ON a.id = c.appraisal_id AND c.sts = 1
LEFT JOIN jxgl_process_node c ON a.id = c.appraisal_id AND c.process_type = a.sts
WHERE a.performance_appraisal_id = #{param.id}
<if test="param.empNums != null and param.empNums.size() > 0">
......
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