|
@@ -23,6 +23,7 @@ import cn.com.qmth.examcloud.core.oe.admin.service.ExamStudentService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.LocalCacheService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.*;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.cache.ExamStudentCache;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;
|
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
|
|
|
import cn.com.qmth.examcloud.support.cache.bean.ExamPropertyCacheBean;
|
|
@@ -41,6 +42,8 @@ import org.springframework.jdbc.core.RowMapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+
|
|
|
import javax.persistence.EntityManager;
|
|
|
import javax.persistence.Query;
|
|
|
import java.math.BigDecimal;
|
|
@@ -76,10 +79,13 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private LocalCacheService localCacheService;
|
|
|
+ @Autowired
|
|
|
+ private ExamStudentCache examStudentCache;
|
|
|
|
|
|
@Override
|
|
|
public void syncExamStudentAllData(List<ExamStudentInfo> examStudents) {
|
|
|
Check.isEmpty(examStudents, "考生信息不能为空!");
|
|
|
+ List<Long> examStudentIdList = Lists.newArrayList();
|
|
|
//封装并校验数据
|
|
|
for (ExamStudentInfo cur : examStudents) {
|
|
|
Check.isNull(cur.getRootOrgId(), "顶级机构ID不能为空!");
|
|
@@ -119,6 +125,8 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
|
|
|
//保存考生
|
|
|
ExamStudentEntity examStudentEntity = examStudentRepo.save(entity);
|
|
|
+
|
|
|
+ examStudentIdList.add(examStudentEntity.getId());
|
|
|
//已完成 考试,更新考试记录表
|
|
|
if (examStudentEntity.getFinished() != null && examStudentEntity.getFinished()) {
|
|
|
long examStudentId = examStudentEntity.getExamStudentId();
|
|
@@ -128,6 +136,10 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
examRecordDataRepo.syncUpdateExamStudentInfo(examStudentId, studentName, studentCode, infoCollector);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ for (Long cur : examStudentIdList) {
|
|
|
+ examStudentCache.remove(cur);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|