Browse Source

bug修复

wangliang 4 years ago
parent
commit
0e5cc10229

+ 10 - 2
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TBExamCourseMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.qmth.teachcloud.report.business.bean.result.SurveyTeacherExamCourseResult;
 import com.qmth.teachcloud.report.business.bean.result.TBExamCourseResult;
 import com.qmth.teachcloud.report.business.entity.TBExamCourse;
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -26,9 +27,13 @@ public interface TBExamCourseMapper extends BaseMapper<TBExamCourse> {
      * @param examId
      * @param inspect
      * @param collegeIds
+     * @param filter
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamCourseResult> findCourseList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("inspect") boolean inspect, @Param("collegeIds") List<Long> collegeIds, @Param("filter") boolean filter);
+    List<TBExamCourseResult> findCourseList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("inspect") boolean inspect, @Param("collegeIds") List<Long> collegeIds, @Param("filter") boolean filter, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);
 
     /**
      * 查询科目信息
@@ -36,7 +41,10 @@ public interface TBExamCourseMapper extends BaseMapper<TBExamCourse> {
      * @param schoolId
      * @param examId
      * @param teacherId
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamCourseResult> findCourseListByTeacherId(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("teacherId") Long teacherId);
+    List<TBExamCourseResult> findCourseListByTeacherId(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("teacherId") Long teacherId, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);
 }

+ 24 - 26
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TBExamStudentMapper.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.teachcloud.report.business.bean.result.*;
 import com.qmth.teachcloud.report.business.entity.TBExamStudent;
 import com.qmth.teachcloud.report.business.enums.OrderEnum;
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -27,9 +28,12 @@ public interface TBExamStudentMapper extends BaseMapper<TBExamStudent> {
      * @param schoolId
      * @param examId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectTeachCollegeList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
+    List<TBExamStudentResult> selectTeachCollegeList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);
 
     /**
      * 查询考查学院列表
@@ -37,9 +41,12 @@ public interface TBExamStudentMapper extends BaseMapper<TBExamStudent> {
      * @param schoolId
      * @param examId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectInspectCollegeList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
+    List<TBExamStudentResult> selectInspectCollegeList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);
 
     /**
      * 查询考查学院列表(任课老师)
@@ -47,19 +54,12 @@ public interface TBExamStudentMapper extends BaseMapper<TBExamStudent> {
      * @param schoolId
      * @param examId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectInspectCollegeListByTeacher(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("collegeIds") List<Long> collegeIds, @Param("teacherId") Long teacherId);
-
-    /**
-     * 开课课程考试分析-考查学院列表
-     *
-     * @param schoolId
-     * @param examId
-     * @param courseCode
-     * @return
-     */
-    List<TBExamStudentResult> selectInspectCollegeListNotAbsent(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
+    List<TBExamStudentResult> selectInspectCollegeListByTeacher(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("collegeIds") List<Long> collegeIds, @Param("teacherId") Long teacherId, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);
 
     /**
      * 查询老师列表
@@ -68,20 +68,13 @@ public interface TBExamStudentMapper extends BaseMapper<TBExamStudent> {
      * @param examId
      * @param courseCode
      * @param inspectCollegeId
+     * @param teachCollegeId
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectTeachList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("inspectCollegeId") Long inspectCollegeId);
-
-    /**
-     * 开课课程考试分析-查询老师列表
-     *
-     * @param schoolId
-     * @param examId
-     * @param courseCode
-     * @param inspectCollegeId
-     * @return
-     */
-    List<TBExamStudentResult> selectTeachListNotAbsent(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("inspectCollegeId") Long inspectCollegeId);
+    List<TBExamStudentResult> selectTeachList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("inspectCollegeId") Long inspectCollegeId, @Param("teachCollegeId") Long teachCollegeId, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);
 
     /**
      * 查询班级列表
@@ -89,9 +82,14 @@ public interface TBExamStudentMapper extends BaseMapper<TBExamStudent> {
      * @param schoolId
      * @param examId
      * @param courseCode
+     * @param inspectCollegeId
+     * @param teacherId
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectClassList(@Param("schoolId") Long schoolId, @Param("examId") Long examId,@Param("teacherId") Long teacherId, @Param("courseCode") String courseCode, @Param("inspectCollegeId") Long inspectCollegeId);
+    List<TBExamStudentResult> selectClassList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("teacherId") Long teacherId, @Param("courseCode") String courseCode, @Param("inspectCollegeId") Long inspectCollegeId, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);
 
     /**
      * 开课成绩查询

+ 19 - 10
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBExamCourseService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.teachcloud.report.business.bean.result.SurveyTeacherExamCourseResult;
 import com.qmth.teachcloud.report.business.bean.result.TBExamCourseResult;
 import com.qmth.teachcloud.report.business.entity.TBExamCourse;
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 
 import java.util.List;
 
@@ -18,8 +19,9 @@ import java.util.List;
 public interface TBExamCourseService extends IService<TBExamCourse> {
     /**
      * 校验该考试科目是否不能继续进行教研分析流程
-     * @param examId 考试id
-     * @param schoolId 学校id
+     *
+     * @param examId     考试id
+     * @param schoolId   学校id
      * @param courseCode 课程编号
      * @param courseName 课程名称
      * @return 是
@@ -34,27 +36,34 @@ public interface TBExamCourseService extends IService<TBExamCourse> {
      * @param schoolId
      * @param examId
      * @param inspect
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamCourseResult> findCourseList(Long schoolId, Long examId, boolean inspect);
+    List<TBExamCourseResult> findCourseList(Long schoolId, Long examId, boolean inspect, Boolean absent, Boolean current, PublishStatusEnum status);
 
     /**
      * 查询科目信息
      *
      * @param schoolId
      * @param examId
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamCourseResult> findCourseList(Long schoolId, Long examId);
+    List<TBExamCourseResult> findCourseList(Long schoolId, Long examId, Boolean absent, Boolean current, PublishStatusEnum status);
 
     /**
      * 创建课程
-     * @param schoolId 学校id
-     * @param examId 考试id
-     * @param courseCode 课程编号
-     * @param courseName 课程名称
+     *
+     * @param schoolId              学校id
+     * @param examId                考试id
+     * @param courseCode            课程编号
+     * @param courseName            课程名称
      * @param examinationCourseCode 考务课程编号
-     * @param teachCollegeName 开课学院名称
+     * @param teachCollegeName      开课学院名称
      */
