wangwei 7 år sedan
förälder
incheckning
5d38aa6bf9

+ 12 - 10
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/provider/StudentCloudServiceProvider.java

@@ -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);
 		}
 	}

+ 2 - 1
examcloud-core-basic-api/src/main/java/cn/com/qmth/examcloud/core/basic/api/StudentCloudService.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.examcloud.core.basic.api;
 
+import cn.com.qmth.examcloud.commons.web.cloud.api.CloudService;
 import cn.com.qmth.examcloud.core.basic.api.request.InsertOrUpdateStudentReq;
 
 /**
@@ -10,7 +11,7 @@ import cn.com.qmth.examcloud.core.basic.api.request.InsertOrUpdateStudentReq;
  * @company QMTH
  * @description StudentCloudService.java
  */
-public interface StudentCloudService {
+public interface StudentCloudService extends CloudService {
 
 	/**
 	 * 插入或更新学生