Kaynağa Gözat

日常更新

wangliang 4 yıl önce
ebeveyn
işleme
0c4124e7b3

+ 2 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TAExamCourseMapper.java

@@ -47,7 +47,8 @@ public interface TAExamCourseMapper extends BaseMapper<TAExamCourse> {
      */
     IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, @Param("schoolId") Long schoolId, @Param("examId") Long examId,
                                                  @Param("courseCode") String courseCode,
-                                                 @Param("publishStatus") String publishStatus);
+                                                 @Param("publishStatus") String publishStatus,
+                                                 @Param("semester") String semester);
 
     Map<String, String> getScoreAndRate(@Param("schoolId") Long schoolId, @Param("semester") String semester, @Param("examId") Long examId, @Param("courseCode") String courseCode);
 

+ 4 - 3
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TAExamCourseService.java

@@ -42,9 +42,10 @@ public interface TAExamCourseService extends IService<TAExamCourse> {
      * @param examId
      * @param courseCode
      * @param publishStatus
+     * @param semester
      * @return
      */
-    IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, Long schoolId, Long examId, String courseCode, PublishStatusEnum publishStatus);
+    IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, Long schoolId, Long examId, String courseCode, PublishStatusEnum publishStatus, SemesterEnum semester);
 
     Map<String, Object> getGradeDistribute(String semester, Long examId, String courseCode);
 
@@ -111,8 +112,8 @@ public interface TAExamCourseService extends IService<TAExamCourse> {
     /**
      * 赋分试算
      *
-     * @param examId     考试id
-     * @param courseCode 课程编号
+     * @param examId      考试id
+     * @param courseCode  课程编号
      * @param coefficient 赋分系数
      * @return 结果
      */

+ 11 - 13
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseServiceImpl.java

@@ -44,9 +44,6 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
     @Resource
     TAExamCourseRecordMapper taExamCourseRecordMapper;
 
-    @Resource
-    TBPaperStructService tbPaperStructService;
-
     @Resource
     ReportCommonService reportCommonService;
 
@@ -64,7 +61,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
      */
     @Override
     public IPage<TAExamCourseResult> surveyTeacherList(IPage<Map> iPage, Long examId, SemesterEnum semester, Long schoolId) {
-        return taExamCourseMapper.surveyTeacherList(iPage, examId, semester.name(), schoolId);
+        return taExamCourseMapper.surveyTeacherList(iPage, examId, Objects.nonNull(semester) ? semester.name() : null, schoolId);
     }
 
 
@@ -82,11 +79,12 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
      * @param examId
      * @param courseCode
      * @param publishStatus
+     * @param semester
      * @return
      */
     @Override
-    public IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, Long schoolId, Long examId, String courseCode, PublishStatusEnum publishStatus) {
-        return taExamCourseMapper.surveyAspointsList(iPage, schoolId, examId, courseCode, publishStatus.name());
+    public IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, Long schoolId, Long examId, String courseCode, PublishStatusEnum publishStatus, SemesterEnum semester) {
+        return taExamCourseMapper.surveyAspointsList(iPage, schoolId, examId, courseCode, Objects.nonNull(publishStatus) ? publishStatus.name() : null, Objects.nonNull(semester) ? semester.name() : null);
     }
 
     @Override
@@ -207,7 +205,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
      */
     @Override
     public IPage<TAExamCourseCollegeTeacherResult> surveyTeacherTeacherView(IPage<Map> iPage, Long schoolId, SemesterEnum semester, Long examId, String courseCode) {
-        return taExamCourseMapper.surveyTeacherTeacherView(iPage, schoolId, semester.name(), examId, courseCode);
+        return taExamCourseMapper.surveyTeacherTeacherView(iPage, schoolId, Objects.nonNull(semester) ? semester.name() : null, examId, courseCode);
     }
 
     /**
@@ -247,8 +245,8 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
     @Override
     public TrialCalculationResult trialCalculate(Long examId, String courseCode, BigDecimal coefficient) {
         // 试卷分数设置
-        List<TBPaper> tbPaperList = tbPaperService.list(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getExamId,examId).eq(TBPaper::getCourseCode,courseCode));
-        if (tbPaperList.size() == 0){
+        List<TBPaper> tbPaperList = tbPaperService.list(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getExamId, examId).eq(TBPaper::getCourseCode, courseCode));
+        if (tbPaperList.size() == 0) {
             throw ExceptionResultEnum.ERROR.exception("该课程不存在");
         }
         TBPaper tbPaper = tbPaperList.get(0);
@@ -256,13 +254,13 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
         BigDecimal passScore = tbPaper.getPassScore();
         // 参考的考生数据
         List<TAExamCourseRecord> taExamCourseRecordList = taExamCourseRecordMapper.selectList(new QueryWrapper<TAExamCourseRecord>().lambda()
-                .eq(TAExamCourseRecord::getExamId,examId)
-                .eq(TAExamCourseRecord::getCourseCode,courseCode)
-                .eq(TAExamCourseRecord::getAbsent,false));
+                .eq(TAExamCourseRecord::getExamId, examId)
+                .eq(TAExamCourseRecord::getCourseCode, courseCode)
+                .eq(TAExamCourseRecord::getAbsent, false));
         for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
             BigDecimal paperScore = taExamCourseRecord.getTotalScore();
             BigDecimal assignScore = paperScore.add((fullScore.subtract(paperScore)).divide(coefficient, 4, BigDecimal.ROUND_HALF_UP));
-            assignScore = assignScore.setScale(0,BigDecimal.ROUND_HALF_UP);
+            assignScore = assignScore.setScale(0, BigDecimal.ROUND_HALF_UP);
             taExamCourseRecord.setAssignedScore(assignScore);
         }
         int totalCount = taExamCourseRecordList.size();

+ 2 - 1
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/CourseController.java

@@ -124,11 +124,12 @@ public class CourseController {
     @RequestMapping(value = "/survey_aspoints/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TAExamCourseResult.class)})
     public Result surveyAspointsList(@ApiParam(value = "学校id", required = false) @RequestParam(required = false) String schoolId,
+                                     @ApiParam(value = "学期", required = true) @RequestParam SemesterEnum semester,
                                      @ApiParam(value = "考试id", required = true) @RequestParam String examId,
                                      @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode,
                                      @ApiParam(value = "发布状态", required = false) @RequestParam(required = false) PublishStatusEnum publishStatus,
                                      @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
                                      @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        return ResultUtil.ok(taExamCourseService.surveyAspointsList(new Page<>(pageNumber, pageSize), Objects.isNull(schoolId) ? (Long) ServletUtil.getRequestHeaderSchoolId() : SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode, publishStatus));
+        return ResultUtil.ok(taExamCourseService.surveyAspointsList(new Page<>(pageNumber, pageSize), Objects.isNull(schoolId) ? (Long) ServletUtil.getRequestHeaderSchoolId() : SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode, publishStatus, semester));
     }
 }