考试创建同规则删除
This commit is contained in:
parent
62739021be
commit
37c0cee2ae
@ -8,7 +8,6 @@ import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.LessonVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.company.*;
|
||||
import club.joylink.rtss.vo.client.student.StudentClassVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -69,7 +69,7 @@ public class ExamService implements IExamService{
|
||||
//检查分数是否合理
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(checkScore(examDefinitionVO));
|
||||
//检查考试名称和考试规则是否唯一
|
||||
checkExam(examDefinitionVO);
|
||||
checkName(examDefinitionVO);
|
||||
//插入考试定义表数据
|
||||
ExamDefinition examDefinition = examDefinitionVO.toDB();
|
||||
examDefinition.setCreateTime(LocalDateTime.now());
|
||||
@ -175,13 +175,13 @@ public class ExamService implements IExamService{
|
||||
// definitionRulesDAO.insert(examDefinitionRules);
|
||||
// });
|
||||
// }
|
||||
// private void checkName(ExamDefinitionVO examDefinitionVO) {
|
||||
// //一个课程下考试名称查重
|
||||
// ExamDefinitionExample examDefinitionExample = new ExamDefinitionExample();
|
||||
// examDefinitionExample.createCriteria().andLessonIdEqualTo(examDefinitionVO.getLessonId()).andNameEqualTo(examDefinitionVO.getName());
|
||||
// List<ExamDefinition> examDefinitionList = examDefinitionDAO.selectByExample(examDefinitionExample);
|
||||
// BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertCollectionEmpty(examDefinitionList);
|
||||
// }
|
||||
private void checkName(ExamDefinitionVO examDefinitionVO) {
|
||||
//一个课程下考试名称查重
|
||||
ExamDefinitionExample examDefinitionExample = new ExamDefinitionExample();
|
||||
examDefinitionExample.createCriteria().andLessonIdEqualTo(examDefinitionVO.getLessonId()).andNameEqualTo(examDefinitionVO.getName());
|
||||
List<ExamDefinition> examDefinitionList = examDefinitionDAO.selectByExample(examDefinitionExample);
|
||||
BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertCollectionEmpty(examDefinitionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查考试定义及规则分数是否合理
|
||||
@ -503,6 +503,8 @@ public class ExamService implements IExamService{
|
||||
BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertCollectionEmpty(examDefinitionList);
|
||||
examDefinition.setName(examDefinitionVO.getName());
|
||||
examDefinition.setTrial(examDefinitionVO.getTrial());
|
||||
examDefinition.setStartTime(examDefinitionVO.getStartTime());
|
||||
examDefinition.setEndTime(examDefinitionVO.getEndTime());
|
||||
this.examDefinitionDAO.updateByPrimaryKey(examDefinition);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user