xiaofei 11 місяців тому
батько
коміт
2e9a4da29f

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/BasicExamStudentResult.java

@@ -15,7 +15,7 @@ import javax.annotation.Resource;
  */
 public class BasicExamStudentResult extends BasicExamStudent {
 
-    @ApiModelProperty("课程名称")
+    @ApiModelProperty("考生ID")
     @JsonSerialize(using = ToStringSerializer.class)
     private Long studentId;
 

+ 1 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/BasicExamStudentMapper.java

@@ -29,21 +29,9 @@ public interface BasicExamStudentMapper extends BaseMapper<BasicExamStudent> {
 
     /**
      * 列表查询
-     *
-     * @param schoolId        学校id
-     * @param semesterId      学期id
-     * @param examId          考试id
-     * @param courseCode      课程代码
-     * @param teacher         教师
-     * @param college         学院
-     * @param major           专业
-     * @param teachClazz      教学班
-     * @param examStudentInfo 考生信息(姓名/学号)
-     * @param dpr             数据权限
-     * @return 查询结果
      */
     List<BasicExamStudentResult> findBasicExamStudentList(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId,
-                                                          @Param("courseCode") String courseCode, @Param("teacher") String teacher, @Param("college") String college,
+                                                          @Param("courseId") Long courseId, @Param("teacher") String teacher, @Param("college") String college,
                                                           @Param("major") String major, @Param("teachClazz") String teachClazz, @Param("examStudentInfo") String examStudentInfo,
                                                           @Param("dpr") DataPermissionRule dpr);
 

+ 2 - 23
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicExamStudentService.java

@@ -31,19 +31,8 @@ public interface BasicExamStudentService extends IService<BasicExamStudent> {
 
     /**
      * 列表查询
-     *
-     * @param requestUser     请求人
-     * @param semesterId      学期id
-     * @param examId          考试id
-     * @param courseCode      课程代码
-     * @param teacher         教师
-     * @param college         学院
-     * @param major           专业
-     * @param teachClazz      教学班
-     * @param examStudentInfo 考生信息(姓名/学号)
-     * @return 查询结果
      */
-    List<BasicExamStudentResult> list(SysUser requestUser, Long semesterId, Long examId, String courseCode, String teacher,
+    List<BasicExamStudentResult> list(SysUser requestUser, Long semesterId, Long examId, Long courseId, String teacher,
                                       String college, String major, String teachClazz, String examStudentInfo);
 
     /**
@@ -64,18 +53,8 @@ public interface BasicExamStudentService extends IService<BasicExamStudent> {
 
     /**
      * 导出
-     *
-     * @param response        response
-     * @param semesterId      学期id
-     * @param examId          考试id
-     * @param courseCode      课程代码
-     * @param teacher         教师
-     * @param college         学院
-     * @param major           专业
-     * @param teachClazz      教学班
-     * @param examStudentInfo 考生信息(姓名/学号)
      */
-    void exportLogic(HttpServletResponse response, Long semesterId, Long examId, String courseCode, String teacher,
+    void exportLogic(HttpServletResponse response, Long semesterId, Long examId, Long courseId, String teacher,
                      String college, String major, String teachClazz, String examStudentInfo) throws Exception;
 
     /**

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

@@ -116,11 +116,10 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     }
 
     @Override
-    public List<BasicExamStudentResult> list(SysUser requestUser, Long semesterId, Long examId, String courseCode,
+    public List<BasicExamStudentResult> list(SysUser requestUser, Long semesterId, Long examId, Long courseId,
                                              String teacher, String college, String major, String teachClazz, String examStudentInfo) {
         Long schoolId = requestUser.getSchoolId();
 
-        courseCode = SystemConstant.translateSpecificSign(courseCode);
         teacher = SystemConstant.translateSpecificSign(teacher);
         college = SystemConstant.translateSpecificSign(college);
         major = SystemConstant.translateSpecificSign(major);
@@ -130,7 +129,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, requestUser.getId(),
                 ServletUtil.getRequest().getServletPath());
         List<BasicExamStudentResult> list = this.baseMapper.findBasicExamStudentList(schoolId, semesterId, examId,
-                courseCode, teacher, college, major, teachClazz, examStudentInfo, dpr);
+                courseId, teacher, college, major, teachClazz, examStudentInfo, dpr);
         for (BasicExamStudentResult basicExamStudentResult : list) {
             Long examStartTime = basicExamStudentResult.getExamStartTime();
             Long examEndTime = basicExamStudentResult.getExamEndTime();
@@ -194,10 +193,10 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     }
 
     @Override
-    public void exportLogic(HttpServletResponse response, Long semesterId, Long examId, String courseCode, String teacher, String college, String major, String teachClazz, String examStudentInfo)
+    public void exportLogic(HttpServletResponse response, Long semesterId, Long examId, Long courseId, String teacher, String college, String major, String teachClazz, String examStudentInfo)
             throws Exception {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
-        List<BasicExamStudentResult> list = this.list(requestUser, semesterId, examId, courseCode, teacher, college,
+        List<BasicExamStudentResult> list = this.list(requestUser, semesterId, examId, courseId, teacher, college,
                 major, teachClazz, examStudentInfo);
         List<BasicExamStudentDto> exportDto = list.stream().flatMap(e -> {
             BasicExamStudentDto basicExamStudentDto = new BasicExamStudentDto();

+ 7 - 6
distributed-print-business/src/main/resources/mapper/BasicExamStudentMapper.xml

@@ -75,7 +75,7 @@
                     AND bes.create_id = #{dpr.requestUserId}
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bc.teaching_room_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>
@@ -87,8 +87,9 @@
             resultType="com.qmth.distributed.print.business.bean.result.BasicExamStudentResult">
         SELECT
             bes.id,
+            bc.course_id courseId,
             bc.name AS courseName,
-            bes.course_code AS courseCode,
+            bc.code AS courseCode,
             bes.student_name AS studentName,
             bes.student_code AS studentCode,
             bes.college_name AS collegeName,
@@ -104,7 +105,7 @@
         FROM
             basic_exam_student bes
                 LEFT JOIN
-            basic_course bc ON bes.course_code = bc.code AND bes.school_id = bc.school_id
+            basic_course bc ON bes.course_id = bc.id
                 LEFT JOIN
             basic_teach_clazz tbc ON bes.clazz_id = tbc.id
                 LEFT JOIN
@@ -121,8 +122,8 @@
             <if test="examId != null">
                 AND bes.exam_id = #{examId}
             </if>
-            <if test="courseCode != null and courseCode != ''">
-                AND bes.course_code LIKE CONCAT('%',#{courseCode},'%')
+            <if test="courseId != null">
+                AND bes.course_id LIKE CONCAT('%',#{courseId},'%')
             </if>
             <if test="teacher != null and teacher != ''">
                 AND (teacher.real_name LIKE CONCAT('%',#{teacher},'%') OR teacher.code LIKE CONCAT('%',#{teacher},'%'))
@@ -144,7 +145,7 @@
                     AND bes.create_id = #{dpr.requestUserId}
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bc.teaching_room_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>

+ 2 - 2
distributed-print-business/src/main/resources/mapper/ClientMapper.xml

@@ -346,7 +346,7 @@
         JOIN
         exam_student c ON b.id = c.exam_detail_course_id
         JOIN
-            basic_exam_student bes ON c.student_id = bes.id
+            basic_exam_student bes ON c.basic_student_id = bes.id
         LEFT JOIN
             basic_course bc ON b.course_id = bc.id
         <where>
@@ -359,7 +359,7 @@
                 and c.student_name like concat('%', #{studentName}, '%')
             </if>
             <if test="courseId != null">
-                and b.course_code = #{courseCode}
+                and b.course_id = #{courseId}
             </if>
         </where>
         order by c.student_code

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/BasicExamStudentController.java

@@ -129,14 +129,14 @@ public class BasicExamStudentController {
     @OperationLogDetail(operationType = OperationTypeEnum.EXPORT)
     public void export(@ApiParam(value = "学期id") @RequestParam(required = false) String semesterId,
                        @ApiParam(value = "考试id") @RequestParam(required = false) String examId,
-                       @ApiParam(value = "课程编号") @RequestParam(required = false) String courseCode,
+                       @ApiParam(value = "课程编号") @RequestParam(required = false) Long courseId,
                        @ApiParam(value = "教师(工号/姓名)") @RequestParam(required = false) String teacher,
                        @ApiParam(value = "学院") @RequestParam(required = false) String college,
                        @ApiParam(value = "专业") @RequestParam(required = false) String major,
                        @ApiParam(value = "教学班(模糊查询)") @RequestParam(required = false) String teachClazz,
                        @ApiParam(value = "考生信息(姓名/学号)") @RequestParam(required = false) String examStudentInfo, HttpServletResponse response) throws Exception {
         basicExamStudentService.exportLogic(response, SystemConstant.convertIdToLong(semesterId),
-                SystemConstant.convertIdToLong(examId), courseCode, teacher, college, major, teachClazz,
+                SystemConstant.convertIdToLong(examId), courseId, teacher, college, major, teachClazz,
                 examStudentInfo);
     }
 

+ 9 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamCardController.java

@@ -9,7 +9,9 @@ import com.qmth.distributed.print.business.entity.ExamCard;
 import com.qmth.distributed.print.business.service.ExamCardService;
 import com.qmth.teachcloud.common.annotation.OperationLogDetail;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
+import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import io.swagger.annotations.*;
@@ -39,6 +41,8 @@ public class ExamCardController {
 
     @Resource
     private ExamCardService examCardService;
+    @Resource
+    private BasicCourseService basicCourseService;
 
     //====================================通卡接口(start)===================================
 
@@ -126,6 +130,11 @@ public class ExamCardController {
     @RequestMapping(value = "/get_one", method = RequestMethod.POST)
     public Result getOne(@RequestParam(value = "cardId", required = false) Long cardId) {
         ExamCard examCard = examCardService.getById(cardId);
+        if (examCard.getCourseId() != null) {
+            BasicCourse basicCourse = basicCourseService.getById(examCard.getCourseId());
+            examCard.setCourseCode(basicCourse != null ? basicCourse.getCode() : null);
+            examCard.setCourseName(basicCourse != null ? basicCourse.getName() : null);
+        }
         return ResultUtil.ok(examCard);
     }
 

+ 3 - 3
teachcloud-obe/src/main/resources/mapper/ObeConditionMapper.xml

@@ -56,7 +56,7 @@
                     AND EXISTS( SELECT 1 FROM (select course_code from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = bc.code)
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bc.teaching_room_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>
@@ -141,7 +141,7 @@
                     AND oco.user_id = #{dpr.requestUserId}
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bc.teaching_room_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>
@@ -178,7 +178,7 @@
                 AND EXISTS( SELECT 1 FROM (select course_code from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = bc.code)
             </if>
             <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                AND su.org_id IN
+                AND bc.teaching_room_id IN
                 <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                     #{item}
                 </foreach>

+ 1 - 1
teachcloud-obe/src/main/resources/mapper/ObeCourseOutlineMapper.xml

@@ -70,7 +70,7 @@
                     AND EXISTS( SELECT 1 FROM (select course_code from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = bc.code)
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bc.teaching_room_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>

+ 2 - 4
teachcloud-obe/src/main/resources/mapper/ObeCultureProgramMapper.xml

@@ -85,8 +85,6 @@
             obe_course_outline oco
             LEFT JOIN
             basic_course bc on oco.course_id = bc.id
-            LEFT JOIN
-            sys_user su ON oco.user_id = su.id
             WHERE
             ocp.id = oco.culture_program_id
             <if test="schoolId != null">
@@ -100,7 +98,7 @@
                     AND EXISTS( SELECT 1 FROM (select course_code from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = bc.code)
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bc.teaching_room_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>
@@ -138,7 +136,7 @@
                 AND EXISTS( SELECT 1 FROM (select course_code from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = bc.code)
             </if>
             <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                AND su.org_id IN
+                AND bc.teaching_room_id IN
                 <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                     #{item}
                 </foreach>

+ 1 - 1
teachcloud-obe/src/main/resources/mapper/TCUsualScoreMapper.xml

@@ -44,7 +44,7 @@
                     AND EXISTS( SELECT 1 FROM (select course_code from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = bc.code)
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bc.teaching_room_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>