|
@@ -18,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -264,4 +265,38 @@ public class StudentController extends ControllerSupport {
|
|
|
return studentInfo;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "解绑学号", notes = "")
|
|
|
+ @PostMapping("unbindStudentCode/{ids}")
|
|
|
+ public void unbindStudentCode(@PathVariable String ids) {
|
|
|
+ List<Long> studentIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ for (Long cur : studentIds) {
|
|
|
+ StudentEntity s = studentRepo.findOne(cur);
|
|
|
+ if (null == s) {
|
|
|
+ throw new StatusException("B-450110", "学生不存在");
|
|
|
+ }
|
|
|
+ validateRootOrgIsolation(s.getRootOrgId());
|
|
|
+
|
|
|
+ s.setStudentCode(null);
|
|
|
+ studentRepo.save(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "解绑安全手机", notes = "")
|
|
|
+ @PostMapping("unbindSecurityPhone/{ids}")
|
|
|
+ public void unbindSecurityPhone(@PathVariable String ids) {
|
|
|
+ List<Long> studentIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ for (Long cur : studentIds) {
|
|
|
+ StudentEntity s = studentRepo.findOne(cur);
|
|
|
+ if (null == s) {
|
|
|
+ throw new StatusException("B-450110", "学生不存在");
|
|
|
+ }
|
|
|
+ validateRootOrgIsolation(s.getRootOrgId());
|
|
|
+
|
|
|
+ s.setSecurityPhone(null);
|
|
|
+ studentRepo.save(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|