-    void createCourse(Long schoolId,Long examId,String courseCode,String courseName,String examinationCourseCode,String teachCollegeName);
+    void createCourse(Long schoolId, Long examId, String courseCode, String courseName, String examinationCourseCode, String teachCollegeName);
 }

+ 20 - 25
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBExamStudentService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.teachcloud.report.business.bean.result.*;
 import com.qmth.teachcloud.report.business.entity.TBExamStudent;
 import com.qmth.teachcloud.report.business.enums.OrderEnum;
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import com.qmth.teachcloud.report.business.enums.SemesterEnum;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -26,31 +27,28 @@ public interface TBExamStudentService extends IService<TBExamStudent> {
     /**
      * 查询开课学院列表
      *
-     * @param examId
-     * @param courseCode
-     * @return
-     */
-    List<TBExamStudentResult> selectTeachCollegeList(Long schoolId, Long examId, String courseCode);
-
-    /**
-     * 查询考查学院列表
-     *
      * @param schoolId
      * @param examId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectInspectCollegeList(Long schoolId, Long examId, String courseCode);
+    List<TBExamStudentResult> selectTeachCollegeList(Long schoolId, Long examId, String courseCode, Boolean absent, Boolean current, PublishStatusEnum status);
 
     /**
-     * 开课课程考试分析-考查学院列表
+     * 查询考查学院列表
      *
      * @param schoolId
      * @param examId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectInspectCollegeListNotAbsent(Long schoolId, Long examId, String courseCode);
+    List<TBExamStudentResult> selectInspectCollegeList(Long schoolId, Long examId, String courseCode, Boolean absent, Boolean current, PublishStatusEnum status);
 
     /**
      * 查询老师列表
@@ -59,30 +57,27 @@ public interface TBExamStudentService extends IService<TBExamStudent> {
      * @param examId
      * @param courseCode
      * @param inspectCollegeId
+     * @param teachCollegeId
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectTeachList(Long schoolId, Long examId, String courseCode, Long inspectCollegeId);
-
-    /**
-     * 开课课程考试分析-查询老师列表
-     *
-     * @param schoolId
-     * @param examId
-     * @param courseCode
-     * @param inspectCollegeId
-     * @return
-     */
-    List<TBExamStudentResult> selectTeachListNotAbsent(Long schoolId, Long examId, String courseCode, Long inspectCollegeId);
+    List<TBExamStudentResult> selectTeachList(Long schoolId, Long examId, String courseCode, Long inspectCollegeId, Long teachCollegeId, Boolean absent, Boolean current, PublishStatusEnum status);
 
     /**
      * 查询班级列表
      *
      * @param schoolId
      * @param examId
+     * @param teacherId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
-    List<TBExamStudentResult> selectClassList(Long schoolId, Long examId,Long teacherId, String courseCode);
+    List<TBExamStudentResult> selectClassList(Long schoolId, Long examId, Long teacherId, String courseCode, Boolean absent, Boolean current, PublishStatusEnum status);
 
     /**
      * 开课成绩查询

+ 3 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/ReportCommonServiceImpl.java

@@ -111,6 +111,9 @@ public class ReportCommonServiceImpl implements ReportCommonService {
 //        if (collegeDescriptiveStatisticsList.size() != 1) {
 //            throw ExceptionResultEnum.DATA_COUNT_EXCEPTION.exception();
 //        }
+        if (taExamCourseCollegeInspectResultList.size() != 1) {
+            throw ExceptionResultEnum.DATA_COUNT_EXCEPTION.exception();
+        }
         TAExamCourseCollegeInspectResult collegeDescriptiveStatistics = taExamCourseCollegeInspectResultList.get(0);
 
         // 全校该科目的描述统计

+ 8 - 5
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExamCourseServiceImpl.java

@@ -117,10 +117,13 @@ public class TBExamCourseServiceImpl extends ServiceImpl<TBExamCourseMapper, TBE
      * @param schoolId
      * @param examId
      * @param inspect
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
     @Override
-    public List<TBExamCourseResult> findCourseList(Long schoolId, Long examId, boolean inspect) {
+    public List<TBExamCourseResult> findCourseList(Long schoolId, Long examId, boolean inspect, Boolean absent, Boolean current, PublishStatusEnum status) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         List<Long> collegeIds = sysOrgService.findCollegeIds(sysUser.getOrgId());
         AuthBean authBean = cacheService.userAuthCache(sysUser.getId());
@@ -132,9 +135,9 @@ public class TBExamCourseServiceImpl extends ServiceImpl<TBExamCourseMapper, TBE
             filter = false;
         }
         if (Objects.nonNull(collegeIds) && collegeIds.size() > 0) {
-            return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, collegeIds, filter);
+            return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, collegeIds, filter, absent, current, Objects.nonNull(status) ? status.name() : null);
         } else {
-            return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, Objects.nonNull(sysUser.getOrgId()) ? Arrays.asList(sysUser.getOrgId()) : null, filter);
+            return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, Objects.nonNull(sysUser.getOrgId()) ? Arrays.asList(sysUser.getOrgId()) : null, filter, absent, current, Objects.nonNull(status) ? status.name() : null);
         }
     }
 
@@ -146,9 +149,9 @@ public class TBExamCourseServiceImpl extends ServiceImpl<TBExamCourseMapper, TBE
      * @return
      */
     @Override
-    public List<TBExamCourseResult> findCourseList(Long schoolId, Long examId) {
+    public List<TBExamCourseResult> findCourseList(Long schoolId, Long examId, Boolean absent, Boolean current, PublishStatusEnum status) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        return tbExamCourseMapper.findCourseListByTeacherId(schoolId, examId, sysUser.getId());
+        return tbExamCourseMapper.findCourseListByTeacherId(schoolId, examId, sysUser.getId(),absent, current, Objects.nonNull(status) ? status.name() : null);
     }
 
     @Transactional

+ 25 - 41
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExamStudentServiceImpl.java

@@ -26,6 +26,7 @@ import com.qmth.teachcloud.report.business.bean.result.*;
 import com.qmth.teachcloud.report.business.entity.*;
 import com.qmth.teachcloud.report.business.enums.AssignEnum;
 import com.qmth.teachcloud.report.business.enums.OrderEnum;
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import com.qmth.teachcloud.report.business.enums.SemesterEnum;
 import com.qmth.teachcloud.report.business.mapper.*;
 import com.qmth.teachcloud.report.business.service.TBExamStudentService;
@@ -87,9 +88,6 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
     @Resource
     SysOrgService sysOrgService;
 
-    @Resource
-    SysRoleService sysRoleService;
-
     @Resource
     CacheService cacheService;
 
@@ -99,11 +97,14 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
      * @param schoolId
      * @param examId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
     @Override
-    public List<TBExamStudentResult> selectTeachCollegeList(Long schoolId, Long examId, String courseCode) {
-        return tbExamStudentMapper.selectTeachCollegeList(schoolId, examId, courseCode);
+    public List<TBExamStudentResult> selectTeachCollegeList(Long schoolId, Long examId, String courseCode, Boolean absent, Boolean current, PublishStatusEnum status) {
+        return tbExamStudentMapper.selectTeachCollegeList(schoolId, examId, courseCode, absent, current, Objects.nonNull(status) ? status.name() : null);
     }
 
     /**
@@ -112,34 +113,24 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
      * @param schoolId
      * @param examId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
     @Override
-    public List<TBExamStudentResult> selectInspectCollegeList(Long schoolId, Long examId, String courseCode) {
+    public List<TBExamStudentResult> selectInspectCollegeList(Long schoolId, Long examId, String courseCode, Boolean absent, Boolean current, PublishStatusEnum status) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         AuthBean authBean = cacheService.userAuthCache(sysUser.getId());
         if (Objects.nonNull(authBean) && Objects.nonNull(authBean.getRoleList()) && authBean.getRoleList().get(0).getType() == RoleTypeEnum.TEACHER) {
             List<Long> collegeIds = sysOrgService.findCollegeIds(sysUser.getOrgId());
             if (Objects.nonNull(collegeIds) && collegeIds.size() > 0) {
-                return tbExamStudentMapper.selectInspectCollegeListByTeacher(schoolId, examId, courseCode, collegeIds,sysUser.getId());
+                return tbExamStudentMapper.selectInspectCollegeListByTeacher(schoolId, examId, courseCode, collegeIds, sysUser.getId(), absent, current, Objects.nonNull(status) ? status.name() : null);
             } else {
-                return tbExamStudentMapper.selectInspectCollegeListByTeacher(schoolId, examId, courseCode, Objects.nonNull(sysUser.getOrgId()) ? Arrays.asList(sysUser.getOrgId()) : null,sysUser.getId());
+                return tbExamStudentMapper.selectInspectCollegeListByTeacher(schoolId, examId, courseCode, Objects.nonNull(sysUser.getOrgId()) ? Arrays.asList(sysUser.getOrgId()) : null, sysUser.getId(), absent, current, Objects.nonNull(status) ? status.name() : null);
             }
         }
-        return tbExamStudentMapper.selectInspectCollegeList(schoolId, examId, courseCode);
-    }
-
-    /**
-     * 开课课程考试分析-考查学院列表
-     *
-     * @param schoolId
-     * @param examId
-     * @param courseCode
-     * @return
-     */
-    @Override
-    public List<TBExamStudentResult> selectInspectCollegeListNotAbsent(Long schoolId, Long examId, String courseCode) {
-        return tbExamStudentMapper.selectInspectCollegeListNotAbsent(schoolId, examId, courseCode);
+        return tbExamStudentMapper.selectInspectCollegeList(schoolId, examId, courseCode, absent, current, Objects.nonNull(status) ? status.name() : null);
     }
 
     /**
@@ -149,25 +140,15 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
      * @param examId
      * @param courseCode
      * @param inspectCollegeId
+     * @param teachCollegeId
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
     @Override
-    public List<TBExamStudentResult> selectTeachList(Long schoolId, Long examId, String courseCode, Long inspectCollegeId) {
-        return tbExamStudentMapper.selectTeachList(schoolId, examId, courseCode, inspectCollegeId);
-    }
-
-    /**
-     * 开课课程考试分析-查询老师列表
-     *
-     * @param schoolId
-     * @param examId
-     * @param courseCode
-     * @param inspectCollegeId
-     * @return
-     */
-    @Override
-    public List<TBExamStudentResult> selectTeachListNotAbsent(Long schoolId, Long examId, String courseCode, Long inspectCollegeId) {
-        return tbExamStudentMapper.selectTeachListNotAbsent(schoolId, examId, courseCode, inspectCollegeId);
+    public List<TBExamStudentResult> selectTeachList(Long schoolId, Long examId, String courseCode, Long inspectCollegeId, Long teachCollegeId, Boolean absent, Boolean current, PublishStatusEnum status) {
+        return tbExamStudentMapper.selectTeachList(schoolId, examId, courseCode, inspectCollegeId, teachCollegeId, absent, current, Objects.nonNull(status) ? status.name() : null);
     }
 
     /**
@@ -175,14 +156,17 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
      *
      * @param schoolId
      * @param examId
+     * @param teacherId
      * @param courseCode
+     * @param absent
+     * @param current
+     * @param status
      * @return
      */
     @Override
-    public List<TBExamStudentResult> selectClassList(Long schoolId, Long examId,Long teacherId, String courseCode) {
+    public List<TBExamStudentResult> selectClassList(Long schoolId, Long examId, Long teacherId, String courseCode, Boolean absent, Boolean current, PublishStatusEnum status) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        Long orgId = sysUser.getOrgId();
-        return tbExamStudentMapper.selectClassList(schoolId, examId, teacherId, courseCode, orgId);
+        return tbExamStudentMapper.selectClassList(schoolId, examId, teacherId, courseCode, sysUser.getOrgId(), absent, current, Objects.nonNull(status) ? status.name() : null);
     }
 
     @Override

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

@@ -49,6 +49,8 @@
         select DISTINCT tbs.course_code,tbs.course_name from t_b_exam_student tbs
         join basic_course bc
         on tbs.course_code = bc.code
+        join t_b_exam_course tbec on
+        tbec.course_code = tbs.course_code
         <where>
             <if test="examId != null and examId != ''">
                 and tbs.exam_id = #{examId}
@@ -59,6 +61,15 @@
             <if test="teacherId != null and teacherId != ''">
                 and tbs.teacher_id = #{teacherId}
             </if>
+            <if test="absent != null and absent != ''">
+                and tbs.absent = #{absent}
+            </if>
+            <if test="current != null and current != ''">
+                and tbs.student_current = #{current}
+            </if>
+            <if test="status != null and status != ''">
+                and tbec.publish_status = #{status}
+            </if>
         </where>
     </select>
 </mapper>

+ 23 - 37
teachcloud-report-business/src/main/resources/mapper/TBExamStudentMapper.xml

@@ -12,7 +12,15 @@
         <if test="courseCode != null and courseCode != ''">
             and tbes.course_code = #{courseCode}
         </if>
-        and tbes.absent = false
+        <if test="absent != null and absent != ''">
+            and tbes.absent = #{absent}
+        </if>
+        <if test="current != null and current != ''">
+            and tbes.student_current = #{current}
+        </if>
+        <if test="status != null and status != ''">
+            and tbec.publish_status = #{status}
+        </if>
     </sql>
 
     <select id="selectTeachCollegeList"
@@ -25,6 +33,8 @@
         t_b_exam_student tbes
         join sys_org so on
         so.id = tbes.teach_college_id
+        join t_b_exam_course tbec on
+            tbec.course_code = tbes.course_code
         <where>
             <include refid="conditionSql"/>
         </where>
@@ -40,6 +50,8 @@
         t_b_exam_student tbes
         join sys_org so on
         so.id = tbes.inspect_college_id
+        join t_b_exam_course tbec on
+            tbec.course_code = tbes.course_code
         <where>
             <include refid="conditionSql"/>
         </where>
@@ -55,6 +67,8 @@
         t_b_exam_student tbes
         join sys_org so on
         so.id = tbes.inspect_college_id
+        join t_b_exam_course tbec on
+            tbec.course_code = tbes.course_code
         <where>
             <include refid="conditionSql"/>
             <if test="collegeIds != null and collegeIds != ''">
@@ -67,23 +81,6 @@
         </where>
     </select>
 
-    <select id="selectInspectCollegeListNotAbsent"
-            resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
-        select
-        DISTINCT tbes.inspect_college_id as inspectCollegeId,
-        so.name as inspectCollegeName,
-        so.code as inspectCollegeCode
-        from
-        t_b_exam_student tbes
-        join sys_org so on
-        so.id = tbes.inspect_college_id
-        <where>
-            <include refid="conditionSql"/>
-            and tbes.absent = false
-            and tbes.student_current = true
-        </where>
-    </select>
-
     <select id="selectTeachList" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
         select
         DISTINCT tbes.teacher_id as teacherId,
@@ -92,29 +89,16 @@
         t_b_exam_student tbes
         join sys_user su on
         su.id = tbes.teacher_id
+        join t_b_exam_course tbec on
+            tbec.course_code = tbes.course_code
         <where>
             <include refid="conditionSql"/>
             <if test="inspectCollegeId != null and inspectCollegeId != ''">
                 and tbes.inspect_college_id = #{inspectCollegeId}
             </if>
-        </where>
-    </select>
-
-    <select id="selectTeachListNotAbsent" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
-        select
-        DISTINCT tbes.teacher_id as teacherId,
-        su.real_name as teacherName
-        from
-        t_b_exam_student tbes
-        join sys_user su on
-        su.id = tbes.teacher_id
-        <where>
-            <include refid="conditionSql"/>
-            <if test="inspectCollegeId != null and inspectCollegeId != ''">
-                and tbes.inspect_college_id = #{inspectCollegeId}
+            <if test="teachCollegeId != null and teachCollegeId != ''">
+                and tbes.teach_college_id = #{teachCollegeId}
             </if>
-            and tbes.absent = false
-            and tbes.student_current = true
         </where>
     </select>
 
@@ -126,13 +110,15 @@
         from
         t_b_exam_student tbes
         join t_b_school_clazz tbsc on
-        tbsc.id = tbes.clazz_id
+            tbsc.id = tbes.clazz_id
+        join t_b_exam_course tbec on
+            tbec.course_code = tbes.course_code
         <where>
             <include refid="conditionSql"/>
             <if test="teacherId != null and teacherId != ''">
                 and tbes.teacher_id = #{teacherId}
             </if>
-            <if test="inspectCollegeId != null and teacherId != ''">
+            <if test="inspectCollegeId != null and inspectCollegeId != ''">
                 and tbes.inspect_college_id = #{inspectCollegeId}
             </if>
         </where>

+ 32 - 31
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysReportController.java

@@ -9,6 +9,7 @@ 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;
 import com.qmth.teachcloud.report.business.entity.TBExamCourse;
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import com.qmth.teachcloud.report.business.enums.SemesterEnum;
 import com.qmth.teachcloud.report.business.service.TBExamCourseService;
 import com.qmth.teachcloud.report.business.service.TBExamService;
@@ -80,16 +81,22 @@ public class SysReportController {
     @ApiResponses({@ApiResponse(code = 200, message = "科目信息", response = TBExamCourse.class)})
     public Result listCourse(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
                              @ApiParam(value = "考试id", required = true) @RequestParam String examId,
-                             @ApiParam(value = "是否考查学院", required = true) @RequestParam boolean inspect) {
-        return ResultUtil.ok(tbExamCourseService.findCourseList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), inspect));
+                             @ApiParam(value = "是否考查学院", required = true) @RequestParam boolean inspect,
+                             @ApiParam(value = "是否缺考,false:没缺考,true:缺考", required = false) @RequestParam(required = false) Boolean absent,
+                             @ApiParam(value = "是否本届,false:非本届,true:本届", required = false) @RequestParam(required = false) Boolean current,
+                             @ApiParam(value = "发布状态(UN_COMPUTE:未计算、COMPUTING:计算中、 UN_PUBLISH:未发布、PUBLISH:已发布)", required = false) @RequestParam(required = false) PublishStatusEnum status) {
+        return ResultUtil.ok(tbExamCourseService.findCourseList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), inspect, absent, current, status));
     }
 
     @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)));
