Jelajahi Sumber

Merge branch 'dev'
1111

wangliang 4 tahun lalu
induk
melakukan
d63a45777b

+ 12 - 12
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamReexamController.java

@@ -67,7 +67,7 @@ public class TEExamReexamController {
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
     public Result apply(@ApiJsonObject(name = "reexamApply", value = {
-            @ApiJsonProperty(key = "examRecordId", type = "long", example = "1", description = "考试记录id", required = true),
+            @ApiJsonProperty(key = "examRecordId", description = "考试记录id数组", required = true),
             @ApiJsonProperty(key = "model", type = "int", example = "1", description = "重考方式", required = true),
             @ApiJsonProperty(key = "reason", description = "重考原因", required = true),
             @ApiJsonProperty(key = "remark", description = "备注")
@@ -75,7 +75,7 @@ public class TEExamReexamController {
         if (Objects.isNull(mapParameter.get("examRecordId")) || Objects.equals(mapParameter.get("examRecordId"), "")) {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
-        List<Long> recordIdList = (List<Long>) mapParameter.get("examRecordId");
+        List<String> recordIdList = (List<String>) mapParameter.get("examRecordId");
         if (Objects.isNull(mapParameter.get("model")) || Objects.equals(mapParameter.get("model"), "")) {
             throw new BusinessException("重考方式不能为空");
         }
@@ -88,11 +88,11 @@ public class TEExamReexamController {
         Long examId = null, examStudentId = null, examActivityId = null;
         Integer reexamAuditing = null, status;
         List<TEExamReexamAuditing> teExamReexamAuditingList = new ArrayList<>();
-        for (Long s : recordIdList) {
+        for (String s : recordIdList) {
             //获取考试记录缓存
-            Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(s));
+            Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(Long.parseLong(s)));
             if (Objects.isNull(objectMap) || objectMap.size() == 0) {
-                TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(s);
+                TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(Long.parseLong(s));
                 if (Objects.isNull(tOeExamRecord)) {
                     throw new BusinessException("考试记录[" + s + "]不存在");
                 }
@@ -110,7 +110,7 @@ public class TEExamReexamController {
             }
             reexamAuditing = examCacheBean.getReexamAuditing();
             status = Objects.isNull(reexamAuditing) || reexamAuditing.intValue() == 0 ? 0 : 1;
-            TEExamReexam teExamReexam = new TEExamReexam(examId, examActivityId, s, examStudentId, model, reason, status, Objects.isNull(mapParameter.get("remark")) ? null : String.valueOf(mapParameter.get("remark")));
+            TEExamReexam teExamReexam = new TEExamReexam(examId, examActivityId, Long.parseLong(s), examStudentId, model, reason, status, Objects.isNull(mapParameter.get("remark")) ? null : String.valueOf(mapParameter.get("remark")));
             teExamReexam.setCreateId(tbUser.getId());
             teExamReexamService.save(teExamReexam);
             if (Objects.nonNull(status) && status.intValue() == 1) {
@@ -135,25 +135,25 @@ public class TEExamReexamController {
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
     public Result auditing(@ApiJsonObject(name = "reexamAuditing", value = {
-            @ApiJsonProperty(key = "reexamId", type = "long", example = "1", description = "重考id", required = true),
+            @ApiJsonProperty(key = "reexamId", description = "重考id数组", required = true),
             @ApiJsonProperty(key = "auditingSuggest", description = "审批意见"),
             @ApiJsonProperty(key = "auditingStatus", type = "long", example = "1", description = "审批状态", required = true)
     }) @ApiParam(value = "重考信息", required = true) @RequestBody Map<String, Object> mapParameter) {
         if (Objects.isNull(mapParameter.get("reexamId")) || Objects.equals(mapParameter.get("reexamId"), "")) {
             throw new BusinessException("重考id不能为空");
         }
-        List<Long> reexamIdList = null;
+        List<String> reexamIdList = null;
         try {
-            reexamIdList = (List<Long>) mapParameter.get("reexamId");
+            reexamIdList = (List<String>) mapParameter.get("reexamId");
             if (Objects.isNull(mapParameter.get("auditingStatus")) || Objects.equals(mapParameter.get("auditingStatus"), "")) {
                 throw new BusinessException("审批状态不能为空");
             }
             Integer auditingStatus = Integer.parseInt(String.valueOf(mapParameter.get("auditingStatus")));
             TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
             List<TEExamReexam> teExamReexamUpdateList = new ArrayList<>();
-            for (Long reexamId : reexamIdList) {
-                if (redisUtil.lock(SystemConstant.REDIS_LOCK_REEXAM_AUDITING + reexamId, SystemConstant.REDIS_LOCK_REEXAM_TIME_OUT)) {
-                    TEExamReexam teExamReexam = teExamReexamService.getById(reexamId);
+            for (String reexamId : reexamIdList) {
+                if (redisUtil.lock(SystemConstant.REDIS_LOCK_REEXAM_AUDITING + Long.parseLong(reexamId), SystemConstant.REDIS_LOCK_REEXAM_TIME_OUT)) {
+                    TEExamReexam teExamReexam = teExamReexamService.getById(Long.parseLong(reexamId));
                     if (Objects.isNull(teExamReexam)) {
                         throw new BusinessException("重考id[" + reexamId + "]记录不存在");
                     }

+ 8 - 7
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateWarnInfoController.java

@@ -25,10 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * @Description: 监考预警信息 前端控制器
@@ -118,20 +115,24 @@ public class TIeInvigilateWarnInfoController {
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
     public Result saveWarnStatus(@ApiJsonObject(name = "saveWarnStatus", value = {
-            @ApiJsonProperty(key = "warningId", type = "long", example = "1", description = "预警id", required = true),
+            @ApiJsonProperty(key = "warningIds", description = "预警id数组", required = true),
             @ApiJsonProperty(key = "approveStatus", type = "long", example = "1", description = "审阅状态,0:未阅,1:已阅", required = true)
     }) @ApiParam(value = "监考员信息", required = true) @RequestBody Map<String, Object> mapParameter) {
         if (Objects.isNull(mapParameter.get("warningIds")) || Objects.equals(mapParameter.get("warningIds"), "")) {
             throw new BusinessException("预警id不能为空");
         }
-        List<Long> warningIds = (List<Long>) mapParameter.get("warningIds");
+        List<String> warningIds = (List<String>) mapParameter.get("warningIds");
         if (Objects.isNull(mapParameter.get("approveStatus")) || Objects.equals(mapParameter.get("approveStatus"), "")) {
             throw new BusinessException("审阅状态不能为空");
         }
+        List<Long> warningTranIds = new ArrayList<>();
+        warningIds.forEach(s -> {
+            warningTranIds.add(Long.parseLong(s));
+        });
         Integer approveStatus = Integer.parseInt(String.valueOf(mapParameter.get("approveStatus")));
         UpdateWrapper<TIeInvigilateWarnInfo> tIeInvigilateWarnInfoUpdateWrapper = new UpdateWrapper<>();
         tIeInvigilateWarnInfoUpdateWrapper.lambda().set(TIeInvigilateWarnInfo::getApproveStatus, approveStatus)
-                .in(TIeInvigilateWarnInfo::getId, warningIds);
+                .in(TIeInvigilateWarnInfo::getId, warningTranIds);
         tIeInvigilateWarnInfoService.update(tIeInvigilateWarnInfoUpdateWrapper);
         return ResultUtil.ok(Collections.singletonMap("success", true));
     }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListBean.java

@@ -13,6 +13,9 @@ import java.util.Date;
 @ApiModel("实时监控台返回对象")
 public class InvigilateListBean implements Serializable {
 
+    @ApiModelProperty(name = "序号")
+    private Integer seq;
+
     @ApiModelProperty(name = "考试批次名称")
     private String examName;
 
@@ -85,6 +88,14 @@ public class InvigilateListBean implements Serializable {
     @ApiModelProperty(name = "新增预警")
     private Integer warningNew;
 
+    public Integer getSeq() {
+        return seq;
+    }
+
+    public void setSeq(Integer seq) {
+        this.seq = seq;
+    }
+
     public String getExamName() {
         return examName;
     }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListHistoryBean.java

@@ -18,6 +18,9 @@ import java.util.Date;
 @ApiModel("监考明细管理列表返回对象")
 public class InvigilateListHistoryBean implements Serializable {
 
+    @ApiModelProperty(name = "序号")
+    private Integer seq;
+
     @ApiModelProperty(name = "考试批次名称")
     private String examName;
 
@@ -78,6 +81,14 @@ public class InvigilateListHistoryBean implements Serializable {
     @ApiModelProperty(name = "联系电话")
     private String mobileNumber;
 
+    public Integer getSeq() {
+        return seq;
+    }
+
+    public void setSeq(Integer seq) {
+        this.seq = seq;
+    }
+
     public String getMobileNumber() {
         return mobileNumber;
     }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListPatrolBean.java

@@ -17,6 +17,9 @@ import java.util.Date;
 @ApiModel("在线巡考返回对象")
 public class InvigilateListPatrolBean implements Serializable {
 
+    @ApiModelProperty(name = "序号")
+    private Integer seq;
+
     @ApiModelProperty(name = "考试批次名称")
     private String examName;
 
@@ -68,6 +71,14 @@ public class InvigilateListPatrolBean implements Serializable {
     @ApiModelProperty(name = "虚拟考场名称")
     private String roomName;
 
+    public Integer getSeq() {
+        return seq;
+    }
+
+    public void setSeq(Integer seq) {
+        this.seq = seq;
+    }
+
     public String getExamName() {
         return examName;
     }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListVideoBean.java

@@ -19,6 +19,9 @@ import java.util.Date;
 @ApiModel("实时监控台视频返回对象")
 public class InvigilateListVideoBean implements Serializable {
 
+    @ApiModelProperty(name = "序号")
+    private Integer seq;
+
     @ApiModelProperty(name = "考试批次名称")
     private String examName;
 
@@ -76,6 +79,14 @@ public class InvigilateListVideoBean implements Serializable {
     @ApiModelProperty(name = "新增预警")
     private Integer warningNew;
 
+    public Integer getSeq() {
+        return seq;
+    }
+
+    public void setSeq(Integer seq) {
+        this.seq = seq;
+    }
+
     public Integer getWarningNew() {
         return warningNew;
     }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListWarningBean.java

@@ -17,6 +17,9 @@ import java.util.Date;
 @ApiModel("预警提醒返回对象")
 public class InvigilateListWarningBean implements Serializable {
 
+    @ApiModelProperty(name = "序号")
+    private Integer seq;
+
     @ApiModelProperty(name = "预警id")
     private Long warningId;
 
@@ -80,6 +83,14 @@ public class InvigilateListWarningBean implements Serializable {
     @ApiModelProperty(value = "审阅状态,0:未阅,1:已阅")
     private Integer approveStatus;
 
+    public Integer getSeq() {
+        return seq;
+    }
+
+    public void setSeq(Integer seq) {
+        this.seq = seq;
+    }
+
     public Long getWarningId() {
         return warningId;
     }

+ 41 - 24
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -169,21 +169,34 @@
 		</where>
 	</sql>
 
-	<select id="invigilatePageList"
-		resultType="com.qmth.themis.business.bean.backend.InvigilateListBean">
-		<include refid="invigilatePageHead" />
-		,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and tiiwi.approve_status = 0) as warningNew
-		,date_format(date_sub(date_add(teea.start_time, interval IFNULL(teea.max_duration_seconds, tee.max_duration_seconds) second), interval teea.max_duration_seconds / 60 - t.duration_seconds minute),'%H:%i:%s') as remainTime
-		<include refid="invigilatePageMiddle" />
-		<include refid="invigilatePageFoot" />
-		<if test="paperDownload != null and paperDownload != ''">
-			and t.paper_download = #{paperDownload}
-		</if>
-		order by s.room_code
+	<select id="invigilatePageList" resultType="com.qmth.themis.business.bean.backend.InvigilateListBean">
+        select
+        (@i := @i + 1) as seq,
+        t.*
+        from
+        (
+        <include refid="invigilatePageHead"/>
+        ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and
+        tiiwi.approve_status = 0) as warningNew
+        <include refid="invigilatePageMiddle"/>
+		<include refid="invigilatePageFoot"/>
+        <if test="paperDownload != null and paperDownload != ''">,
+            date_format(date_sub(date_add(teea.start_time, interval IFNULL(teea.max_duration_seconds,
+            tee.max_duration_seconds) second), interval teea.max_duration_seconds / 60 - t.duration_seconds
+            minute),'%H:%i:%s') as remainTime
+            and t.paper_download = #{paperDownload}
+        </if>
+        ) t,
+        (SELECT @i := 0) as i
+		order by t.roomCode
 	</select>
 
-	<select id="invigilatePageListVideo"
-		resultType="com.qmth.themis.business.bean.backend.InvigilateListVideoBean">
+	<select id="invigilatePageListVideo" resultType="com.qmth.themis.business.bean.backend.InvigilateListVideoBean">
+		select
+		(@i := @i + 1) as seq,
+		t.*
+		from
+		(
 		<include refid="invigilatePageHead" />
 		,t.monitor_live_url as monitorLiveUrl
 		,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and tiiwi.approve_status = 0) as warningNew
@@ -193,12 +206,13 @@
 		<if test="paperDownload != null and paperDownload != ''">
 			and t.paper_download = #{paperDownload}
 		</if>
-		order by s.room_code
+		) t,
+		(SELECT @i := 0) as i
+		order by t.roomCode
 	</select>
 
-	<select id="invigilatePagePatrolList"
-		resultType="com.qmth.themis.business.bean.backend.InvigilateListPatrolBean">
-		select * from(<include refid="invigilatePageHead" />
+	<select id="invigilatePagePatrolList" resultType="com.qmth.themis.business.bean.backend.InvigilateListPatrolBean">
+		select (@i := @i + 1) as seq,t.* from(<include refid="invigilatePageHead" />
 		,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = t.id) as exceptionCount
 		,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and tiiwi.`type` =
 		'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
@@ -221,12 +235,12 @@
 				and t.exceptionCount &gt;= #{maxExceptionCount}
 			</if>
 		</where>
+		,(SELECT @i := 0) as i
 		order by t.roomCode
 	</select>
 
-	<select id="invigilatePageWarningList"
-		resultType="com.qmth.themis.business.bean.backend.InvigilateListWarningBean">
-		select * from(select
+	<select id="invigilatePageWarningList" resultType="com.qmth.themis.business.bean.backend.InvigilateListWarningBean">
+		select (@i := @i + 1) as seq,t.* from(select
 		tiiwi.id as warningId,
 		tee.id as examId,
 		tee.name as examName,
@@ -318,11 +332,11 @@
 				and t.exceptionCount &gt;= #{maxExceptionCount}
 			</if>
 		</where>
+		,(SELECT @i := 0) as i
 		order by t.roomCode
 	</select>
 
-	<select id="invigilatePageProgressList"
-		resultType="com.qmth.themis.business.bean.backend.InvigilateListProgressBean">
+	<select id="invigilatePageProgressList" resultType="com.qmth.themis.business.bean.backend.InvigilateListProgressBean">
 		select
 		distinct tee.id as examId,
 		tee.name as examName,
@@ -377,6 +391,7 @@
 	</select>
 
 	<select id="invigilatePageListHistory" resultType="com.qmth.themis.business.bean.backend.InvigilateListHistoryBean">
+		select (@i := @i + 1) as seq,t.* from(
 		<include refid="invigilatePageHead" />
 		,tes.mobile_number as mobileNumber
 		<include refid="invigilatePageMiddle" />
@@ -391,7 +406,9 @@
 		<if test="courseCode != null and courseCode != ''">
 			and tees.course_code like CONCAT('%', #{courseCode},'%')
 		</if>
-		order by s.room_code
+		) t,
+		(SELECT @i := 0) as i
+		order by t.roomCode
 	</select>
 
 	<select id="getDoneCount" resultType="java.util.Map">
@@ -441,7 +458,7 @@
 		order by f.id
 		limit 500
 	</select>
-	
+
 	<update id="updateObjectiveScore">
 		update t_oe_exam_record t set t.objective_score=#{score} where t.id=#{recordId}
 	</update>