wangliang 3 жил өмнө
parent
commit
77a8924117

+ 2 - 2
themis-admin/src/main/java/com/qmth/themis/admin/api/SysController.java

@@ -280,7 +280,7 @@ public class SysController {
             if (Objects.nonNull(name) && !Objects.equals(name, "")) {
                 teExamQueryWrapper.lambda().like(TEExam::getName, name);
             }
-            teExamQueryWrapper.lambda().orderByAsc(TEExam::getCode).orderByDesc(TEExam::getCreateTime);
+            teExamQueryWrapper.lambda().orderByDesc(TEExam::getCreateTime);
             teExamList = teExamService.list(teExamQueryWrapper);
         } else {
             if (Objects.nonNull(userId) && !Objects.equals(userId, "")) {
@@ -295,7 +295,7 @@ public class SysController {
                     teExamQueryWrapper.lambda()
                             .ne(TEExam::getMonitorStatus, InvigilateMonitorStatusEnum.FINISHED.name());
                 }
-                teExamQueryWrapper.lambda().orderByAsc(TEExam::getCode).orderByDesc(TEExam::getCreateTime);
+                teExamQueryWrapper.lambda().orderByDesc(TEExam::getCreateTime);
                 teExamList = teExamService.list(teExamQueryWrapper);
             }
         }

