|
@@ -356,4 +356,41 @@ public class ExamStudentController extends ControllerSupport {
|
|
|
exportFile("考生导入模板.xlsx", new File(resoucePath));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "启用考生")
|
|
|
+ @PutMapping("enable/{ids}")
|
|
|
+ public List<String> enableStudent(@PathVariable String ids) {
|
|
|
+ List<Long> examStuIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List<String> ret = Lists.newArrayList();
|
|
|
+ for (Long cur : examStuIds) {
|
|
|
+ ExamStudentEntity s = examStudentRepo.findOne(cur);
|
|
|
+ s.setEnable(true);
|
|
|
+ examStudentRepo.save(s);
|
|
|
+ ret.add(s.getId() + ":" + s.getName());
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "禁用考生")
|
|
|
+ @PutMapping("disable/{ids}")
|
|
|
+ public List<String> disableStudent(@PathVariable String ids) {
|
|
|
+ List<Long> examStuIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List<String> ret = Lists.newArrayList();
|
|
|
+ for (Long cur : examStuIds) {
|
|
|
+ ExamStudentEntity s = examStudentRepo.findOne(cur);
|
|
|
+ s.setEnable(false);
|
|
|
+ examStudentRepo.save(s);
|
|
|
+ ret.add(s.getId() + ":" + s.getName());
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
}
|