yin 10 ay önce
ebeveyn
işleme
840f4948a8

+ 11 - 9
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkCronService.java

@@ -294,8 +294,10 @@ public class MarkCronService {
                 if (!libraryList.isEmpty()) {
                     count += libraryList.size();
                     // 任务乱序
-                    int shuffleCount =(group.getDoubleRate() != null && group.getDoubleRate() > 0) ? 40:20;
-
+                    int shuffleCount = 20;
+                    if (group.getDoubleRate() != null && group.getDoubleRate() > 0) {
+                        shuffleCount = (int) (20 * (1 + group.getDoubleRate()));
+                    }
                     List<MarkLibrary> list = new ArrayList<>();
                     List<MarkLibrary> saveList = new ArrayList<>();
                     for (MarkLibrary l : libraryList) {
@@ -368,13 +370,13 @@ public class MarkCronService {
                         .collect(Collectors.groupingBy(TrialLibrary::getMarkerId));
                 List<Marker> markerList = markerService.findByExamAndSubjectAndGroup(group.getExamId(),
                         group.getSubjectCode(), group.getNumber());
-                for (ExamStudent student : studentList) {
-                    if (studentService.validateStatus(student.getId())) {
-                        for (Marker marker : markerList) {
-                            List<TrialLibrary> markerLibraryList = map.get(marker.getId());
-                            if (markerLibraryList != null && markerLibraryList.size() >= studentList.size()) {
-                                continue;
-                            } else {
+                for (Marker marker : markerList) {
+                    List<TrialLibrary> markerLibraryList = map.get(marker.getId());
+                    if (markerLibraryList != null && markerLibraryList.size() >= studentList.size()) {
+                        continue;
+                    } else {
+                        for (ExamStudent student : studentList) {
+                            if (studentService.validateStatus(student.getId())) {
                                 TrialLibrary library = null;
                                 if (markerLibraryList != null) {
                                     library = markerLibraryList.stream().filter(e -> e.getMarkerId() == marker.getId()

+ 13 - 3
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkServiceImpl.java

@@ -379,7 +379,11 @@ public class MarkServiceImpl implements MarkService {
     @Override
     public boolean applyLibrary(TrialLibrary library, Marker marker) {
         TaskLock taskLock = TaskLockUtil.getTrialTask(getGroupKey(marker));
-        return taskLock.add(library.getStudentId(), 1, marker.getId());
+        if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
+            return taskLock.add(library.getStudentId(),marker.getId() , marker.getId());
+        }else {
+            return taskLock.add(library.getStudentId(), 1, marker.getId());
+        }
     }
 
     /**
@@ -409,7 +413,11 @@ public class MarkServiceImpl implements MarkService {
     @Override
     public boolean hasApplied(TrialLibrary library, Marker marker) {
         TaskLock taskLock = TaskLockUtil.getTrialTask(getGroupKey(marker));
-        return taskLock.exist(library.getStudentId(), 1, marker.getId());
+        if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
+            return library.getMarkerId().equals(marker.getId());
+        }else {
+            return taskLock.exist(library.getStudentId(), 1, marker.getId());
+        }
     }
 
     /**
@@ -572,6 +580,8 @@ public class MarkServiceImpl implements MarkService {
                         trackDao.deleteByLibraryId(library.getId());
                         specialTagDao.deleteByLibraryId(library.getId());
                         return SubmitResult.success(library);
+                    }else{
+                        return SubmitResult.faile();
                     }
                 }
                 if (result.getMarkerScore() <= group.getTotalScore()) {
@@ -606,9 +616,9 @@ public class MarkServiceImpl implements MarkService {
                 }
                 if (!TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
                     checkStudentTrial(library, group);
+                    inspectedService.cancelByStudent(library.getStudentId());
                 }
                 updateMarkedCount(group);
-                inspectedService.cancelByStudent(library.getStudentId());
                 return SubmitResult.success(library);
             }
         }