From c406d1fb36672cbdd0d143cea6b129471e3f69e3 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 19 Mar 2021 18:21:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E8=AF=84=E5=88=86bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/club/joylink/rtss/dao/UserExamMapper.java | 4 ++-- .../club/joylink/rtss/services/org/OrgScoringRuleService.java | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/club/joylink/rtss/dao/UserExamMapper.java b/src/main/java/club/joylink/rtss/dao/UserExamMapper.java index 5c6668e1e..7c59ceb16 100644 --- a/src/main/java/club/joylink/rtss/dao/UserExamMapper.java +++ b/src/main/java/club/joylink/rtss/dao/UserExamMapper.java @@ -117,7 +117,7 @@ public interface UserExamMapper { "FROM " + "user_exam " + "WHERE " + - "user_id = 3 " + - "AND exam_id = 39") + "user_id = #{userId} " + + "AND exam_id = #{examId}") Integer findHeightScoreUserExam(Long userId, Long examId); } diff --git a/src/main/java/club/joylink/rtss/services/org/OrgScoringRuleService.java b/src/main/java/club/joylink/rtss/services/org/OrgScoringRuleService.java index 08b88b0aa..65e2b919f 100644 --- a/src/main/java/club/joylink/rtss/services/org/OrgScoringRuleService.java +++ b/src/main/java/club/joylink/rtss/services/org/OrgScoringRuleService.java @@ -83,12 +83,10 @@ public class OrgScoringRuleService implements IOrgScoringRuleService { int totalWeight = orgScoringRuleVO.calculateTotalWeight(); Map usualScoreMap = new HashMap<>(); if (orgScoringRuleVO.getUsualScoringRule() != null) { - totalWeight += orgScoringRuleVO.getUsualScoringRule().calculateTotalWeight(); usualScoreMap = this.score(userIds, orgScoringRuleVO.getUsualScoringRule(), totalWeight, projects); } Map finalScoreMap = new HashMap<>(); if (orgScoringRuleVO.getFinalScoringRule() != null) { - totalWeight += orgScoringRuleVO.getFinalScoringRule().calculateTotalWeight(); finalScoreMap = this.score(userIds, orgScoringRuleVO.getFinalScoringRule(), totalWeight, projects); } List list = new ArrayList<>(); @@ -182,7 +180,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService { List exams = rule.getExams(); if (!CollectionUtils.isEmpty(exams)) { for (OrgScoringRuleVO.Exam exam : exams) { - int examScore = iUserExamService.queryHeightScoreOfUserExam(userId, exam.getExamId()); + Integer examScore = iUserExamService.queryHeightScoreOfUserExam(userId, exam.getExamId()); score += exam.calculateScore(examScore, totalWeight); } }