|
@@ -127,7 +127,7 @@ public class ExamStudentImportServiceImpl implements ExamStudentImportService {
|
|
|
|
|
|
examStudentTempRepo.processExamStudentTemp(batchId);
|
|
examStudentTempRepo.processExamStudentTemp(batchId);
|
|
|
|
|
|
- saveExamStudents(batchId);
|
|
|
|
|
|
+ saveExamStudents(failRecords, batchId);
|
|
|
|
|
|
delete(batchId);
|
|
delete(batchId);
|
|
|
|
|
|
@@ -250,7 +250,7 @@ public class ExamStudentImportServiceImpl implements ExamStudentImportService {
|
|
transaction.commit();
|
|
transaction.commit();
|
|
}
|
|
}
|
|
|
|
|
|
- private void saveExamStudents(Long batchId) {
|
|
|
|
|
|
+ private void saveExamStudents(List<Map<String, Object>> failRecords, Long batchId) {
|
|
EntityManager em = entityManagerFactory.createEntityManager();
|
|
EntityManager em = entityManagerFactory.createEntityManager();
|
|
Query query = em.createQuery("select s from ExamStudentTempEntity s where "
|
|
Query query = em.createQuery("select s from ExamStudentTempEntity s where "
|
|
+ "s.name is not null and s.orgId is not null and s.identityNumber is not null "
|
|
+ "s.name is not null and s.orgId is not null and s.identityNumber is not null "
|
|
@@ -265,8 +265,16 @@ public class ExamStudentImportServiceImpl implements ExamStudentImportService {
|
|
|
|
|
|
try {
|
|
try {
|
|
saveExamStudent(examStudent);
|
|
saveExamStudent(examStudent);
|
|
|
|
+ } catch (StatusException e) {
|
|
|
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
|
|
+ map.put("lineNum", examStudent.getLineNum());
|
|
|
|
+ map.put("msg", e.getDesc());
|
|
|
|
+ failRecords.add(map);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- e.printStackTrace();
|
|
|
|
|
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
|
|
+ map.put("lineNum", examStudent.getLineNum());
|
|
|
|
+ map.put("msg", e.getMessage());
|
|
|
|
+ failRecords.add(map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|