deason hace 9 meses
padre
commit
b3e2e0d0d6

+ 4 - 4
src/main/java/cn/com/qmth/scancentral/controller/admin/OmrArbitrateController.java

@@ -50,18 +50,18 @@ public class OmrArbitrateController extends BaseController {
 
     @ApiOperation(value = "识别对照仲裁任务释放")
     @RequestMapping(value = "/release", method = RequestMethod.POST)
-    public Object release(@RequestParam Long examId) {
+    public Object release(@RequestParam Long groupId) {
         User user = getAccessUser();
-        omrTaskService.releaseByUser(examId, user.getAccount());
+        omrTaskService.releaseByUser(groupId, user.getAccount());
         return success(true);
     }
 
     @ApiOperation(value = "识别对照仲裁任务历史")
     @RequestMapping(value = "/history", method = RequestMethod.POST)
-    public TaskVo history(@RequestParam Long examId, @RequestParam(required = false) Long id,
+    public TaskVo history(@RequestParam Long groupId, @RequestParam(required = false) Long id,
                           @RequestParam(required = false) Boolean next) {
         User user = getAccessUser();
-        return omrTaskService.getArbitrateHistory(examId, id, user.getAccount(), next);
+        return omrTaskService.getArbitrateHistory(groupId, id, user.getAccount(), next);
     }
 
 }

+ 5 - 5
src/main/java/cn/com/qmth/scancentral/service/OmrTaskService.java

@@ -33,7 +33,7 @@ public interface OmrTaskService extends IService<OmrTaskEntity> {
 
     List<OmrTaskEntity> buildTask(OmrGroupEntity group, Long studentId);
 
-    TaskVo getTask(Long examId, String account);
+    TaskVo getTask(Long groupId, String account);
 
     TaskSaveVo submitTask(TaskResultVo result, User user);
 
@@ -43,13 +43,13 @@ public interface OmrTaskService extends IService<OmrTaskEntity> {
 
     boolean apply(OmrTaskEntity t, String account);
 
-    void releaseByUser(Long examId, String account);
+    void releaseByUser(Long groupId, String account);
 
     void releaseByTask(OmrTaskEntity t);
 
     boolean hasApplied(OmrTaskEntity t, String account);
 
-    List<OmrTaskEntity> findUnMarked(Long examId, int pageNumber, int pageSize, TaskStatus status);
+    List<OmrTaskEntity> findUnMarked(Long groupId, int pageNumber, int pageSize, TaskStatus status);
 
     OmrTaskEntity getByPaperId(Long groupId, Long paperId);
 
@@ -59,9 +59,9 @@ public interface OmrTaskService extends IService<OmrTaskEntity> {
 
     void updateStudentId(Long studentId, Long paperId);
 
-    TaskVo history(Long examId, Long taskId, String account, Boolean next);
+    TaskVo history(Long groupId, Long taskId, String account, Boolean next);
 
-    TaskVo getArbitrateHistory(Long examId, Long taskId, String account, Boolean next);
+    TaskVo getArbitrateHistory(Long groupId, Long taskId, String account, Boolean next);
 
     OmrTaskOverview countByExamIdAndFixed(Long examId, Boolean fixed);
 

+ 15 - 15
src/main/java/cn/com/qmth/scancentral/service/impl/OmrTaskServiceImpl.java

@@ -463,8 +463,8 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
     }
 
     @Override
-    public TaskVo getTask(Long examId, String account) {
-        return findWaitingTask(examId, account, false);
+    public TaskVo getTask(Long groupId, String account) {
+        return findWaitingTask(groupId, account, false);
     }
 
     private TaskVo findWaitingTask(Long groupId, String account, boolean isArbitrate) {
@@ -771,7 +771,7 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
 
     @Override
     public boolean apply(OmrTaskEntity t, String account) {
-        TaskLock taskLock = TaskLockUtil.getOmrTask(t.getExamId().toString());
+        TaskLock taskLock = TaskLockUtil.getOmrTask(t.getGroupId().toString());
         boolean lock = taskLock.add(t.getId(), account);
         // 上锁失败直接返回
         if (!lock) {
@@ -787,26 +787,26 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
     }
 
     @Override
-    public void releaseByUser(Long examId, String account) {
-        TaskLock taskLock = TaskLockUtil.getOmrTask(examId.toString());
+    public void releaseByUser(Long groupId, String account) {
+        TaskLock taskLock = TaskLockUtil.getOmrTask(groupId.toString());
         taskLock.clear(account);
     }
 
     @Override
     public void releaseByTask(OmrTaskEntity t) {
-        TaskLock taskLock = TaskLockUtil.getOmrTask(t.getExamId().toString());
+        TaskLock taskLock = TaskLockUtil.getOmrTask(t.getGroupId().toString());
         taskLock.remove(t.getId());
     }
 
     @Override
     public boolean hasApplied(OmrTaskEntity t, String account) {
-        TaskLock taskLock = TaskLockUtil.getOmrTask(t.getExamId().toString());
+        TaskLock taskLock = TaskLockUtil.getOmrTask(t.getGroupId().toString());
         return taskLock.exist(t.getId(), account);
     }
 
     @Override
-    public List<OmrTaskEntity> findUnMarked(Long examId, int pageNumber, int pageSize, TaskStatus status) {
-        return this.baseMapper.findUnMarked(examId, pageNumber, pageSize, status);
+    public List<OmrTaskEntity> findUnMarked(Long groupId, int pageNumber, int pageSize, TaskStatus status) {
+        return this.baseMapper.findUnMarked(groupId, pageNumber, pageSize, status);
     }
 
     @Override
@@ -847,18 +847,18 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
     }
 
     @Override
-    public TaskVo history(Long examId, Long taskId, String account, Boolean next) {
-        return getHistory(examId, taskId, account, next, false);
+    public TaskVo history(Long groupId, Long taskId, String account, Boolean next) {
+        return getHistory(groupId, taskId, account, next, false);
     }
 
-    private TaskVo getHistory(Long examId, Long taskId, String account, Boolean next, boolean isArbitrate) {
+    private TaskVo getHistory(Long groupId, Long taskId, String account, Boolean next, boolean isArbitrate) {
         OmrTaskEntity cur = null;
         if (taskId != null) {
             cur = this.getById(taskId);
         }
         QueryWrapper<OmrTaskEntity> wrapper = new QueryWrapper<>();
         LambdaQueryWrapper<OmrTaskEntity> lw = wrapper.lambda();
-        lw.eq(OmrTaskEntity::getExamId, examId);
+        lw.eq(OmrTaskEntity::getGroupId, groupId);
         lw.eq(OmrTaskEntity::getDevice, account);
         if (isArbitrate) {
             lw.eq(OmrTaskEntity::getStatus, TaskStatus.ARBITRATED);
@@ -889,8 +889,8 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
     }
 
     @Override
-    public TaskVo getArbitrateHistory(Long examId, Long taskId, String account, Boolean next) {
-        return getHistory(examId, taskId, account, next, true);
+    public TaskVo getArbitrateHistory(Long groupId, Long taskId, String account, Boolean next) {
+        return getHistory(groupId, taskId, account, next, true);
     }
 
     @Override