|
@@ -2,6 +2,7 @@ package cn.com.qmth.scancentral.service.impl;
|
|
|
|
|
|
import cn.com.qmth.scancentral.bean.ImportStudentDomain;
|
|
|
import cn.com.qmth.scancentral.enums.AsyncTaskStatus;
|
|
|
+import cn.com.qmth.scancentral.service.DataCacheService;
|
|
|
import cn.com.qmth.scancentral.service.StudentImportService;
|
|
|
import cn.com.qmth.scancentral.service.StudentService;
|
|
|
import cn.com.qmth.scancentral.service.SubjectService;
|
|
@@ -32,6 +33,9 @@ public class StudentImportServiceImpl implements StudentImportService {
|
|
|
@Autowired
|
|
|
private StudentService studentService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DataCacheService dataCacheService;
|
|
|
+
|
|
|
@Override
|
|
|
public ImportTaskVo studentImportProgress(String taskId) {
|
|
|
ImportTaskVo task = IMPORT_TASKS.get(taskId);
|
|
@@ -54,7 +58,7 @@ public class StudentImportServiceImpl implements StudentImportService {
|
|
|
@Async
|
|
|
@Override
|
|
|
public void studentImport(String taskId, List<String> lines, Long examId, String subjectCode, Integer yearConfig,
|
|
|
- Integer yearHalfConfig) {
|
|
|
+ Integer yearHalfConfig) {
|
|
|
ImportTaskVo task = new ImportTaskVo();
|
|
|
task.setTaskId(taskId);
|
|
|
task.setProgress(0d);
|
|
@@ -104,6 +108,7 @@ public class StudentImportServiceImpl implements StudentImportService {
|
|
|
task.setProgress(100d);
|
|
|
long cost = (System.currentTimeMillis() - startTime) / 1000L;
|
|
|
log.info("【考生导入】共{}条 已导入:{}条 已耗时:{}秒 进度:100% taskId:{}", total, finishCount, cost, taskId);
|
|
|
+ dataCacheService.loadCache();
|
|
|
} catch (Exception e) {
|
|
|
task.setStatus(AsyncTaskStatus.FAILED);
|
|
|
task.setErrMsg(String.format("导入异常终止,已导入%s条,未导入%s条!", finishCount, total - finishCount));
|
|
@@ -130,7 +135,7 @@ public class StudentImportServiceImpl implements StudentImportService {
|
|
|
}
|
|
|
|
|
|
private void parseValues(List<String> lines, List<StudentImportInfo> list, Long examId, String subjectCodeConfig,
|
|
|
- Integer yearConfig, Integer yearHalfConfig) {
|
|
|
+ Integer yearConfig, Integer yearHalfConfig) {
|
|
|
Set<String> subjectCodes = new HashSet<>();
|
|
|
Set<String> examNumbers = new HashSet<>();
|
|
|
Pattern examNumberPattern = Pattern.compile("^[0-9]{15}$");
|