+ 1 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -241,7 +241,7 @@ public class TEExamController {
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length())
                         .replaceAll("'", "");
                 throw new BusinessException(
-                        "机构id[" + teExam.getOrgId() + "]下的" + FieldUniqueEnum.convertToCode(columnStr) + "数据不允许重复插入");
+                        "批次名称[" + teExam.getName() + "]下的" + FieldUniqueEnum.convertToCode(columnStr) + "不能重复创建");
             } else if (e instanceof BusinessException) {
                 throw new BusinessException(e.getMessage());
             } else {

+ 1 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamCourseController.java

@@ -83,7 +83,7 @@ public class TEExamCourseController {
                         @ApiParam(value = "科目名称", required = false) @RequestParam(required = false) String courseName,
                         @ApiParam(value = "是否已绑定试卷", required = false) @RequestParam(required = false) Integer hasPaper,
                         @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) {
+                        @ApiParam(value = "分页数", required = true) @RequestParam @Min(1) @Max(SystemConstant.PAGE_SIZE_MAX) int pageSize) {
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }

+ 2 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/TEStudentController.java

@@ -58,10 +58,11 @@ public class TEStudentController {
     public Result query(@ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
                         @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
                         @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable,
+                        @ApiParam(value = "是否有照片(true为有,false为无)", required = false) @RequestParam(required = false) Boolean photo,
                         @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();
-        IPage<TEStudentDto> teExamStudentIPage = teStudentService.studentQuery(new Page<>(pageNumber, pageSize), identity, name, enable, tbUser.getOrgId());
+        IPage<TEStudentDto> teExamStudentIPage = teStudentService.studentQuery(new Page<>(pageNumber, pageSize), identity, name, enable, tbUser.getOrgId(), photo);
         if (teExamStudentIPage.getRecords() != null && teExamStudentIPage.getRecords().size() > 0) {
             for (TEStudentDto dto : teExamStudentIPage.getRecords()) {
                 if (StringUtils.isNotBlank(dto.getBasePhotoPath())) {

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

@@ -28,9 +28,10 @@ public interface TEStudentMapper extends BaseMapper<TEStudent> {
      * @param name
      * @param enable
      * @param orgId
+     * @param photo
      * @return
      */
-    public IPage<TEStudentDto> studentQuery(IPage<Map> iPage, @Param("identity") String identity, @Param("name") String name, @Param("enable") Integer enable, @Param("orgId") Long orgId);
+    public IPage<TEStudentDto> studentQuery(IPage<Map> iPage, @Param("identity") String identity, @Param("name") String name, @Param("enable") Integer enable, @Param("orgId") Long orgId, @Param("photo") Boolean photo);
 
     /**
      * 学生考试记录查询

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/TEStudentDto.java

@@ -47,6 +47,17 @@ public class TEStudentDto implements Serializable {
     @ApiModelProperty(name = "更新时间")
     private Long updateTime;//更新时间
 
+    @ApiModelProperty(name = "是否有照片")
+    private Boolean photo;
+
+    public Boolean getPhoto() {
+        return photo;
+    }
+
+    public void setPhoto(Boolean photo) {
+        this.photo = photo;
+    }
+
     public Long getId() {
         return id;
     }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/TEStudentExamRecordDto.java

@@ -59,6 +59,17 @@ public class TEStudentExamRecordDto implements Serializable {
     @ApiModelProperty(name = "首次开考时间")
     private Long firstStartTime;
 
+    @ApiModelProperty(name = "交卷时间")
+    private Long finishTime;
+
+    public Long getFinishTime() {
+        return finishTime;
+    }
+
+    public void setFinishTime(Long finishTime) {
+        this.finishTime = finishTime;
+    }
+
     public Long getFirstStartTime() {
         return firstStartTime;
     }

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

@@ -27,9 +27,10 @@ public interface TEStudentService extends IService<TEStudent> {
      * @param name
      * @param enable
      * @param orgId
+     * @param photo
      * @return
      */
-    public IPage<TEStudentDto> studentQuery(IPage<Map> iPage, String identity, String name, Integer enable, Long orgId);
+    public IPage<TEStudentDto> studentQuery(IPage<Map> iPage, String identity, String name, Integer enable, Long orgId, Boolean photo);
 
     /**
      * 学生考试记录查询

+ 3 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEStudentServiceImpl.java

@@ -56,12 +56,13 @@ public class TEStudentServiceImpl extends ServiceImpl<TEStudentMapper, TEStudent
      * @param name
      * @param enable
      * @param orgId
+     * @param photo
      * @return
      */
     @Override
     public IPage<TEStudentDto> studentQuery(IPage<Map> iPage, String identity, String name, Integer enable,
-                                            Long orgId) {
-        return teStudentMapper.studentQuery(iPage, identity, name, enable, orgId);
+                                            Long orgId, Boolean photo) {
+        return teStudentMapper.studentQuery(iPage, identity, name, enable, orgId, photo);
     }
 
     /**

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

@@ -137,7 +137,7 @@
         t.monitorVideoSource,
         t.monitorRecord,
         t.monitorStatus
-        order by t.code,t.createTime desc
+        order by t.createTime desc
     </select>
 
     <select id="getWaitingExam" resultType="com.qmth.themis.business.dto.response.TEExamWaitDto">

+ 12 - 3
themis-business/src/main/resources/mapper/TEStudentMapper.xml

@@ -11,7 +11,8 @@
         t.enable,
         t.basePhotoPath,
         if(t.updateName is not null, t.updateName, t.createName) as updateName,
-        if(t.updateTime is not null, t.updateTime, t.createTime) as updateTime
+        if(t.updateTime is not null, t.updateTime, t.createTime) as updateTime,
+        t.photo
         from
         (select
         tes.id,
@@ -20,6 +21,7 @@
         tbo.name as orgName,
         tes.enable,
         tes.base_photo_path as basePhotoPath,
+        IF(tes.base_photo_path is null,0,1) as photo,
         (select tbu.name from t_b_user tbu where tbu.id = tes.create_id) as createName,
         (select tbu.name from t_b_user tbu where tbu.id = tes.update_id) as updateName,
         tes.create_time as createTime,
@@ -42,7 +44,13 @@
                 and tes.org_id = #{orgId}
             </if>
         </where>
-        ) t order by t.id
+        ) t
+        <where>
+            <if test="photo != null and photo != '' or photo == 0">
+                and t.photo = #{photo}
+            </if>
+        </where>
+        order by t.id
     </select>
 
     <select id="studentExamRecordQuery" resultType="com.qmth.themis.business.dto.response.TEStudentExamRecordDto">
@@ -58,7 +66,8 @@
             toer.objective_score as objectiveScore,
             toer.status,
             toer.tencent_video_url as tencentVideoUrl,
-            toer.first_start_time as firstStartTime
+            toer.first_start_time as firstStartTime,
+            toer.finish_time as finishTime
         from
             t_e_exam_student tees
         left join t_e_exam tee on