|
@@ -31,6 +31,8 @@ import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.bean.ExamStudentInfo;
|
|
|
+import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
|
|
|
+import cn.com.qmth.examcloud.task.api.request.SyncExamStudentReq;
|
|
|
|
|
|
/**
|
|
|
* 考试学生服务类 Created by songyue on 17/1/14.
|
|
@@ -64,6 +66,9 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
@Autowired
|
|
|
ExamCourseRelationRepo examCourseRelationRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ DataSyncCloudService dataSyncCloudService;
|
|
|
+
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|
|
@@ -172,9 +177,14 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
ExamStudentEntity examStudent = examStudentRepo.findByExamIdAndStudentIdAndCourseId(
|
|
|
exam.getId(), studentInfo.getId(), courseBean.getId());
|
|
|
|
|
|
+ long updateTime = 0L;
|
|
|
if (null == examStudent) {
|
|
|
examStudent = new ExamStudentEntity();
|
|
|
examStudent.setEnable(true);
|
|
|
+ } else {
|
|
|
+ if (null != examStudent.getUpdateTime()) {
|
|
|
+ updateTime = examStudent.getUpdateTime().getTime();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
examStudent.setInfoCollector(examStudentInfo.getInfoCollector());
|
|
@@ -206,6 +216,30 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
relation.setCourseName(saved.getCourseName());
|
|
|
examCourseRelationRepo.save(relation);
|
|
|
|
|
|
+ // 同步操作
|
|
|
+ if (updateTime != saved.getUpdateTime().getTime()) {
|
|
|
+ SyncExamStudentReq req = new SyncExamStudentReq();
|
|
|
+ req.setId(saved.getId());
|
|
|
+ req.setCourseCode(courseBean.getCode());
|
|
|
+ req.setCourseLevel(courseBean.getLevel());
|
|
|
+ req.setCourseName(courseBean.getName());
|
|
|
+ req.setExamId(exam.getId());
|
|
|
+ req.setExamName(exam.getName());
|
|
|
+ req.setIdentityNumber(saved.getIdentityNumber());
|
|
|
+ req.setStudentCode(saved.getStudentCode());
|
|
|
+ req.setPaperType(saved.getPaperType());
|
|
|
+ req.setRootOrgId(saved.getRootOrgId());
|
|
|
+ req.setStudentName(studentInfo.getName());
|
|
|
+ req.setOrgId(studentInfo.getOrgId());
|
|
|
+ req.setOrgName(studentInfo.getOrgName());
|
|
|
+ req.setOrgCode(studentInfo.getOrgCode());
|
|
|
+ req.setRemark(saved.getRemark());
|
|
|
+ req.setInfoCollector(saved.getInfoCollector());
|
|
|
+ req.setExamSite(saved.getExamSite());
|
|
|
+
|
|
|
+ dataSyncCloudService.syncExamStudent(req);
|
|
|
+ }
|
|
|
+
|
|
|
ExamStudentInfo ret = new ExamStudentInfo();
|
|
|
ret.setId(saved.getId());
|
|
|
ret.setCourseCode(courseBean.getCode());
|