فهرست منبع

fix 题库模块

he2802 4 سال پیش
والد
کامیت
e16d815d6c

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

@@ -128,7 +128,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
         Exam update = BeanUtil.toBean(bo, Exam.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
-        if(bo.getQuestionList()!=null){
+        if(bo.getQuestionList()!=null&&bo.getQuestionList().size()>0){
             Collection<ExamQuestion> coll = new HashSet<>();
             iExamQuestionService.remove(new LambdaQueryWrapper<ExamQuestion>().eq(ExamQuestion::getExamId, bo.getExamId()));
             for(int i=0;i<bo.getQuestionList().size();i++){
@@ -141,7 +141,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
             }
             iExamQuestionService.saveBatch(coll);
         }
-        if(bo.getBusinessList()!=null){
+        if(bo.getBusinessList()!=null&&bo.getBusinessList().size()>0){
             iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>()
                     .eq(QuestionBusiness::getMajorId, bo.getExamId())
                     .eq(QuestionBusiness::getType,QuestionBusiness.TYPE_EXAM));

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

@@ -104,7 +104,7 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
         QuestionChapter update = BeanUtil.toBean(bo, QuestionChapter.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
-        if(bo.getBusinessList()!=null){
+        if(bo.getBusinessList()!=null&&bo.getBusinessList().size()>0){
             iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>().eq(QuestionBusiness::getMajorId, bo.getChapterExamId())
                     .eq(QuestionBusiness::getType,QuestionBusiness.TYPE_QUESTION_CHAPTER));
             Collection<QuestionBusiness> coll = new HashSet<>();

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

@@ -118,7 +118,7 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
         QuestionModule update = BeanUtil.toBean(bo, QuestionModule.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
-        if(bo.getBusinessList()!=null){
+        if(bo.getBusinessList()!=null&&bo.getBusinessList().size()>0){
             iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>().eq(QuestionBusiness::getMajorId, bo.getModuleExamId())
                     .eq(QuestionBusiness::getType,QuestionBusiness.TYPE_QUESTION_MODULE));
             Collection<QuestionBusiness> coll = new HashSet<>();
@@ -131,7 +131,7 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
             }
             iQuestionBusinessService.saveBatch(coll);
         }
-        if(bo.getChapterList()!=null){
+        if(bo.getChapterList()!=null&&bo.getChapterList().size()>0){
             iQuestionModuleChapterService.remove(new LambdaQueryWrapper<QuestionModuleChapter>().eq(QuestionModuleChapter::getModuleExamId, bo.getModuleExamId()));
             Collection<QuestionModuleChapter> coll = new HashSet<>();
             for(int i=0;i<bo.getChapterList().size();i++){

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

@@ -127,7 +127,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         }
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
-        if(bo.getBusinessList()!=null){
+        if(bo.getBusinessList()!=null&&bo.getBusinessList().size()>0){
             iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>()
                     .eq(QuestionBusiness::getMajorId, bo.getQuestionId())
             .eq(QuestionBusiness::getType,QuestionBusiness.TYPE_QUESTION));

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterServiceImpl.java

@@ -134,7 +134,7 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
         CourseChapter update = BeanUtil.toBean(bo, CourseChapter.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
-        if(bo.getBusinessList()!= null){
+        if(bo.getBusinessList()!= null&&bo.getBusinessList().size()>0){
             iCourseChapterBusinessService.remove(new LambdaQueryWrapper<CourseChapterBusiness>().eq(CourseChapterBusiness::getChapterId, bo.getChapterId()));
             for(int i=0;i<bo.getBusinessList().size();i++){
                 CourseChapterBusinessAddBo item = bo.getBusinessList().get(i);
@@ -142,7 +142,7 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
                 iCourseChapterBusinessService.insertByAddBo(item);
             }
         }
-        if(bo.getSectionIdList()!=null){
+        if(bo.getSectionIdList()!=null&&bo.getSectionIdList().size()>0){
             iCourseChapterSectionService.remove(new LambdaQueryWrapper<CourseChapterSection>().eq(CourseChapterSection::getChapterId, bo.getChapterId()));
             Collection<CourseChapterSection> coll = new HashSet<>();
             for(int i=0;i<bo.getSectionIdList().size();i++){

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleServiceImpl.java

@@ -121,7 +121,7 @@ public class CourseModuleServiceImpl extends ServiceImpl<CourseModuleMapper, Cou
         CourseModule update = BeanUtil.toBean(bo, CourseModule.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
-        if(bo.getBusinessList()!= null){
+        if(bo.getBusinessList()!= null&&bo.getBusinessList().size()>0){
             iCourseModuleBusinessService.remove(new LambdaQueryWrapper<CourseModuleBusiness>().eq(CourseModuleBusiness::getModuleId, bo.getModuleId()));
             for(int i=0;i<bo.getBusinessList().size();i++){
                 CourseModuleBusinessAddBo item = bo.getBusinessList().get(i);
@@ -129,7 +129,7 @@ public class CourseModuleServiceImpl extends ServiceImpl<CourseModuleMapper, Cou
                 iCourseModuleBusinessService.insertByAddBo(item);
             }
         }
-        if(bo.getChapterIdList()!=null){
+        if(bo.getChapterIdList()!=null&&bo.getChapterIdList().size()>0){
             iCourseModuleChapterService.remove(new LambdaQueryWrapper<CourseModuleChapter>().eq(CourseModuleChapter::getModuleId, bo.getModuleId()));
             Collection<CourseModuleChapter> coll = new HashSet<>();
             for(int i=0;i<bo.getChapterIdList().size();i++){

+ 0 - 2
zhongzheng-system/src/main/resources/mapper/modules/bank/ExamQuestionMapper.xml

@@ -24,8 +24,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="type" column="type"/>
         <result property="answerQuestion" column="answer_question"/>
         <result property="status" column="status"/>
-        <result property="createTime" column="create_time"/>
-        <result property="updateTime" column="update_time"/>
         <result property="analysisContent" column="analysis_content"/>
         <result property="imgUrl" column="img_url"/>
         <result property="jsonStr" column="json_str"/>