|
@@ -57,7 +57,7 @@ import io.swagger.annotations.ApiOperation;
|
|
* 考试服务API Created by songyue on 17/1/13.
|
|
* 考试服务API Created by songyue on 17/1/13.
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("${$rmp.ctr.examwork}")
|
|
|
|
|
|
+@RequestMapping("${$rmp.ctr.examwork}/exam")
|
|
public class ExamController extends ControllerSupport {
|
|
public class ExamController extends ControllerSupport {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -85,7 +85,7 @@ public class ExamController extends ControllerSupport {
|
|
private JdbcTemplate jdbcTemplate;
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@ApiOperation(value = "查询所有考试批次", notes = "分页带查询")
|
|
@ApiOperation(value = "查询所有考试批次", notes = "分页带查询")
|
|
- @GetMapping("/exam/all/{curPage}/{pageSize}")
|
|
|
|
|
|
+ @GetMapping("all/{curPage}/{pageSize}")
|
|
public ResponseEntity getAllExam(HttpServletRequest request, @ModelAttribute Exam examCriteria,
|
|
public ResponseEntity getAllExam(HttpServletRequest request, @ModelAttribute Exam examCriteria,
|
|
@PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
@PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
@@ -101,7 +101,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询所有考试批次(包含有效)", notes = "不分页带查询")
|
|
@ApiOperation(value = "查询所有考试批次(包含有效)", notes = "不分页带查询")
|
|
- @GetMapping("/exam/all")
|
|
|
|
|
|
+ @GetMapping("all")
|
|
public ResponseEntity getEnableExam(HttpServletRequest request,
|
|
public ResponseEntity getEnableExam(HttpServletRequest request,
|
|
@ModelAttribute Exam examCriteria) {
|
|
@ModelAttribute Exam examCriteria) {
|
|
cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
@@ -113,7 +113,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据机构ID和考试类型查询所有有效考试批次", notes = "根据机构ID和考试类型查询所有有效考试批次")
|
|
@ApiOperation(value = "根据机构ID和考试类型查询所有有效考试批次", notes = "根据机构ID和考试类型查询所有有效考试批次")
|
|
- @GetMapping("/exam/rootOrgId/{orgId}/{examType}")
|
|
|
|
|
|
+ @GetMapping("rootOrgId/{orgId}/{examType}")
|
|
public ResponseEntity getEnableExamByRootOrgId(@PathVariable Long orgId,
|
|
public ResponseEntity getEnableExamByRootOrgId(@PathVariable Long orgId,
|
|
@PathVariable String examType) {
|
|
@PathVariable String examType) {
|
|
if (orgId == null) {
|
|
if (orgId == null) {
|
|
@@ -129,7 +129,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询所有考试批次(包含有效无效)", notes = "不分页带查询")
|
|
@ApiOperation(value = "查询所有考试批次(包含有效无效)", notes = "不分页带查询")
|
|
- @GetMapping("/exam/all/both")
|
|
|
|
|
|
+ @GetMapping("all/both")
|
|
public List<Exam> getAllExam(@ModelAttribute Exam examCriteria) {
|
|
public List<Exam> getAllExam(@ModelAttribute Exam examCriteria) {
|
|
examCriteria.setRootOrgId(getRootOrgId());
|
|
examCriteria.setRootOrgId(getRootOrgId());
|
|
ExampleMatcher exampleMatcher = ExampleMatcher.matching().withMatcher("name", contains());
|
|
ExampleMatcher exampleMatcher = ExampleMatcher.matching().withMatcher("name", contains());
|
|
@@ -138,7 +138,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据名称查询考试批次(包含有效)", notes = "不分页带查询")
|
|
@ApiOperation(value = "根据名称查询考试批次(包含有效)", notes = "不分页带查询")
|
|
- @GetMapping("/exam/name")
|
|
|
|
|
|
+ @GetMapping("name")
|
|
public ResponseEntity getEnableExamByName(HttpServletRequest request,
|
|
public ResponseEntity getEnableExamByName(HttpServletRequest request,
|
|
@ModelAttribute Exam examCriteria) {
|
|
@ModelAttribute Exam examCriteria) {
|
|
cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
@@ -151,13 +151,13 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
|
|
@ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
|
|
- @GetMapping("/exam/{id}")
|
|
|
|
|
|
+ @GetMapping("{id}")
|
|
public ResponseEntity<Exam> getExamById(@PathVariable Long id) {
|
|
public ResponseEntity<Exam> getExamById(@PathVariable Long id) {
|
|
return new ResponseEntity<Exam>(examService.getExamById(id), HttpStatus.OK);
|
|
return new ResponseEntity<Exam>(examService.getExamById(id), HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "新增考试批次", notes = "新增")
|
|
@ApiOperation(value = "新增考试批次", notes = "新增")
|
|
- @PostMapping("/exam")
|
|
|
|
|
|
+ @PostMapping()
|
|
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) {
|
|
@@ -184,7 +184,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "更新考试批次", notes = "更新")
|
|
@ApiOperation(value = "更新考试批次", notes = "更新")
|
|
- @PutMapping("/exam")
|
|
|
|
|
|
+ @PutMapping()
|
|
public Exam updateExam(@RequestBody Exam exam) {
|
|
public Exam updateExam(@RequestBody Exam exam) {
|
|
if (!examService.checkExamName(exam)) {
|
|
if (!examService.checkExamName(exam)) {
|
|
throw new StatusException("E-001001", "考试名称已存在,请重新填写");
|
|
throw new StatusException("E-001001", "考试名称已存在,请重新填写");
|
|
@@ -205,7 +205,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "按ID删除考试批次", notes = "删除")
|
|
@ApiOperation(value = "按ID删除考试批次", notes = "删除")
|
|
- @DeleteMapping("/exam/{id}")
|
|
|
|
|
|
+ @DeleteMapping("{id}")
|
|
public ResponseEntity deleteExam(@PathVariable String id) {
|
|
public ResponseEntity deleteExam(@PathVariable String id) {
|
|
try {
|
|
try {
|
|
List<Long> examIds = Stream.of(id.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
List<Long> examIds = Stream.of(id.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
@@ -220,7 +220,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "启用考试", notes = "启用考试")
|
|
@ApiOperation(value = "启用考试", notes = "启用考试")
|
|
- @PutMapping("/exam/enable/{ids}")
|
|
|
|
|
|
+ @PutMapping("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()))
|
|
List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -233,7 +233,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "禁用考试", notes = "禁用考试")
|
|
@ApiOperation(value = "禁用考试", notes = "禁用考试")
|
|
- @PutMapping("/exam/disable/{ids}")
|
|
|
|
|
|
+ @PutMapping("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()))
|
|
List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -246,14 +246,14 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "回填考生不可删除标志", notes = "回填考生不可删除标志")
|
|
@ApiOperation(value = "回填考生不可删除标志", notes = "回填考生不可删除标志")
|
|
- @PutMapping("/exam/canNotDel/{id}")
|
|
|
|
|
|
+ @PutMapping("canNotDel/{id}")
|
|
public ResponseEntity disableUser(@PathVariable Long id) {
|
|
public ResponseEntity disableUser(@PathVariable Long id) {
|
|
examRepo.canNotDel(id);
|
|
examRepo.canNotDel(id);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "网考初始化更新考务信息", notes = "网考初始化更新考务信息")
|
|
@ApiOperation(value = "网考初始化更新考务信息", notes = "网考初始化更新考务信息")
|
|
- @PutMapping("/exam/updateExamInfo")
|
|
|
|
|
|
+ @PutMapping("updateExamInfo")
|
|
public ResponseEntity updateExamInfo(@RequestParam Long examId, @RequestParam Long examStuId) {
|
|
public ResponseEntity updateExamInfo(@RequestParam Long examId, @RequestParam Long examStuId) {
|
|
examRepo.canNotDel(examId);
|
|
examRepo.canNotDel(examId);
|
|
examStudentService.updateExamStudentInfo(examStuId);
|
|
examStudentService.updateExamStudentInfo(examStuId);
|
|
@@ -261,7 +261,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "网考更新考务信息", notes = "网考更新考务信息")
|
|
@ApiOperation(value = "网考更新考务信息", notes = "网考更新考务信息")
|
|
- @PutMapping("/exam/updateExamStudent")
|
|
|
|
|
|
+ @PutMapping("updateExamStudent")
|
|
public ResponseEntity updateExamStudent(@RequestParam Long examId,
|
|
public ResponseEntity updateExamStudent(@RequestParam Long examId,
|
|
@RequestParam Long examStuId) {
|
|
@RequestParam Long examStuId) {
|
|
examRepo.canNotDel(examId);
|
|
examRepo.canNotDel(examId);
|
|
@@ -272,7 +272,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询课程组集合", notes = "")
|
|
@ApiOperation(value = "查询课程组集合", notes = "")
|
|
- @GetMapping("/exam/queryCourseGroupList/{examId}/{curPage}/{pageSize}")
|
|
|
|
|
|
+ @GetMapping("queryCourseGroupList/{examId}/{curPage}/{pageSize}")
|
|
public List<CourseGroupBean> queryCourseGroupList(@PathVariable Long examId,
|
|
public List<CourseGroupBean> queryCourseGroupList(@PathVariable Long examId,
|
|
@PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
@PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
|
|
|
|
@@ -310,7 +310,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "通过课程ID查询课程组集合", notes = "")
|
|
@ApiOperation(value = "通过课程ID查询课程组集合", notes = "")
|
|
- @GetMapping("/exam/queryCourseGroupList/{examId}/{courseId}")
|
|
|
|
|
|
+ @GetMapping("queryCourseGroupList/{examId}/{courseId}")
|
|
public List<CourseGroupBean> queryCourseGroupList(@PathVariable Long examId,
|
|
public List<CourseGroupBean> queryCourseGroupList(@PathVariable Long examId,
|
|
@PathVariable Long courseId) {
|
|
@PathVariable Long courseId) {
|
|
|
|
|
|
@@ -354,7 +354,7 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "更新课程组", notes = "")
|
|
@ApiOperation(value = "更新课程组", notes = "")
|
|
- @PutMapping("/exam/courseGroup")
|
|
|
|
|
|
+ @PutMapping("courseGroup")
|
|
public void updateCourseGroup(@RequestBody CourseGroupBean courseGroupBean,
|
|
public void updateCourseGroup(@RequestBody CourseGroupBean courseGroupBean,
|
|
HttpServletRequest request) {
|
|
HttpServletRequest request) {
|
|
|
|
|
|
@@ -386,14 +386,14 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除课程组", notes = "")
|
|
@ApiOperation(value = "删除课程组", notes = "")
|
|
- @DeleteMapping("/exam/courseGroup/{id}")
|
|
|
|
|
|
+ @DeleteMapping("courseGroup/{id}")
|
|
public void deleteSpecificExam(@PathVariable Long id, HttpServletRequest request) {
|
|
public void deleteSpecificExam(@PathVariable Long id, HttpServletRequest request) {
|
|
courseGroupRepo.delete(id);
|
|
courseGroupRepo.delete(id);
|
|
courseGroupRelationRepo.deleteByGroupId(id);
|
|
courseGroupRelationRepo.deleteByGroupId(id);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询考试相关的学习中心设置", notes = "")
|
|
@ApiOperation(value = "查询考试相关的学习中心设置", notes = "")
|
|
- @GetMapping("/exam/getExamOrgList/{examId}/{curPage}/{pageSize}")
|
|
|
|
|
|
+ @GetMapping("getExamOrgList/{examId}/{curPage}/{pageSize}")
|
|
public List<?> getExamOrgList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
public List<?> getExamOrgList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
@PathVariable Integer pageSize) {
|
|
@PathVariable Integer pageSize) {
|
|
Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
@@ -403,21 +403,21 @@ public class ExamController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "新增考试相关的学习中心设置", notes = "")
|
|
@ApiOperation(value = "新增考试相关的学习中心设置", notes = "")
|
|
- @PostMapping("/exam/examOrg")
|
|
|
|
|
|
+ @PostMapping("examOrg")
|
|
public ExamOrgEntity addExamOrg(@RequestBody ExamOrgEntity examOrg) {
|
|
public ExamOrgEntity addExamOrg(@RequestBody ExamOrgEntity examOrg) {
|
|
ExamOrgEntity ret = examOrgRepo.save(examOrg);
|
|
ExamOrgEntity ret = examOrgRepo.save(examOrg);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "更新考试相关的学习中心设置", notes = "")
|
|
@ApiOperation(value = "更新考试相关的学习中心设置", notes = "")
|
|
- @PutMapping("/exam/examOrg")
|
|
|
|
|
|
+ @PutMapping("examOrg")
|
|
public ExamOrgEntity updateExamOrg(@RequestBody ExamOrgEntity examOrg) {
|
|
public ExamOrgEntity updateExamOrg(@RequestBody ExamOrgEntity examOrg) {
|
|
ExamOrgEntity ret = examOrgRepo.save(examOrg);
|
|
ExamOrgEntity ret = examOrgRepo.save(examOrg);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除考试相关的学习中心设置", notes = "")
|
|
@ApiOperation(value = "删除考试相关的学习中心设置", notes = "")
|
|
- @DeleteMapping("/exam/examOrg/{examId}/{orgId}")
|
|
|
|
|
|
+ @DeleteMapping("examOrg/{examId}/{orgId}")
|
|
public void deleteExamOrg(@PathVariable Long examId, @PathVariable Long orgId) {
|
|
public void deleteExamOrg(@PathVariable Long examId, @PathVariable Long orgId) {
|
|
ExamOrgEntity examOrg = new ExamOrgEntity();
|
|
ExamOrgEntity examOrg = new ExamOrgEntity();
|
|
examOrg.setExamId(examId);
|
|
examOrg.setExamId(examId);
|