Bläddra i källkod

在线考试2022/05/20临时上线需求更改,管理员报表修改

wangliang 3 år sedan
förälder
incheckning
f9659c6af8

+ 3 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -68,6 +68,9 @@ public class TIeReportServiceImpl implements TIeReportService {
         // 缺考人数
         // 缺考人数
         Integer examTotal = 0, actualExamTotal = 0, absentNum = 0, completeOffExamTotal = 0;
         Integer examTotal = 0, actualExamTotal = 0, absentNum = 0, completeOffExamTotal = 0;
         ExamCacheBean exam = examService.getExamCacheBean(examId);
         ExamCacheBean exam = examService.getExamCacheBean(examId);
+        if (System.currentTimeMillis() > exam.getStartTime()) {
+            exam.setMonitorStatus(InvigilateMonitorStatusEnum.START);
+        }
         // 应考人数&实考人数
         // 应考人数&实考人数
         List<Integer> list = tOeExamRecordService.findByViewAdmin(orgId, examId, examActivityId, roomCode, courseCode, exam.getMonitorStatus());
         List<Integer> list = tOeExamRecordService.findByViewAdmin(orgId, examId, examActivityId, roomCode, courseCode, exam.getMonitorStatus());
         if (Objects.nonNull(list) && list.size() > 0) {
         if (Objects.nonNull(list) && list.size() > 0) {

+ 30 - 0
themis-business/src/main/java/com/qmth/themis/business/util/HttpUtil.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.util;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.exception.BusinessException;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FileUtils;
+import org.apache.http.Consts;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.HttpClient;
@@ -130,6 +131,35 @@ public class HttpUtil {
         return getRespString(post);
         return getRespString(post);
     }
     }
 
 
+    /**
+     * get 请求
+     *
+     * @param url
+     * @param params
+     * @param secret
+     * @param timestamp
+     * @return
+     */
+    public static String get(String url, Map<String, Object> params, String secret, Long timestamp) throws IOException {
+        // 构建请求参数
+        List<BasicNameValuePair> pairs = new ArrayList<BasicNameValuePair>();
+        if (params != null) {
+            for (String key : params.keySet()) {
+                pairs.add(new BasicNameValuePair(key, String.valueOf(params.get(key))));
+            }
+        }
+        String str = EntityUtils.toString(new UrlEncodedFormEntity(pairs, Consts.UTF_8));//转换为键值对
+        HttpGet get = new HttpGet(url + "?" + str);
+        if (Objects.nonNull(secret)) {
+            get.setHeader(SystemConstant.HEADER_AUTHORIZATION, secret);
+        }
+        if (Objects.nonNull(timestamp)) {
+            get.setHeader(SystemConstant.HEADER_TIME, String.valueOf(timestamp));
+        }
+        // 执行请求,获取响应
+        return getRespString(get);
+    }
+
     /**
     /**
      * 获取响应信息
      * 获取响应信息
      *
      *