|
@@ -43,6 +43,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
@@ -641,6 +642,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
public void disposeExamStudentByExaminationExcel(List<ExaminationImportDto> dataList, Long userId, SysUser sysUser) throws IllegalAccessException {
|
|
|
List<ExamStudent> examStudentList = new ArrayList<>();
|
|
|
List<BasicStudentExtrasParam> basicStudentExtrasParamList = new ArrayList<>();
|
|
|
+ Map<String, Integer> ticketNumberCodeMap = new HashMap<>();
|
|
|
for (ExaminationImportDto examinationImportDto : dataList) {
|
|
|
Long schoolId = examinationImportDto.getSchoolId();
|
|
|
Long printPlanId = examinationImportDto.getPrintPlanId();
|
|
@@ -659,6 +661,12 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
String majorName = examinationImportDto.getMajorName();
|
|
|
String clazzName = examinationImportDto.getClazzName();
|
|
|
|
|
|
+ if (ticketNumberCodeMap.containsKey(ticketNumber)) {
|
|
|
+ ticketNumberCodeMap.put(ticketNumber, ticketNumberCodeMap.get(ticketNumber) + 1);
|
|
|
+ } else {
|
|
|
+ ticketNumberCodeMap.put(ticketNumber, 1);
|
|
|
+ }
|
|
|
+
|
|
|
List<FieldsDto> fieldsDtoList = examinationImportDto.getSecondaryFieldList();
|
|
|
List<ExtendFieldsDto> extendFieldsDtoList = this.getExtendFieldsByFields(fieldsDtoList);
|
|
|
List<ExamDetail> examDetailList = this.list(new QueryWrapper<ExamDetail>().lambda()
|
|
@@ -709,6 +717,13 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
basicStudentExtrasParam.setClazzName(clazzName);
|
|
|
basicStudentExtrasParamList.add(basicStudentExtrasParam);
|
|
|
}
|
|
|
+
|
|
|
+ // 校验准考证号是否重复
|
|
|
+ List<String> stringList = ticketNumberCodeMap.entrySet().stream().filter(m -> m.getValue().intValue() > 1).map(m -> String.format("准考证号[%s]有%d条重复数据", m.getKey(), m.getValue().intValue())).collect(Collectors.toList());
|
|
|
+ if (!stringList.isEmpty()) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(String.join(",", stringList));
|
|
|
+ }
|
|
|
+
|
|
|
// 更新基础学生表和附加数据
|
|
|
basicStudentService.saveBasicStudentWithExtrasList(basicStudentExtrasParamList, sysUser);
|
|
|
for (ExamStudent examStudent : examStudentList) {
|