|
@@ -447,59 +447,34 @@ public class MarkServiceImpl implements MarkService {
|
|
|
lock.clear(marker.getId());
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 重置某个评卷员
|
|
|
- *
|
|
|
- * @param marker
|
|
|
- * - 评卷员
|
|
|
- */
|
|
|
+ @Transactional
|
|
|
@Override
|
|
|
- public void resetMarker(Marker marker) {
|
|
|
- MarkGroup group = groupDao.findOne(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber());
|
|
|
- if (group == null || !markerDao.exists(marker.getId())) {
|
|
|
- return;
|
|
|
+ public boolean resetLibrary(TrialLibrary library) {
|
|
|
+ if(library==null){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ trialTagDao.deleteByLibraryId(library.getId());
|
|
|
+ trialTrackDao.deleteByLibraryId(library.getId());
|
|
|
+ if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
|
|
|
+ trialLibraryDao.resetByIdButMarkerId(library.getId());
|
|
|
+ }else{
|
|
|
+ trialLibraryDao.resetById(library.getId());
|
|
|
+ updateStudentGroupStatus(library.getStudentId(), library.getExamId(), library.getSubjectCode(),
|
|
|
+ library.getGroupNumber(), SubjectiveStatus.UNMARK);
|
|
|
+ studentService.updateSubjectiveStatusAndScore(library.getStudentId(), SubjectiveStatus.UNMARK, 0,
|
|
|
+ null);
|
|
|
+ inspectedService.clearByStudent(library.getStudentId());
|
|
|
}
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public void markerLogout(Marker marker) {
|
|
|
User user = userService.findById(marker.getUserId());
|
|
|
user.refreshAccessToken();
|
|
|
userService.save(user);
|
|
|
releaseByMarker(marker);
|
|
|
-
|
|
|
- if (group.getStatus() == MarkStatus.FORMAL) {
|
|
|
- // 仲裁和等待仲裁的任务不被重置
|
|
|
- // 只选取评卷完成状态的记录重新检查
|
|
|
- // 遍历相关评卷任务的模式
|
|
|
- List<MarkLibrary> list = libraryDao.findByMarkerIdAndStatusNotIn(marker.getId(), LibraryStatus.ARBITRATED,
|
|
|
- LibraryStatus.WAIT_ARBITRATE, LibraryStatus.PROBLEM);
|
|
|
- for (MarkLibrary library : list) {
|
|
|
- lockService.waitlock(LockType.STUDENT, library.getStudentId());
|
|
|
- try {
|
|
|
- resetLibrary(library);
|
|
|
- } finally {
|
|
|
- lockService.unlock(LockType.STUDENT, library.getStudentId());
|
|
|
- }
|
|
|
- }
|
|
|
- markerDao.resetById(marker.getId());
|
|
|
- } else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
- List<TrialLibrary> list = trialLibraryDao.findByMarkerId(marker.getId());
|
|
|
- for (TrialLibrary library : list) {
|
|
|
- lockService.waitlock(LockType.STUDENT, library.getStudentId());
|
|
|
- updateStudentGroupStatus(library.getStudentId(), library.getExamId(), library.getSubjectCode(),
|
|
|
- library.getGroupNumber(), SubjectiveStatus.UNMARK);
|
|
|
- studentService.updateSubjectiveStatusAndScore(library.getStudentId(), SubjectiveStatus.UNMARK, 0, null);
|
|
|
- inspectedService.clearByStudent(library.getStudentId());
|
|
|
- lockService.unlock(LockType.STUDENT, library.getStudentId());
|
|
|
- }
|
|
|
- trialTagDao.deleteByMarkerId(marker.getId());
|
|
|
- trialTrackDao.deleteByMarkerId(marker.getId());
|
|
|
- if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
|
|
|
- trialLibraryDao.resetByMarkerIdButMarkerId(marker.getId());
|
|
|
- }else{
|
|
|
- trialLibraryDao.resetByMarkerId(marker.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- updateMarkedCount(group);
|
|
|
- // inspectHistoryService.deleteByExamIdAndSubjectCode(marker.getExamId(),
|
|
|
- // marker.getSubjectCode());
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@@ -519,10 +494,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void deleteMarker(Marker marker) {
|
|
|
- User user = userService.findById(marker.getUserId());
|
|
|
- user.refreshAccessToken();
|
|
|
- userService.save(user);
|
|
|
- this.releaseByMarker(marker);
|
|
|
+ this.markerLogout(marker);
|
|
|
if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
|
|
|
trialLibraryDao.deleteByMarkerId(marker.getId());
|
|
|
}
|
|
@@ -944,29 +916,6 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 管理员/组长重置某个试评任务
|
|
|
- *
|
|
|
- * @param library
|
|
|
- * - 试评任务
|
|
|
- */
|
|
|
- @Override
|
|
|
- @Transactional
|
|
|
- public boolean resetLibrary(TrialLibrary library) {
|
|
|
- if (library != null) {
|
|
|
- if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
|
|
|
- trialLibraryDao.resetByIdButMarkerId(library.getId());
|
|
|
- }else{
|
|
|
- trialLibraryDao.resetById(library.getId());
|
|
|
- }
|
|
|
- trialTrackDao.deleteByLibraryId(library.getId());
|
|
|
- trialTagDao.deleteByLibraryId(library.getId());
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 管理员/组长处理仲裁卷 - 仲裁卷
|
|
|
*/
|