|
@@ -34,12 +34,12 @@ import com.google.common.collect.Lists;
|
|
|
import cn.com.qmth.examcloud.common.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
|
import cn.com.qmth.examcloud.common.util.ErrorMsg;
|
|
|
-import cn.com.qmth.examcloud.service.examwork.dao.CourseGroupRepo;
|
|
|
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.entity.CourseGroup;
|
|
|
+import cn.com.qmth.examcloud.service.examwork.dao.SpecificExamRepo;
|
|
|
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.SpecificExam;
|
|
|
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.ExamStudentService;
|
|
@@ -65,7 +65,7 @@ public class ExamApi extends ControllerSupport {
|
|
|
ExamStudentService examStudentService;
|
|
|
|
|
|
@Autowired
|
|
|
- CourseGroupRepo courseGroupRepo;
|
|
|
+ SpecificExamRepo specificExamRepo;
|
|
|
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
@@ -221,19 +221,19 @@ public class ExamApi extends ControllerSupport {
|
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "查询课程组", notes = "查询课程组")
|
|
|
- @GetMapping("/exam/allCourseGroups/{examId}/{curPage}/{pageSize}")
|
|
|
- public ResponseEntity<?> queryAllCourseGroups(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
|
+ @ApiOperation(value = "查询特殊考试设置", notes = "查询特殊考试设置")
|
|
|
+ @GetMapping("/exam/querySpecificExamList/{examId}/{curPage}/{pageSize}")
|
|
|
+ public ResponseEntity<?> querySpecificExamList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
|
@PathVariable Integer pageSize) {
|
|
|
|
|
|
- List<CourseGroup> groupList = courseGroupRepo.findByExamId(examId, (curPage - 1) * pageSize, pageSize);
|
|
|
+ List<SpecificExam> groupList = specificExamRepo.findByExamId(examId, (curPage - 1) * pageSize, pageSize);
|
|
|
|
|
|
- for (CourseGroup courseGroup : groupList) {
|
|
|
+ for (SpecificExam specificExam : groupList) {
|
|
|
List<Long> courseIdList = Lists.newArrayList();
|
|
|
- courseGroup.setCourseIdList(courseIdList);
|
|
|
+ specificExam.setCourseIdList(courseIdList);
|
|
|
|
|
|
List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
|
|
|
- "select t.course_id from ecs_exam_course_group_course t where t.group_id=?", courseGroup.getId());
|
|
|
+ "select t.course_id from ecs_exam_specific_exam_course t where t.specific_exam_id=?", specificExam.getId());
|
|
|
if (CollectionUtils.isNotEmpty(queryList)) {
|
|
|
for (Map<String, Object> map : queryList) {
|
|
|
Long courseId = Long.valueOf(map.get("COURSE_ID").toString());
|
|
@@ -242,20 +242,20 @@ public class ExamApi extends ControllerSupport {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return new ResponseEntity<List<CourseGroup>>(groupList, HttpStatus.OK);
|
|
|
+ return new ResponseEntity<List<SpecificExam>>(groupList, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "查询课程组", notes = "查询课程组")
|
|
|
- @GetMapping("/exam/queryCourseGroupsByCourseId/{courseId}")
|
|
|
- public ResponseEntity<?> queryCourseGroupsByCourseId(@PathVariable Long courseId) {
|
|
|
- List<CourseGroup> groupList = courseGroupRepo.queryCourseGroupsByCourseId(courseId);
|
|
|
+ @ApiOperation(value = "通过课程ID查询特殊考试设置", notes = "通过课程ID查询特殊考试设置")
|
|
|
+ @GetMapping("/exam/querySpecificExamByCourseId/{courseId}")
|
|
|
+ public ResponseEntity<?> querySpecificExamByCourseId(@PathVariable Long courseId) {
|
|
|
+ List<SpecificExam> groupList = specificExamRepo.queryCourseGroupsByCourseId(courseId);
|
|
|
|
|
|
- for (CourseGroup courseGroup : groupList) {
|
|
|
+ for (SpecificExam specificExam : groupList) {
|
|
|
List<Long> courseIdList = Lists.newArrayList();
|
|
|
- courseGroup.setCourseIdList(courseIdList);
|
|
|
+ specificExam.setCourseIdList(courseIdList);
|
|
|
|
|
|
List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
|
|
|
- "select t.course_id from ecs_exam_course_group_course t where t.group_id=?", courseGroup.getId());
|
|
|
+ "select t.course_id from ecs_exam_specific_exam_course t where t.specific_exam_id=?", specificExam.getId());
|
|
|
if (CollectionUtils.isNotEmpty(queryList)) {
|
|
|
for (Map<String, Object> map : queryList) {
|
|
|
Long curCourseId = Long.valueOf(map.get("COURSE_ID").toString());
|
|
@@ -267,23 +267,23 @@ public class ExamApi extends ControllerSupport {
|
|
|
return new ResponseEntity<Object>(groupList, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "更新课程组", notes = "更新课程组")
|
|
|
- @PutMapping("/exam/courseGroup")
|
|
|
- public ResponseEntity<?> updateCourseGroup(@RequestBody CourseGroup courseGroup, HttpServletRequest request) {
|
|
|
+ @ApiOperation(value = "更新特殊考试设置", notes = "更新特殊考试设置")
|
|
|
+ @PutMapping("/exam/specificExam")
|
|
|
+ public ResponseEntity<?> updateSpecificExam(@RequestBody SpecificExam specificExam, HttpServletRequest request) {
|
|
|
|
|
|
- courseGroupRepo.save(courseGroup);
|
|
|
- Long groupId = courseGroup.getId();
|
|
|
- Long examId = courseGroup.getExamId();
|
|
|
+ specificExamRepo.save(specificExam);
|
|
|
+ Long specificExamId = specificExam.getId();
|
|
|
+ Long examId = specificExam.getExamId();
|
|
|
|
|
|
- List<Long> courseIdList = courseGroup.getCourseIdList();
|
|
|
- jdbcTemplate.update("delete from ecs_exam_course_group_course where group_id=?", groupId);
|
|
|
+ List<Long> courseIdList = specificExam.getCourseIdList();
|
|
|
+ jdbcTemplate.update("delete from ecs_exam_specific_exam_course where specific_exam_id=?", specificExamId);
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(courseIdList)) {
|
|
|
for (Long courseId : courseIdList) {
|
|
|
- jdbcTemplate.update("delete from ecs_exam_course_group_course where exam_id=? and course_id=?",
|
|
|
- groupId, courseId);
|
|
|
+ jdbcTemplate.update("delete from ecs_exam_specific_exam_course where exam_id=? and course_id=?",
|
|
|
+ specificExamId, courseId);
|
|
|
jdbcTemplate.update(
|
|
|
- "insert into ecs_exam_course_group_course(group_id,course_id,exam_id) values(?,?,?)", groupId,
|
|
|
+ "insert into ecs_exam_specific_exam_course(specific_exam_id,course_id,exam_id) values(?,?,?)", specificExamId,
|
|
|
courseId, examId);
|
|
|
}
|
|
|
}
|
|
@@ -291,10 +291,10 @@ public class ExamApi extends ControllerSupport {
|
|
|
return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "删除课程组", notes = "添加课程组")
|
|
|
- @DeleteMapping("/exam/courseGroup/{id}")
|
|
|
- public ResponseEntity<?> CourseGroup(@PathVariable Long id, HttpServletRequest request) {
|
|
|
- courseGroupRepo.delete(id);
|
|
|
+ @ApiOperation(value = "删除特殊考试设置", notes = "删除特殊考试设置")
|
|
|
+ @DeleteMapping("/exam/specificExam/{id}")
|
|
|
+ public ResponseEntity<?> deleteSpecificExam(@PathVariable Long id, HttpServletRequest request) {
|
|
|
+ specificExamRepo.delete(id);
|
|
|
jdbcTemplate.update("delete from ecs_exam_course_group_course where group_id=?", id);
|
|
|
return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|