Browse Source

发布状态

he2802 3 years ago
parent
commit
367992ff12

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

@@ -186,7 +186,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
      */
     private void validEntityBeforeSave(Exam entity){
         //TODO 做一些数据校验,如唯一约束
-        if(entity.getExamId()!=null&&entity.getPublishStatus()==0){
+        if(entity.getExamId()!=null&&entity.getPublishStatus()!=null&&entity.getPublishStatus()==0){
             GoodsAttached one = iGoodsAttachedService.getOne(new LambdaQueryWrapper<GoodsAttached>().eq(GoodsAttached::getMajorId, entity.getExamId()).eq(GoodsAttached::getType,3).last("limit 1"));
             if(one!=null){
                 throw new CustomException("该卷已被绑定,不允许修改发布状态为未发布");

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterServiceImpl.java

@@ -174,7 +174,7 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
      */
     private void validEntityBeforeSave(QuestionChapter entity){
         //TODO 做一些数据校验,如唯一约束
-        if(entity.getChapterExamId()!=null&&entity.getPublishStatus()==0){
+        if(entity.getChapterExamId()!=null&&entity.getPublishStatus()!=null&&entity.getPublishStatus()==0){
             GoodsAttached one = iGoodsAttachedService.getOne(new LambdaQueryWrapper<GoodsAttached>().eq(GoodsAttached::getMajorId, entity.getChapterExamId()).eq(GoodsAttached::getType,2).last("limit 1"));
             if(one!=null){
                 throw new CustomException("该章卷已被绑定,不允许修改发布状态为未发布");

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionModuleServiceImpl.java

@@ -166,7 +166,7 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
      */
     private void validEntityBeforeSave(QuestionModule entity){
         //TODO 做一些数据校验,如唯一约束
-        if(entity.getModuleExamId()!=null&&entity.getPublishStatus()==0){
+        if(entity.getModuleExamId()!=null&&entity.getPublishStatus()!=null&&entity.getPublishStatus()==0){
             GoodsAttached one = iGoodsAttachedService.getOne(new LambdaQueryWrapper<GoodsAttached>().eq(GoodsAttached::getMajorId, entity.getModuleExamId()).eq(GoodsAttached::getType,1).last("limit 1"));
             if(one!=null){
                 throw new CustomException("该模块卷已被绑定,不允许修改发布状态为未发布");

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -191,7 +191,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
        /* if(checkNameUnique(entity)&&Validator.isEmpty(entity.getQuestionId())){
             throw new CustomException("名称重复");
         }*/
-        if(entity.getQuestionId()!=null&&entity.getPublishStatus()==0){
+        if(entity.getQuestionId()!=null&&entity.getPublishStatus()!=null&&entity.getPublishStatus()==0){
             if(iExamQuestionService.getOne(new LambdaQueryWrapper<ExamQuestion>().eq(ExamQuestion::getQuestionId,entity.getQuestionId()).last("limit 1"))!=null){
                 throw new CustomException("该题目已被绑定,不允许修改发布状态为未发布");
             }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -176,7 +176,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
       /*  if(checkNameUnique(entity)){
             throw new CustomException("名称重复");
         }*/
-        if(entity.getCourseId()!=null&&entity.getPublishStatus()==0){
+        if(entity.getCourseId()!=null&&entity.getPublishStatus()!=null&&entity.getPublishStatus()==0){
             if(iGoodsCourseService.getOne(new LambdaQueryWrapper<GoodsCourse>().eq(GoodsCourse::getCourseId,entity.getCourseId()).last("limit 1"))!=null){
                 throw new CustomException("该课程已被绑定,不允许修改发布状态为未发布");
             }