Explorar o código

课程目标达成度加入重新计算

wangliang hai 11 meses
pai
achega
42d394d49e

+ 13 - 3
distributed-print/install/mysql/upgrade/3.4.0.sql

@@ -341,9 +341,6 @@ CREATE TABLE `tmp_help_topic` (
                                   PRIMARY KEY (`help_topic_id`)
                                   PRIMARY KEY (`help_topic_id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4;
 ) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4;
 
 
--- ----------------------------
--- Records of tmp_help_topic
--- ----------------------------
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (1);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (1);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (2);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (2);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (3);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (3);
@@ -394,3 +391,16 @@ INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (47);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (48);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (48);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (49);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (49);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (50);
 INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (50);
+
+-- 2024-07-17
+UPDATE sys_privilege
+SET name='查看详情', url='View', `type`='LINK', parent_id=2002, `sequence`=1, property='AUTH', related='2026,2027,2028,2031', enable=1, default_auth=0, front_display=1
+WHERE id=2025;
+
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(2108, '重新计算', 'Calculate', 'LINK', 2002, 2, 'AUTH', '2109', 1, 0, 1);
+
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(2109, '重新计算接口', '/api/admin/course/degree/report/again/calculate', 'URL', 2108, 1, 'AUTH', NULL, 1, 1, 1);

+ 37 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TRBasicInfoController.java

@@ -183,6 +183,41 @@ public class TRBasicInfoController {
         return ResultUtil.ok(trBasicInfo.getReportResult());
         return ResultUtil.ok(trBasicInfo.getReportResult());
     }
     }
 
 
+    @ApiOperation(value = "报告重新计算")
+    @RequestMapping(value = "/report/again/calculate", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "查看报告", response = ReportResult.class)})
+    @Transactional
+    public Result reportAgainCalculate(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
+                                       @ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
+                                       @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId,
+                courseId);
+
+        ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId());
+        log.info("ObeCourseWeightResult:{}", JacksonUtil.parseJson(obeCourseWeightResult));
+        TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber);
+        if (Objects.isNull(tcPaperStruct) || Objects.isNull(tcPaperStruct.getPaperStructDimension())) {
+            throw ExceptionResultEnum.ERROR.exception("未找到试卷蓝图信息");
+        }
+        MarkPaper markPaper = printCommonService.getMarkPaper(null, tcPaperStruct.getPaperNumber(), courseId);
+
+        TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber);
+        trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber,
+                Objects.nonNull(tcPaperStruct.getDimensionSign())
+                        && tcPaperStruct.getDimensionSign().longValue()
+                        != obeCourseWeightResult.getDimensionSign().longValue());
+
+        TRBasicInfo trBasicInfoAgainCalculate = trBasicInfoService.getReportView(null, markPaper, sysUser.getId(),
+                obeCourseWeightResult, cultureProgramId, courseId);
+        if (Objects.nonNull(trBasicInfo)) {
+            trBasicInfoAgainCalculate.setCalculate(trBasicInfo);
+        }
+        //课程目标达成评价明细结果-课程目标达成评价值图
+        trBasicInfoService.save(trBasicInfoAgainCalculate);
+        return ResultUtil.ok(trBasicInfoAgainCalculate.getReportResult());
+    }
+
     @ApiOperation(value = "保存报告")
     @ApiOperation(value = "保存报告")
     @RequestMapping(value = "/report/save", method = RequestMethod.POST)
     @RequestMapping(value = "/report/save", method = RequestMethod.POST)
     @OperationLogDetail(operationType = OperationTypeEnum.UPDATE)
     @OperationLogDetail(operationType = OperationTypeEnum.UPDATE)
@@ -378,8 +413,8 @@ public class TRBasicInfoController {
             if (!report) {
             if (!report) {
                 TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber);
                 TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber);
                 if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
                 if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
-                    List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
-                    }.getType());
+//                    List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
+//                    }.getType());
                     StringJoiner stringJoiner = new StringJoiner("");
                     StringJoiner stringJoiner = new StringJoiner("");
                     for (CourseWeightDto c : courseWeightDtoList) {
                     for (CourseWeightDto c : courseWeightDtoList) {
                         if (Objects.isNull(c.getTotalWeight())) {
                         if (Objects.isNull(c.getTotalWeight())) {

+ 13 - 0
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/entity/TRBasicInfo.java

@@ -235,6 +235,19 @@ public class TRBasicInfo extends BaseEntity implements Serializable {
         this.courseSuggest = trBasicInfo.getCourseSuggest();
         this.courseSuggest = trBasicInfo.getCourseSuggest();
     }
     }
 
 
+    public void setCalculate(TRBasicInfo trBasicInfo) {
+        this.courseType = trBasicInfo.getCourseType();
+        this.courseEnName = trBasicInfo.getCourseEnName();
+        this.credit = trBasicInfo.getCredit();
+        this.period = trBasicInfo.getPeriod();
+        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,
     public void setBasicInfo(Long examId, String courseCode, String courseName, String paperNumber, String openTime,
                              String teachingObject, String teacher, Integer participantCount, Long cultureProgramId,
                              String teachingObject, String teacher, Integer participantCount, Long cultureProgramId,
                              Long courseId, BigDecimal courseDegree, String profession, String courseEnName, String college,
                              Long courseId, BigDecimal courseDegree, String profession, String courseEnName, String college,