wangliang преди 1 година
родител
ревизия
ee62d2741b

+ 59 - 59
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportCourseTargetDto.java

@@ -1,59 +1,59 @@
-package com.qmth.distributed.print.business.bean.dto.report;
-
-import io.swagger.annotations.ApiModelProperty;
-import org.jetbrains.annotations.NotNull;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * @Description: 报告课程目标dto
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2024/2/26
- */
-public class ReportCourseTargetDto implements Serializable, Comparable<ReportCourseTargetDto> {
-
-    @ApiModelProperty(value = "课程目标id")
-    private Long targetId;
-
-    @ApiModelProperty(value = "课程目标值")
-    private CourseTargetValueDto courseTargetValueDto;
-
-    public ReportCourseTargetDto() {
-
-    }
-
-    public ReportCourseTargetDto(Long targetId, CourseTargetValueDto courseTargetValueDto) {
-        this.targetId = targetId;
-        this.courseTargetValueDto = courseTargetValueDto;
-    }
-
-    public Long getTargetId() {
-        return targetId;
-    }
-
-    public void setTargetId(Long targetId) {
-        this.targetId = targetId;
-    }
-
-    public CourseTargetValueDto getCourseTargetValueDto() {
-        return courseTargetValueDto;
-    }
-
-    public void setCourseTargetValueDto(CourseTargetValueDto courseTargetValueDto) {
-        this.courseTargetValueDto = courseTargetValueDto;
-    }
-
-    @Override
-    public int compareTo(@NotNull ReportCourseTargetDto o) {
-        if (o.getTargetId().longValue() < this.getTargetId().longValue()) {
-            return 1;
-        } else if (o.getTargetId().longValue() > this.getTargetId().longValue()) {
-            return -1;
-        } else {
-            return 0;
-        }
-    }
-}
+//package com.qmth.distributed.print.business.bean.dto.report;
+//
+//import io.swagger.annotations.ApiModelProperty;
+//import org.jetbrains.annotations.NotNull;
+//
+//import java.io.Serializable;
+//import java.util.List;
+//
+///**
+// * @Description: 报告课程目标dto
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2024/2/26
+// */
+//public class ReportCourseTargetDto implements Serializable, Comparable<ReportCourseTargetDto> {
+//
+//    @ApiModelProperty(value = "课程目标id")
+//    private Long targetId;
+//
+//    @ApiModelProperty(value = "课程目标值")
+//    private CourseTargetValueDto courseTargetValueDto;
+//
+//    public ReportCourseTargetDto() {
+//
+//    }
+//
+//    public ReportCourseTargetDto(Long targetId, CourseTargetValueDto courseTargetValueDto) {
+//        this.targetId = targetId;
+//        this.courseTargetValueDto = courseTargetValueDto;
+//    }
+//
+//    public Long getTargetId() {
+//        return targetId;
+//    }
+//
+//    public void setTargetId(Long targetId) {
+//        this.targetId = targetId;
+//    }
+//
+//    public CourseTargetValueDto getCourseTargetValueDto() {
+//        return courseTargetValueDto;
+//    }
+//
+//    public void setCourseTargetValueDto(CourseTargetValueDto courseTargetValueDto) {
+//        this.courseTargetValueDto = courseTargetValueDto;
+//    }
+//
+//    @Override
+//    public int compareTo(@NotNull ReportCourseTargetDto o) {
+//        if (o.getTargetId().longValue() < this.getTargetId().longValue()) {
+//            return 1;
+//        } else if (o.getTargetId().longValue() > this.getTargetId().longValue()) {
+//            return -1;
+//        } else {
+//            return 0;
+//        }
+//    }
+//}

+ 2 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRBasicInfoServiceImpl.java

@@ -391,13 +391,11 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
         }
         if (Objects.nonNull(paramsMap.get("targetMap"))) {
             Map<Long, CourseTargetValueDto> targetMap = (Map<Long, CourseTargetValueDto>) paramsMap.get("targetMap");
-            List<ReportCourseTargetDto> reportCourseTargetDtoList = new ArrayList<>();
-            targetMap.forEach((k, v) -> {
-                reportCourseTargetDtoList.add(new ReportCourseTargetDto(k, v));
-            });
+            List<CourseTargetValueDto> reportCourseTargetDtoList = new ArrayList<>(targetMap.values());
             Collections.sort(reportCourseTargetDtoList);
             trBasicInfo.setCourseEvaluationResultDetail(JacksonUtil.parseJson(reportCourseTargetDtoList));
         }
+//        trBasicInfo.setCourseEvaluationResultDetail(JacksonUtil.parseJson(paramsMap));
 
         trBasicInfo.getReportResult().setCommonInfo(new ReportCommonDto(markPaper.getExamId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber()));
         return trBasicInfo;

+ 8 - 15
distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java

