Ver Fonte

Merge branch 'dev_v2.1.0' into release_v2.1.0
merge

wangliang há 3 anos atrás
pai
commit
1382e812b0

+ 2 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TBPaperStructMapper.java

@@ -25,4 +25,6 @@ public interface TBPaperStructMapper extends BaseMapper<TBPaperStruct> {
      * @return
      */
     List<TBPaperStructResult> findQuestionInfo(@Param("examId") Long examId, @Param("courseCode") String courseCode);
+
+    List<TBPaperStructResult> findQuestionInfoByTeacherCollege(@Param("examId") Long examId,@Param("courseCode") String courseCode,@Param("inspectCollegeId") Long inspectCollegeId,@Param("teacherId") Long teacherId);
 }

+ 8 - 7
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/ReportCommonService.java

@@ -81,14 +81,15 @@ public interface ReportCommonService {
     TeacherInfoListResult findTeacherInfo(Long examId, String courseCode, Long collegeId);
 
     /**
-     * 查找题目信息
-     *
-     * @param examId
-     * @param courseCode
-     * @param collegeId
-     * @return
+     * 根据参数查找题目信息
+     * @param examId 考试id
+     * @param courseCode 课程编号
+     * @param teachCollegeId 开课学院id
+     * @param inspectCollegeId 考察学院id
+     * @param teacherId 授课教师id
+     * @return 结果
      */
-    QuestionListResult findQuestionInfo(Long examId, String courseCode, Long collegeId);
+    QuestionListResult findQuestionInfo(Long examId, String courseCode, Long teachCollegeId,Long inspectCollegeId,Long teacherId);
 
     /**
      * 取总体平均分

+ 10 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBPaperStructService.java

@@ -24,4 +24,14 @@ public interface TBPaperStructService extends IService<TBPaperStruct> {
      * @return
      */
     List<TBPaperStructResult> findQuestionInfo(Long examId, String courseCode);
+
+    /**
+     * 查找教师学院下试卷结果
+     * @param examId 考试id
+     * @param courseCode 课程编号
+     * @param inspectCollegeId 考察学院id
+     * @param teacherId 授课教师id
+     * @return 结果
+     */
+    List<TBPaperStructResult> findQuestionInfoByTeacherCollege(Long examId,String courseCode,Long inspectCollegeId,Long teacherId);
 }

+ 15 - 7
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/ReportCommonServiceImpl.java

@@ -427,16 +427,24 @@ public class ReportCommonServiceImpl implements ReportCommonService {
 
     /**
      * 查找题目信息
-     *
-     * @param examId
-     * @param courseCode
-     * @param collegeId
-     * @return
+     * @param examId 考试id
+     * @param courseCode 课程编号
+     * @param teachCollegeId 开课学院id
+     * @param inspectCollegeId 考察学院id
+     * @param teacherId 授课教师id
+     * @return 结果
      */
     @Override
-    public QuestionListResult findQuestionInfo(Long examId, String courseCode, Long collegeId) {
+    public QuestionListResult findQuestionInfo(Long examId, String courseCode, Long teachCollegeId,Long inspectCollegeId,Long teacherId) {
         //查找试卷结构
-        List<TBPaperStructResult> questionDatasource = tbPaperStructService.findQuestionInfo(examId, courseCode);
+        List<TBPaperStructResult> questionDatasource;
+        if (SystemConstant.longNotNull(inspectCollegeId) && SystemConstant.longNotNull(teacherId)){
+            // 教师课堂查询 -> 教师在某课程学院下学生数据集
+            questionDatasource = tbPaperStructService.findQuestionInfoByTeacherCollege(examId, courseCode,inspectCollegeId,teacherId);
+        }else {
+            // 开课学院和考察学院查询 -> 全校学生某课程数据集
+            questionDatasource = tbPaperStructService.findQuestionInfo(examId, courseCode);
+        }
         //查找维度
         QueryWrapper<TBDimension> tbDimensionQueryWrapper = new QueryWrapper<>();
         tbDimensionQueryWrapper.lambda().eq(TBDimension::getExamId, examId)

+ 2 - 2
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseCollegeTeacherServiceImpl.java

@@ -142,8 +142,8 @@ public class TAExamCourseCollegeTeacherServiceImpl extends ServiceImpl<TAExamCou
         SurveyTeacherExamCourseResult surveyTeacherExamCourseResult = reportCommonService.findAvgScore(schoolId, courseCode, examId, false);
         //学院学科报表科目描述
         List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = reportCommonService.surveyTeacherDistribution(examId, courseCode, inspectCollegeId, false);
-        //查找题目信息
-        QuestionListResult questionListResult = reportCommonService.findQuestionInfo(examId, courseCode, inspectCollegeId);
+        //查找题目信息(该教师在该学院下的数据)
+        QuestionListResult questionListResult = reportCommonService.findQuestionInfo(examId, courseCode, null,inspectCollegeId,sysUser.getId());
         return new SurveyTeacherViewResult(surveyTeacherGradeDistributionResultList, teachCourseResultFinal, questionListResult, surveyTeacherExamCourseResult);
     }
 

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

@@ -161,7 +161,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
         //查找老师得分
         TeacherInfoListResult teacherInfoListResult = reportCommonService.findTeacherInfo(examId, courseCode, collegeId);
         //查找题目信息
-        QuestionListResult questionListResult = reportCommonService.findQuestionInfo(examId, courseCode, collegeId);
+        QuestionListResult questionListResult = reportCommonService.findQuestionInfo(examId, courseCode, null,null,null);
 
         return new CollegeAndCourseResult(courseInfoResult, collegeAndSchoolGradeDistributionResult, dimensionAnalyzeResult,
                 questionInfoResult, teacherInfoListResult, questionListResult);
@@ -189,7 +189,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
         //学院学科报表科目描述
         List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = reportCommonService.surveyTeacherDistribution(examId, courseCode, null, false);
         //查找题目信息
-        QuestionListResult questionListResult = reportCommonService.findQuestionInfo(examId, courseCode, collegeId);
+        QuestionListResult questionListResult = reportCommonService.findQuestionInfo(examId, courseCode, null,null,null);
         return new SurveyTeacherViewResult(surveyTeacherGradeDistributionResultList, questionListResult, surveyTeacherExamCourseResult, teachCourseSurveyResult);
     }
 

+ 5 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBPaperStructServiceImpl.java

@@ -35,4 +35,9 @@ public class TBPaperStructServiceImpl extends ServiceImpl<TBPaperStructMapper, T
     public List<TBPaperStructResult> findQuestionInfo(Long examId, String courseCode) {
         return tbPaperStructMapper.findQuestionInfo(examId, courseCode);
     }
+
+    @Override
+    public List<TBPaperStructResult> findQuestionInfoByTeacherCollege(Long examId, String courseCode, Long inspectCollegeId, Long teacherId) {
+        return tbPaperStructMapper.findQuestionInfoByTeacherCollege(examId, courseCode,inspectCollegeId,teacherId);
+    }
 }