+                                  @ApiParam(value = "考试id", required = true) @RequestParam String examId,
+                                  @ApiParam(value = "是否缺考,false:没缺考,true:缺考", required = false) @RequestParam(required = false) Boolean absent,
+                                  @ApiParam(value = "是否本届,false:非本届,true:本届", required = false) @RequestParam(required = false) Boolean current,
+                                  @ApiParam(value = "发布状态(UN_COMPUTE:未计算、COMPUTING:计算中、 UN_PUBLISH:未发布、PUBLISH:已发布)", required = false) @RequestParam(required = false) PublishStatusEnum status) {
+        return ResultUtil.ok(tbExamCourseService.findCourseList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), absent, current, status));
     }
 
     @ApiOperation(value = "开课学院列表")
@@ -97,8 +104,11 @@ public class SysReportController {
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
     public Result listTeachCollege(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
                                    @ApiParam(value = "考试id", required = true) @RequestParam String examId,
-                                   @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode) {
-        return ResultUtil.ok(tbExamStudentService.selectTeachCollegeList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode));
+                                   @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode,
+                                   @ApiParam(value = "是否缺考,false:没缺考,true:缺考", required = false) @RequestParam(required = false) Boolean absent,
+                                   @ApiParam(value = "是否本届,false:非本届,true:本届", required = false) @RequestParam(required = false) Boolean current,
+                                   @ApiParam(value = "发布状态(UN_COMPUTE:未计算、COMPUTING:计算中、 UN_PUBLISH:未发布、PUBLISH:已发布)", required = false) @RequestParam(required = false) PublishStatusEnum status) {
+        return ResultUtil.ok(tbExamStudentService.selectTeachCollegeList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode, absent, current, status));
     }
 
     @ApiOperation(value = "考查学院列表")
