|
@@ -1,59 +1,32 @@
|
|
|
package cn.com.qmth.stmms.biz.mark.service.Impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Comparator;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.concurrent.ConcurrentHashMap;
|
|
|
-
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.domain.Sort;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
import cn.com.qmth.stmms.biz.campus.model.Campus;
|
|
|
import cn.com.qmth.stmms.biz.exam.dao.ExamQuestionDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.dao.MarkGroupDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.dao.MarkerDao;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.*;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.ArbitrateHistoryDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.MarkLibraryDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.MarkSpecialTagDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.MarkTrackDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.ProblemHistoryDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.TrialHistoryDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.TrialLibraryDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.TrialTagDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.dao.TrialTrackDao;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.ArbitrateHistory;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.MarkResult;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.MarkTrack;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.ProblemHistory;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.TrialHistory;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.TrialLibrary;
|
|
|
+import cn.com.qmth.stmms.biz.mark.dao.*;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.*;
|
|
|
import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
|
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkService;
|
|
|
import cn.com.qmth.stmms.biz.mark.service.ProblemHistoryService;
|
|
|
import cn.com.qmth.stmms.biz.utils.FormalTaskUtil;
|
|
|
import cn.com.qmth.stmms.biz.utils.ScoreItem;
|
|
|
import cn.com.qmth.stmms.biz.utils.TrialTaskUtil;
|
|
|
-import cn.com.qmth.stmms.common.enums.HistoryStatus;
|
|
|
-import cn.com.qmth.stmms.common.enums.LibraryStatus;
|
|
|
-import cn.com.qmth.stmms.common.enums.MarkStatus;
|
|
|
-import cn.com.qmth.stmms.common.enums.ScorePolicy;
|
|
|
-import cn.com.qmth.stmms.common.enums.ThirdPolicy;
|
|
|
+import cn.com.qmth.stmms.common.enums.*;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
/**
|
|
|
* 与评卷相关的所有修改操作(非传播性的新增操作除外),全部汇总到这里进行集中控制
|
|
@@ -118,8 +91,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 某个评卷分组已申请的评卷任务数量
|
|
|
*
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param group - 评卷分组
|
|
|
* @return int
|
|
|
*/
|
|
|
@Override
|
|
@@ -136,8 +108,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 某个评卷员已申请的评卷任务数量
|
|
|
*
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param marker - 评卷员
|
|
|
* @return int
|
|
|
*/
|
|
|
@Override
|
|
@@ -159,8 +130,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 某个评卷员已完成的评卷任务数量
|
|
|
*
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param marker - 评卷员
|
|
|
* @return long
|
|
|
*/
|
|
|
@Override
|
|
@@ -173,8 +143,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
return trialHistoryDao.countByMarkerId(marker.getId());
|
|
|
} else {
|
|
|
- return libraryDao.countByMarkerAndStatus(marker.getId(), LibraryStatus.MARKED,
|
|
|
- LibraryStatus.ARBITRATED, LibraryStatus.INSPECTED);
|
|
|
+ return libraryDao.countByMarkerAndStatus(marker.getId(), LibraryStatus.MARKED, LibraryStatus.ARBITRATED,
|
|
|
+ LibraryStatus.INSPECTED);
|
|
|
}
|
|
|
}
|
|
|
return 0;
|
|
@@ -183,8 +153,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 释放某个评卷分组的锁定任务
|
|
|
*
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param group - 评卷分组
|
|
|
*/
|
|
|
@Override
|
|
|
public void releaseByGroup(MarkGroup group) {
|
|
@@ -198,8 +167,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 重置某个评卷分组的所有评卷任务
|
|
|
*
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param group - 评卷分组
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -210,8 +178,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 删除某个评卷分组
|
|
|
*
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param group - 评卷分组
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -247,14 +214,13 @@ public class MarkServiceImpl implements MarkService {
|
|
|
subjectService.updateScore(group.getExamId(), group.getSubjectCode(), false,
|
|
|
sumTotalScore(group.getExamId(), group.getSubjectCode()));
|
|
|
// 需要重新统分
|
|
|
- examService.updateNeedCalculate(group.getExamId(), true);
|
|
|
+ subjectService.updateNeedCalculate(group.getExamId(), group.getSubjectCode(), true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改某个评卷分组给分步骤,并重置评卷任务
|
|
|
*
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param group - 评卷分组
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -278,10 +244,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 评卷员申请领取某个正式评卷任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 正评任务
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param library - 正评任务
|
|
|
+ * @param marker - 评卷员
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean applyLibrary(MarkLibrary library, Marker marker) {
|
|
@@ -297,10 +261,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 评卷员申请领取某个试评评卷任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 试评任务
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param library - 试评任务
|
|
|
+ * @param marker - 评卷员
|
|
|
* @return boolean
|
|
|
*/
|
|
|
@Override
|
|
@@ -311,10 +273,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 评卷员是否已领取了某个正式评卷任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 正评任务
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param library - 正评任务
|
|
|
+ * @param marker - 评卷员
|
|
|
* @return boolean
|
|
|
*/
|
|
|
@Override
|
|
@@ -325,10 +285,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 评卷员是否已领取了某个试评评卷任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 试评任务
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param library - 试评任务
|
|
|
+ * @param marker - 评卷员
|
|
|
* @return boolean
|
|
|
*/
|
|
|
@Override
|
|
@@ -339,10 +297,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 释放某个评卷员已领取的正评任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 正评任务
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param library - 正评任务
|
|
|
+ * @param marker - 评卷员
|
|
|
*/
|
|
|
@Override
|
|
|
public void releaseLibrary(MarkLibrary library, Marker marker) {
|
|
@@ -352,10 +308,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 释放某个评卷员已领取的试评任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 试评任务
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param library - 试评任务
|
|
|
+ * @param marker - 评卷员
|
|
|
*/
|
|
|
@Override
|
|
|
public void releaseLibrary(TrialLibrary library, Marker marker) {
|
|
@@ -365,8 +319,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 释放某个评卷员的所有锁定任务
|
|
|
*
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param marker - 评卷员
|
|
|
*/
|
|
|
@Override
|
|
|
public void releaseByMarker(Marker marker) {
|
|
@@ -377,8 +330,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 重置某个评卷员
|
|
|
*
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param marker - 评卷员
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -408,8 +360,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 根据考生删除评卷任务
|
|
|
*
|
|
|
- * @param student
|
|
|
- * - 考生
|
|
|
+ * @param student - 考生
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -432,10 +383,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 评卷员提交评卷任务
|
|
|
*
|
|
|
- * @param result
|
|
|
- * - 评卷结果
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param result - 评卷结果
|
|
|
+ * @param marker - 评卷员
|
|
|
* @return boolean
|
|
|
*/
|
|
|
@Override
|
|
@@ -443,8 +392,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
public boolean submitTask(MarkResult result, Marker marker) {
|
|
|
// 判断评卷分组是否存在/评卷是否结束
|
|
|
MarkGroup group = groupDao.findOne(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber());
|
|
|
- if (group == null || group.getStatus() == MarkStatus.FINISH
|
|
|
- || group.getStatus().getValue() != result.getStatusValue()) {
|
|
|
+ if (group == null || group.getStatus() == MarkStatus.FINISH || group.getStatus().getValue() != result
|
|
|
+ .getStatusValue()) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -462,10 +411,10 @@ public class MarkServiceImpl implements MarkService {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
- if (library != null && library.getExamId().equals(group.getExamId())
|
|
|
- && library.getSubjectCode().equals(group.getSubjectCode())
|
|
|
- && library.getGroupNumber().equals(group.getNumber())
|
|
|
- && result.getTotalScore() <= group.getTotalScore() && StringUtils.isNotBlank(result.getScoreList())) {
|
|
|
+ if (library != null && library.getExamId().equals(group.getExamId()) && library.getSubjectCode()
|
|
|
+ .equals(group.getSubjectCode()) && library.getGroupNumber().equals(group.getNumber())
|
|
|
+ && result.getTotalScore() <= group.getTotalScore() && StringUtils
|
|
|
+ .isNotBlank(result.getScoreList())) {
|
|
|
if (submitLibrary(library, marker, group, result)) {
|
|
|
updateMarkedCount(group);
|
|
|
releaseLibrary(library, marker);
|
|
@@ -474,10 +423,10 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
} else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
TrialLibrary library = trialLibraryDao.findOne(result.getLibraryId());
|
|
|
- if (library != null && library.getExamId().equals(group.getExamId())
|
|
|
- && library.getSubjectCode().equals(group.getSubjectCode())
|
|
|
- && library.getGroupNumber().equals(group.getNumber())
|
|
|
- && result.getTotalScore() <= group.getTotalScore() && StringUtils.isNotBlank(result.getScoreList())) {
|
|
|
+ if (library != null && library.getExamId().equals(group.getExamId()) && library.getSubjectCode()
|
|
|
+ .equals(group.getSubjectCode()) && library.getGroupNumber().equals(group.getNumber())
|
|
|
+ && result.getTotalScore() <= group.getTotalScore() && StringUtils
|
|
|
+ .isNotBlank(result.getScoreList())) {
|
|
|
TrialHistory history = new TrialHistory();
|
|
|
history.setExamId(library.getExamId());
|
|
|
history.setSubjectCode(library.getSubjectCode());
|
|
@@ -527,14 +476,10 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 评卷员提交某个正评任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 正评任务
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
- * @param result
|
|
|
- * - 评卷结果
|
|
|
+ * @param library - 正评任务
|
|
|
+ * @param marker - 评卷员
|
|
|
+ * @param group - 评卷分组
|
|
|
+ * @param result - 评卷结果
|
|
|
*/
|
|
|
private boolean submitLibrary(MarkLibrary library, Marker marker, MarkGroup group, MarkResult result) {
|
|
|
// 非本人领取的待评任务
|
|
@@ -542,8 +487,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
return false;
|
|
|
}
|
|
|
// 非本人的回评任务
|
|
|
- if ((library.getStatus() == LibraryStatus.MARKED || library.getStatus() == LibraryStatus.INSPECTED)
|
|
|
- && !library.getMarkerId().equals(marker.getId())) {
|
|
|
+ if ((library.getStatus() == LibraryStatus.MARKED || library.getStatus() == LibraryStatus.INSPECTED) && !library
|
|
|
+ .getMarkerId().equals(marker.getId())) {
|
|
|
return false;
|
|
|
}
|
|
|
// 是否多评情况下已处理过该考生评卷任务
|
|
@@ -553,9 +498,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
// 尝试提交评卷结果
|
|
|
Date now = new Date();
|
|
|
- if (libraryDao.updateMarkerResult(library.getId(), LibraryStatus.MARKED, marker.getId(),
|
|
|
- result.getTotalScore(), result.getScoreList(), now, result.getSpent(), LibraryStatus.WAITING,
|
|
|
- LibraryStatus.MARKED, LibraryStatus.INSPECTED) == 0) {
|
|
|
+ if (libraryDao.updateMarkerResult(library.getId(), LibraryStatus.MARKED, marker.getId(), result.getTotalScore(),
|
|
|
+ result.getScoreList(), now, result.getSpent(), LibraryStatus.WAITING, LibraryStatus.MARKED,
|
|
|
+ LibraryStatus.INSPECTED) == 0) {
|
|
|
// 条件不符更新失败,直接返回
|
|
|
return false;
|
|
|
}
|
|
@@ -575,8 +520,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
ArbitrateHistory history = null;
|
|
|
if (group.getArbitrateThreshold() != null && group.getArbitrateThreshold() > 0) {
|
|
|
// 多评模式
|
|
|
- List<MarkLibrary> list = libraryDao.findByStudentIdAndGroupNumberAndStatus(library.getStudentId(),
|
|
|
- library.getGroupNumber(), LibraryStatus.MARKED, LibraryStatus.INSPECTED);
|
|
|
+ List<MarkLibrary> list = libraryDao
|
|
|
+ .findByStudentIdAndGroupNumberAndStatus(library.getStudentId(), library.getGroupNumber(),
|
|
|
+ LibraryStatus.MARKED, LibraryStatus.INSPECTED);
|
|
|
for (MarkLibrary other : list) {
|
|
|
if (other.getId().equals(library.getId()) || other.getHeaderScore() != null) {
|
|
|
// 本评卷任务或组长已打分,则跳过该任务
|
|
@@ -586,12 +532,13 @@ public class MarkServiceImpl implements MarkService {
|
|
|
if (Math.abs(other.getMarkerScore() - result.getTotalScore()) > group.getArbitrateThreshold()) {
|
|
|
// 开启三评
|
|
|
if (group.getThirdPolicy().equals(ThirdPolicy.LOW_DIFF_HIGH_AVG)) {
|
|
|
- if (libraryDao.countByStudentIdAndGroupNumber(library.getStudentId(), library.getGroupNumber()) == 2) {
|
|
|
+ if (libraryDao.countByStudentIdAndGroupNumber(library.getStudentId(), library.getGroupNumber())
|
|
|
+ == 2) {
|
|
|
buildThirdLibrary(library, group);
|
|
|
} else {
|
|
|
// 两两比较,触发仲裁
|
|
|
- List<MarkLibrary> libraries = libraryDao.findByStudentIdAndGroupNumber(
|
|
|
- library.getStudentId(), library.getGroupNumber());
|
|
|
+ List<MarkLibrary> libraries = libraryDao
|
|
|
+ .findByStudentIdAndGroupNumber(library.getStudentId(), library.getGroupNumber());
|
|
|
history = getArbitrate(libraries, group.getArbitrateThreshold(), now);
|
|
|
}
|
|
|
} else {
|
|
@@ -665,8 +612,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
* 管理员/组长打回某个评卷任务<br>
|
|
|
* 暂时不用到BACKED状态,直接等同于重置该评卷任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 正评任务
|
|
|
+ * @param library - 正评任务
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -690,8 +636,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 管理员/组长重置某个试评任务
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 试评任务
|
|
|
+ * @param library - 试评任务
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -709,8 +654,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 管理员/组长处理仲裁卷
|
|
|
*
|
|
|
- * @param history
|
|
|
- * - 仲裁卷
|
|
|
+ * @param history - 仲裁卷
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -728,10 +672,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 对某个考生某个科目进行主观题统分
|
|
|
*
|
|
|
- * @param student
|
|
|
- * - 考生
|
|
|
- * @param groups
|
|
|
- * - 所有评卷分组
|
|
|
+ * @param student - 考生
|
|
|
+ * @param groups - 所有评卷分组
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -757,8 +699,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
// 全部评完,更新考生主观题得分
|
|
|
student.setSubjectiveScore(totalScore);
|
|
|
student.setScoreList(scoreList, false);
|
|
|
- studentService.updateSubjectiveScore(student.getId(), student.getSubjectiveScore(),
|
|
|
- student.getSubjectiveScoreList());
|
|
|
+ studentService
|
|
|
+ .updateSubjectiveScore(student.getId(), student.getSubjectiveScore(), student.getSubjectiveScoreList());
|
|
|
}
|
|
|
|
|
|
private boolean calculateGroup(MarkGroup group, Integer studentId) {
|
|
@@ -793,12 +735,12 @@ public class MarkServiceImpl implements MarkService {
|
|
|
return -1;
|
|
|
}
|
|
|
});
|
|
|
- Double score1 = list.get(0).getHeaderScore() != null ? list.get(0).getHeaderScore() : list.get(0)
|
|
|
- .getMarkerScore();
|
|
|
- Double score2 = list.get(1).getHeaderScore() != null ? list.get(1).getHeaderScore() : list.get(1)
|
|
|
- .getMarkerScore();
|
|
|
- Double score3 = list.get(2).getHeaderScore() != null ? list.get(2).getHeaderScore() : list.get(2)
|
|
|
- .getMarkerScore();
|
|
|
+ Double score1 =
|
|
|
+ list.get(0).getHeaderScore() != null ? list.get(0).getHeaderScore() : list.get(0).getMarkerScore();
|
|
|
+ Double score2 =
|
|
|
+ list.get(1).getHeaderScore() != null ? list.get(1).getHeaderScore() : list.get(1).getMarkerScore();
|
|
|
+ Double score3 =
|
|
|
+ list.get(2).getHeaderScore() != null ? list.get(2).getHeaderScore() : list.get(2).getMarkerScore();
|
|
|
if ((score3 - score2) <= (score2 - score1)) {
|
|
|
list.remove(0);
|
|
|
} else {
|
|
@@ -870,8 +812,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 更新某个评卷分组已评任务数量
|
|
|
*
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param group - 评卷分组
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -879,7 +820,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
if (group.getStatus() == MarkStatus.FORMAL || group.getStatus() == MarkStatus.FINISH) {
|
|
|
groupDao.updateMarkedCount(group.getExamId(), group.getSubjectCode(), group.getNumber(), (int) libraryDao
|
|
|
.countByExamIdAndSubjectCodeAndGroupNumberAndStatus(group.getExamId(), group.getSubjectCode(),
|
|
|
- group.getNumber(), LibraryStatus.MARKED, LibraryStatus.ARBITRATED, LibraryStatus.INSPECTED));
|
|
|
+ group.getNumber(), LibraryStatus.MARKED, LibraryStatus.ARBITRATED,
|
|
|
+ LibraryStatus.INSPECTED));
|
|
|
} else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
groupDao.updateMarkedCount(group.getExamId(), group.getSubjectCode(), group.getNumber(),
|
|
|
(int) trialLibraryDao.countMarked(group.getExamId(), group.getSubjectCode(), group.getNumber()));
|
|
@@ -889,20 +831,21 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 更新某个评卷分组评卷任务总量
|
|
|
*
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param group - 评卷分组
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void updateLibraryCount(MarkGroup group) {
|
|
|
if (group.getStatus() == MarkStatus.FORMAL || group.getStatus() == MarkStatus.FINISH) {
|
|
|
- group.setLibraryCount((int) libraryDao.countByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(),
|
|
|
- group.getSubjectCode(), group.getNumber()));
|
|
|
+ group.setLibraryCount((int) libraryDao
|
|
|
+ .countByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
+ group.getNumber()));
|
|
|
groupDao.updateLibraryCount(group.getExamId(), group.getSubjectCode(), group.getNumber(),
|
|
|
group.getLibraryCount());
|
|
|
} else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
- group.setLibraryCount((int) trialLibraryDao.countByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(),
|
|
|
- group.getSubjectCode(), group.getNumber()));
|
|
|
+ group.setLibraryCount((int) trialLibraryDao
|
|
|
+ .countByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
+ group.getNumber()));
|
|
|
groupDao.updateLibraryCount(group.getExamId(), group.getSubjectCode(), group.getNumber(),
|
|
|
group.getLibraryCount());
|
|
|
}
|
|
@@ -911,10 +854,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 更新某个科目所有评卷分组评卷任务数量
|
|
|
*
|
|
|
- * @param examId
|
|
|
- * - 考试ID
|
|
|
- * @param subjectCode
|
|
|
- * - 科目代码
|
|
|
+ * @param examId - 考试ID
|
|
|
+ * @param subjectCode - 科目代码
|
|
|
*/
|
|
|
@Transactional
|
|
|
@Override
|
|
@@ -929,14 +870,10 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 根据考生、学习中心、评卷分组构造正式评卷任务
|
|
|
*
|
|
|
- * @param student
|
|
|
- * - 考生
|
|
|
- * @param campus
|
|
|
- * - 学习中心
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
- * @param subject
|
|
|
- * - 科目
|
|
|
+ * @param student - 考生
|
|
|
+ * @param campus - 学习中心
|
|
|
+ * @param group - 评卷分组
|
|
|
+ * @param subject - 科目
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -962,14 +899,15 @@ public class MarkServiceImpl implements MarkService {
|
|
|
} else {
|
|
|
double studentCount = subject.getUploadCount();
|
|
|
double libraryCount = group.getLibraryCount();
|
|
|
- double doubleCount = libraryDao.countByExamIdAndSubjectCodeAndGroupNumberAndTaskNumber(
|
|
|
- group.getExamId(), group.getSubjectCode(), group.getNumber(), 2);
|
|
|
+ double doubleCount = libraryDao
|
|
|
+ .countByExamIdAndSubjectCodeAndGroupNumberAndTaskNumber(group.getExamId(),
|
|
|
+ group.getSubjectCode(), group.getNumber(), 2);
|
|
|
int expectCount = (int) (studentCount * group.getDoubleRate());
|
|
|
// 随机数判断加入当前已经生成双评任务的比例加权
|
|
|
// 实际双评任务数小于理论生成数 &&(剩余未生成双评的考生数量小于剩余应生成的数量||随机比例)
|
|
|
- needDouble = doubleCount < expectCount
|
|
|
- && ((studentCount - libraryCount + doubleCount) <= (expectCount - doubleCount) || Math
|
|
|
- .random() < group.getDoubleRate() + 0.1);
|
|
|
+ needDouble = doubleCount < expectCount && (
|
|
|
+ (studentCount - libraryCount + doubleCount) <= (expectCount - doubleCount)
|
|
|
+ || Math.random() < group.getDoubleRate() + 0.1);
|
|
|
}
|
|
|
if (needDouble) {
|
|
|
library = new MarkLibrary();
|
|
@@ -994,12 +932,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 根据考生、学习中心、评卷分组构造试评评卷任务
|
|
|
*
|
|
|
- * @param student
|
|
|
- * - 考生
|
|
|
- * @param campus
|
|
|
- * - 学习中心
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param student - 考生
|
|
|
+ * @param campus - 学习中心
|
|
|
+ * @param group - 评卷分组
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -1021,8 +956,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
* 领取正式评卷任务时,用来区分的唯一标识<br/>
|
|
|
* 多评时同一个考生的多份任务不能被同一位评卷员领取
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 正评任务
|
|
|
+ * @param library - 正评任务
|
|
|
*/
|
|
|
private String getApplyTaskId(MarkLibrary library) {
|
|
|
return library.getStudentId() + "_" + library.getGroupNumber();
|
|
@@ -1031,8 +965,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 领取试评评卷任务时,用来区分的唯一标识
|
|
|
*
|
|
|
- * @param library
|
|
|
- * - 试评任务
|
|
|
+ * @param library - 试评任务
|
|
|
*/
|
|
|
private String getApplyTaskId(TrialLibrary library, Marker marker) {
|
|
|
return library.getId() + "_" + marker.getId();
|
|
@@ -1041,8 +974,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 重置评卷分组的连带操作
|
|
|
*
|
|
|
- * @param group
|
|
|
- * - 评卷分组
|
|
|
+ * @param group - 评卷分组
|
|
|
*/
|
|
|
private void resetGroup(MarkGroup group) {
|
|
|
if (group.getStatus() == MarkStatus.FORMAL) {
|
|
@@ -1055,8 +987,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
group.getNumber());
|
|
|
libraryDao.resetByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber(), LibraryStatus.WAITING);
|
|
|
- libraryDao.deleteByExamIdAndSubjectCodeAndGroupNumberAndTaskNumber(group.getExamId(),
|
|
|
- group.getSubjectCode(), group.getNumber(), 3);
|
|
|
+ libraryDao
|
|
|
+ .deleteByExamIdAndSubjectCodeAndGroupNumberAndTaskNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
+ group.getNumber(), 3);
|
|
|
markerDao.resetByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber());
|
|
|
} else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
@@ -1074,8 +1007,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
/**
|
|
|
* 计算并更新指定评卷员的评卷质量指标
|
|
|
*
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
+ * @param marker - 评卷员
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|