考试评分bug修改

This commit is contained in:
joylink_zhangsai 2021-03-19 18:21:25 +08:00
parent 8192e0be98
commit c406d1fb36
2 changed files with 3 additions and 5 deletions

View File

@ -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);
}

View File

@ -83,12 +83,10 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
int totalWeight = orgScoringRuleVO.calculateTotalWeight();
Map<Long, Integer> usualScoreMap = new HashMap<>();
if (orgScoringRuleVO.getUsualScoringRule() != null) {
totalWeight += orgScoringRuleVO.getUsualScoringRule().calculateTotalWeight();
usualScoreMap = this.score(userIds, orgScoringRuleVO.getUsualScoringRule(), totalWeight, projects);
}
Map<Long, Integer> finalScoreMap = new HashMap<>();
if (orgScoringRuleVO.getFinalScoringRule() != null) {
totalWeight += orgScoringRuleVO.getFinalScoringRule().calculateTotalWeight();
finalScoreMap = this.score(userIds, orgScoringRuleVO.getFinalScoringRule(), totalWeight, projects);
}
List<OrgScoringResultVO> list = new ArrayList<>();
@ -182,7 +180,7 @@ public class OrgScoringRuleService implements IOrgScoringRuleService {
List<OrgScoringRuleVO.Exam> 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);
}
}