@@ -106,17 +116,11 @@ public class SysReportController {
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
     public Result listInspectCollege(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
                                      @ApiParam(value = "考试id", required = true) @RequestParam String examId,
-                                     @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode) {
-        return ResultUtil.ok(tbExamStudentService.selectInspectCollegeList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode));
-    }
-
-    @ApiOperation(value = "开课课程考试分析-考查学院列表")
-    @RequestMapping(value = "/common/list_inspect_college_not_absent", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
-    public Result listInspectCollegeNotAbsent(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
-                                              @ApiParam(value = "考试id", required = false) @RequestParam(required = false) String examId,
-                                              @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode) {
-        return ResultUtil.ok(tbExamStudentService.selectInspectCollegeListNotAbsent(SystemConstant.convertIdToLong(schoolId), Objects.nonNull(examId) ? SystemConstant.convertIdToLong(examId) : null, courseCode));
+                                     @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode,
+                                     @ApiParam(value = "是否缺考,false:没缺考,true:缺考", required = false) @RequestParam(required = false) Boolean absent,
+                                     @ApiParam(value = "是否本届,false:非本届,true:本届", required = false) @RequestParam(required = false) Boolean current,
+                                     @ApiParam(value = "发布状态(UN_COMPUTE:未计算、COMPUTING:计算中、 UN_PUBLISH:未发布、PUBLISH:已发布)", required = false) @RequestParam(required = false) PublishStatusEnum status) {
+        return ResultUtil.ok(tbExamStudentService.selectInspectCollegeList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode, absent, current, status));
     }
 
     @ApiOperation(value = "教师列表")
