|
@@ -755,6 +755,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
Long examId = doubleMarkParam.getExamId();
|
|
Long examId = doubleMarkParam.getExamId();
|
|
String paperNumber = doubleMarkParam.getPaperNumber();
|
|
String paperNumber = doubleMarkParam.getPaperNumber();
|
|
Long questionId = doubleMarkParam.getQuestionId();
|
|
Long questionId = doubleMarkParam.getQuestionId();
|
|
|
|
+ Double doubleRate = doubleMarkParam.getDoubleRate() != null ? doubleMarkParam.getDoubleRate() : 0;
|
|
List<MarkTaskStatus> markTaskStatuses = Arrays.asList(MarkTaskStatus.MARKED, MarkTaskStatus.WAIT_ARBITRATE, MarkTaskStatus.PROBLEM, MarkTaskStatus.REJECTED, MarkTaskStatus.ARBITRATED);
|
|
List<MarkTaskStatus> markTaskStatuses = Arrays.asList(MarkTaskStatus.MARKED, MarkTaskStatus.WAIT_ARBITRATE, MarkTaskStatus.PROBLEM, MarkTaskStatus.REJECTED, MarkTaskStatus.ARBITRATED);
|
|
if (markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndStatusIn(examId, paperNumber, questionId, markTaskStatuses) > 0) {
|
|
if (markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndStatusIn(examId, paperNumber, questionId, markTaskStatuses) > 0) {
|
|
throw ExceptionResultEnum.ERROR.exception("该题已开始评卷,不允许修改");
|
|
throw ExceptionResultEnum.ERROR.exception("该题已开始评卷,不允许修改");
|
|
@@ -763,14 +764,14 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
MarkQuestion markQuestion = this.getById(questionId);
|
|
MarkQuestion markQuestion = this.getById(questionId);
|
|
|
|
|
|
UpdateWrapper<MarkQuestion> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<MarkQuestion> updateWrapper = new UpdateWrapper<>();
|
|
- updateWrapper.lambda().set(MarkQuestion::getDoubleRate, doubleMarkParam.getDoubleRate())
|
|
|
|
- .set(MarkQuestion::getArbitrateThreshold, doubleMarkParam.getArbitrateThreshold())
|
|
|
|
- .set(MarkQuestion::getScorePolicy, doubleMarkParam.getScorePolicy())
|
|
|
|
|
|
+ updateWrapper.lambda().set(MarkQuestion::getDoubleRate, doubleRate)
|
|
|
|
+ .set(MarkQuestion::getArbitrateThreshold, doubleRate > 0 ? doubleMarkParam.getArbitrateThreshold() : null)
|
|
|
|
+ .set(MarkQuestion::getScorePolicy, doubleRate > 0 ? doubleMarkParam.getScorePolicy() : null)
|
|
.eq(MarkQuestion::getId, doubleMarkParam.getQuestionId());
|
|
.eq(MarkQuestion::getId, doubleMarkParam.getQuestionId());
|
|
this.update(updateWrapper);
|
|
this.update(updateWrapper);
|
|
|
|
|
|
// 单、又评切换、双评比例修改,删除任务
|
|
// 单、又评切换、双评比例修改,删除任务
|
|
- if (!markQuestion.getDoubleRate().equals(doubleMarkParam.getDoubleRate())) {
|
|
|
|
|
|
+ if (!markQuestion.getDoubleRate().equals(doubleRate)) {
|
|
this.updateMarkedCount(questionId, 0);
|
|
this.updateMarkedCount(questionId, 0);
|
|
this.updateTaskCount(questionId, 0);
|
|
this.updateTaskCount(questionId, 0);
|
|
if (lockService.trylock(LockType.QUESTION_UPDATE, questionId)) {
|
|
if (lockService.trylock(LockType.QUESTION_UPDATE, questionId)) {
|