|
@@ -1,5 +1,7 @@
|
|
package cn.com.qmth.examcloud.task.api.controller;
|
|
package cn.com.qmth.examcloud.task.api.controller;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
import javax.transaction.Transactional;
|
|
import javax.transaction.Transactional;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -9,12 +11,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+
|
|
import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.LockExamStudentsReq;
|
|
import cn.com.qmth.examcloud.task.dao.CopyExamStudentRepo;
|
|
import cn.com.qmth.examcloud.task.dao.CopyExamStudentRepo;
|
|
import cn.com.qmth.examcloud.task.dao.entity.CopyExamStudentEntity;
|
|
import cn.com.qmth.examcloud.task.dao.entity.CopyExamStudentEntity;
|
|
import cn.com.qmth.examcloud.task.dao.entity.CopyExamStudentPK;
|
|
import cn.com.qmth.examcloud.task.dao.entity.CopyExamStudentPK;
|
|
@@ -76,6 +81,15 @@ public class CopyExamStudentController extends ControllerSupport {
|
|
one.setStart(1L);
|
|
one.setStart(1L);
|
|
one.setStatus(CopyExamStudentStatus.NONE);
|
|
one.setStatus(CopyExamStudentStatus.NONE);
|
|
|
|
|
|
|
|
+ // 锁定
|
|
|
|
+ List<Long> examIdList = Lists.newArrayList();
|
|
|
|
+ examIdList.add(one.getExamId1());
|
|
|
|
+ examIdList.add(one.getExamId2());
|
|
|
|
+
|
|
|
|
+ LockExamStudentsReq lockReq = new LockExamStudentsReq();
|
|
|
|
+ lockReq.setExamIdList(examIdList);
|
|
|
|
+ examCloudService.lockExamStudents(lockReq);
|
|
|
|
+
|
|
copyExamStudentRepo.save(one);
|
|
copyExamStudentRepo.save(one);
|
|
}
|
|
}
|
|
|
|
|