|
@@ -7,6 +7,7 @@ import java.util.stream.Stream;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.qmth.teachcloud.mark.service.*;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -34,9 +35,6 @@ import com.qmth.teachcloud.mark.entity.MarkPaper;
|
|
|
import com.qmth.teachcloud.mark.mapper.MarkQuestionMapper;
|
|
|
import com.qmth.teachcloud.mark.params.MarkObjectiveQuestionParams;
|
|
|
import com.qmth.teachcloud.mark.params.MarkQuestionParams;
|
|
|
-import com.qmth.teachcloud.mark.service.MarkGroupService;
|
|
|
-import com.qmth.teachcloud.mark.service.MarkPaperService;
|
|
|
-import com.qmth.teachcloud.mark.service.MarkQuestionService;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -56,6 +54,8 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
|
@Resource
|
|
|
private MarkGroupService markGroupService;
|
|
|
@Resource
|
|
|
+ private MarkService markService;
|
|
|
+ @Resource
|
|
|
private FileStoreUtil fileStoreUtil;
|
|
|
|
|
|
@Override
|
|
@@ -222,7 +222,18 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
|
}
|
|
|
|
|
|
// 主观题结构有变动
|
|
|
+ List<MarkQuestion> subjectiveQuestions = questions.stream().filter(m -> m.getObjective()).collect(Collectors.toList());
|
|
|
+ List<MarkQuestion> subjectiveMarkQuestionList = markQuestionList.stream().filter(m -> m.getObjective()).collect(Collectors.toList());
|
|
|
+ if(!CollectionUtils.isEqualCollection(subjectiveQuestions, subjectiveMarkQuestionList)){
|
|
|
+ // 未分组的题目
|
|
|
+ long unGroupQuestionCount = this.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(examId, paperNumber, false);
|
|
|
+ long groupCount = CollectionUtils.size(markGroupService.listGroupByExamIdAndPaperNumber(examId, paperNumber));
|
|
|
+ // 考生主观题重新统分
|
|
|
+ markService.checkStudentSubjectiveScore(examId, markPaper.getCoursePaperId(),groupCount, unGroupQuestionCount);
|
|
|
+ }
|
|
|
|
|
|
+ // 更新分组状态
|
|
|
+ markService.updateMarkGroupStatus(examId, paperNumber);
|
|
|
}
|
|
|
|
|
|
@Override
|