wangliang 7 ماه پیش
والد
کامیت
7c0d1f16b2

+ 19 - 6
distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TRBasicInfoController.java

@@ -67,6 +67,7 @@ import java.math.BigDecimal;
 import java.util.*;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -150,17 +151,29 @@ public class TRBasicInfoController {
         MarkPaper markPaper = printCommonService.getMarkPaper(examId, tcPaperStruct.getPaperNumber(), courseId);
         if (CollectionUtils.isEmpty(trBasicInfoList)) {
             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,
                     Objects.nonNull(tcPaperStruct.getDimensionSign())
                             && tcPaperStruct.getDimensionSign().longValue()
                             != obeCourseWeightResult.getDimensionSign().longValue());
             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 {
             List<TRBasicInfo> trBasicInfoFilterList = trBasicInfoList.stream().filter(s -> Objects.nonNull(s.getTeachClassName()) && Objects.equals(s.getTeachClassName(), SystemConstant.ALL)).collect(Collectors.toList());
             if (!CollectionUtils.isEmpty(trBasicInfoFilterList)) {

+ 4 - 1
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TCFinalScoreServiceImpl.java

@@ -426,7 +426,10 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
                         trBasicInfoService.clearReportData(t.getCultureProgramId(), t.getCourseId(), t.getPaperNumber(), t.getExamId(), true);
                     }
                 }
-                if (!CollectionUtils.isEmpty(dpr.getOrgIdSet()) || Objects.nonNull(dpr.getCourseUserId())) {
+                if ((CollectionUtils.isEmpty(dpr.getOrgIdSet()) && Objects.isNull(dpr.getCourseUserId()) &&
+                        Objects.isNull(dpr.getRequestUserId()))
+                        || !CollectionUtils.isEmpty(dpr.getOrgIdSet())
+                        || Objects.nonNull(dpr.getCourseUserId())) {
                     successData.add("共同步").add(tcFinalScoreList.size() + "").add("条数据");
                     List<TCFinalScore> tcFinalScoreDbSourceList = tcFinalScoreService.queryFinalScore(cultureProgramId,
                             courseId, paperNumber, examId);