|
@@ -59,16 +59,24 @@ public class MarkTaskSelfCheckService {
|
|
|
private LevelRepo levelRepo;
|
|
|
|
|
|
/**
|
|
|
- * @param workId 工作ID
|
|
|
- * @param subject 科目
|
|
|
- * @param stage 阶段
|
|
|
- * @param markerId 评卷员ID
|
|
|
- * @param taskId 正评任务ID
|
|
|
+ * @param markTaskDTO 任务对象
|
|
|
+ * @param stage 阶段
|
|
|
+ * @param taskId 任务ID
|
|
|
+ * @param canCreateSelf 是否可以生成自查卷(批量操作使用)
|
|
|
* @return 是否有自查卷
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public boolean updateMarkingCount(Long workId, Subject subject, MarkStage stage, Long markerId, Long taskId) {
|
|
|
+ public boolean updateMarkingCount(MarkTaskDTO markTaskDTO, MarkStage stage, Long taskId, boolean canCreateSelf) {
|
|
|
+ Long workId = markTaskDTO.getWorkId();
|
|
|
+ Subject subject = markTaskDTO.getSubject();
|
|
|
+ Long markerId = markTaskDTO.getMarkerId();
|
|
|
+
|
|
|
+ // 回评卷,不参与自查逻辑
|
|
|
+ if (markTaskDTO.getReLevel()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
MarkSubject markSubject = markSubjectRepo.findOne(workId + "-" + subject.name());
|
|
|
+ // 试评阶段,不参与自查逻辑
|
|
|
if (markSubject.getTest() != TrialEnum.DEFAULT.getId()) {
|
|
|
return false;
|
|
|
}
|
|
@@ -89,11 +97,11 @@ public class MarkTaskSelfCheckService {
|
|
|
|
|
|
int count = markTaskMarkerPaperRepo.countByWorkIdAndSubjectAndStageAndMarkerId(workId, subject, stage, markerId);
|
|
|
// 更新分组中评卷老师评卷数量
|
|
|
- updateMarkingCount(workId, subject, stage, markerId, count);
|
|
|
+ updateMarkerGroupLeaderCount(workId, subject, stage, markerId, count);
|
|
|
|
|
|
boolean isReturnSelf = false;
|
|
|
// 评卷数量等于频率值时
|
|
|
- if (count >= selfCheckFrequency) {
|
|
|
+ if (canCreateSelf && count >= selfCheckFrequency) {
|
|
|
// 生成自查卷评卷任务(当时批次中随机抽取一张)
|
|
|
isReturnSelf = saveSelfCheckTask(workId, subject, stage, markerId);
|
|
|
}
|
|
@@ -164,7 +172,7 @@ public class MarkTaskSelfCheckService {
|
|
|
markTaskSelfCheckRepo.updateMarkingById(id, level, levelValue, StringUtils.isNotBlank(level), new Date());
|
|
|
|
|
|
// 更新分组中评卷老师评卷数量(清0)
|
|
|
- updateMarkingCount(workId, subject, stage, markerId, 0);
|
|
|
+ updateMarkerGroupLeaderCount(workId, subject, stage, markerId, 0);
|
|
|
// 清空评卷明细数据(mark_task_marker_paper表)
|
|
|
deleteMarkerPaper(workId, subject, stage, markerId);
|
|
|
return true;
|
|
@@ -179,7 +187,7 @@ public class MarkTaskSelfCheckService {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- public boolean updateMarkingCount(Long workId, Subject subject, MarkStage stage, Long markerId, int markingCount) {
|
|
|
+ public boolean updateMarkerGroupLeaderCount(Long workId, Subject subject, MarkStage stage, Long markerId, int markingCount) {
|
|
|
markerGroupLeaderRepo.updateMarkingCountByWorkIdAndSubjectAndStageAndMarkerId(workId, subject, stage, markerId, markingCount);
|
|
|
return true;
|
|
|
}
|