wangliang 4 роки тому
батько
коміт
139d862475

+ 3 - 4
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -346,7 +346,7 @@ public class TIeInvigilateController {
     @ApiOperation(value = "进度查询列表导出接口")
     @RequestMapping(value = "/progress/list/export", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考进度信息", response = InvigilateListProgressBean.class)})
-    public Result progressListExport(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId,
+    public void progressListExport(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId,
                                      @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long examActivityId,
                                      @ApiParam(value = "虚拟考场代码", required = false) @RequestParam(required = false) String roomCode,
                                      @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
@@ -360,9 +360,8 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        List<InvigilateListProgressBean> invigilateListProgressBeanList = tOeExamRecordService.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, userId);
-        ExportUtils.exportEXCEL("进度信息", InvigilateListProgressBean.class, invigilateListProgressBeanList, response);
-        return ResultUtil.ok(Collections.singletonMap("success", true));
+        List<InvigilateListProgressExcelBean> invigilateListProgressExcelBeanList = tOeExamRecordService.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, userId);
+        ExportUtils.exportEXCEL("进度信息", InvigilateListProgressExcelBean.class, invigilateListProgressExcelBeanList, response);
     }
 
     @ApiOperation(value = "违纪处理接口")

+ 125 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListProgressExcelBean.java

@@ -0,0 +1,125 @@
+package com.qmth.themis.business.bean.backend;
+
+import com.qmth.themis.business.excel.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 进度查询返回对象
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/8/22
+ */
+@ApiModel("进度查询返回对象")
+public class InvigilateListProgressExcelBean implements Serializable {
+
+    @ExcelProperty(name = "批次名称(代码)", width = 30, index = 1)
+    private String examName;
+
+    @ApiModelProperty(name = "考试场次")
+    @ExcelProperty(name = "场次名称(代码)", width = 30, index = 2)
+    private String examActivityCode;
+
+    @ApiModelProperty(name = "证件号")
+    @ExcelProperty(name = "证件号", width = 30, index = 4)
+    private String identity;
+
+    @ApiModelProperty(name = "虚拟考场名称")
+    @ExcelProperty(name = "考场名称(代码)", width = 30, index = 3)
+    private String roomName;
+
+    @ApiModelProperty(name = "姓名")
+    @ExcelProperty(name = "姓名", width = 30, index = 5)
+    private String name;
+
+    @ApiModelProperty(name = "考生状态")
+    @ExcelProperty(name = "完成状态", width = 30, index = 9)
+    private String status;
+
+    @ApiModelProperty(name = "联系电话")
+    @ExcelProperty(name = "联系电话", width = 30, index = 6)
+    private String mobileNumber;
+
+    @ApiModelProperty(name = "科目名称")
+    @ExcelProperty(name = "科目(代码)", width = 30, index = 7)
+    private String courseName;
+
+    @ApiModelProperty(value = "剩余考试次数")
+    @ExcelProperty(name = "剩余考试次数", width = 30, index = 8)
+    private Integer leftExamCount;
+
+    public String getRoomName() {
+        return roomName;
+    }
+
+    public void setRoomName(String roomName) {
+        this.roomName = roomName;
+    }
+
+    public String getExamName() {
+        return examName;
+    }
+
+    public void setExamName(String examName) {
+        this.examName = examName;
+    }
+
+    public String getExamActivityCode() {
+        return examActivityCode;
+    }
+
+    public void setExamActivityCode(String examActivityCode) {
+        this.examActivityCode = examActivityCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getIdentity() {
+        return identity;
+    }
+
+    public void setIdentity(String identity) {
+        this.identity = identity;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getMobileNumber() {
+        return mobileNumber;
+    }
+
+    public void setMobileNumber(String mobileNumber) {
+        this.mobileNumber = mobileNumber;
+    }
+
+    public Integer getLeftExamCount() {
+        return leftExamCount;
+    }
+
+    public void setLeftExamCount(Integer leftExamCount) {
+        this.leftExamCount = leftExamCount;
+    }
+}

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

@@ -220,7 +220,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param userId
      * @return
      */
-    public List<InvigilateListProgressBean> invigilatePageProgressListExport(@Param("examId") Long examId,
+    public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(@Param("examId") Long examId,
                                                                          @Param("examActivityId") Long examActivityId,
                                                                          @Param("roomCode") String roomCode,
                                                                          @Param("courseCode") String courseCode,

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

@@ -282,7 +282,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param userId
      * @return
      */
-    public List<InvigilateListProgressBean> invigilatePageProgressListExport(Long examId,
+    public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(Long examId,
                                                                         Long examActivityId,
                                                                         String roomCode,
                                                                         String courseCode,

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

@@ -609,7 +609,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @return
      */
     @Override
-    public List<InvigilateListProgressBean> invigilatePageProgressListExport(Long examId, Long examActivityId, String roomCode, String courseCode, String name, String identity, Long userId) {
+    public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(Long examId, Long examActivityId, String roomCode, String courseCode, String name, String identity, Long userId) {
         return tOeExamRecordMapper.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, userId);
     }
 

+ 10 - 6
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -366,13 +366,15 @@
 		(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
+		0),'已完成','未完成') as status,
+		tes.mobile_number as mobileNumber
 		from
 		t_e_exam_student tees
 		left join t_e_exam tee on
 		tee.id = tees.exam_id
 		left join t_e_exam_activity teea on
 		teea.id = tees.exam_activity_id
+		left join t_e_student tes on tees.student_id = tes.id
 		inner join (select distinct tbeiu.room_code from t_b_exam_invigilate_user
 		tbeiu
 		<if test="userId != null and userId != ''">
@@ -405,28 +407,29 @@
 		order by tees.room_code
 	</select>
 
-	<select id="invigilatePageProgressListExport" resultType="com.qmth.themis.business.bean.backend.InvigilateListProgressBean">
+	<select id="invigilatePageProgressListExport" resultType="com.qmth.themis.business.bean.backend.InvigilateListProgressExcelBean">
 		select
 		distinct tee.id as examId,
 		tee.name as examName,
 		teea.id as examActivityId,
 		teea.code as examActivityCode,
 		tees.room_code as roomCode,
-		tees.room_name as roomName,
+		group_concat(tees.room_name,CONCAT(CONCAT('(',tees.room_code),')')) as roomName,
 		tees.`identity`,
 		tees.name,
-		tees.course_code as courseCode,
-		tees.course_name as courseName,
+		group_concat(tees.course_name,CONCAT(CONCAT('(',tees.course_code),')')) as courseName,
 		(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
+		0),'已完成','未完成') as status,
+		tes.mobile_number as mobileNumber
 		from
 		t_e_exam_student tees
 		left join t_e_exam tee on
 		tee.id = tees.exam_id
 		left join t_e_exam_activity teea on
 		teea.id = tees.exam_activity_id
+		left join t_e_student tes on tees.student_id = tes.id
 		inner join (select distinct tbeiu.room_code from t_b_exam_invigilate_user
 		tbeiu
 		<if test="userId != null and userId != ''">
@@ -456,6 +459,7 @@
 			and teea.enable = 1
 			and tees.enable = 1
 		</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
 	</select>