Bläddra i källkod

课程目标达成度word报表修改

wangliang 1 år sedan
förälder
incheckning
66248bc6ff
13 ändrade filer med 657 tillägg och 125 borttagningar
  1. 24 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/CourseTargetWordDto.java
  2. 36 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportCourseBasicInfoDto.java
  3. 41 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/ReportResult.java
  4. 130 32
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/word/CourseBasicBean.java
  5. 62 28
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/word/CourseReportBean.java
  6. 98 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TRBasicInfo.java
  7. 26 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TRBasicInfoService.java
  8. 220 45
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRBasicInfoServiceImpl.java
  9. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRExamStudentServiceImpl.java
  10. 12 0
      distributed-print-business/src/main/resources/db/log/wangliang.sql
  11. 5 11
      distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java
  12. BIN
      distributed-print/src/main/resources/static/course_degree_report.docx
  13. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ImportTemplateEnum.java

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/CourseTargetWordDto.java

@@ -57,6 +57,12 @@ public class CourseTargetWordDto implements Serializable, Comparable<CourseTarge
     @ApiModelProperty(value = "期末成绩小题卷面总分")
     private Double finalScoreQuestionScoreSum = 0.0d;
 
+    @ApiModelProperty("指标点名称")
+    private String obeCultureProgramRequirementName;
+
+    @ApiModelProperty("父指标点名称")
+    private String parentRequirementName;
+
     public CourseTargetWordDto() {
 
     }
@@ -67,6 +73,24 @@ public class CourseTargetWordDto implements Serializable, Comparable<CourseTarge
         this.graduationRequirement = courseWeightDto.getDegreeRequirement();
         this.graduationRequirementPoint = courseWeightDto.getDimensionStr();
         this.targetSumWeight = courseWeightDto.getTotalWeight();
