|
@@ -380,32 +380,12 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
- public void verify(Long batchId, Boolean comfirm, User user) {
|
|
|
+ public BatchVerifyVo verify(Long batchId, Boolean comfirm, User user) {
|
|
|
BatchEntity entity = this.getById(batchId);
|
|
|
if (entity == null) {
|
|
|
throw new ParameterException("批次不存在");
|
|
|
}
|
|
|
- if (!VerifyStatus.WAITING.equals(entity.getVerifyStatus())) {
|
|
|
- throw new ParameterException("批次已被处理");
|
|
|
- }
|
|
|
- if (comfirm) {
|
|
|
- updateBatchAssignedStudentData(user, batchId, entity.getExamId());
|
|
|
- entity.setVerifyStatus(VerifyStatus.CONFIRM);
|
|
|
- } else {
|
|
|
- entity.setVerifyStatus(VerifyStatus.REJECT);
|
|
|
- }
|
|
|
- entity.setUpdateTime(System.currentTimeMillis());
|
|
|
- this.saveOrUpdate(entity);
|
|
|
- }
|
|
|
-
|
|
|
- @Transactional
|
|
|
- @Override
|
|
|
- public BatchVerifyVo batchVerify(Long id) {
|
|
|
- BatchEntity entity = this.getById(id);
|
|
|
- if (entity == null) {
|
|
|
- throw new ParameterException("批次不存在");
|
|
|
- }
|
|
|
- Integer count = findStudentCountByBatch(id);
|
|
|
+ Integer count = findStudentCountByBatch(batchId);
|
|
|
if (count == null || count == 0) {
|
|
|
throw new ParameterException("该批次未上传图片");
|
|
|
}
|
|
@@ -417,6 +397,18 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
entity.setVerifyStatus(VerifyStatus.WAITING);
|
|
|
this.saveOrUpdate(entity);
|
|
|
}
|
|
|
+ if (!VerifyStatus.WAITING.equals(entity.getVerifyStatus())) {
|
|
|
+ throw new ParameterException("批次已被处理");
|
|
|
+ }
|
|
|
+ if (comfirm) {
|
|
|
+ updateBatchAssignedStudentData(user, batchId, entity.getExamId());
|
|
|
+ entity.setVerifyStatus(VerifyStatus.CONFIRM);
|
|
|
+ } else {
|
|
|
+ entity.setVerifyStatus(VerifyStatus.REJECT);
|
|
|
+ }
|
|
|
+ entity.setUpdateTime(System.currentTimeMillis());
|
|
|
+ this.saveOrUpdate(entity);
|
|
|
+ this.releaseVerifyTask(entity);
|
|
|
BatchVerifyVo vo = new BatchVerifyVo();
|
|
|
vo.setStatus(entity.getVerifyStatus());
|
|
|
vo.setUpdateTime(entity.getUpdateTime());
|