瀏覽代碼

平时成绩导出

wangliang 10 月之前
父節點
當前提交
2514307624

+ 5 - 1
distributed-print-business/src/main/resources/db/log/wl.sql

@@ -8,4 +8,8 @@ WHERE id=2025;
 
 INSERT INTO sys_privilege
 (id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
-VALUES(2110, '导出平时成绩报告', '/api/admin/course/degree/report/usual_score/export', 'URL', 2025, 1, 'AUTH', NULL, 1, 1, 1);
+VALUES(2110, '导出平时成绩报告', '/api/admin/course/degree/report/usual_score/export', 'URL', 2025, 1, 'AUTH', NULL, 1, 1, 1);
+
+-- 2024.08.27
+ALTER TABLE t_r_basic_info DROP COLUMN finish_points;
+ALTER TABLE t_r_basic_info DROP COLUMN requirement_points;

+ 46 - 25
distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TRBasicInfoController.java

@@ -481,8 +481,7 @@ public class TRBasicInfoController {
             throw ExceptionResultEnum.ERROR.exception("未找到学生信息");
         }
 
-        Map<Long, BigDecimal> examStudentMatrixDegree = new LinkedHashMap<>(),
-                examStudentSumMatrixDegree = new LinkedHashMap<>();
+        Map<Long, BigDecimal> examStudentMatrixDegree = new LinkedHashMap<>(), examStudentSumMatrixDegree = new LinkedHashMap<>();
         BigDecimal examStudentSumTargetWeight = new BigDecimal(0);
         LinkedMultiValueMap<String, String> courseTargetMap = new LinkedMultiValueMap<>();
         LinkedMultiValueMap<Long, BigDecimal> examStudentMatrixDegreeMap = new LinkedMultiValueMap<>();
@@ -523,7 +522,7 @@ public class TRBasicInfoController {
                                 examStudentMatrixDegree.put(t.getId(), matrixDegree);
 
                                 examStudentSumTargetWeight = examStudentSumTargetWeight.setScale(2, BigDecimal.ROUND_HALF_UP);
-                                BigDecimal sumMatrixDegree = SystemConstant.PERCENT.multiply(matrixDegree).divide(examStudentSumTargetWeight, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
+                                BigDecimal sumMatrixDegree = SystemConstant.PERCENT.multiply(matrixDegree).divide(examStudentSumTargetWeight, 2, BigDecimal.ROUND_HALF_UP);
                                 examStudentSumMatrixDegree.put(t.getId(), sumMatrixDegree);
                             }
                         }
@@ -534,25 +533,7 @@ public class TRBasicInfoController {
 
         SXSSFWorkbook wb = new SXSSFWorkbook();
         Sheet sheet = wb.createSheet("过程考核");
-        CellStyle headerStyle = wb.createCellStyle();
-        headerStyle.setAlignment(HorizontalAlignment.CENTER); // 水平居中格式
-        headerStyle.setVerticalAlignment(VerticalAlignment.CENTER); //垂直居中
-        headerStyle.setBorderRight(BorderStyle.THIN);
-        headerStyle.setRightBorderColor(IndexedColors.BLACK.getIndex());
-        headerStyle.setBorderLeft(BorderStyle.THIN);
-        headerStyle.setLeftBorderColor(IndexedColors.BLACK.getIndex());
-        headerStyle.setBorderTop(BorderStyle.THIN);
-        headerStyle.setTopBorderColor(IndexedColors.BLACK.getIndex());
-        headerStyle.setBorderBottom(BorderStyle.THIN);
-        headerStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex());
-        // 背景颜色
-        headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-        headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
-
-        Font defaultFont = wb.createFont();
-        defaultFont.setFontHeightInPoints((short) 12);
-        defaultFont.setBold(true);
-        headerStyle.setFont(defaultFont);
+        CellStyle headerStyle = this.createHeadStyle(wb);
 
         Row rowHeadOne = sheet.createRow(0);
         Row rowHeadTwo = sheet.createRow(1);
@@ -601,9 +582,7 @@ public class TRBasicInfoController {
         //第二行
         this.drawExcelFixedHead(rowHeadTwo, headerStyle, sheet, "课程:" + trBasicInfo.getCourseName() + "     班级:" + (Objects.nonNull(trBasicInfo.getTeachingObject()) ? trBasicInfo.getTeachingObject() : "无") + "     任课教师:" + (Objects.nonNull(trBasicInfo.getTeacher()) ? trBasicInfo.getTeacher() : "无") + "     学期:" + trBasicInfo.getOpenTime(), 0, 1, 1, 0, cellTwoIndex.get() - 1, sheet.getColumnWidth(cellTwoIndex.get()) * 17);
 
-        CellStyle styleExamStudent = wb.createCellStyle();
-        styleExamStudent.setAlignment(HorizontalAlignment.LEFT);
-        styleExamStudent.setVerticalAlignment(VerticalAlignment.CENTER);
+        CellStyle styleExamStudent = this.createRowStyle(wb);
         AtomicInteger rowStudentIndex = new AtomicInteger(4);
         for (TRExamStudent t : trExamStudentList) {
             Row rowStudent = sheet.createRow(rowStudentIndex.get());
@@ -622,6 +601,48 @@ public class TRBasicInfoController {
         ExcelUtil.exportEXCEL(fileName, wb, ServletUtil.getResponse());
     }
 
+    /**
+     * 创建行样式
+     *
+     * @param wb
+     * @return
+     */
+    protected CellStyle createRowStyle(SXSSFWorkbook wb) {
+        CellStyle styleExamStudent = wb.createCellStyle();
+        styleExamStudent.setAlignment(HorizontalAlignment.LEFT);
+        styleExamStudent.setVerticalAlignment(VerticalAlignment.CENTER);
+        return styleExamStudent;
+    }
+
+    /**
+     * 创建头样式
+     *
+     * @param wb
+     * @return
+     */
+    protected CellStyle createHeadStyle(SXSSFWorkbook wb) {
+        CellStyle headerStyle = wb.createCellStyle();
+        headerStyle.setAlignment(HorizontalAlignment.CENTER); // 水平居中格式
+        headerStyle.setVerticalAlignment(VerticalAlignment.CENTER); //垂直居中
+        headerStyle.setBorderRight(BorderStyle.THIN);
+        headerStyle.setRightBorderColor(IndexedColors.BLACK.getIndex());
+        headerStyle.setBorderLeft(BorderStyle.THIN);
+        headerStyle.setLeftBorderColor(IndexedColors.BLACK.getIndex());
+        headerStyle.setBorderTop(BorderStyle.THIN);
+        headerStyle.setTopBorderColor(IndexedColors.BLACK.getIndex());
+        headerStyle.setBorderBottom(BorderStyle.THIN);
+        headerStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex());
+        // 背景颜色
+        headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
+
+        Font defaultFont = wb.createFont();
+        defaultFont.setFontHeightInPoints((short) 12);
+        defaultFont.setBold(true);
+        headerStyle.setFont(defaultFont);
+        return headerStyle;
+    }
+
     /**
      * 创建固定行表头
      *

二進制
distributed-print/src/main/resources/static/course_degree_report.docx


+ 73 - 0
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/been/obe/CourseSuggestDto.java

@@ -0,0 +1,73 @@
+package com.qmth.teachcloud.obe.been.obe;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 课程建议dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2024/8/27
+ */
+public class CourseSuggestDto implements Serializable {
+
+    @ApiModelProperty("目标id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long targetId;
+
+    @ApiModelProperty("目标名称")
+    private String targetName;
+
+    @ApiModelProperty("达成情况")
+    private String finishPoints;
+
+    @ApiModelProperty("课程支撑毕业要求达成情况评价")
+    private String requirementPoints;
+
+    @ApiModelProperty("课程持续改进")
+    private String courseSuggest;
+
+    public Long getTargetId() {
+        return targetId;
+    }
+
+    public void setTargetId(Long targetId) {
+        this.targetId = targetId;
+    }
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(String targetName) {
+        this.targetName = targetName;
+    }
+
+    public String getFinishPoints() {
+        return finishPoints;
+    }
+
+    public void setFinishPoints(String finishPoints) {
+        this.finishPoints = finishPoints;
+    }
+
+    public String getRequirementPoints() {
+        return requirementPoints;
+    }
+
+    public void setRequirementPoints(String requirementPoints) {
+        this.requirementPoints = requirementPoints;
+    }
+
+    public String getCourseSuggest() {
+        return courseSuggest;
+    }
+
+    public void setCourseSuggest(String courseSuggest) {
+        this.courseSuggest = courseSuggest;
+    }
+}

+ 4 - 28
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/been/result/report/ReportResult.java

@@ -36,14 +36,6 @@ public class ReportResult implements Serializable {
     @TableField(exist = false)
     private ReportCourseEvaluationResultDetailDto courseEvaluationResultDetailInfo;
 
-    @ApiModelProperty(value = "达成情况")
-    @TableField(exist = false)
-    private String finishPoints;
-
-    @ApiModelProperty(value = "课程支撑毕业要求达成情况评价")
-    @TableField(exist = false)
-    private String requirementPoints;
-
     @ApiModelProperty(value = "课程持续改进")
     @TableField(exist = false)
     private String courseSuggest;
@@ -52,34 +44,18 @@ public class ReportResult implements Serializable {
 
     }
 
-    public ReportResult(ReportCommonDto commonInfo, ReportCourseBasicInfoDto courseBasicInfo, ReportCourseEvaluationSpreadDto courseEvaluationSpreadInfo
-            , ReportCourseEvaluationResultDto courseEvaluationResultInfo, ReportCourseEvaluationResultDetailDto courseEvaluationResultDetailInfo, TRBasicInfo trBasicInfo) {
+    public ReportResult(ReportCommonDto commonInfo, ReportCourseBasicInfoDto courseBasicInfo,
+                        ReportCourseEvaluationSpreadDto courseEvaluationSpreadInfo,
+                        ReportCourseEvaluationResultDto courseEvaluationResultInfo,
+                        ReportCourseEvaluationResultDetailDto courseEvaluationResultDetailInfo, TRBasicInfo trBasicInfo) {
         this.commonInfo = commonInfo;
         this.courseBasicInfo = courseBasicInfo;
         this.courseEvaluationSpreadInfo = courseEvaluationSpreadInfo;
         this.courseEvaluationResultInfo = courseEvaluationResultInfo;
         this.courseEvaluationResultDetailInfo = courseEvaluationResultDetailInfo;
-        this.finishPoints = trBasicInfo.getFinishPoints();
-        this.requirementPoints = trBasicInfo.getRequirementPoints();
         this.courseSuggest = trBasicInfo.getCourseSuggest();
     }
 
-    public String getFinishPoints() {
-        return finishPoints;
-    }
-
-    public void setFinishPoints(String finishPoints) {
-        this.finishPoints = finishPoints;
-    }
-
-    public String getRequirementPoints() {
-        return requirementPoints;
-    }
-
-    public void setRequirementPoints(String requirementPoints) {
-        this.requirementPoints = requirementPoints;
-    }
-
     public String getCourseSuggest() {
         return courseSuggest;
     }

+ 13 - 30
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/been/result/report/word/CourseBasicBean.java

@@ -1,13 +1,17 @@
 package com.qmth.teachcloud.obe.been.result.report.word;
 
 import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSONArray;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.obe.been.obe.CourseSuggestDto;
 import com.qmth.teachcloud.obe.entity.TRBasicInfo;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
+import java.util.Objects;
 
 /**
  * @Description: 课程基本信息bean
@@ -72,14 +76,8 @@ public class CourseBasicBean implements Serializable {
     @ApiModelProperty(value = "任课老师")
     private String teacher;
 
-    @ApiModelProperty(value = "达成情况")
-    private String finishPoints;
-
-    @ApiModelProperty(value = "课程支撑毕业要求达成情况评价")
-    private String requirementPoints;
-
     @ApiModelProperty(value = "课程持续改进")
-    private String courseSuggest;
+    private List<CourseSuggestDto> courseSuggestList;
 
     public CourseBasicBean() {
 
@@ -99,36 +97,21 @@ public class CourseBasicBean implements Serializable {
         this.profession = trBasicInfo.getProfession();
         this.openTime = trBasicInfo.getOpenTime();
         this.teachingObject = trBasicInfo.getTeachingObject();
-        this.finishPoints = trBasicInfo.getFinishPoints();
-        this.requirementPoints = trBasicInfo.getRequirementPoints();
-        this.courseSuggest = trBasicInfo.getCourseSuggest();
+        if (Objects.nonNull(trBasicInfo.getCourseSuggest())) {
+            List<CourseSuggestDto> courseSuggestDtoList = JSONArray.parseArray(trBasicInfo.getCourseSuggest(), CourseSuggestDto.class);
+            this.courseSuggestList = courseSuggestDtoList;
+        }
         this.courseEnName = trBasicInfo.getCourseEnName();
         this.participantCount = trBasicInfo.getParticipantCount();
         this.teacher = trBasicInfo.getTeacher();
     }
 
-    public String getFinishPoints() {
-        return finishPoints;
-    }
-
-    public void setFinishPoints(String finishPoints) {
-        this.finishPoints = finishPoints;
-    }
-
-    public String getRequirementPoints() {
-        return requirementPoints;
-    }
-
-    public void setRequirementPoints(String requirementPoints) {
-        this.requirementPoints = requirementPoints;
-    }
-
-    public String getCourseSuggest() {
-        return courseSuggest;
+    public List<CourseSuggestDto> getCourseSuggestList() {
+        return courseSuggestList;
     }
 
-    public void setCourseSuggest(String courseSuggest) {
-        this.courseSuggest = courseSuggest;
+    public void setCourseSuggestList(List<CourseSuggestDto> courseSuggestList) {
+        this.courseSuggestList = courseSuggestList;
     }
 
     public Integer getParticipantCount() {

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

@@ -100,12 +100,6 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "课程考核成绩评价明细结果")
     private String courseEvaluationResultDetail;
 
-    @ApiModelProperty(value = "达成情况")
-    private String finishPoints;
-
-    @ApiModelProperty(value = "课程支撑毕业要求达成情况评价")
-    private String requirementPoints;
-
     @ApiModelProperty(value = "课程持续改进")
     private String courseSuggest;
 
@@ -122,7 +116,7 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
 
     public TRBasicInfo(Long cultureProgramId, Long courseId, String courseCode, String courseName,
                        String paperNumber, String openTime,
-                       Long userId, String finishPoints, String requirementPoints,
+                       Long userId,
                        String courseSuggest, String courseEnName, Long examId,
                        ReportCourseBasicInfoDto reportCourseBasicInfoDto) {
         insertInfo(userId);
@@ -138,8 +132,6 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.profession = reportCourseBasicInfoDto.getProfession();
         this.courseDegree = reportCourseBasicInfoDto.getCourseDegree();
         this.courseEnName = courseEnName;
-        this.finishPoints = finishPoints;
-        this.requirementPoints = requirementPoints;
         this.courseSuggest = courseSuggest;
         this.examId = examId;
         this.college = reportCourseBasicInfoDto.getCollege();
@@ -153,22 +145,6 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.courseEnName = courseEnName;
     }
 
-    public String getFinishPoints() {
-        return finishPoints;
-    }
-
-    public void setFinishPoints(String finishPoints) {
-        this.finishPoints = finishPoints;
-    }
-
-    public String getRequirementPoints() {
-        return requirementPoints;
-    }
-
-    public void setRequirementPoints(String requirementPoints) {
-        this.requirementPoints = requirementPoints;
-    }
-
     public String getCourseSuggest() {
         return courseSuggest;
     }
@@ -233,8 +209,6 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.profession = trBasicInfo.getProfession();
         this.courseEnName = trBasicInfo.getCourseEnName();
         this.college = trBasicInfo.getCollege();
-        this.finishPoints = trBasicInfo.getFinishPoints();
-        this.requirementPoints = trBasicInfo.getRequirementPoints();
         this.courseSuggest = trBasicInfo.getCourseSuggest();
     }
 
@@ -246,16 +220,13 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.teachingObject = trBasicInfo.getTeachingObject();
         this.teacher = trBasicInfo.getTeacher();
         this.director = trBasicInfo.getDirector();
-        this.finishPoints = trBasicInfo.getFinishPoints();
-        this.requirementPoints = trBasicInfo.getRequirementPoints();
         this.courseSuggest = trBasicInfo.getCourseSuggest();
     }
 
     public void setBasicInfo(Long examId, String courseCode, String courseName, String paperNumber, String openTime,
                              Long cultureProgramId,
                              Long courseId, String courseEnName,
-                             String finishPoints, String requirementPoints, String courseSuggest,
-                             ReportCourseBasicInfoDto reportCourseBasicInfoDto) {
+                             String courseSuggest, ReportCourseBasicInfoDto reportCourseBasicInfoDto) {
         this.examId = examId;
         this.courseCode = courseCode;
         this.courseName = courseName;
@@ -271,8 +242,6 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.profession = reportCourseBasicInfoDto.getProfession();
         this.courseEnName = courseEnName;
         this.college = reportCourseBasicInfoDto.getCollege();
-        this.finishPoints = finishPoints;
-        this.requirementPoints = requirementPoints;
         this.courseSuggest = courseSuggest;
     }
 

+ 2 - 2
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TRBasicInfoServiceImpl.java

@@ -442,9 +442,9 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
             throw ExceptionResultEnum.ERROR.exception("未找到试卷蓝图信息");
         }
         if (Objects.isNull(trBasicInfo)) {
-            trBasicInfo = new TRBasicInfo(cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), userId, Objects.nonNull(trBasicInfo) ? trBasicInfo.getFinishPoints() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getRequirementPoints() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseSuggest() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseEnName() : null, tcPaperStruct.getExamId(), reportCourseBasicInfoDtoBasic);
+            trBasicInfo = new TRBasicInfo(cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), userId, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseSuggest() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseEnName() : null, tcPaperStruct.getExamId(), reportCourseBasicInfoDtoBasic);
         } else {
-            trBasicInfo.setBasicInfo(tcPaperStruct.getExamId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), cultureProgramId, courseId, trBasicInfo.getCourseEnName(), trBasicInfo.getFinishPoints(), trBasicInfo.getRequirementPoints(), trBasicInfo.getCourseSuggest(), reportCourseBasicInfoDtoBasic);
+            trBasicInfo.setBasicInfo(tcPaperStruct.getExamId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), cultureProgramId, courseId, trBasicInfo.getCourseEnName(), trBasicInfo.getCourseSuggest(), reportCourseBasicInfoDtoBasic);
         }
         //课程基本情况
         ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);