|
@@ -31,6 +31,7 @@ import cn.com.qmth.stmms.admin.thread.MarkGroupDeleteThread;
|
|
import cn.com.qmth.stmms.admin.thread.ScoreCalculateThread;
|
|
import cn.com.qmth.stmms.admin.thread.ScoreCalculateThread;
|
|
import cn.com.qmth.stmms.api.dto.GroupDTO;
|
|
import cn.com.qmth.stmms.api.dto.GroupDTO;
|
|
import cn.com.qmth.stmms.api.dto.GroupQuestionDTO;
|
|
import cn.com.qmth.stmms.api.dto.GroupQuestionDTO;
|
|
|
|
+import cn.com.qmth.stmms.api.dto.MarkerClassDTO;
|
|
import cn.com.qmth.stmms.api.dto.PaperDTO;
|
|
import cn.com.qmth.stmms.api.dto.PaperDTO;
|
|
import cn.com.qmth.stmms.api.dto.PaperStructureDTO;
|
|
import cn.com.qmth.stmms.api.dto.PaperStructureDTO;
|
|
import cn.com.qmth.stmms.api.dto.QuestionDTO;
|
|
import cn.com.qmth.stmms.api.dto.QuestionDTO;
|
|
@@ -1003,13 +1004,12 @@ public class CoreController extends BaseApiController {
|
|
@RequestMapping(value = "/user/class/save", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/user/class/save", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@RoleRequire({ Role.SCHOOL_ADMIN, Role.SCHOOL_DEV, Role.SUBJECT_HEADER, Role.COLLEGE_ADMIN })
|
|
@RoleRequire({ Role.SCHOOL_ADMIN, Role.SCHOOL_DEV, Role.SUBJECT_HEADER, Role.COLLEGE_ADMIN })
|
|
- public JSONObject userClassSave(HttpServletRequest request, @RequestParam Integer examId,
|
|
|
|
- @RequestParam List<String> className, @RequestParam String account) {
|
|
|
|
|
|
+ public JSONObject userClassSave(HttpServletRequest request, @RequestBody MarkerClassDTO markerClass) {
|
|
ApiUser user = RequestUtils.getApiUser(request);
|
|
ApiUser user = RequestUtils.getApiUser(request);
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
// 输入字段预处理并初步校验
|
|
// 输入字段预处理并初步校验
|
|
- account = validate("account", account, true, 32);
|
|
|
|
- Exam exam = examService.findById(examId);
|
|
|
|
|
|
+ String account = validate("account", markerClass.getAccount(), true, 32);
|
|
|
|
+ Exam exam = examService.findById(markerClass.getExamId());
|
|
if (exam == null || !validateSchool(user.getSchoolId(), exam.getSchoolId())
|
|
if (exam == null || !validateSchool(user.getSchoolId(), exam.getSchoolId())
|
|
|| exam.getStatus() != ExamStatus.START) {
|
|
|| exam.getStatus() != ExamStatus.START) {
|
|
throw ApiException.EXAM_NOT_ACCESSIBLED;
|
|
throw ApiException.EXAM_NOT_ACCESSIBLED;
|
|
@@ -1018,7 +1018,8 @@ public class CoreController extends BaseApiController {
|
|
if (u == null || !Role.MARKER.equals(u.getRole())) {
|
|
if (u == null || !Role.MARKER.equals(u.getRole())) {
|
|
throw ApiException.QUERY_PARAM_ERROR.appendMessage(": account error");
|
|
throw ApiException.QUERY_PARAM_ERROR.appendMessage(": account error");
|
|
}
|
|
}
|
|
- markerClassService.save(u.getId(), examId, className.stream().toArray(String[]::new));
|
|
|
|
|
|
+ markerClassService.save(u.getId(), markerClass.getExamId(),
|
|
|
|
+ markerClass.getClassName().stream().toArray(String[]::new));
|
|
result.accumulate("updateTime", DateUtils.formatDateTime(new Date()));
|
|
result.accumulate("updateTime", DateUtils.formatDateTime(new Date()));
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|