@@ -125,18 +129,12 @@ public class SysReportController {
     public Result listTeacher(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
                               @ApiParam(value = "考试id", required = true) @RequestParam String examId,
                               @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
-                              @ApiParam(value = "考查学院id", required = false) @RequestParam(required = false) String inspectCollegeId) {
-        return ResultUtil.ok(tbExamStudentService.selectTeachList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode, Objects.nonNull(inspectCollegeId) ? SystemConstant.convertIdToLong(inspectCollegeId) : null));
-    }
-
-    @ApiOperation(value = "开课课程考试分析-教师列表")
-    @RequestMapping(value = "/common/list_teacher_not_absent", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
-    public Result listTeacherNotAbsent(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
-                                       @ApiParam(value = "考试id", required = false) @RequestParam(required = false) String examId,
-                                       @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode,
-                                       @ApiParam(value = "考查学院id", required = false) @RequestParam(required = false) String inspectCollegeId) {
-        return ResultUtil.ok(tbExamStudentService.selectTeachListNotAbsent(SystemConstant.convertIdToLong(schoolId), Objects.nonNull(examId) ? SystemConstant.convertIdToLong(examId) : null, courseCode, Objects.nonNull(inspectCollegeId) ? SystemConstant.convertIdToLong(inspectCollegeId) : null));
+                              @ApiParam(value = "考查学院id", required = false) @RequestParam(required = false) String inspectCollegeId,
+                              @ApiParam(value = "开课学院id", required = false) @RequestParam(required = false) String teachCollegeId,
+                              @ApiParam(value = "是否缺考,false:没缺考,true:缺考", required = false) @RequestParam(required = false) Boolean absent,
+                              @ApiParam(value = "是否本届,false:非本届,true:本届", required = false) @RequestParam(required = false) Boolean current,
+                              @ApiParam(value = "发布状态(UN_COMPUTE:未计算、COMPUTING:计算中、 UN_PUBLISH:未发布、PUBLISH:已发布)", required = false) @RequestParam(required = false) PublishStatusEnum status) {
+        return ResultUtil.ok(tbExamStudentService.selectTeachList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode, Objects.nonNull(inspectCollegeId) ? SystemConstant.convertIdToLong(inspectCollegeId) : null, Objects.nonNull(teachCollegeId) ? SystemConstant.convertIdToLong(teachCollegeId) : null, absent, current, status));
     }
 
     @ApiOperation(value = "班级列表")
@@ -145,7 +143,10 @@ public class SysReportController {
     public Result listClass(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
                             @ApiParam(value = "考试id", required = true) @RequestParam String examId,
                             @ApiParam(value = "考试id", required = false) @RequestParam(required = false) String teacherId,
-                            @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode) {
-        return ResultUtil.ok(tbExamStudentService.selectClassList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), SystemConstant.convertIdToLong(teacherId), courseCode));
+                            @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
+                            @ApiParam(value = "是否缺考,false:没缺考,true:缺考", required = false) @RequestParam(required = false) Boolean absent,
+                            @ApiParam(value = "是否本届,false:非本届,true:本届", required = false) @RequestParam(required = false) Boolean current,
+                            @ApiParam(value = "发布状态(UN_COMPUTE:未计算、COMPUTING:计算中、 UN_PUBLISH:未发布、PUBLISH:已发布)", required = false) @RequestParam(required = false) PublishStatusEnum status) {
+        return ResultUtil.ok(tbExamStudentService.selectClassList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), SystemConstant.convertIdToLong(teacherId), courseCode, absent, current, status));
     }
 }