+        this.obeCultureProgramRequirementName = courseWeightDto.getObeCultureProgramRequirementName();
+        this.parentRequirementName = courseWeightDto.getParentRequirementName();
+    }
+
+    public String getObeCultureProgramRequirementName() {
+        return obeCultureProgramRequirementName;
+    }
+
+    public void setObeCultureProgramRequirementName(String obeCultureProgramRequirementName) {
+        this.obeCultureProgramRequirementName = obeCultureProgramRequirementName;
+    }
+
+    public String getParentRequirementName() {
+        return parentRequirementName;
+    }
+
+    public void setParentRequirementName(String parentRequirementName) {
+        this.parentRequirementName = parentRequirementName;
     }
 
     public Double getFinalScoreQuestionScoreSum() {

+ 36 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportCourseBasicInfoDto.java

@@ -1,6 +1,5 @@
 package com.qmth.distributed.print.business.bean.dto.report;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
 import com.qmth.distributed.print.business.entity.TRBasicInfo;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -51,6 +50,15 @@ public class ReportCourseBasicInfoDto implements Serializable {
     @ApiModelProperty(value = "评价参与人")
     private String participant;
 
+    @ApiModelProperty(value = "开课专业")
+    private String profession;
+
+    @ApiModelProperty(value = "开课学院")
+    private String college;
+
+    @ApiModelProperty(name = "课程英文名称")
+    String courseEnName;
+
     public ReportCourseBasicInfoDto() {
 
     }
@@ -68,6 +76,33 @@ public class ReportCourseBasicInfoDto implements Serializable {
         this.teacher = trBasicInfo.getTeacher();
         this.director = trBasicInfo.getDirector();
         this.participant = trBasicInfo.getParticipant();
+        this.profession = trBasicInfo.getProfession();
+        this.college = trBasicInfo.getCollege();
+        this.courseEnName = trBasicInfo.getCourseEnName();
+    }
+
+    public String getCollege() {
+        return college;
+    }
+
+    public void setCollege(String college) {
+        this.college = college;
+    }
+
+    public String getCourseEnName() {
+        return courseEnName;
+    }
+
+    public void setCourseEnName(String courseEnName) {
+        this.courseEnName = courseEnName;
+    }
+
+    public String getProfession() {
+        return profession;
+    }
+
+    public void setProfession(String profession) {
+        this.profession = profession;
     }
 
     public String getCredit() {

+ 41 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/ReportResult.java

@@ -2,6 +2,7 @@ package com.qmth.distributed.print.business.bean.result.report;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.qmth.distributed.print.business.bean.dto.report.*;
+import com.qmth.distributed.print.business.entity.TRBasicInfo;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -35,17 +36,56 @@ 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;
+
     public ReportResult() {
 
     }
 
     public ReportResult(ReportCommonDto commonInfo, ReportCourseBasicInfoDto courseBasicInfo, ReportCourseEvaluationSpreadDto courseEvaluationSpreadInfo
-            , ReportCourseEvaluationResultDto courseEvaluationResultInfo, ReportCourseEvaluationResultDetailDto courseEvaluationResultDetailInfo) {
+            , 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;
+    }
+
+    public void setCourseSuggest(String courseSuggest) {
+        this.courseSuggest = courseSuggest;
     }
 
     public ReportCommonDto getCommonInfo() {

+ 130 - 32
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/word/CourseBasicBean.java

@@ -1,9 +1,14 @@
 package com.qmth.distributed.print.business.bean.result.report.word;
 
+import cn.hutool.core.date.DateUtil;
+import com.qmth.distributed.print.business.entity.TRBasicInfo;
+import com.qmth.teachcloud.common.contant.SystemConstant;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.Date;
+import java.util.Objects;
 
 /**
  * @Description: 课程基本信息bean
@@ -26,14 +31,23 @@ public class CourseBasicBean implements Serializable {
     @ApiModelProperty(name = "课程性质")
     String courseType;
 
-    @ApiModelProperty(name = "总学时/学分")
+    @ApiModelProperty(name = "学分")
     String credit;
 
-    @ApiModelProperty(name = "理论/实验")
-    String theory;
+    @ApiModelProperty(name = "学时")
+    String period;
 
-    @ApiModelProperty(name = "评价样本范围")
-    String sampleRange;
+    @ApiModelProperty(name = "开课学院")
+    String college;
+
+    @ApiModelProperty(name = "开课专业")
+    String profession;
+
+    @ApiModelProperty(value = "开课时间")
+    private String openTime;
+
+    @ApiModelProperty(value = "授课对象")
+    private String teachingObject;
 
     @ApiModelProperty(name = "评价人")
     String people;
@@ -53,23 +67,123 @@ public class CourseBasicBean implements Serializable {
     @ApiModelProperty(name = "期末考试权重")
     BigDecimal finalScoreWeight;
 
+    @ApiModelProperty(value = "参评人数")
+    private Integer participantCount = 0;
+
+    @ApiModelProperty(value = "任课老师")
+    private String teacher;
+
+    @ApiModelProperty(value = "达成情况")
+    private String finishPoints;
+
+    @ApiModelProperty(value = "课程支撑毕业要求达成情况评价")
+    private String requirementPoints;
+
+    @ApiModelProperty(value = "课程持续改进")
+    private String courseSuggest;
+
     public CourseBasicBean() {
 
     }
 
-    public CourseBasicBean(String courseName, String courseCode, String courseEnName, String courseType, String credit
-            , String theory, String sampleRange, String people, String date, String courseTarget, Integer courseTargetNum) {
-        this.courseName = courseName;
-        this.courseCode = courseCode;
-        this.courseEnName = courseEnName;
-        this.courseType = courseType;
-        this.credit = credit;
-        this.theory = theory;
-        this.sampleRange = sampleRange;
-        this.people = people;
-        this.date = date;
+    public CourseBasicBean(TRBasicInfo trBasicInfo, String courseTarget, Integer courseTargetNum) {
+        this.courseName = trBasicInfo.getCourseName();
+        this.courseCode = trBasicInfo.getCourseCode();
+        this.courseType = trBasicInfo.getCourseType();
+        this.credit = trBasicInfo.getCredit();
+        this.period = trBasicInfo.getPeriod();
+        this.people = trBasicInfo.getDirector();
+        this.date = DateUtil.format(new Date(trBasicInfo.getCreateTime()), SystemConstant.DEFAULT_DATE_PATTERN);
         this.courseTarget = courseTarget;
         this.courseTargetNum = courseTargetNum;
+        this.college = trBasicInfo.getCollege();
+        this.profession = trBasicInfo.getProfession();
+        this.openTime = trBasicInfo.getOpenTime();
+        this.teachingObject = trBasicInfo.getTeachingObject();
+        this.finishPoints = trBasicInfo.getFinishPoints();
+        this.requirementPoints = trBasicInfo.getRequirementPoints();
+        this.courseSuggest = trBasicInfo.getCourseSuggest();
+        this.courseEnName = trBasicInfo.getCourseEnName();
+    }
+
+    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;
+    }
+
+    public Integer getParticipantCount() {
+        return participantCount;
+    }
+
+    public void setParticipantCount(Integer participantCount) {
+        this.participantCount = participantCount;
+    }
+
+    public String getTeacher() {
+        return teacher;
+    }
+
+    public void setTeacher(String teacher) {
+        this.teacher = teacher;
+    }
+
+    public String getOpenTime() {
+        return openTime;
+    }
+
+    public void setOpenTime(String openTime) {
+        this.openTime = openTime;
+    }
+
+    public String getTeachingObject() {
+        return teachingObject;
+    }
+
+    public void setTeachingObject(String teachingObject) {
+        this.teachingObject = teachingObject;
+    }
+
+    public String getCollege() {
+        return college;
+    }
+
+    public void setCollege(String college) {
+        this.college = college;
+    }
+
+    public String getProfession() {
+        return profession;
+    }
+
+    public void setProfession(String profession) {
+        this.profession = profession;
+    }
+
+    public String getPeriod() {
+        return period;
+    }
+
+    public void setPeriod(String period) {
+        this.period = period;
     }
 
     public BigDecimal getUsualScoreWeight() {
@@ -144,22 +258,6 @@ public class CourseBasicBean implements Serializable {
         this.credit = credit;
     }
 
-    public String getTheory() {
-        return theory;
-    }
-
-    public void setTheory(String theory) {
-        this.theory = theory;
-    }
-
-    public String getSampleRange() {
-        return sampleRange;
-    }
-
-    public void setSampleRange(String sampleRange) {
-        this.sampleRange = sampleRange;
-    }
-
     public String getPeople() {
         return people;
     }

+ 62 - 28
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/report/word/CourseReportBean.java

@@ -1,5 +1,6 @@
 package com.qmth.distributed.print.business.bean.result.report.word;
 
+import com.deepoove.poi.data.ChartMultiSeriesRenderData;
 import com.deepoove.poi.data.TableRenderData;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -17,11 +18,11 @@ public class CourseReportBean implements Serializable {
     @ApiModelProperty(name = "标题1")
     String title1;
 
-    @ApiModelProperty(name = "考生标题1")
-    String examStudentTitle1;
-
-    @ApiModelProperty(name = "考生标题2")
-    String examStudentTitle2;
+//    @ApiModelProperty(name = "考生标题1")
+//    String examStudentTitle1;
+//
+//    @ApiModelProperty(name = "考生标题2")
+//    String examStudentTitle2;
 
     @ApiModelProperty(name = "课程bean")
     CourseBasicBean courseBasicBean;
@@ -32,15 +33,24 @@ public class CourseReportBean implements Serializable {
     @ApiModelProperty(name = "课程报告表格2bean-课程目标达成考核/评价环节及目标分值")
     TableRenderData courseTargetTable2;
 
-    @ApiModelProperty(name = "课程报告表格3bean-课程课后作业考核/评价内容及目标分值")
-    TableRenderData courseTargetTable3;
-
-    @ApiModelProperty(name = "课程报告表格4bean-课程期末考试考核/评价内容及目标分值")
-    TableRenderData courseTargetTable4;
+//    @ApiModelProperty(name = "课程报告表格3bean-课程课后作业考核/评价内容及目标分值")
+//    TableRenderData courseTargetTable3;
+//
+//    @ApiModelProperty(name = "课程报告表格4bean-课程期末考试考核/评价内容及目标分值")
+//    TableRenderData courseTargetTable4;
 
     @ApiModelProperty(name = "考生表格1bean")
     TableRenderData examStudentTable1;
 
+    @ApiModelProperty(name = "课程报告表格3bean-课程目标达成度评价分析")
+    TableRenderData courseTargetTable6;
+
+    @ApiModelProperty(name = "达成度分布柱状图")
+    ChartMultiSeriesRenderData courseTargetColumnDiagram1;
+
+    @ApiModelProperty(name = "课程目标达成度情况柱状图")
+    ChartMultiSeriesRenderData courseTargetColumnDiagram2;
+
     public CourseReportBean() {
 
     }
@@ -58,37 +68,61 @@ public class CourseReportBean implements Serializable {
         this.examStudentTable1 = examStudentTable1;
     }
 
-    public TableRenderData getCourseTargetTable3() {
-        return courseTargetTable3;
+    public TableRenderData getCourseTargetTable6() {
+        return courseTargetTable6;
     }
 
-    public void setCourseTargetTable3(TableRenderData courseTargetTable3) {
-        this.courseTargetTable3 = courseTargetTable3;
+    public void setCourseTargetTable6(TableRenderData courseTargetTable6) {
+        this.courseTargetTable6 = courseTargetTable6;
     }
 
-    public TableRenderData getCourseTargetTable4() {
-        return courseTargetTable4;
+    public ChartMultiSeriesRenderData getCourseTargetColumnDiagram1() {
+        return courseTargetColumnDiagram1;
     }
 
-    public void setCourseTargetTable4(TableRenderData courseTargetTable4) {
-        this.courseTargetTable4 = courseTargetTable4;
+    public void setCourseTargetColumnDiagram1(ChartMultiSeriesRenderData courseTargetColumnDiagram1) {
+        this.courseTargetColumnDiagram1 = courseTargetColumnDiagram1;
     }
 
-    public String getExamStudentTitle1() {
-        return examStudentTitle1;
+    public ChartMultiSeriesRenderData getCourseTargetColumnDiagram2() {
+        return courseTargetColumnDiagram2;
     }
 
-    public void setExamStudentTitle1(String examStudentTitle1) {
-        this.examStudentTitle1 = examStudentTitle1;
+    public void setCourseTargetColumnDiagram2(ChartMultiSeriesRenderData courseTargetColumnDiagram2) {
+        this.courseTargetColumnDiagram2 = courseTargetColumnDiagram2;
     }
 
-    public String getExamStudentTitle2() {
-        return examStudentTitle2;
-    }
+    //    public TableRenderData getCourseTargetTable3() {
+//        return courseTargetTable3;
+//    }
+//
+//    public void setCourseTargetTable3(TableRenderData courseTargetTable3) {
+//        this.courseTargetTable3 = courseTargetTable3;
+//    }
+//
+//    public TableRenderData getCourseTargetTable4() {
+//        return courseTargetTable4;
+//    }
+//
+//    public void setCourseTargetTable4(TableRenderData courseTargetTable4) {
+//        this.courseTargetTable4 = courseTargetTable4;
+//    }
 
-    public void setExamStudentTitle2(String examStudentTitle2) {
-        this.examStudentTitle2 = examStudentTitle2;
-    }
+//    public String getExamStudentTitle1() {
+//        return examStudentTitle1;
+//    }
+//
+//    public void setExamStudentTitle1(String examStudentTitle1) {
+//        this.examStudentTitle1 = examStudentTitle1;
+//    }
+//
+//    public String getExamStudentTitle2() {
+//        return examStudentTitle2;
+//    }
+//
+//    public void setExamStudentTitle2(String examStudentTitle2) {
+//        this.examStudentTitle2 = examStudentTitle2;
+//    }
 
     public String getTitle1() {
         return title1;

+ 98 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TRBasicInfo.java

@@ -53,6 +53,12 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "学时")
     private String period;
 
+    @ApiModelProperty(value = "开课学院")
+    private String college;
+
+    @ApiModelProperty(value = "开课专业")
+    private String profession;
+
     @ApiModelProperty(value = "考核方式")
     private String evaluationMode;
 
@@ -92,6 +98,18 @@ 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;
+
+    @ApiModelProperty(name = "课程英文名称")
+    String courseEnName;
+
     @ApiModelProperty(value = "报告信息")
     @TableField(exist = false)
     private ReportResult reportResult;
@@ -100,7 +118,10 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
 
     }
 
-    public TRBasicInfo(Long cultureProgramId, Long courseId, String courseCode, String courseName, String paperNumber, String openTime, String teachingObject, String teacher, Integer participantCount, Long userId) {
+    public TRBasicInfo(Long cultureProgramId, Long courseId, String courseCode, String courseName,
+                       String paperNumber, String openTime, String teachingObject, String teacher, Integer participantCount,
+                       Long userId, String profession, String finishPoints, String requirementPoints,
+                       String courseSuggest, Double courseDegree, String courseEnName) {
         insertInfo(userId);
         this.cultureProgramId = cultureProgramId;
         this.courseId = courseId;
@@ -113,6 +134,63 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.participantCount = participantCount;
         this.enable = true;
         this.reportResult = new ReportResult();
+        this.profession = profession;
+        this.finishPoints = finishPoints;
+        this.requirementPoints = requirementPoints;
+        this.courseSuggest = courseSuggest;
+        this.courseDegree = courseDegree;
+        this.courseEnName = courseEnName;
+        this.finishPoints = finishPoints;
+        this.requirementPoints = requirementPoints;
+        this.courseSuggest = courseSuggest;
+    }
+
+    public String getCourseEnName() {
+        return courseEnName;
+    }
+
+    public void setCourseEnName(String courseEnName) {
+        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;
+    }
+
+    public void setCourseSuggest(String courseSuggest) {
+        this.courseSuggest = courseSuggest;
+    }
+
+    public String getCollege() {
+        return college;
+    }
+
+    public void setCollege(String college) {
+        this.college = college;
+    }
+
+    public String getProfession() {
+        return profession;
+    }
+
+    public void setProfession(String profession) {
+        this.profession = profession;
     }
 
     public TRBasicInfo(TRBasicInfo trBasicInfo, Long userId) {
@@ -148,9 +226,18 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.courseEvaluationSpread = trBasicInfo.getCourseEvaluationSpread();
         this.courseEvaluationResult = trBasicInfo.getCourseEvaluationResult();
         this.courseEvaluationResultDetail = trBasicInfo.getCourseEvaluationResultDetail();
-    }
-
-    public void setBasicInfo(Long examId, String courseCode, String courseName, String paperNumber, String openTime, String teachingObject, String teacher, Integer participantCount, Long cultureProgramId, Long courseId) {
+        this.profession = trBasicInfo.getProfession();
+        this.courseEnName = trBasicInfo.getCourseEnName();
+        this.college = trBasicInfo.getCollege();
+        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,
+                             String teachingObject, String teacher, Integer participantCount, Long cultureProgramId,
+                             Long courseId, Double courseDegree, String profession, String courseEnName, String college,
+                             String finishPoints, String requirementPoints, String courseSuggest) {
         this.examId = examId;
         this.courseCode = courseCode;
         this.courseName = courseName;
@@ -163,6 +250,13 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.reportResult = new ReportResult();
         this.cultureProgramId = cultureProgramId;
         this.courseId = courseId;
+        this.courseDegree = courseDegree;
+        this.profession = profession;
+        this.courseEnName = courseEnName;
+        this.college = college;
+        this.finishPoints = finishPoints;
+        this.requirementPoints = requirementPoints;
+        this.courseSuggest = courseSuggest;
     }
 
     public Long getCultureProgramId() {

+ 26 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TRBasicInfoService.java

@@ -1,6 +1,7 @@
 package com.qmth.distributed.print.business.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.deepoove.poi.data.ChartMultiSeriesRenderData;
 import com.deepoove.poi.data.TableRenderData;
 import com.qmth.distributed.print.business.bean.dto.CourseWeightDto;
 import com.qmth.distributed.print.business.bean.dto.report.CourseTargetWordDto;
@@ -118,6 +119,31 @@ public interface TRBasicInfoService extends IService<TRBasicInfo> {
      */
     public TableRenderData buildWordTable5(TRBasicInfo trBasicInfo, CourseReportBean courseReportBean);
 
+    /**
+     * 构建word动态表格6
+     *
+     * @param map
+     * @return
+     */
+    public TableRenderData buildWordTable6(Map<String, Object> map);
+
+    /**
+     * 构建word图形表格1
+     *
+     * @param map
+     * @return
+     */
+    public ChartMultiSeriesRenderData buildCourseTargetColumnDiagram1(Map<String, Object> map);
+
+
+    /**
+     * 构建word图形表格2
+     *
+     * @param map
+     * @return
+     */
+    public ChartMultiSeriesRenderData buildCourseTargetColumnDiagram2(Map<String, Object> map);
+
     /**
      * 根据考试id/课程编码/试卷编码删除数据
      *

+ 220 - 45
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRBasicInfoServiceImpl.java

@@ -15,10 +15,7 @@ import com.qmth.distributed.print.business.bean.result.FinalScoreResult;
 import com.qmth.distributed.print.business.bean.result.ObeCourseWeightResult;
 import com.qmth.distributed.print.business.bean.result.report.PaperStructDimensionResult;
 import com.qmth.distributed.print.business.bean.result.report.word.CourseReportBean;
-import com.qmth.distributed.print.business.entity.ObeCourseOutline;
-import com.qmth.distributed.print.business.entity.TCPaperStruct;
-import com.qmth.distributed.print.business.entity.TRBasicInfo;
-import com.qmth.distributed.print.business.entity.TRExamStudent;
+import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.mapper.TRBasicInfoMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.teachcloud.common.contant.SystemConstant;
@@ -87,6 +84,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
     @Resource
     ObeCourseOutlineService obeCourseOutlineService;
 
+    @Resource
+    ObeCultureProgramService obeCultureProgramService;
+
+    @Resource
+    BasicProfessionalService basicProfessionalService;
+
     protected static final String tbBgColor = "F2F2F2";
     protected static final String tbPercentWidth = "100%";
 
@@ -433,17 +436,22 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
         BasicSemester basicSemester = basicSemesterService.getById(obeCourseOutline.getSemesterId());
         Objects.requireNonNull(basicSemester, "未找到学期信息");
 
-        String teachingObject = null, teacher = null;
+        String teachingObject = Objects.nonNull(trBasicInfo) ? trBasicInfo.getTeachingObject() : null, teacher = null;
         if (Objects.nonNull(markPaper.getPaperNumber())) {
             ExamStudentDto examStudentDto = examStudentService.queryExamStudent(markPaper.getExamId(), markPaper.getCourseCode(), markPaper.getPaperNumber());
-            teachingObject = Objects.nonNull(examStudentDto) ? examStudentDto.getClazzNames() : null;
+//            teachingObject = Objects.nonNull(examStudentDto) ? examStudentDto.getClazzNames() : null;
             teacher = Objects.nonNull(examStudentDto) ? examStudentDto.getTeacherNames() : null;
         }
 
+        ObeCultureProgram obeCultureProgram = obeCultureProgramService.getById(obeCourseOutline.getCultureProgramId());
+        Objects.requireNonNull(obeCultureProgram, "未找到培养方案信息");
+        BasicProfessional basicProfessional = basicProfessionalService.getById(obeCultureProgram.getProfessionalId());
+        Objects.requireNonNull(basicProfessional, "未找到专业信息");
+        Double expectValue = obeCourseWeightResult.getSubmitForm().get(0).getExpectValue();
         if (Objects.isNull(trBasicInfo)) {
-            trBasicInfo = new TRBasicInfo(cultureProgramId, basicCourseService.findByCourseCode(markPaper.getCourseCode(), basicSemester.getSchoolId()).getId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), teachingObject, teacher, null, userId);
+            trBasicInfo = new TRBasicInfo(cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), teachingObject, teacher, null, userId, basicProfessional.getName(), Objects.nonNull(trBasicInfo) ? trBasicInfo.getFinishPoints() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getRequirementPoints() : null, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseSuggest() : null, expectValue, Objects.nonNull(trBasicInfo) ? trBasicInfo.getCourseEnName() : null);
         } else {
-            trBasicInfo.setBasicInfo(markPaper.getExamId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), teachingObject, teacher, null, cultureProgramId, courseId);
+            trBasicInfo.setBasicInfo(markPaper.getExamId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), basicSemester.getName(), teachingObject, teacher, null, cultureProgramId, courseId, expectValue, basicProfessional.getName(), trBasicInfo.getCourseEnName(), trBasicInfo.getCollege(), trBasicInfo.getFinishPoints(), trBasicInfo.getRequirementPoints(), trBasicInfo.getCourseSuggest());
         }
         //课程基本情况
         ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
@@ -518,7 +526,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
 
         for (int i = 0; i < courseTargetWordDtoList.size(); i++) {
             CourseTargetWordDto courseTargetWordDto = courseTargetWordDtoList.get(i);
-            RowRenderData row = Rows.of(courseTargetWordDto.getTargetName(), courseTargetWordDto.getGraduationRequirement(), courseTargetWordDto.getGraduationRequirementPoint()).rowStyle(this.getRowStyle()).create();
+            RowRenderData row = Rows.of(courseTargetWordDto.getTargetName(), courseTargetWordDto.getParentRequirementName(), courseTargetWordDto.getObeCultureProgramRequirementName()).rowStyle(this.getRowStyle()).create();
             tableBuilder1.addRow(row);
         }
         return tableBuilder1.left().create();
@@ -758,7 +766,10 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
     @Override
     public TableRenderData buildWordTable5(TRBasicInfo trBasicInfo, CourseReportBean courseReportBean) {
         TableRenderData tableRenderDataExamStudent = null;
-        List<TRExamStudent> trExamStudentList = trExamStudentService.list(new QueryWrapper<TRExamStudent>().lambda().eq(TRExamStudent::getrBasicInfoId, trBasicInfo.getId()));
+        List<TRExamStudent> trExamStudentList = trExamStudentService.list(new QueryWrapper<TRExamStudent>().lambda()
+                .eq(TRExamStudent::getrBasicInfoId, trBasicInfo.getId()).and(w -> w.ne(TRExamStudent::getStudentCode, "目标分")
+//                        .ne(TRExamStudent::getStudentCode, "各课程目标平均分")
+                ));
         if (!CollectionUtils.isEmpty(trExamStudentList)) {
             List<CellRenderData> examStudent_cells_1 = new ArrayList<>(), examStudent_cells_2 = new ArrayList<>();
             examStudent_cells_1.add(Cells.of("序号").center().create());
@@ -768,9 +779,10 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
             examStudent_cells_2.addAll(examStudent_cells_1);
 
             Map<Long, Integer> targetUsualScoreSizeMap = new LinkedHashMap<>();
+            Map<Long, BigDecimal> targetCourseDegreeMap = new LinkedHashMap<>();
             TRExamStudent trExamStudentTemp = trExamStudentList.get(0);
 
-            RowRenderData[] rowRenderDataExamStudent = new RowRenderData[trExamStudentList.size() + 2];
+            RowRenderData[] rowRenderDataExamStudent = new RowRenderData[trExamStudentList.size() + 3];
             RowRenderData examStudent_header_1 = new RowRenderData();
             examStudent_header_1.setCells(examStudent_cells_1);
             examStudent_header_1.setRowStyle(this.getHeadRowStyle());
@@ -790,6 +802,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 } else {
                     targetUsualScoreSizeMap.put(c.getTargetId(), 0);
                 }
+                targetCourseDegreeMap.put(c.getTargetId(), c.getEvaluationValue());
+            }
+
+            Double courseDegree = 0.0d;
+            if (!CollectionUtils.isEmpty(targetCourseDegreeMap)) {
+                courseDegree = targetCourseDegreeMap.values().stream().mapToDouble(b -> b.doubleValue()).min().orElse(0);
             }
             //首行
             if (Objects.nonNull(trExamStudentTemp.getResultDetail())) {
@@ -823,25 +841,26 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 examStudent_cells_2.add(Cells.of("综合成绩").center().create());
             }
 
+            List<Double> scoreList = new ArrayList<>();
             for (int i = 0; i < trExamStudentList.size(); i++) {
                 TRExamStudent trExamStudent = trExamStudentList.get(i);
                 RowRenderData examStudent_row = new RowRenderData();
                 List<CellRenderData> examStudent_cells = new ArrayList<>();
                 switch (trExamStudent.getName()) {
-                    case "目标分":
-                        examStudent_cells.add(Cells.of("课程目标考核要素的目标分").create());
-                        examStudent_cells.add(Cells.of("课程目标考核要素的目标分").create());
-                        examStudent_cells.add(Cells.of("课程目标考核要素的目标分").create());
-                        break;
+//                    case "目标分":
+//                        examStudent_cells.add(Cells.of("课程目标考核要素的目标分").create());
+//                        examStudent_cells.add(Cells.of("课程目标考核要素的目标分").create());
+//                        examStudent_cells.add(Cells.of("课程目标考核要素的目标分").create());
+//                        break;
                     case "平均分":
-                        examStudent_cells.add(Cells.of("课程目标考核要素的平均分").create());
-                        examStudent_cells.add(Cells.of("课程目标考核要素的平均分").create());
-                        examStudent_cells.add(Cells.of("课程目标考核要素的平均分").create());
+                        examStudent_cells.add(Cells.of("平均分").create());
+                        examStudent_cells.add(Cells.of("平均分").create());
+                        examStudent_cells.add(Cells.of("平均分").create());
                         break;
                     case "各课程目标平均分":
-                        examStudent_cells.add(Cells.of(trExamStudent.getName()).create());
-                        examStudent_cells.add(Cells.of(trExamStudent.getStudentCode()).create());
-                        examStudent_cells.add(Cells.of(trExamStudent.getName()).create());
+                        examStudent_cells.add(Cells.of("课程目标达成度").create());
+                        examStudent_cells.add(Cells.of("课程目标达成度").create());
+                        examStudent_cells.add(Cells.of("课程目标达成度").create());
                         break;
                     default:
                         examStudent_cells.add(Cells.of(String.valueOf(i + 1)).create());
@@ -851,7 +870,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 }
                 examStudent_cells.add(Cells.of(trExamStudent.getAdministrativeClass()).create());
 
-                BigDecimal targetSumScore = new BigDecimal(0), targetAvgScore = new BigDecimal(0);
+//                BigDecimal targetSumScore = new BigDecimal(0),
+                BigDecimal targetAvgScore = new BigDecimal(0);
                 if (Objects.nonNull(trExamStudent.getResultDetail())) {
                     List<ReportExamStudentTargetDto> reportExamStudentTargetDtoList = JSONArray.parseArray(trExamStudent.getResultDetail(), ReportExamStudentTargetDto.class);
                     for (ReportExamStudentTargetDto reportExamStudentTargetDto : reportExamStudentTargetDtoList) {
@@ -863,16 +883,16 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                                 List<ReportExamStudentUsualScoreObjDto> reportExamStudentUsualScoreObjDtoList = reportExamStudentUsualScoreDto.getScoreList();
                                 for (ReportExamStudentUsualScoreObjDto reportExamStudentUsualScoreObjDto : reportExamStudentUsualScoreObjDtoList) {
                                     switch (trExamStudent.getName()) {
-                                        case "目标分":
-                                            examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentUsualScoreObjDto.getTargetScore())).create());
-                                            targetSumScore = targetSumScore.add(reportExamStudentUsualScoreObjDto.getTargetScore());
-                                            break;
+//                                        case "目标分":
+//                                            examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentUsualScoreObjDto.getTargetScore())).create());
+//                                            targetSumScore = targetSumScore.add(reportExamStudentUsualScoreObjDto.getTargetScore());
+//                                            break;
                                         case "平均分":
                                             examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentUsualScoreObjDto.getMatrixAvgScore())).create());
                                             targetAvgScore = targetAvgScore.add(new BigDecimal(reportExamStudentUsualScoreObjDto.getMatrixAvgScore()));
                                             break;
                                         case "各课程目标平均分":
-                                            examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentTargetDto.getTargetMatrixAvgScore())).create());
+                                            examStudent_cells.add(Cells.of(targetCourseDegreeMap.get(reportExamStudentTargetDto.getTargetId()) + "").create());
                                             break;
                                         default:
                                             examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentUsualScoreObjDto.getScore())).create());
@@ -885,16 +905,16 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                             if (Objects.nonNull(reportExamStudentFinalScoreDto) && Objects.equals(reportExamStudentFinalScoreDto.getEvaluation(), SystemConstant.FINAL_SCORE_STR)) {
                                 courseReportBean.getCourseBasicBean().setFinalScoreWeight(reportExamStudentFinalScoreDto.getTargetWeight());
                                 switch (trExamStudent.getName()) {
-                                    case "目标分":
-                                        examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getTargetScore())).create());
-                                        targetSumScore = targetSumScore.add(reportExamStudentFinalScoreDto.getTargetScore());
-                                        break;
+//                                    case "目标分":
+//                                        examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getTargetScore())).create());
+//                                        targetSumScore = targetSumScore.add(reportExamStudentFinalScoreDto.getTargetScore());
+//                                        break;
                                     case "平均分":
                                         examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getMatrixAvgScore())).create());
                                         targetAvgScore = targetAvgScore.add(new BigDecimal(reportExamStudentFinalScoreDto.getMatrixAvgScore()));
                                         break;
                                     case "各课程目标平均分":
-                                        examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentTargetDto.getTargetMatrixAvgScore())).create());
+                                        examStudent_cells.add(Cells.of(targetCourseDegreeMap.get(reportExamStudentTargetDto.getTargetId()) + "").create());
                                         break;
                                     default:
                                         examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getTargetScoreSum())).create());
@@ -905,9 +925,9 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                     }
                 }
                 switch (trExamStudent.getName()) {
-                    case "目标分":
-                        examStudent_cells.add(Cells.of(SystemConstant.df.format(targetSumScore.setScale(2, BigDecimal.ROUND_HALF_UP))).create());
-                        break;
+//                    case "目标分":
+//                        examStudent_cells.add(Cells.of(SystemConstant.df.format(targetSumScore.setScale(2, BigDecimal.ROUND_HALF_UP))).create());
+//                        break;
                     case "平均分":
                         examStudent_cells.add(Cells.of(SystemConstant.df.format(targetAvgScore.setScale(1, BigDecimal.ROUND_DOWN))).create());
                         break;
@@ -915,6 +935,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                         examStudent_cells.add(Cells.of("").create());
                         break;
                     default:
+                        scoreList.add(trExamStudent.getScore());
                         examStudent_cells.add(Cells.of(SystemConstant.df.format(trExamStudent.getScore())).create());
                         break;
                 }
@@ -922,13 +943,27 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 examStudent_row.setRowStyle(this.getRowStyle());
                 rowRenderDataExamStudent[i + 2] = examStudent_row;
             }
+            List<CellRenderData> cellRenderData_last_cell = new ArrayList<>();
+            RowRenderData examStudent_last_row = new RowRenderData();
+            cellRenderData_last_cell.add(Cells.of("课程达成度").create());
+            cellRenderData_last_cell.add(Cells.of("课程达成度").create());
+            cellRenderData_last_cell.add(Cells.of("课程达成度").create());
+            cellRenderData_last_cell.add(Cells.of("课程达成度").create());
+
+            int cellSize = rowRenderDataExamStudent[rowRenderDataExamStudent.length - 2].getCells().size();
+            for (int i = 4; i < cellSize; i++) {
+                cellRenderData_last_cell.add(Cells.of(courseDegree + "").center().create());
+            }
+            examStudent_last_row.setCells(cellRenderData_last_cell);
+            examStudent_last_row.setRowStyle(this.getRowStyle());
+            rowRenderDataExamStudent[rowRenderDataExamStudent.length - 1] = examStudent_last_row;
 
-            String title = Objects.nonNull(trBasicInfo.getTeachingObject()) ? trBasicInfo.getTeachingObject() : "";
-            String sumTitle = "学生共${examStudentSum}名";
-            sumTitle = sumTitle.replace("${examStudentSum}", trExamStudentList.size() - 3 + "");
+//            String title = Objects.nonNull(trBasicInfo.getTeachingObject()) ? trBasicInfo.getTeachingObject() : "";
+//            String sumTitle = "学生共${examStudentSum}名";
+//            sumTitle = sumTitle.replace("${examStudentSum}", trExamStudentList.size() - 3 + "");
 
-            courseReportBean.setExamStudentTitle1(title + sumTitle);
-            courseReportBean.setExamStudentTitle2(title + "《" + courseReportBean.getCourseBasicBean().getCourseName() + "》");
+//            courseReportBean.setExamStudentTitle1(title + sumTitle);
+//            courseReportBean.setExamStudentTitle2(title + "《" + courseReportBean.getCourseBasicBean().getCourseName() + "》");
 
             //表格合并,根据坐标
             MergeCellRule mergeCellRuleExamStudent = MergeCellRule.builder().build();
@@ -946,11 +981,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 int increaseNum = 1;
                 while (increaseNum <= v) {
                     mergeCellRuleExamStudent.getMapping().add(new MergeCellRule.GridRule(MergeCellRule.Grid.of(0, initNum.get()), MergeCellRule.Grid.of(0, initNum.get() + increaseNum)));
-                    mergeCellRuleExamStudent.getMapping().add(new MergeCellRule.GridRule(MergeCellRule.Grid.of(rowRenderDataExamStudent.length - 1, initNum.get()), MergeCellRule.Grid.of(rowRenderDataExamStudent.length - 1, initNum.get() + increaseNum)));
+                    mergeCellRuleExamStudent.getMapping().add(new MergeCellRule.GridRule(MergeCellRule.Grid.of(rowRenderDataExamStudent.length - 2, initNum.get()), MergeCellRule.Grid.of(rowRenderDataExamStudent.length - 2, initNum.get() + increaseNum)));
                     increaseNum++;
                 }
                 initNum.set(initNum.get() + increaseNum);
             });
+            mergeCellRuleExamStudent.getMapping().add(new MergeCellRule.GridRule(MergeCellRule.Grid.of(rowRenderDataExamStudent.length - 1, 4), MergeCellRule.Grid.of(rowRenderDataExamStudent.length - 1, cellSize - 1)));
             mergeCellRuleExamStudent.getMapping().add(new MergeCellRule.GridRule(MergeCellRule.Grid.of(0, rowRenderDataExamStudent[rowRenderDataExamStudent.length - 1].getCells().size() - 1), MergeCellRule.Grid.of(1, rowRenderDataExamStudent[rowRenderDataExamStudent.length - 1].getCells().size() - 1)));
 
 //            Tables.TableBuilder tableBuilderExamStudent = Tables.ofPercentWidth(tbPercentWidth, new int[]{6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 16});
@@ -959,10 +995,149 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 tableBuilderExamStudent.addRow(rowRenderDataExamStudent[i]);
             }
             tableRenderDataExamStudent = tableBuilderExamStudent.mergeRule(mergeCellRuleExamStudent).left().create();
+
+            if (!CollectionUtils.isEmpty(scoreList)) {
+                Integer[] scoreSizes = new Integer[]{0, 0, 0, 0, 0};
+                BigDecimal[] scorePercent = new BigDecimal[]{new BigDecimal(0), new BigDecimal(0), new BigDecimal(0), new BigDecimal(0), new BigDecimal(0)};
+                Map<String, Object> map = new HashMap<>();
+                Double maxScore = scoreList.stream().mapToDouble(s -> s).max().orElse(0.0d);
+                Double minScore = scoreList.stream().mapToDouble(s -> s).min().orElse(0.0d);
+                Double avgScore = scoreList.stream().mapToDouble(s -> s).average().orElse(0.0d);
+                for (Double d : scoreList) {
+                    if (d.doubleValue() <= 100 && d.doubleValue() >= 90) {
+                        scoreSizes[0] = scoreSizes[0] + 1;
+                    } else if (d.doubleValue() <= 89 && d.doubleValue() >= 80) {
+                        scoreSizes[1] = scoreSizes[1] + 1;
+                    } else if (d.doubleValue() <= 79 && d.doubleValue() >= 70) {
+                        scoreSizes[2] = scoreSizes[2] + 1;
+                    } else if (d.doubleValue() <= 69 && d.doubleValue() >= 60) {
+                        scoreSizes[3] = scoreSizes[3] + 1;
+                    } else {
+                        scoreSizes[4] = scoreSizes[4] + 1;
+                    }
+                }
+                for (int i = 0; i < scoreSizes.length; i++) {
+                    scorePercent[i] = new BigDecimal(scoreSizes[i]).divide(new BigDecimal(scoreList.size()), 2, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.PERCENT).setScale(2, BigDecimal.ROUND_HALF_UP);
+                }
+                map.put("scoreSizes", scoreSizes);
+                map.put("scorePercent", scorePercent);
+                map.put("maxScore", maxScore);
+                map.put("minScore", minScore);
+                map.put("avgScore", avgScore);
+                map.put("courseTargetWebDtoList", courseTargetWebDtoList);
+                courseReportBean.setCourseTargetTable6(this.buildWordTable6(map));
+                courseReportBean.setCourseTargetColumnDiagram1(this.buildCourseTargetColumnDiagram1(map));
+                courseReportBean.setCourseTargetColumnDiagram2(this.buildCourseTargetColumnDiagram2(map));
+            }
         }
         return tableRenderDataExamStudent;
     }
 
+    /**
+     * 构建word动态表格6
+     *
+     * @param map
+     * @return
+     */
+    @Override
+    public TableRenderData buildWordTable6(Map<String, Object> map) {
+        String[] scoreTitles = new String[]{"100-90", "89-80", "79-70", "69-60", "<60"};
+        Integer[] scoreSizes = (Integer[]) map.get("scoreSizes");
+        BigDecimal[] scorePercent = (BigDecimal[]) map.get("scorePercent");
+        Double maxScore = new BigDecimal((Double) map.get("maxScore")).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+        Double minScore = new BigDecimal((Double) map.get("minScore")).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+        Double avgScore = new BigDecimal((Double) map.get("avgScore")).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+
+        RowRenderData[] rowRenderData = new RowRenderData[3];
+        List<CellRenderData> cells_1 = new ArrayList<>(), cells_2 = new ArrayList<>(), cells_3 = new ArrayList<>();
+        cells_1.add(Cells.of("达成度区间").center().create());
+        cells_2.add(Cells.of("人数").create());
+        cells_3.add(Cells.of("百分比").create());
+        for (int i = 0; i < scoreTitles.length; i++) {
+            cells_1.add(Cells.of(scoreTitles[i]).center().create());
+            cells_2.add(Cells.of(scoreSizes[i] + "").create());
+            cells_3.add(Cells.of(scorePercent[i] + "%").create());
+        }
+        cells_1.add(Cells.of("平均分").center().create());
+        cells_1.add(Cells.of("最高分").center().create());
+        cells_1.add(Cells.of("最低分").center().create());
+
+        cells_2.add(Cells.of(avgScore + "").create());
+        cells_2.add(Cells.of(maxScore + "").create());
+        cells_2.add(Cells.of(minScore + "").create());
+
+        cells_3.add(Cells.of(avgScore + "").create());
+        cells_3.add(Cells.of(maxScore + "").create());
+        cells_3.add(Cells.of(minScore + "").create());
+
+        RowRenderData row_1 = new RowRenderData();
+        row_1.setCells(cells_1);
+        row_1.setRowStyle(this.getHeadRowStyle());
+
+        RowRenderData row_2 = new RowRenderData();
+        row_2.setCells(cells_2);
+        row_2.setRowStyle(this.getRowStyle());
+
+        RowRenderData row_3 = new RowRenderData();
+        row_3.setCells(cells_3);
+        row_3.setRowStyle(this.getRowStyle());
+
+        rowRenderData[0] = row_1;
+        rowRenderData[1] = row_2;
+        rowRenderData[2] = row_3;
+
+        MergeCellRule mergeCellRule6 = MergeCellRule.builder().
+                map(MergeCellRule.Grid.of(1, 6), MergeCellRule.Grid.of(2, 6)).
+                map(MergeCellRule.Grid.of(1, 7), MergeCellRule.Grid.of(2, 7)).
+                map(MergeCellRule.Grid.of(1, 8), MergeCellRule.Grid.of(2, 8)).
+                build();
+
+        Tables.TableBuilder tableBuilder6 = Tables.ofPercentWidth(tbPercentWidth);
+        for (int i = 0; i < rowRenderData.length; i++) {
+            tableBuilder6.addRow(rowRenderData[i]);
+        }
+        return tableBuilder6.mergeRule(mergeCellRule6).left().create();
+    }
+
+    /**
+     * 构建word图形表格1
+     *
+     * @param map
+     * @return
+     */
+    @Override
+    public ChartMultiSeriesRenderData buildCourseTargetColumnDiagram1(Map<String, Object> map) {
+        String[] scoreTitles = new String[]{"100-90", "89-80", "79-70", "69-60", "<60"};
+        Integer[] scoreSizes = (Integer[]) map.get("scoreSizes");
+        ChartMultiSeriesRenderData chart = Charts
+                .ofMultiSeries("达成度分布柱状图", scoreTitles)
+                .addSeries("人数", scoreSizes)
+                .create();
+        return chart;
+    }
+
+    /**
+     * 构建word图形表格2
+     *
+     * @param map
+     * @return
+     */
+    @Override
+    public ChartMultiSeriesRenderData buildCourseTargetColumnDiagram2(Map<String, Object> map) {
+        List<CourseTargetWebDto> courseTargetWebDtoList = (List<CourseTargetWebDto>) map.get("courseTargetWebDtoList");
+        List<String> courseDegreeList = courseTargetWebDtoList.stream().map(s -> s.getTargetName()).collect(Collectors.toList());
+        List<BigDecimal> courseDegreeValueList = courseTargetWebDtoList.stream().map(s -> s.getEvaluationValue()).collect(Collectors.toList());
+        String[] courseDegreeTitle = new String[courseDegreeList.size()];
+        BigDecimal[] courseDegreeValues = new BigDecimal[courseDegreeValueList.size()];
+        courseDegreeList.toArray(courseDegreeTitle);
+        courseDegreeValueList.toArray(courseDegreeValues);
+        ChartMultiSeriesRenderData chart = Charts
+                .ofMultiSeries("课程目标达成度情况", courseDegreeTitle)
+                .addSeries("达成度", courseDegreeValues)
+                .create();
+        return chart;
+    }
+
     @Override
     @Transactional
     public Boolean remove(Long cultureProgramId, Long courseId, String paperNumber) {
@@ -987,8 +1162,8 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
 //        Objects.requireNonNull(obeCourseWeightResult.getCustomRate(), "未设置平时成绩权重");
 //        Objects.requireNonNull(obeCourseWeightResult.getDefaultRate(), "未设置期末考试权重");
 
-//        Objects.requireNonNull(obeCourseWeightResult.getWeightSettingSign(), "课程权重变化id为空");
-//        Objects.requireNonNull(obeCourseWeightResult.getDimensionSign(), "知识点变化id为空");
+        Objects.requireNonNull(obeCourseWeightResult.getWeightSettingSign(), "课程权重变化id为空");
+        Objects.requireNonNull(obeCourseWeightResult.getDimensionSign(), "知识点变化id为空");
         List<CourseWeightDto> courseWeightDtoList = obeCourseWeightResult.getSubmitForm();
         if (CollectionUtils.isEmpty(courseWeightDtoList)) {
             throw ExceptionResultEnum.ERROR.exception("未设置课程目标评价方式");
@@ -1221,7 +1396,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 UsualScoreWordDto usualScoreWordDto = courseTargetWordDto.getUsualScoreDto();
                 //old平时作业换算:分数/100*作业目标分
                 //new平时作业换算:分数/作业目标分
-                Double matrixScore = new BigDecimal(score).multiply(reportEvaluationDto.getTargetWeight()).divide(SystemConstant.PERCENT, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                Double matrixScore = new BigDecimal(score).divide(reportEvaluationDto.getTargetScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(reportEvaluationDto.getTargetWeight()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
                 reportExamStudentUsualScoreObjDtoList.add(new ReportExamStudentUsualScoreObjDto(reportEvaluationDto.getTargetId(), reportEvaluationDto, score, matrixScore, usualScoreWordDto.getUsualScoreTargetSumScore()));
                 scoreListMap.put(reportEvaluationDto.getTargetId(), reportExamStudentUsualScoreObjDtoList);
             }

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

@@ -93,7 +93,7 @@ public class TRExamStudentServiceImpl extends ServiceImpl<TRExamStudentMapper, T
                                 //new卷面分/目标分
 //                                    targetMatrixScore = new BigDecimal(v).divide(courseTargetWordDto.getFinalScoreDto().getFinalScoreTargetSumScore()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
                                 //卷面分*权重/100
-                                targetMatrixScore = new BigDecimal(v).multiply(courseTargetWordDto.getFinalScoreDto().getFinalScoreSumWeight()).divide(SystemConstant.PERCENT, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                                targetMatrixScore = new BigDecimal(v).divide(courseTargetWordDto.getFinalScoreDto().getFinalScoreTargetSumScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(courseTargetWordDto.getFinalScoreDto().getFinalScoreSumWeight()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
                                 BigDecimal bigDecimal = new BigDecimal(v).setScale(2, BigDecimal.ROUND_HALF_UP);
                                 BigDecimal targetEvaluationValue = bigDecimal.divide(courseTargetWordDto.getFinalScoreDto().getFinalScoreTargetSumScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(courseTargetWordDto.getFinalScoreDto().getFinalScoreSumWeight().divide(courseTargetWordDto.getTargetSumWeight(), 2, BigDecimal.ROUND_HALF_UP)).setScale(2, BigDecimal.ROUND_HALF_UP);
                                 matrixDegree.set(matrixDegree.get().add(targetEvaluationValue));
@@ -130,7 +130,7 @@ public class TRExamStudentServiceImpl extends ServiceImpl<TRExamStudentMapper, T
                             Double targetMatrixScore = 0.0d;
                             if (Objects.nonNull(reportExamStudentTargetDto.getFinalScore())) {
                                 reportExamStudentFinalScoreAvgDto = reportExamStudentTargetDto.getFinalScore();
-                                targetMatrixScore = new BigDecimal(v).multiply(courseTargetWordDto.getFinalScoreDto().getFinalScoreSumWeight()).divide(SystemConstant.PERCENT, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                                targetMatrixScore = new BigDecimal(v).divide(courseTargetWordDto.getFinalScoreDto().getFinalScoreTargetSumScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(courseTargetWordDto.getFinalScoreDto().getFinalScoreSumWeight()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
 
                                 BigDecimal bigDecimal = new BigDecimal(v).setScale(2, BigDecimal.ROUND_HALF_UP);
                                 BigDecimal targetEvaluationValue = bigDecimal.divide(courseTargetWordDto.getFinalScoreDto().getFinalScoreTargetSumScore(), 2, BigDecimal.ROUND_HALF_UP).multiply(courseTargetWordDto.getFinalScoreDto().getFinalScoreSumWeight().divide(courseTargetWordDto.getTargetSumWeight(), 2, BigDecimal.ROUND_HALF_UP)).setScale(2, BigDecimal.ROUND_HALF_UP);

+ 12 - 0
distributed-print-business/src/main/resources/db/log/wangliang.sql

@@ -29,3 +29,15 @@ CREATE TABLE `obe_course_requirement_report` (
 -- 2024-06-15
 ALTER TABLE t_c_final_score MODIFY COLUMN course_code varchar(100) NULL COMMENT '课程编码';
 ALTER TABLE t_c_usual_score MODIFY COLUMN course_code varchar(100) NULL COMMENT '课程编码';
+
+-- 2024-06-17
+ALTER TABLE t_r_basic_info ADD college varchar(200) NULL COMMENT '开课学院';
+ALTER TABLE t_r_basic_info ADD profession varchar(200) NULL COMMENT '开课专业';
+ALTER TABLE t_r_basic_info CHANGE college college varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '开课学院' AFTER period;
+ALTER TABLE t_r_basic_info CHANGE profession profession varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '开课专业' AFTER college;
+ALTER TABLE t_r_basic_info ADD finish_points MEDIUMTEXT NULL COMMENT '达成情况';
+ALTER TABLE t_r_basic_info CHANGE finish_points finish_points MEDIUMTEXT NULL COMMENT '达成情况' AFTER participant;
+ALTER TABLE t_r_basic_info ADD requirement_points MEDIUMTEXT NULL COMMENT '课程支撑毕业要求达成情况评价';
+ALTER TABLE t_r_basic_info CHANGE requirement_points requirement_points MEDIUMTEXT NULL COMMENT '课程支撑毕业要求达成情况评价' AFTER finish_points;
+ALTER TABLE t_r_basic_info ADD course_suggest MEDIUMTEXT NULL COMMENT '课程持续改进';
+ALTER TABLE t_r_basic_info CHANGE course_suggest course_suggest MEDIUMTEXT NULL COMMENT '课程持续改进' AFTER requirement_points;

+ 5 - 11
distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java

@@ -1,6 +1,5 @@
 package com.qmth.distributed.print.api;
 
-import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -166,7 +165,7 @@ public class TRBasicInfoController {
                 }
                 trBasicInfo.setReportResult(new ReportResult(new ReportCommonDto(null, basicCourse.getCode(), markPaper.getCourseName(), paperNumber),
                         reportCourseBasicInfoDto, reportCourseEvaluationSpreadDto, reportCourseEvaluationResultDto,
-                        reportCourseEvaluationResultDetailDto));
+                        reportCourseEvaluationResultDetailDto, trBasicInfo));
             }
         }
         trBasicInfo.updateInfo(sysUser.getId());
@@ -264,10 +263,9 @@ public class TRBasicInfoController {
                 this.reportExport(cultureProgramId, courseId, paperNumber);
             } else {
                 //评价样本的基本信息
-                String period = Objects.nonNull(trBasicInfo.getPeriod()) ? trBasicInfo.getPeriod() : null;
-                String credit = Objects.nonNull(trBasicInfo.getCredit()) ? trBasicInfo.getCredit() : null;
-                period = Objects.nonNull(credit) ? period + "/" + credit : period;
-
+//                String period = Objects.nonNull(trBasicInfo.getPeriod()) ? trBasicInfo.getPeriod() : null;
+//                String credit = Objects.nonNull(trBasicInfo.getCredit()) ? trBasicInfo.getCredit() : null;
+//                period = Objects.nonNull(credit) ? period + "/" + credit : period;
                 JSONObject jsonObject = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResultDetail());
                 List<CourseTargetWordDto> courseTargetWordDtoList = JSONArray.parseArray(jsonObject.get("targetWordMap").toString(), CourseTargetWordDto.class);
 
@@ -276,11 +274,7 @@ public class TRBasicInfoController {
                     courseTarget.add("      ").add(s.getTargetName()).add("——").add(s.getGraduationRequirementPoint()).add("\r\n");
                 }).collect(Collectors.toList());
 
-                CourseBasicBean courseBasicBean = new CourseBasicBean(trBasicInfo.getCourseName(),
-                        trBasicInfo.getCourseCode(), null, trBasicInfo.getCourseType(),
-                        period, null, null, trBasicInfo.getDirector(),
-                        DateUtil.format(new Date(trBasicInfo.getCreateTime()), SystemConstant.DEFAULT_DATE_PATTERN),
-                        courseTarget.toString(), reportCourseEvaluationResultDto.getTargetList().size());
+                CourseBasicBean courseBasicBean = new CourseBasicBean(trBasicInfo, courseTarget.toString(), reportCourseEvaluationResultDto.getTargetList().size());
 
                 CourseReportBean courseReportBean = new CourseReportBean(trBasicInfo.getOpenTime() + "《" + trBasicInfo.getCourseName() + "》", courseBasicBean);
                 //table1-课程目标目标与毕业要求指标点的对应关系

BIN
distributed-print/src/main/resources/static/course_degree_report.docx


+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/ImportTemplateEnum.java

@@ -23,7 +23,7 @@ public enum ImportTemplateEnum {
     TEMPLATE_OBJECTIVE_STRUCT("objectiveStruct.xlsx","客观题导入模板.xlsx"),
     TEMPLATE_SUBJECTIVE_STRUCT("subjectiveStruct.xlsx","主观题导入模板.xlsx"),
 
-    STATIC_COURSE_DEGREE_REPORT("course_degree_report.docx", "课程目标达成度");
+    STATIC_COURSE_DEGREE_REPORT("course_degree_report.docx", "课程目标达成度及分析报告");
 
     ImportTemplateEnum(String templateName, String fileName) {
         this.templateName = templateName;