Jelajahi Sumber

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

wangliang 4 tahun lalu
induk
melakukan
7aec4e5560

+ 9 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TBExamCourseMapper.java

@@ -30,4 +30,13 @@ public interface TBExamCourseMapper extends BaseMapper<TBExamCourse> {
      */
     List<TBExamCourseResult> findCourseList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("inspect") boolean inspect, @Param("collegeIds") List<Long> collegeIds);
 
+    /**
+     * 查询科目信息
+     *
+     * @param schoolId
+     * @param examId
+     * @param teacherId
+     * @return
+     */
+    List<TBExamCourseResult> findCourseListByTeacherId(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("teacherId") Long teacherId);
 }

+ 9 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBExamCourseService.java

@@ -37,4 +37,13 @@ public interface TBExamCourseService extends IService<TBExamCourse> {
      * @return
      */
     List<TBExamCourseResult> findCourseList(Long schoolId, Long examId, boolean inspect);
+
+    /**
+     * 查询科目信息
+     *
+     * @param schoolId
+     * @param examId
+     * @return
+     */
+    List<TBExamCourseResult> findCourseList(Long schoolId, Long examId);
 }

+ 13 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExamCourseServiceImpl.java

@@ -115,4 +115,17 @@ public class TBExamCourseServiceImpl extends ServiceImpl<TBExamCourseMapper, TBE
             return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, Arrays.asList(sysUser.getOrgId()));
         }
     }
+
+    /**
+     * 查询科目信息
+     *
+     * @param schoolId
+     * @param examId
+     * @return
+     */
+    @Override
+    public List<TBExamCourseResult> findCourseList(Long schoolId, Long examId) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        return tbExamCourseMapper.findCourseListByTeacherId(schoolId, examId, sysUser.getId());
+    }
 }

+ 17 - 0
teachcloud-report-business/src/main/resources/mapper/TBExamCourseMapper.xml

@@ -37,4 +37,21 @@
             </if>
         </where>
     </select>
+
+    <select id="findCourseListByTeacherId" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamCourseResult">
+        select DISTINCT tbs.course_code,tbs.course_name from t_b_exam_student tbs
+        join basic_course bc
+        on tbs.course_code = bc.code
+        <where>
+            <if test="examId != null and examId != ''">
+                and tbs.exam_id = #{examId}
+            </if>
+            <if test="schoolId != null and schoolId != ''">
+                and bc.school_id = #{schoolId}
+            </if>
+            <if test="teacherId != null and teacherId != ''">
+                and tbs.teacher_id = #{schoolId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 9 - 0
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysReportController.java

@@ -5,6 +5,7 @@ import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
+import com.qmth.teachcloud.report.business.bean.result.TBExamCourseResult;
 import com.qmth.teachcloud.report.business.bean.result.TBExamResult;
 import com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult;
 import com.qmth.teachcloud.report.business.entity.TBExam;
@@ -84,6 +85,14 @@ public class SysReportController {
         return ResultUtil.ok(tbExamCourseService.findCourseList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), inspect));
     }
 
+    @ApiOperation(value = "任课老师-课程列表")
+    @RequestMapping(value = "/common/list_course_teach", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "科目信息", response = TBExamCourse.class)})
+    public Result listCourseTeach(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
+                                  @ApiParam(value = "考试id", required = true) @RequestParam String examId) {
+        return ResultUtil.ok(tbExamCourseService.findCourseList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId)));
+    }
+
     @ApiOperation(value = "开课学院列表")
     @RequestMapping(value = "/common/list_teach_college", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})