Selaa lähdekoodia

课程目标达成度修改

wangliang 1 vuosi sitten
vanhempi
commit
7723091bd4

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/report/PaperStructParams.java

@@ -21,7 +21,6 @@ public class PaperStructParams implements Serializable {
 
     @ApiModelProperty(value = "考试id")
     @JsonSerialize(using = ToStringSerializer.class)
-    @NotNull(message = "考试id不能为空")
     private Long examId;
 
     @JsonSerialize(using = ToStringSerializer.class)
@@ -30,7 +29,6 @@ public class PaperStructParams implements Serializable {
     private Long courseId;
 
     @ApiModelProperty(value = "课程编码")
-    @NotNull(message = "课程编码不能为空")
     private String courseCode;
 
     @ApiModelProperty(value = "试卷编码")

+ 1 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TCFinalScore.java

@@ -1,6 +1,5 @@
 package com.qmth.distributed.print.business.entity;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.distributed.print.business.enums.SourceEnum;
@@ -211,7 +210,7 @@ public class TCFinalScore extends BaseEntity implements Serializable {
             return false;
         }
         TCFinalScore that = (TCFinalScore) o;
-        return cultureProgramId.equals(that.cultureProgramId) && courseCode.equals(that.courseCode) && Objects.equals(courseName, that.courseName) && Objects.equals(paperNumber, that.paperNumber) && courseId.equals(that.courseId) && name.equals(that.name) && studentCode.equals(that.studentCode) && score.equals(that.score) && scoreDetail.equals(that.scoreDetail) && enable.equals(that.enable) && Objects.equals(getCreateId(), that.getCreateId());
+        return cultureProgramId.equals(that.cultureProgramId) && Objects.equals(courseCode, that.courseCode) && Objects.equals(courseName, that.courseName) && Objects.equals(paperNumber, that.paperNumber) && courseId.equals(that.courseId) && name.equals(that.name) && studentCode.equals(that.studentCode) && score.equals(that.score) && scoreDetail.equals(that.scoreDetail) && enable.equals(that.enable) && Objects.equals(getCreateId(), that.getCreateId());
     }
 
     @Override

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TCUsualScore.java

@@ -167,7 +167,7 @@ public class TCUsualScore extends BaseEntity implements Serializable {
             return false;
         }
         TCUsualScore that = (TCUsualScore) o;
-        return cultureProgramId.equals(that.cultureProgramId) && courseCode.equals(that.courseCode) && Objects.equals(
+        return cultureProgramId.equals(that.cultureProgramId) && Objects.equals(courseCode, that.courseCode) && Objects.equals(
                 courseName, that.courseName) && courseId.equals(that.courseId) && name.equals(that.name) && studentCode.equals(that.studentCode) && score.equals(that.score) && enable.equals(that.enable)
                 && Objects.equals(getCreateId(), that.getCreateId());
     }

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TRBasicInfo.java

@@ -37,11 +37,9 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
     private Long courseId;
 
     @ApiModelProperty(value = "课程编码")
-    @NotNull(message = "课程编码不能为空")
     private String courseCode;
 
     @ApiModelProperty(value = "课程名称")
-    @NotNull(message = "课程名称不能为空")
     private String courseName;
 
     @ApiModelProperty(value = "试卷编码")

+ 4 - 16
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TCFinalScoreMapper.java

@@ -24,50 +24,38 @@ public interface TCFinalScoreMapper extends BaseMapper<TCFinalScore> {
      * 期末成绩列表(分页)
      *
      * @param iPage
-     * @param examId
-     * @param courseCode
-     * @param paperNumber
      * @param cultureProgramId
      * @param courseId
      * @return
      */
-    public IPage<TCFinalScore> finalScoreList(IPage<Map> iPage, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("cultureProgramId") Long cultureProgramId, @Param("courseId") Long courseId);
+    public IPage<TCFinalScore> finalScoreList(IPage<Map> iPage, @Param("cultureProgramId") Long cultureProgramId, @Param("courseId") Long courseId);
 
     /**
      * 查找期末成绩分数图
      *
-     * @param examId
-     * @param courseCode
-     * @param paperNumber
      * @param cultureProgramId
      * @param courseId
      * @return
      */
-    public FinalScoreDto finalScoreScoreOverView(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("cultureProgramId") Long cultureProgramId, @Param("courseId") Long courseId);
+    public FinalScoreDto finalScoreScoreOverView(@Param("cultureProgramId") Long cultureProgramId, @Param("courseId") Long courseId);
 
     /**
      * 查找期末成绩分数区间
      *
-     * @param examId
-     * @param courseCode
-     * @param paperNumber
      * @param cultureProgramId
      * @param courseId
      * @param start
      * @param end
      * @return
      */
-    public int getCountByScoreRange(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("cultureProgramId") Long cultureProgramId, @Param("courseId") Long courseId, @Param("start") Double start, @Param("end") Double end);
+    public int getCountByScoreRange(@Param("cultureProgramId") Long cultureProgramId, @Param("courseId") Long courseId, @Param("start") Double start, @Param("end") Double end);
 
     /**
      * 查找考生成绩
      *
-     * @param examId
-     * @param courseCode
-     * @param paperNumber
      * @param cultureProgramId
      * @param courseId
      * @return
      */
-    public List<FinalScoreResult> examStudentOverview(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("cultureProgramId") Long cultureProgramId, @Param("courseId") Long courseId);
+    public List<FinalScoreResult> examStudentOverview(@Param("cultureProgramId") Long cultureProgramId, @Param("courseId") Long courseId);
 }

+ 2 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TRBasicInfoService.java

@@ -72,9 +72,10 @@ public interface TRBasicInfoService extends IService<TRBasicInfo> {
      * @param userId
      * @param obeCourseWeightResult
      * @param cultureProgramId
+     * @param courseId
      * @return
      */
-    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId, ObeCourseWeightResult obeCourseWeightResult, Long cultureProgramId);
+    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId, ObeCourseWeightResult obeCourseWeightResult, Long cultureProgramId, Long courseId);
 
     /**
      * 构建word动态表格1-课程目标与毕业要求指标点的对应关系

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

@@ -207,7 +207,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
      */
     @Override
     public IPage<TCFinalScore> finalScoreList(IPage<Map> iPage, Long examId, String courseCode, String paperNumber, Long cultureProgramId, Long courseId) {
-        return this.baseMapper.finalScoreList(iPage, examId, courseCode, paperNumber, cultureProgramId, courseId);
+        return this.baseMapper.finalScoreList(iPage, cultureProgramId, courseId);
     }
 
     /**
@@ -222,7 +222,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
      */
     @Override
     public FinalScoreDto finalScoreScoreOverView(Long examId, String courseCode, String paperNumber, Long cultureProgramId, Long courseId) {
-        return this.baseMapper.finalScoreScoreOverView(examId, courseCode, paperNumber, cultureProgramId, courseId);
+        return this.baseMapper.finalScoreScoreOverView(cultureProgramId, courseId);
     }
 
     /**
@@ -239,7 +239,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
      */
     @Override
     public int getCountByScoreRange(Long examId, String courseCode, String paperNumber, Long cultureProgramId, Long courseId, Double start, Double end) {
-        return this.baseMapper.getCountByScoreRange(examId, courseCode, paperNumber, cultureProgramId, courseId, start, end);
+        return this.baseMapper.getCountByScoreRange(cultureProgramId, courseId, start, end);
     }
 
     /**
@@ -254,7 +254,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
      */
     @Override
     public List<FinalScoreResult> examStudentOverview(Long examId, String courseCode, String paperNumber, Long cultureProgramId, Long courseId) {
-        return this.baseMapper.examStudentOverview(examId, courseCode, paperNumber, cultureProgramId, courseId);
+        return this.baseMapper.examStudentOverview(cultureProgramId, courseId);
     }
 
     @Override

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

