|
@@ -1,33 +1,9 @@
|
|
|
-/*
|
|
|
- * *************************************************
|
|
|
- * Copyright (c) 2018 QMTH. All Rights Reserved.
|
|
|
- * Created by Deason on 2018-08-27 16:16:29.
|
|
|
- * *************************************************
|
|
|
- */
|
|
|
-
|
|
|
package cn.com.qmth.examcloud.core.oe.admin.api.controller;
|
|
|
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Set;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import cn.com.qmth.examcloud.api.commons.security.bean.UserDataRule;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordIllegallyService;
|
|
|
-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.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.AdminOperateType;
|
|
|
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.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.commons.util.JsonMapper;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.base.Constants;
|
|
@@ -37,11 +13,10 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.IllegallyTypeRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.IllegallyTypeEntity;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.SelectType;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.AsyncExportService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamAuditService;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordIllegallyService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.UserDataRules;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.ExamAuditEntityConvert;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.ExamAuditExcel;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.ExamAuditInfo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.ExamAuditQuery;
|
|
@@ -57,6 +32,15 @@ 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.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* 考试记录审核相关接口
|
|
@@ -84,15 +68,14 @@ public class ExamAuditController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
private AsyncExportService asyncExportService;
|
|
|
|
|
|
-
|
|
|
- @DataRule(type = {DataRuleType.COURSE,DataRuleType.ORG})
|
|
|
+ @DataRule(type = {DataRuleType.COURSE, DataRuleType.ORG})
|
|
|
@PostMapping("/list")
|
|
|
@ApiOperation(value = "查询“监考已审”列表(分页)")
|
|
|
public Page<ExamAuditInfo> getExamAuditList(@RequestBody ExamAuditQuery query) {
|
|
|
User user = getAccessUser();
|
|
|
query.setRootOrgId(user.getRootOrgId());
|
|
|
- UserDataRules uds=new UserDataRules(getUserDataRule(DataRuleType.ORG), getUserDataRule(DataRuleType.COURSE));
|
|
|
- Page<ExamAuditInfo> examAuditList = examAuditService.getExamAuditList(uds,query);
|
|
|
+ UserDataRules uds = new UserDataRules(getUserDataRule(DataRuleType.ORG), getUserDataRule(DataRuleType.COURSE));
|
|
|
+ Page<ExamAuditInfo> examAuditList = examAuditService.getExamAuditList(uds, query);
|
|
|
|
|
|
examAuditList.getContent().forEach(p -> {
|
|
|
p.setIdentityNumber(IdentityNumberHelper.conceal(user.getRootOrgId(), p.getIdentityNumber()));
|
|
@@ -110,7 +93,7 @@ public class ExamAuditController extends ControllerSupport {
|
|
|
ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), AdminOperateType.TYPE13.getDesc(), "导出条件:" + query));
|
|
|
}
|
|
|
|
|
|
- @DataRule(type = {DataRuleType.COURSE,DataRuleType.ORG})
|
|
|
+ @DataRule(type = {DataRuleType.COURSE, DataRuleType.ORG})
|
|
|
@PostMapping("/discipline/list")
|
|
|
@ApiOperation(value = "查询“违纪名单”列表(分页)")
|
|
|
public Page<ExamAuditInfo> getExamAuditUnPassList(@RequestBody ExamAuditQuery query) {
|
|
@@ -126,19 +109,16 @@ public class ExamAuditController extends ControllerSupport {
|
|
|
return examAuditList;
|
|
|
}
|
|
|
|
|
|
- @DataRule(type = {DataRuleType.COURSE,DataRuleType.ORG})
|
|
|
+ @DataRule(type = {DataRuleType.COURSE, DataRuleType.ORG})
|
|
|
@GetMapping("/discipline/list/export")
|
|
|
@ApiOperation(value = "导出“违纪名单”列表(Excel)", notes = "参数示例:query={\"pageNo\":1,\"pageSize\":10,\"examId\":123, ...}")
|
|
|
public void exportExamAuditUnPassList(@RequestParam String query, HttpServletResponse response) throws Exception {
|
|
|
ExamAuditQuery newQuery = new JsonMapper().parseJson(query, ExamAuditQuery.class);
|
|
|
Check.isNull(newQuery, "请求参数不能为空!");
|
|
|
- newQuery.setSelectType(SelectType.EXPORT);
|
|
|
-
|
|
|
UserDataRule courseRule = super.getUserDataRule(DataRuleType.COURSE);
|
|
|
UserDataRule orgRule = super.getUserDataRule(DataRuleType.ORG);
|
|
|
|
|
|
- Page<ExamAuditInfo> page = examRecordIllegallyService.getExamRecordIllegallyList(newQuery, courseRule, orgRule);
|
|
|
- List<ExamAuditExcel> list = ExamAuditEntityConvert.ofExcel(page);
|
|
|
+ List<ExamAuditExcel> list = examRecordIllegallyService.getExamRecordIllegallyListForExport(newQuery, courseRule, orgRule);
|
|
|
ExportUtils.exportEXCEL("违纪名单列表", ExamAuditExcel.class, list, response);
|
|
|
}
|
|
|
|
|
@@ -228,7 +208,7 @@ public class ExamAuditController extends ControllerSupport {
|
|
|
//原需求:已经生成了评卷任务,不能重新审为不通过,但是可以审核为已通过
|
|
|
//20191220,需求临时调整:已经生成了评卷任务,均不可重审
|
|
|
//20200923,需求调整,恢复至原需求:已经生成了评卷任务,不能重新审为不通过,但是可以审核为已通过
|
|
|
- if(redoAuditInfo.getFromMarking() == null || !redoAuditInfo.getFromMarking()){
|
|
|
+ if (redoAuditInfo.getFromMarking() == null || !redoAuditInfo.getFromMarking()) {
|
|
|
String markingTaskBuilt =
|
|
|
ExamCacheTransferHelper.getDefaultCachedExamProperty(examId, ExamProperties.MARKING_TASK_BUILDED.name()).getValue();
|
|
|
if (StringUtils.isNotBlank(markingTaskBuilt) && Constants.isTrue.equals(markingTaskBuilt)) {
|