WANG 6 years ago
parent
commit
5cad3b8e0d

+ 23 - 0
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/StudentController.java

@@ -355,6 +355,29 @@ public class StudentController extends ControllerSupport {
 
 	}
 
+	@ApiOperation(value = "解绑学号", notes = "")
+	@PutMapping("unbindStudentCodeByStudentCode")
+	public int unbindStudentCodeByStudentCode(@RequestParam(required = true) String studentCode,
+			@RequestParam(required = true) Long rootOrgId) {
+
+		if (null == rootOrgId) {
+			rootOrgId = getRootOrgId();
+		} else {
+			OrgEntity rootOrg = orgRepo.findOne(rootOrgId);
+			if (null == rootOrg) {
+				throw new StatusException("B-450110", "rootOrgId is wrong");
+			}
+			validateRootOrgIsolation(rootOrgId);
+		}
+
+		if (StringUtils.isBlank(studentCode)) {
+			throw new StatusException("B-160002", "studentCode is blank");
+		}
+
+		int affected = studentService.unbindStudentCodeByStudentCode(rootOrgId, studentCode);
+		return affected;
+	}
+
 	@ApiOperation(value = "解绑安全手机", notes = "")
 	@PutMapping("unbindSecurityPhone/{ids}")
 	public void unbindSecurityPhone(@PathVariable String ids) {