+ 7 - 1
teachcloud-report-business/src/main/resources/mapper/TBDimensionMapper.xml

@@ -132,7 +132,7 @@
             name_primary AS dimensionName,
             interpretation,
             total_count AS totalCount,
-            ROUND(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),
+            ROUND(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),
                   2) AS schScoreRate,
             ROUND(CONVERT( myDio.score_rate * 100 , DECIMAL (10 , 4 )),
                   2) AS colScoreRate,
@@ -168,6 +168,12 @@
                 AND tmp.dimension_type = myDio.dimension_type
                 AND papDio.exam_id = myDio.exam_id
                 AND papDio.course_code = myDio.course_code
+                INNER JOIN
+            t_a_exam_course_college_inspect_dio colDio ON tmp.dimension_type = myDio.dimension_type
+                AND tmp.code_primary = colDio.dimension_code
+                AND colDio.exam_id = myDio.exam_id
+                AND colDio.course_code = myDio.course_code
+                AND colDio.inspect_college_id = myDio.inspect_college_id
         <where>
             <if test="examId != null and examId != ''">
                 and papDio.exam_id = #{examId}

+ 31 - 0
teachcloud-report-business/src/main/resources/mapper/TBPaperStructMapper.xml

@@ -27,4 +27,35 @@
             </if>
         </where>
     </select>
+    <select id="findQuestionInfoByTeacherCollege"
+            resultType="com.qmth.teachcloud.report.business.bean.result.TBPaperStructResult">
+        SELECT
+            paper_type AS paperType,
+            question_name AS questionName,
+            big_question_number AS mainNumber,
+            small_question_number AS subNumber,
+            full_score AS fullScore,
+            knowledge_dimension AS knowledgeDimension,
+            ability_dimension AS abilityDimension,
+            ROUND(CONVERT( score_rate * 100 , DECIMAL (10 , 4 )),
+                  2) AS scoreRate,
+            difficult,
+            paper_struct_judge AS paperStructJudge
+        FROM
+            t_a_exam_course_teacher_college_paper_struct
+        <where>
+            <if test="examId != null and examId > 0">
+                and exam_id = #{examId}
+            </if>
+            <if test="courseCode != null and courseCode.length > 0">
+                and course_code = #{courseCode}
+            </if>
+            <if test="inspectCollegeId != null and inspectCollegeId > 0">
+                and inspect_college_id = #{inspectCollegeId}
+            </if>
+            <if test="teacherId != null and teacherId > 0">
+                and teacher_id = #{teacherId}
+            </if>
+        </where>
+    </select>
 </mapper>