|
@@ -43,7 +43,6 @@ 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;
|
|
|
|
|
@@ -83,6 +82,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
@Resource
|
|
|
private BasicStudentService basicStudentService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private BasicExamService basicExamService;
|
|
|
+
|
|
|
@Resource
|
|
|
private SysOrgService sysOrgService;
|
|
|
|
|
@@ -639,10 +641,16 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public void disposeExamStudentByExaminationExcel(List<ExaminationImportDto> dataList, Long userId, SysUser sysUser) throws IllegalAccessException {
|
|
|
+ public void disposeExamStudentByExaminationExcel(Long examId, List<ExaminationImportDto> dataList, Long userId, SysUser sysUser) throws IllegalAccessException {
|
|
|
+ BasicExam basicExam = basicExamService.getById(examId);
|
|
|
+ // 查询学期下所有考务数据的准考证号集合
|
|
|
+ List<String> examStudentTicketNumberList = examStudentService.listTicketNumberBySemesterId(basicExam.getSemesterId());
|
|
|
+
|
|
|
List<ExamStudent> examStudentList = new ArrayList<>();
|
|
|
List<BasicStudentExtrasParam> basicStudentExtrasParamList = new ArrayList<>();
|
|
|
Map<String, Integer> ticketNumberCodeMap = new HashMap<>();
|
|
|
+ Set<String> ticketNumberRepeatList = new HashSet<>();
|
|
|
+ StringJoiner stringJoiner = new StringJoiner(",");
|
|
|
for (ExaminationImportDto examinationImportDto : dataList) {
|
|
|
Long schoolId = examinationImportDto.getSchoolId();
|
|
|
Long printPlanId = examinationImportDto.getPrintPlanId();
|
|
@@ -667,6 +675,10 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
ticketNumberCodeMap.put(ticketNumber, 1);
|
|
|
}
|
|
|
|
|
|
+ if (!examStudentTicketNumberList.isEmpty() && examStudentTicketNumberList.contains(ticketNumber)) {
|
|
|
+ ticketNumberRepeatList.add(ticketNumber);
|
|
|
+ }
|
|
|
+
|
|
|
List<FieldsDto> fieldsDtoList = examinationImportDto.getSecondaryFieldList();
|
|
|
List<ExtendFieldsDto> extendFieldsDtoList = this.getExtendFieldsByFields(fieldsDtoList);
|
|
|
List<ExamDetail> examDetailList = this.list(new QueryWrapper<ExamDetail>().lambda()
|
|
@@ -721,7 +733,13 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
// 校验准考证号是否重复
|
|
|
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));
|
|
|
+ stringJoiner.add(String.join(",", stringList));
|
|
|
+ }
|
|
|
+ if (!ticketNumberRepeatList.isEmpty()) {
|
|
|
+ stringJoiner.add("考号[" + String.join(",", ticketNumberRepeatList) + "]在当前学期下已存在");
|
|
|
+ }
|
|
|
+ if (stringJoiner.toString().length() > 1) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(stringJoiner.toString());
|
|
|
}
|
|
|
|
|
|
// 更新基础学生表和附加数据
|