|
@@ -52,11 +52,14 @@ public class ExportExamCaptureTask implements Task {
|
|
|
|
|
|
for (Long examId : examIds) {
|
|
|
// 按考试ID分批导出
|
|
|
- System.out.println("\n********************\n");
|
|
|
+ log.info("********************" + examId);
|
|
|
|
|
|
+ int index = 0;
|
|
|
Long nextMinId = 0L;
|
|
|
while (true) {
|
|
|
- log.info("query nextMinId:" + nextMinId);
|
|
|
+ index++;
|
|
|
+ log.info("query nextMinId:" + nextMinId + " pageNo:" + index);
|
|
|
+
|
|
|
List<ExamCaptureInfo> list = jdbcTemplate.query(String.format(querySql.toString(), nextMinId, examId),
|
|
|
new BeanPropertyRowMapper(ExamCaptureInfo.class));
|
|
|
|
|
@@ -67,9 +70,14 @@ public class ExportExamCaptureTask implements Task {
|
|
|
nextMinId = list.get(list.size() - 1).getExamRecordDataId();
|
|
|
|
|
|
allList.addAll(this.queryCaptures(list));
|
|
|
+
|
|
|
+ if (allList.size() > 100000) {
|
|
|
+ // 只取10万条左右的数据
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- System.out.println("\n********************\n");
|
|
|
+ log.info("********************" + examId);
|
|
|
}
|
|
|
|
|
|
final String filePath = this.tempDir() + File.separator + "比对结果列表-" + System.currentTimeMillis() + ".xlsx";
|
|
@@ -104,22 +112,28 @@ public class ExportExamCaptureTask implements Task {
|
|
|
okInfo.setFileUrl(this.fixPhotoUrl(capture.getFileUrl()));
|
|
|
okInfo.setFaceCompareResult(capture.getFaceCompareResult());
|
|
|
okInfo.setFacelivenessResult(capture.getFacelivenessResult());
|
|
|
+ okInfo.setCreationTime(capture.getCreationTime());
|
|
|
|
|
|
okCaptures.add(okInfo);
|
|
|
}
|
|
|
|
|
|
// 过滤单条数据
|
|
|
- /*Map<Long, List<ExamCaptureInfo>> groupCaptures = okCaptures.stream().collect(Collectors.groupingBy(ExamCaptureInfo::getExamStudentId));
|
|
|
+ Map<Long, List<ExamCaptureInfo>> groupCaptures = okCaptures.stream().collect(Collectors.groupingBy(ExamCaptureInfo::getExamStudentId));
|
|
|
List<ExamCaptureInfo> finalCaptures = new ArrayList<>();
|
|
|
for (Map.Entry<Long, List<ExamCaptureInfo>> entry : groupCaptures.entrySet()) {
|
|
|
- if (entry.getValue().size() > 1) {
|
|
|
- finalCaptures.addAll(entry.getValue());
|
|
|
+ if (entry.getValue().size() <= 1) {
|
|
|
+ System.out.println("examStudentId:" + entry.getKey() + " captureSize:" + entry.getValue().size());
|
|
|
+ continue;
|
|
|
}
|
|
|
- }*/
|
|
|
+
|
|
|
+ finalCaptures.addAll(entry.getValue());
|
|
|
+ }
|
|
|
|
|
|
log.info(String.format("curExamRecordDataSize = %s, curCaptureSize = %s, okCaptures = %s, finalCaptures = %s",
|
|
|
- examRecords.size(), captures.size(), okCaptures.size(), okCaptures.size()));
|
|
|
- return okCaptures;
|
|
|
+ examRecords.size(), captures.size(), okCaptures.size(), finalCaptures.size()));
|
|
|
+
|
|
|
+ // return okCaptures;
|
|
|
+ return finalCaptures;
|
|
|
}
|
|
|
|
|
|
private String fixPhotoUrl(String url) {
|