|
@@ -16,28 +16,30 @@ import cn.com.qmth.examcloud.core.basic.service.impl.StudentService;
|
|
|
@RequestMapping("${$rmp.cloud.basic}" + "student")
|
|
|
public class StudentCloudServiceProvider extends ControllerSupport implements StudentCloudService {
|
|
|
|
|
|
+ private static final long serialVersionUID = -571041158847398070L;
|
|
|
+
|
|
|
@Autowired
|
|
|
- private UserRepo userRepo;
|
|
|
+ UserRepo userRepo;
|
|
|
|
|
|
@Autowired
|
|
|
- private StudentService studentService;
|
|
|
+ StudentService studentService;
|
|
|
|
|
|
@Autowired
|
|
|
private StudentRepo studentRepo;
|
|
|
|
|
|
@Override
|
|
|
- public void insertOrUpdateStudent(InsertOrUpdateStudentReq studentReq) {
|
|
|
- Student oldStudent = studentRepo.findByIdentityNumber(studentReq.getIdentityNumber());
|
|
|
+ public void insertOrUpdateStudent(InsertOrUpdateStudentReq req) {
|
|
|
+ Student oldStudent = studentRepo.findByIdentityNumber(req.getIdentityNumber());
|
|
|
if (oldStudent == null) {
|
|
|
Student student = new Student();
|
|
|
- student.setName(studentReq.getName());
|
|
|
- student.setIdentityNumber(studentReq.getIdentityNumber());
|
|
|
- student.setStudentCode(studentReq.getStudentCode());
|
|
|
- student.setOrgId(studentReq.getOrgId());
|
|
|
+ student.setName(req.getName());
|
|
|
+ student.setIdentityNumber(req.getIdentityNumber());
|
|
|
+ student.setStudentCode(req.getStudentCode());
|
|
|
+ student.setOrgId(req.getOrgId());
|
|
|
studentRepo.save(student);
|
|
|
} else {
|
|
|
- oldStudent.setOrgId(studentReq.getOrgId());
|
|
|
- oldStudent.setRootOrgId(studentReq.getRootOrgId());
|
|
|
+ oldStudent.setOrgId(req.getOrgId());
|
|
|
+ oldStudent.setRootOrgId(req.getRootOrgId());
|
|
|
studentRepo.save(oldStudent);
|
|
|
}
|
|
|
}
|