Commit 19d5f82c authored by alex yao's avatar alex yao

fix:null

parent e4bfbee4
......@@ -48,12 +48,14 @@ public class ExaminationRestImpl implements ExaminationRest {
Assert.notBlank(generateExaminationDto.getLanguage());
Assert.notBlank(generateExaminationDto.getTitle());
Assert.notBlank(generateExaminationDto.getLevel());
// Assert.notBlank(generateExaminationDto.getPositions());
Assert.notEmpty(generateExaminationDto.getQuestionType());
Assert.notNull(generateExaminationDto.getN());
Assert.isTrue(generateExaminationDto.getN() <= 20, "总题数不可大于20题");
Assert.isTrue(generateExaminationDto.getN() <= generateExaminationDto.getTotalScore() ,"总题数不能大于总分数");
if (generateExaminationDto.getN() > 20){
throw new BusinessException("总题数不可大于20题");
}
if (generateExaminationDto.getN() > generateExaminationDto.getTotalScore()){
throw new BusinessException("总题数不能大于总分数");
}
UserBaseEntity currentUser = BlContext.getCurrentUser();
GenerateExaminationEntity generateExaminationEntity = new GenerateExaminationEntity();
BeanUtil.copyProperties(generateExaminationDto, generateExaminationEntity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment