|
@@ -45,7 +45,7 @@ public class CheckRecordServiceImpl extends ServiceImpl<CheckRecordDao, CheckRec
|
|
|
private UserService userService;
|
|
|
|
|
|
@Override
|
|
|
- public CheckRecordVo start(Long userId, Long examId, String startNumber) {
|
|
|
+ public CheckRecordVo start(Long id, Long userId, Long examId, String startNumber) {
|
|
|
ExamEntity exam = examService.getById(examId);
|
|
|
if (exam == null) {
|
|
|
throw new StatusException("找不到考试");
|
|
@@ -68,7 +68,15 @@ public class CheckRecordServiceImpl extends ServiceImpl<CheckRecordDao, CheckRec
|
|
|
if (student.getSortNo().longValue() != sortNo.longValue()) {
|
|
|
throw new StatusException("该分组开始考生不正确");
|
|
|
}
|
|
|
- CheckRecordEntity checkRecord = findByGroupTypeAndGroupName(exam.getGroupType(), groupName);
|
|
|
+ CheckRecordEntity checkRecord = null;
|
|
|
+ if (id != null) {
|
|
|
+ checkRecord = this.getById(id);
|
|
|
+ } else {
|
|
|
+ checkRecord = findByGroupTypeAndGroupName(exam.getGroupType(), groupName);
|
|
|
+ }
|
|
|
+ if (!checkRecord.getGroupName().equals(groupName)) {
|
|
|
+ throw new StatusException("该分组开始考生不正确");
|
|
|
+ }
|
|
|
checkRecord.setStartNumber(startNumber);
|
|
|
checkRecord.setCreatorId(userId);
|
|
|
checkRecord.setCreateTime(new Date());
|