|
@@ -657,23 +657,31 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
|
|
for (OmrTaskPage page : task.getPages()) {
|
|
for (OmrTaskPage page : task.getPages()) {
|
|
TaskResultPageVo pageVo = result.findPage(page.getIndex());
|
|
TaskResultPageVo pageVo = result.findPage(page.getIndex());
|
|
if (pageVo == null) {
|
|
if (pageVo == null) {
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.STUDENT + "-" + task.getStudentId()).writeLock().unlock();
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + task.getGroupId()).readLock().unlock();
|
|
throw new ParameterException("page[" + page.getIndex() + "]不存在");
|
|
throw new ParameterException("page[" + page.getIndex() + "]不存在");
|
|
}
|
|
}
|
|
for (OmrTaskItem item : page.getItems()) {
|
|
for (OmrTaskItem item : page.getItems()) {
|
|
if (OmrField.ABSENT.equals(item.getField())) {
|
|
if (OmrField.ABSENT.equals(item.getField())) {
|
|
if (pageVo.getAbsent() == null) {
|
|
if (pageVo.getAbsent() == null) {
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.STUDENT + "-" + task.getStudentId()).writeLock().unlock();
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + task.getGroupId()).readLock().unlock();
|
|
throw new ParameterException("page[" + page.getIndex() + "].absent不存在");
|
|
throw new ParameterException("page[" + page.getIndex() + "].absent不存在");
|
|
}
|
|
}
|
|
needArbitrate = setResult(group, item, pageVo.getAbsent().toString()) || needArbitrate;
|
|
needArbitrate = setResult(group, item, pageVo.getAbsent().toString()) || needArbitrate;
|
|
}
|
|
}
|
|
if (OmrField.BREACH.equals(item.getField())) {
|
|
if (OmrField.BREACH.equals(item.getField())) {
|
|
if (pageVo.getBreach() == null) {
|
|
if (pageVo.getBreach() == null) {
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.STUDENT + "-" + task.getStudentId()).writeLock().unlock();
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + task.getGroupId()).readLock().unlock();
|
|
throw new ParameterException("page[" + page.getIndex() + "].breach不存在");
|
|
throw new ParameterException("page[" + page.getIndex() + "].breach不存在");
|
|
}
|
|
}
|
|
needArbitrate = setResult(group, item, pageVo.getBreach().toString()) || needArbitrate;
|
|
needArbitrate = setResult(group, item, pageVo.getBreach().toString()) || needArbitrate;
|
|
}
|
|
}
|
|
if (OmrField.PAPER_TYPE.equals(item.getField())) {
|
|
if (OmrField.PAPER_TYPE.equals(item.getField())) {
|
|
if (pageVo.getPaperType() == null) {
|
|
if (pageVo.getPaperType() == null) {
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.STUDENT + "-" + task.getStudentId()).writeLock().unlock();
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + task.getGroupId()).readLock().unlock();
|
|
throw new ParameterException("page[" + page.getIndex() + "].paperType不存在");
|
|
throw new ParameterException("page[" + page.getIndex() + "].paperType不存在");
|
|
}
|
|
}
|
|
needArbitrate = setResult(group, item, pageVo.getPaperType()) || needArbitrate;
|
|
needArbitrate = setResult(group, item, pageVo.getPaperType()) || needArbitrate;
|
|
@@ -682,6 +690,8 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
|
|
String content = pageVo.getQuestion() != null ? pageVo.getQuestion().get(item.getIndex())
|
|
String content = pageVo.getQuestion() != null ? pageVo.getQuestion().get(item.getIndex())
|
|
: null;
|
|
: null;
|
|
if (content == null) {
|
|
if (content == null) {
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.STUDENT + "-" + task.getStudentId()).writeLock().unlock();
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + task.getGroupId()).readLock().unlock();
|
|
throw new ParameterException(
|
|
throw new ParameterException(
|
|
"page[" + page.getIndex() + "].question[" + item.getIndex() + "]不存在");
|
|
"page[" + page.getIndex() + "].question[" + item.getIndex() + "]不存在");
|
|
}
|
|
}
|
|
@@ -691,6 +701,8 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
|
|
String content = pageVo.getSelective() != null ? pageVo.getSelective().get(item.getIndex())
|
|
String content = pageVo.getSelective() != null ? pageVo.getSelective().get(item.getIndex())
|
|
: null;
|
|
: null;
|
|
if (content == null) {
|
|
if (content == null) {
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.STUDENT + "-" + task.getStudentId()).writeLock().unlock();
|
|
|
|
+ concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + task.getGroupId()).readLock().unlock();
|
|
throw new ParameterException(
|
|
throw new ParameterException(
|
|
"page[" + page.getIndex() + "].selective[" + item.getIndex() + "]不存在");
|
|
"page[" + page.getIndex() + "].selective[" + item.getIndex() + "]不存在");
|
|
}
|
|
}
|