wangliang 2 tuần trước cách đây
mục cha
commit
fbfaea7f10

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

@@ -285,11 +285,13 @@ public class TRBasicInfoController {
             ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
             MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfoDb.getExamId(), trBasicInfoDb.getPaperNumber(), trBasicInfoDb.getCourseId());
             List<TRBasicInfo> trBasicInfoList = trBasicInfoService.queryBasicInfoAll(trBasicInfoDb.getCultureProgramId(), trBasicInfoDb.getCourseId(), trBasicInfoDb.getPaperNumber(), trBasicInfoDb.getExamId());
-            for (TRBasicInfo t : trBasicInfoList) {
-                ReportCourseBasicInfoDto reportCourseBasicInfoDto = trBasicInfoService.setBasicInfo(trBasicInfo, obeCourseOutline, markPaper, obeCourseWeightResult);
-                t.updateInfo(trBasicInfo, reportCourseBasicInfoDto, sysUser.getId());
+            List<TRBasicInfo> trBasicInfoFilterList = trBasicInfoList.stream().filter(s -> s.getId().longValue() == trBasicInfo.getId().longValue()).collect(Collectors.toList());
+            if (CollectionUtils.isEmpty(trBasicInfoFilterList)) {
+                throw ExceptionResultEnum.ERROR.exception("未过滤到报告信息");
             }
-            trBasicInfoService.saveOrUpdateBatch(trBasicInfoList);
+            ReportCourseBasicInfoDto reportCourseBasicInfoDto = trBasicInfoService.setBasicInfo(trBasicInfo, obeCourseOutline, markPaper, obeCourseWeightResult);
+            trBasicInfoFilterList.get(0).updateInfo(trBasicInfo, reportCourseBasicInfoDto, sysUser.getId());
+            trBasicInfoService.saveOrUpdate(trBasicInfoFilterList.get(0));
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof DuplicateKeyException) {

+ 2 - 1
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/entity/TRBasicInfo.java

@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.Objects;
 
 /**
  * <p>
@@ -181,7 +182,7 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
     public void updateInfo(TRBasicInfo trBasicInfo, ReportCourseBasicInfoDto reportCourseBasicInfoDto, Long userId) {
         this.setValue(trBasicInfo);
         this.college = reportCourseBasicInfoDto.getCollege();
-        this.teachingObject = reportCourseBasicInfoDto.getTeachingObject();
+        this.teachingObject = Objects.nonNull(trBasicInfo) && Objects.nonNull(trBasicInfo.getTeachingObject()) && !Objects.equals(trBasicInfo.getTeachingObject(), "") ? trBasicInfo.getTeachingObject() : reportCourseBasicInfoDto.getTeachingObject();
         this.courseDegree = reportCourseBasicInfoDto.getCourseDegree();
         this.profession = reportCourseBasicInfoDto.getProfession();
         updateInfo(userId);