@@ -15,6 +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;
@@ -83,6 +84,9 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
     @Resource
     BasicCourseService basicCourseService;
 
+    @Resource
+    ObeCourseOutlineService obeCourseOutlineService;
+
     protected static final String tbBgColor = "F2F2F2";
     protected static final String tbPercentWidth = "100%";
 
@@ -416,12 +420,15 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
      * @param userId
      * @param obeCourseWeightResult
      * @param cultureProgramId
+     * @param courseId
      * @return
      */
     @Override
     @Transactional
-    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId, ObeCourseWeightResult obeCourseWeightResult, Long cultureProgramId) {
-        BasicSemester basicSemester = basicSemesterService.selectByExamId(markPaper.getExamId());
+    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId, ObeCourseWeightResult obeCourseWeightResult, Long cultureProgramId, Long courseId) {
+        ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId, courseId);
+        Objects.requireNonNull(obeCourseOutline, "未找到课程大纲信息");
+        BasicSemester basicSemester = basicSemesterService.getById(obeCourseOutline.getSemesterId());
         Objects.requireNonNull(basicSemester, "未找到学期信息");
 
         String teachingObject = null, teacher = null;

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

@@ -48,4 +48,8 @@ CREATE TABLE `obe_course_requirement_report` (
 
 UPDATE sys_privilege
 SET name='毕业要求达成度报表列表', url='/api/admin/obe/requirements/list', `type`='URL', parent_id=2070, `sequence`=1, property='AUTH', related=NULL, enable=1, default_auth=1, front_display=1
-WHERE id=2075;
+WHERE id=2075;
+
+-- 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 '课程编码';

+ 8 - 39
distributed-print-business/src/main/resources/mapper/TCFinalScoreMapper.xml

@@ -5,15 +5,6 @@
     <select id="finalScoreList" resultType="com.qmth.distributed.print.business.entity.TCFinalScore">
         select * from t_c_final_score t
         <where>
-            <if test="examId != null and examId != ''">
-                and t.exam_id = #{examId}
-            </if>
-            <if test="courseCode != null and courseCode != ''">
-                and t.course_code = #{courseCode}
-            </if>
-            <if test="paperNumber != null and paperNumber != ''">
-                and t.paper_number = #{paperNumber}
-            </if>
             <if test="cultureProgramId != null and cultureProgramId != ''">
                 and t.culture_program_id = #{cultureProgramId}
             </if>
@@ -30,17 +21,8 @@
             min(case when tcfs.score is not null then tcfs.score else null end) finalScoreMinScore,
             avg(case when tcfs.score is not null then tcfs.score else null end) finalScoreAvgScore
             from t_c_final_score tcfs
-            join t_c_usual_score tcus on tcfs.exam_id = tcus.exam_id and tcfs.course_code = tcus.course_code and tcfs.course_id = tcus.course_id and tcfs.culture_program_id = tcus.culture_program_id and tcfs.student_code = tcus.student_code
+            join t_c_usual_score tcus on tcfs.course_id = tcus.course_id and tcfs.culture_program_id = tcus.culture_program_id and tcfs.student_code = tcus.student_code
         <where>
-            <if test="examId != null and examId != ''">
-                and tcfs.exam_id = #{examId}
-            </if>
-            <if test="courseCode != null and courseCode != ''">
-                and tcfs.course_code = #{courseCode}
-            </if>
-            <if test="paperNumber != null and paperNumber != ''">
-                and tcfs.paper_number = #{paperNumber}
-            </if>
             <if test="cultureProgramId != null and cultureProgramId != ''">
                 and tcfs.culture_program_id = #{cultureProgramId}
             </if>
@@ -54,15 +36,6 @@
     <select id="getCountByScoreRange" resultType="int">
         SELECT count(1) FROM t_c_final_score tcfs
         <where>
-            <if test="examId != null and examId != ''">
-                and tcfs.exam_id = #{examId}
-            </if>
-            <if test="courseCode != null and courseCode != ''">
-                and tcfs.course_code = #{courseCode}
-            </if>
-            <if test="paperNumber != null and paperNumber != ''">
-                and tcfs.paper_number = #{paperNumber}
-            </if>
             <if test="cultureProgramId != null and cultureProgramId != ''">
                 and tcfs.culture_program_id = #{cultureProgramId}
             </if>
@@ -80,20 +53,11 @@
             tcfs.student_code as studentCode,
             tcfs.score_detail as finalScoreDetail,
             tcus.score as usualScore,
-            es.teach_clazz_name as administrativeClass
+            group_concat(es.teach_clazz_name) as administrativeClass
         from t_c_final_score tcfs
-        join t_c_usual_score tcus on tcfs.exam_id = tcus.exam_id and tcfs.course_code = tcus.course_code and tcfs.course_id = tcus.course_id and tcfs.culture_program_id = tcus.culture_program_id and tcfs.student_code = tcus.student_code
+        join t_c_usual_score tcus on tcfs.course_id = tcus.course_id and tcfs.culture_program_id = tcus.culture_program_id and tcfs.student_code = tcus.student_code
         left join exam_student es on es.exam_id = tcfs.exam_id and es.paper_number = tcfs.paper_number and es.student_code = tcfs.student_code
         <where>
-            <if test="examId != null and examId != ''">
-                and tcfs.exam_id = #{examId}
-            </if>
-            <if test="courseCode != null and courseCode != ''">
-                and tcfs.course_code = #{courseCode}
-            </if>
-            <if test="paperNumber != null and paperNumber != ''">
-                and tcfs.paper_number = #{paperNumber}
-            </if>
             <if test="cultureProgramId != null and cultureProgramId != ''">
                 and tcfs.culture_program_id = #{cultureProgramId}
             </if>
@@ -101,6 +65,11 @@
                 and tcfs.course_id = #{courseId}
             </if>
         </where>
+        group by
+        tcfs.name,
+        tcfs.student_code,
+        tcfs.score_detail,
+        tcus.score
             order by tcfs.student_code
     </select>
 </mapper>

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

@@ -104,8 +104,10 @@ public class TRBasicInfoController {
     @ApiOperation(value = "报告管理列表")
     @RequestMapping(value = "/report/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ObeScoreResult.class)})
-    public Result reportList(@ApiParam(value = "培养方案ID", required = true) @RequestParam Long cultureProgramId, @ApiParam(value = "学期ID", required = true) @RequestParam Long semesterId,
-                             @ApiParam(value = "课程id") @RequestParam(required = false) Long courseId, @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+    public Result reportList(@ApiParam(value = "培养方案ID", required = true) @RequestParam Long cultureProgramId,
+                             @ApiParam(value = "学期ID") @RequestParam(required = false) Long semesterId,
+                             @ApiParam(value = "课程id", required = true) Long courseId,
+                             @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                              @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
         return ResultUtil.ok(
                 printCommonService.scoreList(new Page<>(pageNumber, pageSize), cultureProgramId, semesterId, courseId));
@@ -154,7 +156,7 @@ public class TRBasicInfoController {
         MarkPaper markPaper = printCommonService.getMarkPaper(null, basicCourse.getCode(), tcPaperStruct.getPaperNumber());
         if (Objects.isNull(trBasicInfo)) {
             trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(),
-                    obeCourseWeightResult, cultureProgramId);
+                    obeCourseWeightResult, cultureProgramId, courseId);
         } else {
             ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = Objects.nonNull(trBasicInfo.getCourseEvaluationResult()) ?
                     JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class) :
@@ -166,7 +168,7 @@ public class TRBasicInfoController {
                                 && tcPaperStruct.getDimensionSign().longValue()
                                 != obeCourseWeightResult.getDimensionSign().longValue());
                 trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(),
-                        obeCourseWeightResult, cultureProgramId);
+                        obeCourseWeightResult, cultureProgramId, courseId);
             } else {
                 ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
                 ReportCourseEvaluationSpreadDto reportCourseEvaluationSpreadDto = Objects.nonNull(trBasicInfo.getCourseEvaluationSpread()) ?
@@ -211,7 +213,7 @@ public class TRBasicInfoController {
                 TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber());
                 MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), Objects.nonNull(tcPaperStruct) ? tcPaperStruct.getPaperNumber() : trBasicInfo.getPaperNumber());
                 ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId());
-                trBasicInfoDb = trBasicInfoService.getReportView(trBasicInfoDb, markPaper, sysUser.getId(), trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId()), trBasicInfo.getCultureProgramId());
+                trBasicInfoDb = trBasicInfoService.getReportView(trBasicInfoDb, markPaper, sysUser.getId(), trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId()), trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId());
             } else {
                 trBasicInfoDb.updateInfo(trBasicInfo, sysUser.getId());
             }