wangliang 3 years ago
parent
commit
7fc8158d21

+ 5 - 3
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateController.java

@@ -451,6 +451,7 @@ public class TIeInvigilateController {
                                @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
                                @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
                                @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                               @ApiParam(value = "状态", required = false) @RequestParam(required = false) Integer status,
                                @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) int pageNumber,
                                @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) int pageSize) {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
@@ -460,7 +461,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        return ResultUtil.ok(tOeExamRecordService.invigilatePageProgressList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, userId, tbUser.getOrgId()));
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageProgressList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, status, userId, tbUser.getOrgId()));
     }
 
     @ApiOperation(value = "进度查询列表导出接口")
@@ -471,7 +472,8 @@ public class TIeInvigilateController {
                                    @ApiParam(value = "虚拟考场代码", required = false) @RequestParam(required = false) String roomCode,
                                    @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
                                    @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
-                                   @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity) throws Exception {
+                                   @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                                   @ApiParam(value = "状态", required = false) @RequestParam(required = false) Integer status) throws Exception {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = cacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
@@ -479,7 +481,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        List<InvigilateListProgressExcelBean> invigilateListProgressExcelBeanList = tOeExamRecordService.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, userId, tbUser.getOrgId());
+        List<InvigilateListProgressExcelBean> invigilateListProgressExcelBeanList = tOeExamRecordService.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, status, userId, tbUser.getOrgId());
         ExportUtils.exportEXCEL("进度信息", InvigilateListProgressExcelBean.class, invigilateListProgressExcelBeanList, ServletUtil.getResponse());
     }
 

+ 4 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -6,7 +6,6 @@ import com.qmth.themis.business.bean.admin.*;
 import com.qmth.themis.business.cache.bean.ExamRecordDetailBean;
 import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
 import com.qmth.themis.business.entity.TOeExamRecord;
-import com.qmth.themis.business.enums.FinishTypeEnum;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -240,6 +239,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param courseCode
      * @param name
      * @param identity
+     * @param status
      * @param userId
      * @param orgId
      * @return
@@ -250,6 +250,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                         @Param("courseCode") String courseCode,
                                                                         @Param("name") String name,
                                                                         @Param("identity") String identity,
+                                                                        @Param("status") Integer status,
                                                                         @Param("userId") Long userId,
                                                                         @Param("orgId") Long orgId);
 
@@ -262,6 +263,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param courseCode
      * @param name
      * @param identity
+     * @param status
      * @param userId
      * @param orgId
      * @return
@@ -272,6 +274,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                                   @Param("courseCode") String courseCode,
                                                                                   @Param("name") String name,
                                                                                   @Param("identity") String identity,
+                                                                                  @Param("status") Integer status,
                                                                                   @Param("userId") Long userId,
                                                                                   @Param("orgId") Long orgId);
 

+ 4 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -267,6 +267,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param courseCode
      * @param name
      * @param identity
+     * @param status
      * @param userId
      * @param orgId
      * @return
@@ -277,6 +278,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                         String courseCode,
                                                                         String name,
                                                                         String identity,
+                                                                        Integer status,
                                                                         Long userId,
                                                                         Long orgId);
 
@@ -289,6 +291,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param courseCode
      * @param name
      * @param identity
+     * @param status
      * @param userId
      * @param orgId
      * @return
@@ -299,6 +302,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                                   String courseCode,
                                                                                   String name,
                                                                                   String identity,
+                                                                                  Integer status,
                                                                                   Long userId,
                                                                                   Long orgId);
 

+ 9 - 8
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -851,17 +851,18 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param courseCode
      * @param name
      * @param identity
+     * @param status
      * @param userId
