|
|
|
@ -104,16 +104,14 @@ public class SaveAppealDomainServiceImpl implements SaveAppealDomainService { |
|
|
|
return Result.success(appealDTO); |
|
|
|
}else if(appealDTO.getStatus().equals(AppealStatusEnum.PASS_REVIEW.getValue()) && !Boolean.TRUE.equals(questionSnapshotDTO.getIsRight())){ |
|
|
|
//审批通过需要加分
|
|
|
|
calculateScore(appealDTO, examRecord, index, questionSnapshotDTO.getType()); |
|
|
|
TaskEntity taskEntity = taskMapper.getTaskByTaskUserId(examRecord.getTaskUserId()); |
|
|
|
calculateScore(appealDTO, examRecord, index, taskEntity); |
|
|
|
|
|
|
|
//加分后试题变正确,减少错题数
|
|
|
|
List<ExamRecordEntity.QuestionSnapshot> snapshots = examRecord.getAnswerSnapshot(); |
|
|
|
ExamRecordEntity.QuestionSnapshot updatedSnapshot = snapshots.get(index); |
|
|
|
if (Boolean.TRUE.equals(updatedSnapshot.getIsRight())) { |
|
|
|
TaskEntity taskEntity = taskMapper.getTaskByTaskUserId(examRecord.getTaskUserId()); |
|
|
|
statisticsApplicationService.decreaseErrorCountAfterAppeal( |
|
|
|
taskEntity.getId(), appealDTO.getQuestionId(), |
|
|
|
updatedSnapshot.getType(), appealDTO.getRevisedScore()); |
|
|
|
statisticsApplicationService.decreaseErrorCountAfterAppeal(taskEntity.getId(), appealDTO.getQuestionId()); |
|
|
|
} |
|
|
|
} |
|
|
|
//通知用户
|
|
|
|
@ -125,12 +123,11 @@ public class SaveAppealDomainServiceImpl implements SaveAppealDomainService { |
|
|
|
/** |
|
|
|
* 计算分数(审批通过需要加分) |
|
|
|
*/ |
|
|
|
public void calculateScore(AppealDTO appealDTO, ExamRecordEntity examRecord, int index, int type) { |
|
|
|
TaskEntity taskEntity = taskMapper.getTaskByTaskUserId(examRecord.getTaskUserId()); |
|
|
|
|
|
|
|
public void calculateScore(AppealDTO appealDTO, ExamRecordEntity examRecord, int index, TaskEntity taskEntity) { |
|
|
|
List<ExamRecordEntity.QuestionSnapshot> snapshots = examRecord.getAnswerSnapshot(); |
|
|
|
ExamRecordEntity.QuestionSnapshot snapshot = snapshots.get(index); |
|
|
|
|
|
|
|
int type = snapshot.getType(); |
|
|
|
QuestionTypeEnum questionType = QuestionTypeEnum.findByValue(type); |
|
|
|
if (questionType == null) { |
|
|
|
throw new BusinessErrorException("不支持的题目类型:" + type); |
|
|
|
|