|
@@ -32,7 +32,7 @@ import cn.com.qmth.examcloud.service.examwork.service.ExamStudentService;
|
|
|
* Created by songyue on 17/1/13.
|
|
|
*/
|
|
|
@RestController
|
|
|
-@RequestMapping("${app.api.root}")
|
|
|
+@RequestMapping("${app.api.root}/exam_student")
|
|
|
public class ExamStudentApi {
|
|
|
|
|
|
@Autowired
|
|
@@ -41,51 +41,45 @@ public class ExamStudentApi {
|
|
|
@Autowired
|
|
|
ExamStudentService examStudentService;
|
|
|
|
|
|
- @ApiOperation(value="查询所有考试学生",notes = "分页")
|
|
|
- @GetMapping("/exam_student/all/{curPage}/{pageSize}")
|
|
|
+ @ApiOperation(value="查询考试学生带条件和分页",notes = "带条件带分页")
|
|
|
+ @GetMapping("/all/{curPage}/{pageSize}")
|
|
|
public ResponseEntity getAllExamStudent(@ModelAttribute ExamStudent examCriteria, @PathVariable Integer curPage, @PathVariable Integer pageSize){
|
|
|
return new ResponseEntity(examStudentService.getAllExamStudent(examCriteria,new PageRequest(curPage - 1,pageSize)),HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="查询所有考试学生",notes = "不分页")
|
|
|
+ @ApiOperation(value="查询所有考试学生带条件",notes = "带条件不分页")
|
|
|
@GetMapping("/exam_student/all")
|
|
|
public ResponseEntity getAllExamStudent(@ModelAttribute ExamStudent examCriteria){
|
|
|
return new ResponseEntity(examStudentService.getAllExamStudent(examCriteria), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="查询所有考试学生",notes = "不分页不带查询条件")
|
|
|
- @GetMapping("/exam_student")
|
|
|
- public ResponseEntity getAllExamStudent(){
|
|
|
- return new ResponseEntity(examStudentRepo.findAll(), HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
@ApiOperation(value="按ID查询考试学生",notes = "ID查询")
|
|
|
- @GetMapping("/exam_student/{id}")
|
|
|
+ @GetMapping("/{id}")
|
|
|
public ResponseEntity<ExamStudent> getExamStudentById(@PathVariable Long id){
|
|
|
return new ResponseEntity<ExamStudent>(examStudentService.getExamStudentById(id),HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="新增考试学生",notes = "新增")
|
|
|
- @PostMapping("/exam_student")
|
|
|
+ @PostMapping()
|
|
|
public ResponseEntity addExamStudent(@RequestBody ExamStudent examStudent){
|
|
|
return new ResponseEntity<ExamStudent>(examStudentService.saveExamStudent(examStudent),HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="更新考试学生",notes = "更新")
|
|
|
- @PutMapping("/exam_student")
|
|
|
+ @PutMapping()
|
|
|
public ResponseEntity updateExamStudent(@RequestBody ExamStudent examStudent){
|
|
|
return new ResponseEntity(examStudentService.saveExamStudent(examStudent),HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="按ID删除考试学生",notes = "删除")
|
|
|
- @DeleteMapping("/exam_student/{id}")
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
public ResponseEntity deleteExamStudent(@PathVariable Long id){
|
|
|
examStudentService.deleteExamStudent(id);
|
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="导入考试学生",notes = "导入")
|
|
|
- @PostMapping("/exam_student/import")
|
|
|
+ @PostMapping("/import")
|
|
|
public ResponseEntity importExamStudent(@RequestParam Long examId,@RequestParam MultipartFile file){
|
|
|
try {
|
|
|
List<ExcelError> excelErrors = examStudentService.importExamStudent(examId,file.getInputStream());
|
|
@@ -109,7 +103,7 @@ public class ExamStudentApi {
|
|
|
// }
|
|
|
|
|
|
@ApiOperation(value="照片检验",notes = "检验")
|
|
|
- @PostMapping("/exam_student/photo_check")
|
|
|
+ @PostMapping("/photo_check")
|
|
|
public ResponseEntity photoCheck(@RequestParam Long examId){
|
|
|
try {
|
|
|
List<ErrorMsg> errorMsgs = examStudentService.photoCheck(examId);
|
|
@@ -119,4 +113,14 @@ public class ExamStudentApi {
|
|
|
return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// @ApiOperation(value="导出考试学生带条件",notes = "导出")
|
|
|
+// @GetMapping("/export")
|
|
|
+// public void exportExamStudent(@ModelAttribute ExamStudent examCriteria,HttpServletResponse response){
|
|
|
+// List<CourseDTO> list = new ArrayList<CourseDTO>();
|
|
|
+// courseRepo.findByOrgId(orgId).forEach(c -> {
|
|
|
+// list.add(courseAssembler.toDTO(c));
|
|
|
+// });
|
|
|
+// ExportUtils.exportEXCEL("课程列表", CourseDTO.class, list, response);
|
|
|
+// }
|
|
|
}
|