|
@@ -1,7 +1,6 @@
|
|
package cn.com.qmth.examcloud.service.examwork.api;
|
|
package cn.com.qmth.examcloud.service.examwork.api;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
-import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -13,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Sort;
|
|
import org.springframework.data.domain.Sort;
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
@@ -36,11 +36,13 @@ import cn.com.qmth.examcloud.common.support.exception.StatusException;
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.common.util.ErrorMsg;
|
|
import cn.com.qmth.examcloud.common.util.ErrorMsg;
|
|
import cn.com.qmth.examcloud.service.examwork.dao.ExamRepo;
|
|
import cn.com.qmth.examcloud.service.examwork.dao.ExamRepo;
|
|
-import cn.com.qmth.examcloud.service.examwork.dao.ExamStudentRepo;
|
|
|
|
import cn.com.qmth.examcloud.service.examwork.dao.ExamSetting4CourseRepo;
|
|
import cn.com.qmth.examcloud.service.examwork.dao.ExamSetting4CourseRepo;
|
|
|
|
+import cn.com.qmth.examcloud.service.examwork.dao.ExamSetting4OrgRepo;
|
|
|
|
+import cn.com.qmth.examcloud.service.examwork.dao.ExamStudentRepo;
|
|
import cn.com.qmth.examcloud.service.examwork.entity.Exam;
|
|
import cn.com.qmth.examcloud.service.examwork.entity.Exam;
|
|
-import cn.com.qmth.examcloud.service.examwork.entity.ExamStudent;
|
|
|
|
import cn.com.qmth.examcloud.service.examwork.entity.ExamSetting4Course;
|
|
import cn.com.qmth.examcloud.service.examwork.entity.ExamSetting4Course;
|
|
|
|
+import cn.com.qmth.examcloud.service.examwork.entity.ExamSetting4Org;
|
|
|
|
+import cn.com.qmth.examcloud.service.examwork.entity.ExamStudent;
|
|
import cn.com.qmth.examcloud.service.examwork.enums.ExamType;
|
|
import cn.com.qmth.examcloud.service.examwork.enums.ExamType;
|
|
import cn.com.qmth.examcloud.service.examwork.service.ExamService;
|
|
import cn.com.qmth.examcloud.service.examwork.service.ExamService;
|
|
import cn.com.qmth.examcloud.service.examwork.service.ExamStudentService;
|
|
import cn.com.qmth.examcloud.service.examwork.service.ExamStudentService;
|
|
@@ -68,6 +70,9 @@ public class ExamApi extends ControllerSupport {
|
|
@Autowired
|
|
@Autowired
|
|
ExamSetting4CourseRepo examSetting4CourseRepo;
|
|
ExamSetting4CourseRepo examSetting4CourseRepo;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ ExamSetting4OrgRepo examSetting4OrgRepo;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private JdbcTemplate jdbcTemplate;
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@@ -81,13 +86,16 @@ public class ExamApi extends ControllerSupport {
|
|
} else {
|
|
} else {
|
|
return new ResponseEntity(HttpStatus.NOT_FOUND);
|
|
return new ResponseEntity(HttpStatus.NOT_FOUND);
|
|
}
|
|
}
|
|
- return new ResponseEntity(examService.getAllExam(examCriteria,
|
|
|
|
- new PageRequest(curPage, pageSize, new Sort(Direction.DESC, "id"))), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity(
|
|
|
|
+ examService.getAllExam(examCriteria,
|
|
|
|
+ new PageRequest(curPage, pageSize, new Sort(Direction.DESC, "id"))),
|
|
|
|
+ HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询所有考试批次(包含有效)", notes = "不分页带查询")
|
|
@ApiOperation(value = "查询所有考试批次(包含有效)", notes = "不分页带查询")
|
|
@GetMapping("/exam/all")
|
|
@GetMapping("/exam/all")
|
|
- public ResponseEntity getEnableExam(HttpServletRequest request, @ModelAttribute Exam examCriteria) {
|
|
|
|
|
|
+ public ResponseEntity getEnableExam(HttpServletRequest request,
|
|
|
|
+ @ModelAttribute Exam examCriteria) {
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
if (accessUser != null) {
|
|
if (accessUser != null) {
|
|
examCriteria.setOrgId(accessUser.getRootOrgId());
|
|
examCriteria.setOrgId(accessUser.getRootOrgId());
|
|
@@ -98,7 +106,8 @@ public class ExamApi extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "根据机构ID和考试类型查询所有有效考试批次", notes = "根据机构ID和考试类型查询所有有效考试批次")
|
|
@ApiOperation(value = "根据机构ID和考试类型查询所有有效考试批次", notes = "根据机构ID和考试类型查询所有有效考试批次")
|
|
@GetMapping("/exam/rootOrgId/{orgId}/{examType}")
|
|
@GetMapping("/exam/rootOrgId/{orgId}/{examType}")
|
|
- public ResponseEntity getEnableExamByRootOrgId(@PathVariable Long orgId, @PathVariable String examType) {
|
|
|
|
|
|
+ public ResponseEntity getEnableExamByRootOrgId(@PathVariable Long orgId,
|
|
|
|
+ @PathVariable String examType) {
|
|
if (orgId == null) {
|
|
if (orgId == null) {
|
|
return new ResponseEntity(new ErrorMsg("机构ID不能为空"), HttpStatus.OK);
|
|
return new ResponseEntity(new ErrorMsg("机构ID不能为空"), HttpStatus.OK);
|
|
}
|
|
}
|
|
@@ -113,23 +122,26 @@ public class ExamApi extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "查询所有考试批次(包含有效无效)", notes = "不分页带查询")
|
|
@ApiOperation(value = "查询所有考试批次(包含有效无效)", notes = "不分页带查询")
|
|
@GetMapping("/exam/all/both")
|
|
@GetMapping("/exam/all/both")
|
|
- public ResponseEntity getAllExam(HttpServletRequest request, @ModelAttribute Exam examCriteria) {
|
|
|
|
|
|
+ public ResponseEntity getAllExam(HttpServletRequest request,
|
|
|
|
+ @ModelAttribute Exam examCriteria) {
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
if (accessUser != null) {
|
|
if (accessUser != null) {
|
|
examCriteria.setOrgId(accessUser.getRootOrgId());
|
|
examCriteria.setOrgId(accessUser.getRootOrgId());
|
|
}
|
|
}
|
|
return new ResponseEntity(examService.getAllExam(examCriteria), HttpStatus.OK);
|
|
return new ResponseEntity(examService.getAllExam(examCriteria), HttpStatus.OK);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@ApiOperation(value = "根据名称查询考试批次(包含有效)", notes = "不分页带查询")
|
|
@ApiOperation(value = "根据名称查询考试批次(包含有效)", notes = "不分页带查询")
|
|
@GetMapping("/exam/name")
|
|
@GetMapping("/exam/name")
|
|
- public ResponseEntity getEnableExamByName(HttpServletRequest request, @ModelAttribute Exam examCriteria) {
|
|
|
|
|
|
+ public ResponseEntity getEnableExamByName(HttpServletRequest request,
|
|
|
|
+ @ModelAttribute Exam examCriteria) {
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
if (accessUser != null) {
|
|
if (accessUser != null) {
|
|
examCriteria.setRootOrgId(accessUser.getRootOrgId());
|
|
examCriteria.setRootOrgId(accessUser.getRootOrgId());
|
|
}
|
|
}
|
|
examCriteria.setEnable(true);
|
|
examCriteria.setEnable(true);
|
|
- return new ResponseEntity(examService.findByNameAndRootOrgId(examCriteria.getName(),examCriteria.getRootOrgId()), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity(examService.findByNameAndRootOrgId(examCriteria.getName(),
|
|
|
|
+ examCriteria.getRootOrgId()), HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
|
|
@ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
|
|
@@ -141,7 +153,7 @@ public class ExamApi extends ControllerSupport {
|
|
@ApiOperation(value = "新增考试批次", notes = "新增")
|
|
@ApiOperation(value = "新增考试批次", notes = "新增")
|
|
@PostMapping("/exam")
|
|
@PostMapping("/exam")
|
|
public Exam addExam(HttpServletRequest request, @RequestBody Exam exam) {
|
|
public Exam addExam(HttpServletRequest request, @RequestBody Exam exam) {
|
|
-
|
|
|
|
|
|
+
|
|
if (null != exam.getBeforeExamRemark() && exam.getBeforeExamRemark().length() > 250000) {
|
|
if (null != exam.getBeforeExamRemark() && exam.getBeforeExamRemark().length() > 250000) {
|
|
throw new StatusException("EXAMWORK-001002", "考前说明内容过大");
|
|
throw new StatusException("EXAMWORK-001002", "考前说明内容过大");
|
|
}
|
|
}
|
|
@@ -151,7 +163,7 @@ public class ExamApi extends ControllerSupport {
|
|
if (null != exam.getCheatingRemark() && exam.getCheatingRemark().length() > 250000) {
|
|
if (null != exam.getCheatingRemark() && exam.getCheatingRemark().length() > 250000) {
|
|
throw new StatusException("EXAMWORK-001002", "作弊说明内容过大");
|
|
throw new StatusException("EXAMWORK-001002", "作弊说明内容过大");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
if (accessUser != null) {
|
|
if (accessUser != null) {
|
|
exam.setOrgId(accessUser.getOrgId());
|
|
exam.setOrgId(accessUser.getOrgId());
|
|
@@ -174,7 +186,7 @@ public class ExamApi extends ControllerSupport {
|
|
if (!examService.checkExamName(exam)) {
|
|
if (!examService.checkExamName(exam)) {
|
|
throw new StatusException("EXAMWORK-001001", "考试名称已存在,请重新填写");
|
|
throw new StatusException("EXAMWORK-001001", "考试名称已存在,请重新填写");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (null != exam.getBeforeExamRemark() && exam.getBeforeExamRemark().length() > 250000) {
|
|
if (null != exam.getBeforeExamRemark() && exam.getBeforeExamRemark().length() > 250000) {
|
|
throw new StatusException("EXAMWORK-001002", "考前说明内容过大");
|
|
throw new StatusException("EXAMWORK-001002", "考前说明内容过大");
|
|
}
|
|
}
|
|
@@ -184,7 +196,7 @@ public class ExamApi extends ControllerSupport {
|
|
if (null != exam.getCheatingRemark() && exam.getCheatingRemark().length() > 250000) {
|
|
if (null != exam.getCheatingRemark() && exam.getCheatingRemark().length() > 250000) {
|
|
throw new StatusException("EXAMWORK-001002", "作弊说明内容过大");
|
|
throw new StatusException("EXAMWORK-001002", "作弊说明内容过大");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
Exam ret = examService.saveExam(exam);
|
|
Exam ret = examService.saveExam(exam);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
@@ -199,14 +211,16 @@ public class ExamApi extends ControllerSupport {
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("删除失败:", e);
|
|
log.error("删除失败:", e);
|
|
- return new ResponseEntity(new ErrorMsg(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
|
|
+ return new ResponseEntity(new ErrorMsg(e.getMessage()),
|
|
|
|
+ HttpStatus.INTERNAL_SERVER_ERROR);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "启用考试", notes = "启用考试")
|
|
@ApiOperation(value = "启用考试", notes = "启用考试")
|
|
@PutMapping("/exam/enable/{ids}")
|
|
@PutMapping("/exam/enable/{ids}")
|
|
public ResponseEntity enableUser(@PathVariable String ids) {
|
|
public ResponseEntity enableUser(@PathVariable String ids) {
|
|
- List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
for (Long examId : examIds) {
|
|
for (Long examId : examIds) {
|
|
Exam exam = examRepo.findOne(examId);
|
|
Exam exam = examRepo.findOne(examId);
|
|
exam.setEnable(true);
|
|
exam.setEnable(true);
|
|
@@ -218,7 +232,8 @@ public class ExamApi extends ControllerSupport {
|
|
@ApiOperation(value = "禁用考试", notes = "禁用考试")
|
|
@ApiOperation(value = "禁用考试", notes = "禁用考试")
|
|
@PutMapping("/exam/disable/{ids}")
|
|
@PutMapping("/exam/disable/{ids}")
|
|
public ResponseEntity disableUser(@PathVariable String ids) {
|
|
public ResponseEntity disableUser(@PathVariable String ids) {
|
|
- List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
for (Long examId : examIds) {
|
|
for (Long examId : examIds) {
|
|
Exam exam = examRepo.findOne(examId);
|
|
Exam exam = examRepo.findOne(examId);
|
|
exam.setEnable(false);
|
|
exam.setEnable(false);
|
|
@@ -244,7 +259,8 @@ public class ExamApi extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "网考更新考务信息", notes = "网考更新考务信息")
|
|
@ApiOperation(value = "网考更新考务信息", notes = "网考更新考务信息")
|
|
@PutMapping("/exam/updateExamStudent")
|
|
@PutMapping("/exam/updateExamStudent")
|
|
- public ResponseEntity updateExamStudent(@RequestParam Long examId, @RequestParam Long examStuId) {
|
|
|
|
|
|
+ public ResponseEntity updateExamStudent(@RequestParam Long examId,
|
|
|
|
+ @RequestParam Long examStuId) {
|
|
examRepo.canNotDel(examId);
|
|
examRepo.canNotDel(examId);
|
|
ExamStudent examStudent = examStudentRepo.findOne(examStuId);
|
|
ExamStudent examStudent = examStudentRepo.findOne(examStuId);
|
|
examStudent.setFinished(true);
|
|
examStudent.setFinished(true);
|
|
@@ -254,17 +270,19 @@ public class ExamApi extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "查询特殊考试设置", notes = "查询特殊考试设置")
|
|
@ApiOperation(value = "查询特殊考试设置", notes = "查询特殊考试设置")
|
|
@GetMapping("/exam/querySpecificExamList/{examId}/{curPage}/{pageSize}")
|
|
@GetMapping("/exam/querySpecificExamList/{examId}/{curPage}/{pageSize}")
|
|
- public ResponseEntity<?> querySpecificExamList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
|
|
- @PathVariable Integer pageSize) {
|
|
|
|
|
|
+ public ResponseEntity<?> querySpecificExamList(@PathVariable Long examId,
|
|
|
|
+ @PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
|
|
|
|
- List<ExamSetting4Course> groupList = examSetting4CourseRepo.findByExamId(examId, (curPage - 1) * pageSize, pageSize);
|
|
|
|
|
|
+ List<ExamSetting4Course> groupList = examSetting4CourseRepo.findByExamId(examId,
|
|
|
|
+ (curPage - 1) * pageSize, pageSize);
|
|
|
|
|
|
for (ExamSetting4Course specificExam : groupList) {
|
|
for (ExamSetting4Course specificExam : groupList) {
|
|
List<Long> courseIdList = Lists.newArrayList();
|
|
List<Long> courseIdList = Lists.newArrayList();
|
|
specificExam.setCourseIdList(courseIdList);
|
|
specificExam.setCourseIdList(courseIdList);
|
|
|
|
|
|
List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
|
|
List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
|
|
- "select t.course_id from ecs_e_exam_course_relation t where t.specific_exam_id=?", specificExam.getId());
|
|
|
|
|
|
+ "select t.course_id from ecs_e_exam_course_relation t where t.specific_exam_id=?",
|
|
|
|
+ specificExam.getId());
|
|
if (CollectionUtils.isNotEmpty(queryList)) {
|
|
if (CollectionUtils.isNotEmpty(queryList)) {
|
|
for (Map<String, Object> map : queryList) {
|
|
for (Map<String, Object> map : queryList) {
|
|
Long courseId = Long.valueOf(map.get("COURSE_ID").toString());
|
|
Long courseId = Long.valueOf(map.get("COURSE_ID").toString());
|
|
@@ -279,14 +297,16 @@ public class ExamApi extends ControllerSupport {
|
|
@ApiOperation(value = "通过课程ID查询特殊考试设置", notes = "通过课程ID查询特殊考试设置")
|
|
@ApiOperation(value = "通过课程ID查询特殊考试设置", notes = "通过课程ID查询特殊考试设置")
|
|
@GetMapping("/exam/querySpecificExamByCourseId/{courseId}")
|
|
@GetMapping("/exam/querySpecificExamByCourseId/{courseId}")
|
|
public ResponseEntity<?> querySpecificExamByCourseId(@PathVariable Long courseId) {
|
|
public ResponseEntity<?> querySpecificExamByCourseId(@PathVariable Long courseId) {
|
|
- List<ExamSetting4Course> groupList = examSetting4CourseRepo.queryCourseGroupsByCourseId(courseId);
|
|
|
|
|
|
+ List<ExamSetting4Course> groupList = examSetting4CourseRepo
|
|
|
|
+ .queryCourseGroupsByCourseId(courseId);
|
|
|
|
|
|
for (ExamSetting4Course specificExam : groupList) {
|
|
for (ExamSetting4Course specificExam : groupList) {
|
|
List<Long> courseIdList = Lists.newArrayList();
|
|
List<Long> courseIdList = Lists.newArrayList();
|
|
specificExam.setCourseIdList(courseIdList);
|
|
specificExam.setCourseIdList(courseIdList);
|
|
|
|
|
|
List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
|
|
List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
|
|
- "select t.course_id from ecs_e_exam_course_relation t where t.specific_exam_id=?", specificExam.getId());
|
|
|
|
|
|
+ "select t.course_id from ecs_e_exam_course_relation t where t.specific_exam_id=?",
|
|
|
|
+ specificExam.getId());
|
|
if (CollectionUtils.isNotEmpty(queryList)) {
|
|
if (CollectionUtils.isNotEmpty(queryList)) {
|
|
for (Map<String, Object> map : queryList) {
|
|
for (Map<String, Object> map : queryList) {
|
|
Long curCourseId = Long.valueOf(map.get("COURSE_ID").toString());
|
|
Long curCourseId = Long.valueOf(map.get("COURSE_ID").toString());
|
|
@@ -300,22 +320,25 @@ public class ExamApi extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "更新特殊考试设置", notes = "更新特殊考试设置")
|
|
@ApiOperation(value = "更新特殊考试设置", notes = "更新特殊考试设置")
|
|
@PutMapping("/exam/specificExam")
|
|
@PutMapping("/exam/specificExam")
|
|
- public ResponseEntity<?> updateSpecificExam(@RequestBody ExamSetting4Course specificExam, HttpServletRequest request) {
|
|
|
|
|
|
+ public ResponseEntity<?> updateSpecificExam(@RequestBody ExamSetting4Course specificExam,
|
|
|
|
+ HttpServletRequest request) {
|
|
|
|
|
|
examSetting4CourseRepo.save(specificExam);
|
|
examSetting4CourseRepo.save(specificExam);
|
|
Long specificExamId = specificExam.getId();
|
|
Long specificExamId = specificExam.getId();
|
|
Long examId = specificExam.getExamId();
|
|
Long examId = specificExam.getExamId();
|
|
|
|
|
|
List<Long> courseIdList = specificExam.getCourseIdList();
|
|
List<Long> courseIdList = specificExam.getCourseIdList();
|
|
- jdbcTemplate.update("delete from ecs_e_exam_course_relation where specific_exam_id=?", specificExamId);
|
|
|
|
|
|
+ jdbcTemplate.update("delete from ecs_e_exam_course_relation where specific_exam_id=?",
|
|
|
|
+ specificExamId);
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(courseIdList)) {
|
|
if (CollectionUtils.isNotEmpty(courseIdList)) {
|
|
for (Long courseId : courseIdList) {
|
|
for (Long courseId : courseIdList) {
|
|
- jdbcTemplate.update("delete from ecs_e_exam_course_relation where exam_id=? and course_id=?",
|
|
|
|
|
|
+ jdbcTemplate.update(
|
|
|
|
+ "delete from ecs_e_exam_course_relation where exam_id=? and course_id=?",
|
|
specificExamId, courseId);
|
|
specificExamId, courseId);
|
|
jdbcTemplate.update(
|
|
jdbcTemplate.update(
|
|
- "insert into ecs_e_exam_course_relation(specific_exam_id,course_id,exam_id) values(?,?,?)", specificExamId,
|
|
|
|
- courseId, examId);
|
|
|
|
|
|
+ "insert into ecs_e_exam_course_relation(specific_exam_id,course_id,exam_id) values(?,?,?)",
|
|
|
|
+ specificExamId, courseId, examId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -329,4 +352,20 @@ public class ExamApi extends ControllerSupport {
|
|
jdbcTemplate.update("delete from ecs_e_exam_course_relation where group_id=?", id);
|
|
jdbcTemplate.update("delete from ecs_e_exam_course_relation where group_id=?", id);
|
|
return new ResponseEntity<Object>(HttpStatus.OK);
|
|
return new ResponseEntity<Object>(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询考试相关的学习中心设置", notes = "查询考试相关的学习中心设置")
|
|
|
|
+ @GetMapping("/exam/examSetting4OrgList/{examId}/{curPage}/{pageSize}")
|
|
|
|
+ public List<?> getExamSetting4OrgList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
|
|
+ @PathVariable Integer pageSize) {
|
|
|
|
+ Pageable pageable = new PageRequest(curPage, pageSize, Sort.Direction.DESC, "updateTime");
|
|
|
|
+ List<ExamSetting4Org> allByExamId = examSetting4OrgRepo.findAllByExamId(examId, pageable);
|
|
|
|
+ return allByExamId;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "新增考试相关的学习中心设置", notes = "新增考试相关的学习中心设置")
|
|
|
|
+ @PostMapping("/exam/examSetting4Org")
|
|
|
|
+ public ExamSetting4Org addExamSetting4Org(@RequestBody ExamSetting4Org examSetting4Org) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|