| | |
| | | |
| | | @Override |
| | | public int deletePaperStudent(Long paperStudentId) { |
| | | ExPaperStudent paperStudent=baseMapper.selectPaperStudentById(paperStudentId); |
| | | ExPaperStudent paperStudent=baseMapper.selectSimplePaperStudentById(paperStudentId); |
| | | if(ObjectUtil.isNull(paperStudent)){ |
| | | throw new ApiException(String.format("该试卷下不存在该学员<>",paperStudent.getStudentName())); |
| | | throw new ApiException("学员与试卷关系不存在"); |
| | | } |
| | | checkUserAllowed(paperStudent); |
| | | int studentAnswerCount=studentAnswerMapper.countByPaperId(paperStudent.getPaperId(),paperStudent.getStudentId()); |
| | | if(studentAnswerCount>0){ |
| | | throw new ApiException(String.format("学员<%s>已进行答题,不能删除",paperStudent.getStudentName())); |
| | | throw new ApiException("学员已进行答题,不能删除"); |
| | | } |
| | | //删除学员与试卷关系 |
| | | return baseMapper.deleteById(paperStudentId); |