|
@@ -67,6 +67,7 @@ import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.concurrent.ConcurrentMap;
|
|
import java.util.concurrent.ConcurrentMap;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
+import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -150,17 +151,29 @@ public class TRBasicInfoController {
|
|
MarkPaper markPaper = printCommonService.getMarkPaper(examId, tcPaperStruct.getPaperNumber(), courseId);
|
|
MarkPaper markPaper = printCommonService.getMarkPaper(examId, tcPaperStruct.getPaperNumber(), courseId);
|
|
if (CollectionUtils.isEmpty(trBasicInfoList)) {
|
|
if (CollectionUtils.isEmpty(trBasicInfoList)) {
|
|
trBasicInfoList = trBasicInfoService.getReportView(markPaper, obeCourseWeightResult, cultureProgramId, courseId, examId, paperNumber);
|
|
trBasicInfoList = trBasicInfoService.getReportView(markPaper, obeCourseWeightResult, cultureProgramId, courseId, examId, paperNumber);
|
|
- List<TRBasicInfo> trBasicInfoCurrentList = trBasicInfoList.stream().filter(s -> s.getCreateId().longValue() == sysUser.getId().longValue()).collect(Collectors.toList());
|
|
|
|
- if (CollectionUtils.isEmpty(trBasicInfoCurrentList)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("未找到报告信息,请确认成绩数据是否正常");
|
|
|
|
- }
|
|
|
|
trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, examId,
|
|
trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, examId,
|
|
Objects.nonNull(tcPaperStruct.getDimensionSign())
|
|
Objects.nonNull(tcPaperStruct.getDimensionSign())
|
|
&& tcPaperStruct.getDimensionSign().longValue()
|
|
&& tcPaperStruct.getDimensionSign().longValue()
|
|
!= obeCourseWeightResult.getDimensionSign().longValue());
|
|
!= obeCourseWeightResult.getDimensionSign().longValue());
|
|
trBasicInfoService.saveOrUpdateBatch(trBasicInfoList);
|
|
trBasicInfoService.saveOrUpdateBatch(trBasicInfoList);
|
|
- trBasicInfoList.clear();
|
|
|
|
- trBasicInfoList.addAll(trBasicInfoCurrentList);
|
|
|
|
|
|
+ List<TRBasicInfo> trBasicInfoListDb = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber, examId);
|
|
|
|
+ if (!CollectionUtils.isEmpty(trBasicInfoListDb)) {
|
|
|
|
+ List<TRBasicInfo> trBasicInfoTempList = new ArrayList<>(trBasicInfoList.size());
|
|
|
|
+ trBasicInfoTempList.addAll(trBasicInfoList);
|
|
|
|
+ Map<Long, TRBasicInfo> trBasicInfoMap = trBasicInfoTempList.stream().collect(Collectors.toMap(TRBasicInfo::getId, Function.identity(), (dto1, dto2) -> dto1));
|
|
|
|
+ trBasicInfoList.clear();
|
|
|
|
+ trBasicInfoList.addAll(trBasicInfoListDb);
|
|
|
|
+ List<TRBasicInfo> trBasicInfoFilterList = trBasicInfoListDb.stream().filter(s -> Objects.nonNull(s.getTeachClassName()) && Objects.equals(s.getTeachClassName(), SystemConstant.ALL)).collect(Collectors.toList());
|
|
|
|
+ if (!CollectionUtils.isEmpty(trBasicInfoFilterList)) {
|
|
|
|
+ trBasicInfoList.clear();
|
|
|
|
+ trBasicInfoList.addAll(trBasicInfoFilterList);
|
|
|
|
+ }
|
|
|
|
+ if (!CollectionUtils.isEmpty(trBasicInfoList)) {
|
|
|
|
+ trBasicInfoList.stream().peek(s -> s.setReportResult(trBasicInfoMap.get(s.getId()).getReportResult())).collect(Collectors.toList());
|
|
|
|
+ } else {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("未找到报告信息,请确认成绩数据是否正常");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
List<TRBasicInfo> trBasicInfoFilterList = trBasicInfoList.stream().filter(s -> Objects.nonNull(s.getTeachClassName()) && Objects.equals(s.getTeachClassName(), SystemConstant.ALL)).collect(Collectors.toList());
|
|
List<TRBasicInfo> trBasicInfoFilterList = trBasicInfoList.stream().filter(s -> Objects.nonNull(s.getTeachClassName()) && Objects.equals(s.getTeachClassName(), SystemConstant.ALL)).collect(Collectors.toList());
|
|
if (!CollectionUtils.isEmpty(trBasicInfoFilterList)) {
|
|
if (!CollectionUtils.isEmpty(trBasicInfoFilterList)) {
|