|
@@ -1,10 +1,3 @@
|
|
|
-/*
|
|
|
- * *************************************************
|
|
|
- * Copyright (c) 2018 QMTH. All Rights Reserved.
|
|
|
- * Created by Deason on 2018-08-16 17:40:53.
|
|
|
- * *************************************************
|
|
|
- */
|
|
|
-
|
|
|
package cn.com.qmth.examcloud.core.oe.admin.api.controller;
|
|
|
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.AdminOperateType;
|
|
@@ -12,12 +5,9 @@ import cn.com.qmth.examcloud.api.commons.enums.DataRuleType;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.UserDataRule;
|
|
|
import cn.com.qmth.examcloud.commons.util.JsonMapper;
|
|
|
-import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.base.utils.Check;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.base.utils.excel.ExportUtils;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.IllegallyTypeRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.entity.IllegallyTypeEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.AsyncExportService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamStudentService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.UserDataRules;
|
|
@@ -32,14 +22,12 @@ import cn.com.qmth.examcloud.web.security.DataRule;
|
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
/**
|
|
|
* 考生信息接口
|
|
@@ -58,36 +46,6 @@ public class ExamStudentController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
private AsyncExportService asyncExportService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private IllegallyTypeRepo illegallyTypeRepo;
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询课程本地缓存
|
|
|
- */
|
|
|
- private static Map<Long, CourseBean> courseBeanLocalCache;
|
|
|
-
|
|
|
- private static Timer timer;
|
|
|
-
|
|
|
- static {
|
|
|
- courseBeanLocalCache = new ConcurrentHashMap<Long, CourseBean>();
|
|
|
- timer = new Timer();
|
|
|
- }
|
|
|
-
|
|
|
- class CleanCourseBeanCacheTask extends TimerTask {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- courseBeanLocalCache.clear();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public ExamStudentController() {
|
|
|
- long delay = 10 * 60 * 1000;//10分钟后开始
|
|
|
- long period = 30 * 60 * 1000;//30分钟清理一次
|
|
|
- timer.schedule(new CleanCourseBeanCacheTask(), delay, period);
|
|
|
- }
|
|
|
-
|
|
|
@DataRule(type = {DataRuleType.COURSE, DataRuleType.ORG})
|
|
|
@PostMapping("/examScheduling/list")
|
|
|
@ApiOperation(value = "查询“考试进度详情”列表(分页)")
|
|
@@ -177,20 +135,8 @@ public class ExamStudentController extends ControllerSupport {
|
|
|
if (examStudentId == null) {
|
|
|
return;
|
|
|
}
|
|
|
- examStudentService.setReexamine(examStudentId, reexamineType, reexamineDetail);
|
|
|
User user = getAccessUser();
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
- sb.append("考生ID:" + examStudentId);
|
|
|
- if (StringUtils.isNotEmpty(reexamineType)) {
|
|
|
- IllegallyTypeEntity it = illegallyTypeRepo.findByRootOrgIdAndCode(-1L, reexamineType);
|
|
|
- if (it != null) {
|
|
|
- sb.append(" 重考理由:" + it.getName());
|
|
|
- }
|
|
|
- }
|
|
|
- if (StringUtils.isNotEmpty(reexamineDetail)) {
|
|
|
- sb.append(" 详情描述:" + reexamineDetail);
|
|
|
- }
|
|
|
- ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), AdminOperateType.TYPE20.getDesc(), sb.toString()));
|
|
|
+ examStudentService.setReexamine(examStudentId, reexamineType, reexamineDetail, user.getUserId(), user.getDisplayName());
|
|
|
}
|
|
|
|
|
|
@PostMapping("/statistic/by/finished")
|