+     * @param orgId
      * @return
      */
     @SuppressWarnings("rawtypes")
     @Override
     public IPage<InvigilateListProgressBean> invigilatePageProgressList(IPage<Map> iPage, Long examId,
-                                                                        Long examActivityId, String roomCode, String courseCode, String name, String identity, Long userId,
+                                                                        Long examActivityId, String roomCode, String courseCode, String name, String identity,
+                                                                        Integer status, Long userId,
                                                                         Long orgId) {
-        return tOeExamRecordMapper
-                .invigilatePageProgressList(iPage, examId, examActivityId, roomCode, courseCode, name, identity, userId,
-                        orgId);
+        return tOeExamRecordMapper.invigilatePageProgressList(iPage, examId, examActivityId, roomCode, courseCode, name, identity, status, userId, orgId);
     }
 
     /**
@@ -873,16 +874,16 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param courseCode
      * @param name
      * @param identity
+     * @param status
      * @param userId
      * @param orgId
      * @return
      */
     @Override
     public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(Long examId, Long examActivityId,
-                                                                                  String roomCode, String courseCode, String name, String identity, Long userId, Long orgId) {
-        return tOeExamRecordMapper
-                .invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, userId,
-                        orgId);
+                                                                                  String roomCode, String courseCode, String name, String identity,
+                                                                                  Integer status, Long userId, Long orgId) {
+        return tOeExamRecordMapper.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, status, userId, orgId);
     }
 
     /**

+ 1 - 1
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -513,7 +513,7 @@
         <include refid="markResultCommon" />
     </select>
 
-    <select id="markResultQueryExport" resultType="com.qmth.themis.business.dto.MarkResultSimpleExportDto">
+    <select id="markResultQueryExportIpage" resultType="com.qmth.themis.business.dto.MarkResultSimpleExportDto">
         <include refid="markResultCommon" />
     </select>
 

+ 46 - 9
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -662,6 +662,12 @@
 
     <select id="invigilatePageProgressList" resultType="com.qmth.themis.business.bean.admin.InvigilateListProgressBean">
         select
+        *,
+        if(t.statusTemp > 0,
+        '已完成',
+        '未完成') as status
+        from
+        (select
         distinct tee.id as examId,
         tee.name as examName,
         teea.id as examActivityId,
@@ -674,9 +680,9 @@
         tees.course_name as courseName,
         if(tee.exam_count - tees.already_exam_count <![CDATA[ < ]]> 0,0,tee.exam_count - tees.already_exam_count) as
         leftExamCount,
-        if((select count(1) from t_oe_exam_record toer where toer.exam_student_id =
-        tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') >
-        0),'已完成','未完成') as status,
+        (select count(1) from t_oe_exam_record toer where toer.exam_student_id =
+        tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') and toer.first_start_time is not null) as
+        statusTemp,
         tes.mobile_number as mobileNumber
         from
         t_e_exam_student tees
@@ -713,13 +719,31 @@
                 and tees.identity like CONCAT('%', #{identity},'%')
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
+        </where> ) t
+        <where>
+            <if test="status != null and status != '' or status == 0">
+                <choose>
+                    <when test="status == 0">
+                        and t.statusTemp = 0
+                    </when>
+                    <otherwise>
+                        and t.statusTemp <![CDATA[ > ]]> 0
+                    </otherwise>
+                </choose>
+            </if>
         </where>
-        order by tees.room_code
+        order by t.roomCode
     </select>
 
     <select id="invigilatePageProgressListExport"
             resultType="com.qmth.themis.business.bean.admin.InvigilateListProgressExcelBean">
         select
+        *,
+        if(t.statusTemp > 0,
+        '已完成',
+        '未完成') as status
+        from
+        (select
         distinct tee.id as examId,
         tee.name as examName,
         teea.id as examActivityId,
@@ -731,9 +755,8 @@
         group_concat(tees.course_name,CONCAT(CONCAT('(',tees.course_code),')')) as courseName,
         if(tee.exam_count - tees.already_exam_count <![CDATA[ < ]]> 0,0,tee.exam_count - tees.already_exam_count) as
         leftExamCount,
-        if((select count(1) from t_oe_exam_record toer where toer.exam_student_id =
-        tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') >
-        0),'已完成','未完成') as status,
+        (select count(1) from t_oe_exam_record toer where toer.exam_student_id =
+        tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') and toer.first_start_time is not null) as statusTemp,
         tes.mobile_number as mobileNumber
         from
         t_e_exam_student tees
@@ -772,8 +795,20 @@
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
         group by
-        tee.id,tees.room_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,status,tes.mobile_number
-        order by tees.room_code
+        tee.id,tees.room_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number) t
+        <where>
+            <if test="status != null and status != '' or status == 0">
+                <choose>
+                    <when test="status == 0">
+                        and t.statusTemp = 0
+                    </when>
+                    <otherwise>
+                        and t.statusTemp <![CDATA[ > ]]> 0
+                    </otherwise>
+                </choose>
+            </if>
+        </where>
+        order by t.roomCode
     </select>
 
     <select id="invigilatePageListHistory" resultType="com.qmth.themis.business.bean.admin.InvigilateListHistoryBean">
@@ -1620,6 +1655,7 @@
         join t_e_exam_activity teea on teea.exam_id = toer.exam_id and teea.id = toer.exam_activity_id
         join t_e_exam_student tees on tees.exam_id = toer.exam_id and tees.exam_activity_id = toer.exam_activity_id and tees.id = toer.exam_student_id
         <where>
+            toer.first_start_time is not null
             <if test="examId != null and examId != ''">
                 and toer.exam_id = #{examId}
             </if>
@@ -1653,6 +1689,7 @@
         join t_e_exam_activity teea on teea.exam_id = toer.exam_id and teea.id = toer.exam_activity_id
         join t_e_exam_student tees on tees.exam_id = toer.exam_id and tees.exam_activity_id = toer.exam_activity_id and tees.id = toer.exam_student_id
         <where>
+            toer.first_start_time is not null
             <if test="examId != null and examId != ''">
                 and toer.exam_id = #{examId}
             </if>