|
@@ -13,9 +13,9 @@ import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.StudentBean;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.request.GetStudentReq;
|
|
|
-import cn.com.qmth.examcloud.core.basic.api.request.InsertOrUpdateStudentReq;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
|
|
|
-import cn.com.qmth.examcloud.core.basic.api.response.InsertOrUpdateStudentResp;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.UserRepo;
|
|
@@ -51,11 +51,10 @@ public class StudentCloudServiceProvider extends ControllerSupport implements St
|
|
|
@Autowired
|
|
|
StudentRepo studentRepo;
|
|
|
|
|
|
- @ApiOperation(value = "插入或更新学生")
|
|
|
- @PostMapping("insertOrUpdateStudent")
|
|
|
+ @ApiOperation(value = "保存学生")
|
|
|
+ @PostMapping("saveStudent")
|
|
|
@Override
|
|
|
- public InsertOrUpdateStudentResp insertOrUpdateStudent(
|
|
|
- @RequestBody InsertOrUpdateStudentReq req) {
|
|
|
+ public SaveStudentResp saveStudent(@RequestBody SaveStudentReq req) {
|
|
|
|
|
|
trim(req);
|
|
|
|
|
@@ -73,9 +72,9 @@ public class StudentCloudServiceProvider extends ControllerSupport implements St
|
|
|
studentInfo.setPhotoPath(req.getPhotoPath());
|
|
|
studentInfo.setRemark(req.getRemark());
|
|
|
|
|
|
- StudentEntity student = studentService.insertOrUpdateStudent(studentInfo);
|
|
|
+ StudentEntity student = studentService.saveStudent(studentInfo);
|
|
|
|
|
|
- InsertOrUpdateStudentResp resp = new InsertOrUpdateStudentResp();
|
|
|
+ SaveStudentResp resp = new SaveStudentResp();
|
|
|
resp.setStudentId(student.getId());
|
|
|
resp.setRootOrgId(student.getRootOrgId());
|
|
|
|
|
@@ -109,7 +108,8 @@ public class StudentCloudServiceProvider extends ControllerSupport implements St
|
|
|
throw new StatusException("B-150002", "机构错误");
|
|
|
}
|
|
|
|
|
|
- StudentEntity student = studentRepo.findByIdentityNumberAndRootOrgId(identityNumber, rootOrgId);
|
|
|
+ StudentEntity student = studentRepo.findByIdentityNumberAndRootOrgId(identityNumber,
|
|
|
+ rootOrgId);
|
|
|
|
|
|
if (null == student) {
|
|
|
throw new StatusException("B-150005", "学生不存在");
|