@@ -173,8 +173,8 @@ public class TRBasicInfoController {
         CourseReportBean courseReportBean = new CourseReportBean(trBasicInfo.getOpenTime() + "《测试输出报告》", courseBasicBean);
 
         //targetMap
-        List<ReportCourseTargetDto> reportCourseTargetDtoList = JSONArray.parseArray(trBasicInfo.getCourseEvaluationResultDetail(), ReportCourseTargetDto.class);
-        Map<Long, ReportCourseTargetDto> courseTargetValueDtoMap = reportCourseTargetDtoList.stream().collect(Collectors.toMap(ReportCourseTargetDto::getTargetId, Function.identity(), (dto1, dto2) -> dto1));
+        List<CourseTargetValueDto> courseTargetValueDtoList = JSONArray.parseArray(trBasicInfo.getCourseEvaluationResultDetail(), CourseTargetValueDto.class);
+//        Map<Long, CourseTargetValueDto> courseTargetValueDtoMap = courseTargetValueDtoList.stream().collect(Collectors.toMap(CourseTargetValueDto::getTargetId, Function.identity(), (dto1, dto2) -> dto1));
 
         //table1课程目标目标与毕业要求指标点的对应关系
         RowRenderData header1 = Rows.of("课程目标", "毕业要求指标点").bgColor("F2F2F2").center().create();
@@ -185,9 +185,8 @@ public class TRBasicInfoController {
         header2_2List.addAll(header2_1List);
         header2_1List.add("考核/评价环节及目标分值");
 
-        for (int i = 0; i < reportCourseTargetDtoList.size(); i++) {
-            ReportCourseTargetDto reportCourseTargetDto = reportCourseTargetDtoList.get(i);
-            CourseTargetValueDto courseTargetValueDto = reportCourseTargetDto.getCourseTargetValueDto();
+        for (int i = 0; i < courseTargetValueDtoList.size(); i++) {
+            CourseTargetValueDto courseTargetValueDto = courseTargetValueDtoList.get(i);
             Map<String, BigDecimal> usualScoreWeightMap = courseTargetValueDto.getUsualScoreWeight();
             usualScoreWeightMap.forEach((k1, v1) -> {
                 header2_1List.add("");
@@ -216,9 +215,8 @@ public class TRBasicInfoController {
         AtomicReference<BigDecimal> examSum = new AtomicReference<>(new BigDecimal(0));
         AtomicReference<BigDecimal> targetSum2 = new AtomicReference<>(new BigDecimal(0));
         AtomicInteger atomicReference = new AtomicInteger(0);
-        for (int i = 0; i < reportCourseTargetDtoList.size(); i++) {
-            ReportCourseTargetDto reportCourseTargetDto = reportCourseTargetDtoList.get(i);
-            CourseTargetValueDto courseTargetValueDto = reportCourseTargetDto.getCourseTargetValueDto();
+        for (int i = 0; i < courseTargetValueDtoList.size(); i++) {
+            CourseTargetValueDto courseTargetValueDto = courseTargetValueDtoList.get(i);
             CourseTargetTableBean2 courseTargetTableBean2 = new CourseTargetTableBean2(courseTargetValueDto.getTargetName(), courseTargetValueDto.getGraduationRequirement(), new BigDecimal(atomicReference.get() + 2), new BigDecimal(atomicReference.get() + 3), new BigDecimal(atomicReference.get() + 4), new BigDecimal(atomicReference.get() + 5), new BigDecimal(atomicReference.get() + 10));
             bigDecimalExpressionSum.set(bigDecimalExpressionSum.get().add(courseTargetTableBean2.getExpression()));
             homeworkSum.set(homeworkSum.get().add(courseTargetTableBean2.getHomework()));
@@ -298,9 +296,8 @@ public class TRBasicInfoController {
         List<CourseTargetTableBean4> courseTargetTableBean4List = new ArrayList<>();
         BigDecimal sum4 = new BigDecimal(0);
         Integer seq4 = 0;
-        for (int i = 0; i < reportCourseTargetDtoList.size(); i++) {
-            ReportCourseTargetDto reportCourseTargetDto = reportCourseTargetDtoList.get(i);
-            CourseTargetValueDto courseTargetValueDto = reportCourseTargetDto.getCourseTargetValueDto();
+        for (int i = 0; i < courseTargetValueDtoList.size(); i++) {
+            CourseTargetValueDto courseTargetValueDto = courseTargetValueDtoList.get(i);
             List<DimensionDto> dimensionDtoList = courseTargetValueDto.getDimensionList();
             for (DimensionDto dimensionDto : dimensionDtoList) {
                 sum4 = sum4.add(new BigDecimal(dimensionDto.getDimensionScore()));
@@ -365,7 +362,6 @@ public class TRBasicInfoController {
 
             List<ExamStudentTableBean> examStudentTableBeanList = new ArrayList<>();
             int seq5 = 0;
-//            AtomicInteger usualScoreSize = new AtomicInteger(1);
             Map<Long, Integer> targetUsualScoreSizeMap = new HashMap<>();
             trExamStudentList.remove(trExamStudentList.size() - 1);
             TRExamStudent trExamStudentTemp = trExamStudentList.get(0);
@@ -492,12 +488,9 @@ public class TRBasicInfoController {
                     }
                     examStudent_cells_3.add(Cells.of(e.getSumScore().toString()).create());
                     examStudent_cells_4.add(Cells.of(e.getSumScore().toString()).create());
-                    examStudent_cells_3.add(Cells.of("").create());
-                    examStudent_cells_4.add(Cells.of("").create());
                     examStudent_cells_5.add(Cells.of("").create());
                 }
                 examStudent_cells.add(Cells.of(e.getSumScore().toString()).create());
-                examStudent_cells.add(Cells.of("").create());
                 examStudent_row.setCells(examStudent_cells);
                 examStudent_row.setRowStyle(this.getRowStyle());
                 rowRenderDataExamStudent[i + 2] = examStudent_row;