|
@@ -37,10 +37,10 @@ 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.ExamStudentRepo;
|
|
-import cn.com.qmth.examcloud.service.examwork.dao.SpecificExamRepo;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.service.examwork.dao.ExamSetting4CourseRepo;
|
|
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.ExamStudent;
|
|
-import cn.com.qmth.examcloud.service.examwork.entity.SpecificExam;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.service.examwork.entity.ExamSetting4Course;
|
|
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;
|
|
@@ -66,7 +66,7 @@ public class ExamApi extends ControllerSupport {
|
|
ExamStudentService examStudentService;
|
|
ExamStudentService examStudentService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- SpecificExamRepo specificExamRepo;
|
|
|
|
|
|
+ ExamSetting4CourseRepo examSetting4CourseRepo;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private JdbcTemplate jdbcTemplate;
|
|
private JdbcTemplate jdbcTemplate;
|
|
@@ -257,14 +257,14 @@ public class ExamApi extends ControllerSupport {
|
|
public ResponseEntity<?> querySpecificExamList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
public ResponseEntity<?> querySpecificExamList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
@PathVariable Integer pageSize) {
|
|
@PathVariable Integer pageSize) {
|
|
|
|
|
|
- List<SpecificExam> groupList = specificExamRepo.findByExamId(examId, (curPage - 1) * pageSize, pageSize);
|
|
|
|
|
|
+ List<ExamSetting4Course> groupList = examSetting4CourseRepo.findByExamId(examId, (curPage - 1) * pageSize, pageSize);
|
|
|
|
|
|
- for (SpecificExam 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_exam_specific_exam_course 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());
|
|
@@ -273,20 +273,20 @@ public class ExamApi extends ControllerSupport {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- return new ResponseEntity<List<SpecificExam>>(groupList, HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<List<ExamSetting4Course>>(groupList, HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@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<SpecificExam> groupList = specificExamRepo.queryCourseGroupsByCourseId(courseId);
|
|
|
|
|
|
+ List<ExamSetting4Course> groupList = examSetting4CourseRepo.queryCourseGroupsByCourseId(courseId);
|
|
|
|
|
|
- for (SpecificExam 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_exam_specific_exam_course 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,21 +300,21 @@ public class ExamApi extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "更新特殊考试设置", notes = "更新特殊考试设置")
|
|
@ApiOperation(value = "更新特殊考试设置", notes = "更新特殊考试设置")
|
|
@PutMapping("/exam/specificExam")
|
|
@PutMapping("/exam/specificExam")
|
|
- public ResponseEntity<?> updateSpecificExam(@RequestBody SpecificExam specificExam, HttpServletRequest request) {
|
|
|
|
|
|
+ public ResponseEntity<?> updateSpecificExam(@RequestBody ExamSetting4Course specificExam, HttpServletRequest request) {
|
|
|
|
|
|
- specificExamRepo.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_exam_specific_exam_course 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_exam_specific_exam_course 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_exam_specific_exam_course(specific_exam_id,course_id,exam_id) values(?,?,?)", specificExamId,
|
|
|
|
|
|
+ "insert into ecs_e_exam_course_relation(specific_exam_id,course_id,exam_id) values(?,?,?)", specificExamId,
|
|
courseId, examId);
|
|
courseId, examId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -325,8 +325,8 @@ public class ExamApi extends ControllerSupport {
|
|
@ApiOperation(value = "删除特殊考试设置", notes = "删除特殊考试设置")
|
|
@ApiOperation(value = "删除特殊考试设置", notes = "删除特殊考试设置")
|
|
@DeleteMapping("/exam/specificExam/{id}")
|
|
@DeleteMapping("/exam/specificExam/{id}")
|
|
public ResponseEntity<?> deleteSpecificExam(@PathVariable Long id, HttpServletRequest request) {
|
|
public ResponseEntity<?> deleteSpecificExam(@PathVariable Long id, HttpServletRequest request) {
|
|
- specificExamRepo.delete(id);
|
|
|
|
- jdbcTemplate.update("delete from ecs_exam_course_group_course where group_id=?", id);
|
|
|
|
|
|
+ examSetting4CourseRepo.delete(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);
|
|
}
|
|
}
|
|
}
|
|
}
|