|
@@ -47,7 +47,7 @@ import java.util.Set;
|
|
|
@Api(tags = "考试记录审核相关接口")
|
|
|
@RequestMapping("${$rmp.ctr.oe}/exam/audit")
|
|
|
public class ExamAuditController extends ControllerSupport {
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private ExamAuditService examAuditService;
|
|
|
|
|
@@ -60,8 +60,8 @@ public class ExamAuditController extends ControllerSupport {
|
|
|
@PostMapping("/list")
|
|
|
@ApiOperation(value = "查询“监考已审”列表(分页)")
|
|
|
public Page<ExamAuditInfo> getExamAuditList(@RequestBody ExamAuditQuery query) {
|
|
|
- User user = getAccessUser();
|
|
|
- query.setRootOrgId(user.getRootOrgId());
|
|
|
+ User user = getAccessUser();
|
|
|
+ query.setRootOrgId(user.getRootOrgId());
|
|
|
return examAuditService.getExamAuditList(query);
|
|
|
}
|
|
|
|
|
@@ -95,57 +95,60 @@ public class ExamAuditController extends ControllerSupport {
|
|
|
@RequestParam(required = false) String disciplineDetail,
|
|
|
@RequestParam(required = true) Boolean isPass,
|
|
|
@RequestParam(required = false) DisciplineType disciplineType) {
|
|
|
- if(examRecordDataId == null){
|
|
|
- throw new StatusException("singleAudit-001", "examRecordDataId不能为空");
|
|
|
- }
|
|
|
- if(isPass == null){
|
|
|
- throw new StatusException("singleAudit-002", "isPass不能为空");
|
|
|
- }
|
|
|
+ if (examRecordDataId == null) {
|
|
|
+ throw new StatusException("singleAudit-001", "examRecordDataId不能为空");
|
|
|
+ }
|
|
|
+ if (isPass == null) {
|
|
|
+ throw new StatusException("singleAudit-002", "isPass不能为空");
|
|
|
+ }
|
|
|
User user = getAccessUser();
|
|
|
examAuditService.singleAudit(examRecordDataId, isPass, disciplineDetail, disciplineType, user);
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "/batch/audit")
|
|
|
@ApiOperation(value = "监考待审-批量审核")
|
|
|
- public void batchAudit(@RequestParam List<Long> examRecordDataIds,@RequestParam Boolean isPass) {
|
|
|
- if(examRecordDataIds == null || examRecordDataIds.size() == 0){
|
|
|
- throw new StatusException("batchAudit-001", "examRecordDataIds不能为空");
|
|
|
- }
|
|
|
- if(isPass == null){
|
|
|
- throw new StatusException("batchAudit-002", "isPass不能为空");
|
|
|
- }
|
|
|
+ public void batchAudit(@RequestParam List<Long> examRecordDataIds, @RequestParam Boolean isPass) {
|
|
|
+ if (examRecordDataIds == null || examRecordDataIds.size() == 0) {
|
|
|
+ throw new StatusException("batchAudit-001", "examRecordDataIds不能为空");
|
|
|
+ }
|
|
|
+ if (isPass == null) {
|
|
|
+ throw new StatusException("batchAudit-002", "isPass不能为空");
|
|
|
+ }
|
|
|
User user = getAccessUser();
|
|
|
examAuditService.batchAudit(examRecordDataIds, isPass, user);
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "/redoAudit")
|
|
|
@ApiOperation(value = "重新审核")
|
|
|
- public void redoAudit(@RequestBody RedoAuditInfo redoAuditInfo){
|
|
|
- User user = getAccessUser();
|
|
|
- if(redoAuditInfo.getExamRecordDataIds() == null || redoAuditInfo.getExamRecordDataIds().size()==0){
|
|
|
- throw new StatusException("redoAudit-001", "examRecordDataIds不能为空");
|
|
|
- }
|
|
|
- if(redoAuditInfo.getIsPass() == null){
|
|
|
- throw new StatusException("redoAudit-002", "isPass不能为空");
|
|
|
- }
|
|
|
- if(!redoAuditInfo.getIsPass() && StringUtils.isBlank(redoAuditInfo.getDisciplineType())){
|
|
|
- throw new StatusException("redoAudit-003", "审核为不通过时违纪类型不能为空");
|
|
|
- }
|
|
|
- Set<Long> examIds = new HashSet<Long>();
|
|
|
- for(Long examRecordDataId:redoAuditInfo.getExamRecordDataIds()){
|
|
|
- ExamRecordDataEntity examRecordData =GlobalHelper.getEntity(examRecordDataRepo,examRecordDataId,ExamRecordDataEntity.class);
|
|
|
- examIds.add(examRecordData.getExamId().longValue());
|
|
|
- }
|
|
|
- if(examIds.size()>1){
|
|
|
- throw new StatusException("redoAudit-004", "考试ID中包含了多个批次");
|
|
|
- }
|
|
|
- long examId = examIds.iterator().next();
|
|
|
- //是否已经生成了评卷任务
|
|
|
- String markingTaskBuilded = gainBaseDataService.getExamProperty(examId, ExamProperties.MARKING_TASK_BUILDED.name());
|
|
|
- if(StringUtils.isNotBlank(markingTaskBuilded) && Constants.isTrue.equals(markingTaskBuilded)){
|
|
|
- throw new StatusException("redoAudit-005", "该考试评卷任务已生成,不能重审");
|
|
|
- }
|
|
|
- examAuditService.redoAudit(redoAuditInfo,user);
|
|
|
+ public void redoAudit(@RequestBody RedoAuditInfo redoAuditInfo) {
|
|
|
+ User user = getAccessUser();
|
|
|
+ if (redoAuditInfo.getExamRecordDataIds() == null || redoAuditInfo.getExamRecordDataIds().size() == 0) {
|
|
|
+ throw new StatusException("redoAudit-001", "examRecordDataIds不能为空");
|
|
|
+ }
|
|
|
+ if (redoAuditInfo.getIsPass() == null) {
|
|
|
+ throw new StatusException("redoAudit-002", "isPass不能为空");
|
|
|
+ }
|
|
|
+ if (!redoAuditInfo.getIsPass() && StringUtils.isBlank(redoAuditInfo.getDisciplineType())) {
|
|
|
+ throw new StatusException("redoAudit-003", "审核为不通过时违纪类型不能为空");
|
|
|
+ }
|
|
|
+ Set<Long> examIds = new HashSet<Long>();
|
|
|
+ for (Long examRecordDataId : redoAuditInfo.getExamRecordDataIds()) {
|
|
|
+ ExamRecordDataEntity examRecordData = GlobalHelper.getEntity(examRecordDataRepo, examRecordDataId, ExamRecordDataEntity.class);
|
|
|
+ examIds.add(examRecordData.getExamId().longValue());
|
|
|
+ }
|
|
|
+ if (examIds.size() > 1) {
|
|
|
+ throw new StatusException("redoAudit-004", "考试ID中包含了多个批次");
|
|
|
+ }
|
|
|
+ long examId = examIds.iterator().next();
|
|
|
+
|
|
|
+ //已经生成了评卷任务,不能重新审为不通过,但是可以审核为已通过
|
|
|
+ String markingTaskBuilded = gainBaseDataService.getExamProperty(examId, ExamProperties.MARKING_TASK_BUILDED.name());
|
|
|
+ if (StringUtils.isNotBlank(markingTaskBuilded) && Constants.isTrue.equals(markingTaskBuilded)) {
|
|
|
+ if (!redoAuditInfo.getIsPass()) {
|
|
|
+ throw new StatusException("redoAudit-005", "该考试评卷任务已生成,不能重审为不通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ examAuditService.redoAudit(redoAuditInfo, user);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|