wangwei 6 years ago
parent
commit
dbce41a6d6

+ 2 - 1
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamController.java

@@ -209,7 +209,8 @@ public class ExamController extends ControllerSupport {
 			ExamEntity bean = new ExamEntity();
 			bean.setId(next.getId());
 			bean.setName(next.getName());
-
+			bean.setEnable(next.getEnable());
+			bean.setRootOrgId(next.getRootOrgId());
 			list.add(bean);
 		}
 

+ 15 - 6
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/HandleSyncCloudServiceProvider.java

@@ -1,7 +1,9 @@
 package cn.com.qmth.examcloud.core.examwork.api.provider;
 
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -19,6 +21,7 @@ import cn.com.qmth.examcloud.commons.api.response.SyncOrgResp;
 import cn.com.qmth.examcloud.commons.api.response.SyncSpecialtyResp;
 import cn.com.qmth.examcloud.commons.api.response.SyncStudentResp;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
 import io.swagger.annotations.ApiOperation;
 
 /**
@@ -37,45 +40,51 @@ public class HandleSyncCloudServiceProvider extends ControllerSupport
 
 	private static final long serialVersionUID = 9122543745597481498L;
 
+	@Autowired
+	ExamStudentRepo examStudentRepo;
+
 	@ApiOperation(value = "同步课程")
 	@PostMapping("syncCourse")
 	@Override
-	public SyncCourseResp syncCourse(SyncCourseReq req) {
+	public SyncCourseResp syncCourse(@RequestBody SyncCourseReq req) {
 		return null;
 	}
 
 	@ApiOperation(value = "同步机构")
 	@PostMapping("syncOrg")
 	@Override
-	public SyncOrgResp syncOrg(SyncOrgReq req) {
+	public SyncOrgResp syncOrg(@RequestBody SyncOrgReq req) {
 		return null;
 	}
 
 	@ApiOperation(value = "同步学生")
 	@PostMapping("syncStudent")
 	@Override
-	public SyncStudentResp syncStudent(SyncStudentReq req) {
+	public SyncStudentResp syncStudent(@RequestBody SyncStudentReq req) {
+		String name = req.getName();
+		Long id = req.getId();
+		examStudentRepo.updateStudent(name, id);
 		return null;
 	}
 
 	@ApiOperation(value = "同步考生")
 	@PostMapping("syncExamStudent")
 	@Override
-	public SyncExamStudentResp syncExamStudent(SyncExamStudentReq req) {
+	public SyncExamStudentResp syncExamStudent(@RequestBody SyncExamStudentReq req) {
 		return null;
 	}
 
 	@ApiOperation(value = "同步专业")
 	@PostMapping("syncSpecialty")
 	@Override
-	public SyncSpecialtyResp syncSpecialty(SyncSpecialtyReq req) {
+	public SyncSpecialtyResp syncSpecialty(@RequestBody SyncSpecialtyReq req) {
 		return null;
 	}
 
 	@ApiOperation(value = "同步考试")
 	@PostMapping("syncExam")
 	@Override
-	public SyncExamResp syncExam(SyncExamReq req) {
+	public SyncExamResp syncExam(@RequestBody SyncExamReq req) {
 		return null;
 	}
 

+ 4 - 0
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamStudentRepo.java

@@ -26,4 +26,8 @@ public interface ExamStudentRepo
 
 	ExamStudentEntity findByExamIdAndStudentIdAndCourseId(Long examId, Long studentId,
 			Long courseId);
+
+	@Modifying
+	@Query("update ExamStudentEntity s set s.name = ?1  where s.studentId = ?2")
+	void updateStudent(String name, Long studentId);
 }