yangdamao vor 2 Jahren
Ursprung
Commit
d3e13c0650

+ 13 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -2535,15 +2535,16 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                     .eq(CourseMenuExam::getCourseId, oldCourseId)
                     .eq(CourseMenuExam::getModuleId, oldModuleId));
             if (CollectionUtils.isNotEmpty(examList)){
+                List<CourseMenuExam> newCourseExams = new ArrayList<>();
                 for (CourseMenuExam menuExam : examList) {
-                    if (ObjectUtils.isNotNull(menuExam.getChapterId()) || menuExam.getChapterId() != 0){
+                    if (ObjectUtils.isNotNull(menuExam.getChapterId()) && menuExam.getChapterId() != 0){
                         Long newChapterId = getNewIdByTenant(menuExam.getChapterId(),GoodsCopyEnum.COURSE_CHAPTER.getType(),newTenantId);
                         if (ObjectUtils.isNull(newChapterId)){
                             continue;
                         }
                         menuExam.setChapterId(newChapterId);
                     }
-                    if (ObjectUtils.isNotNull(menuExam.getSectionId()) || menuExam.getSectionId() != 0){
+                    if (ObjectUtils.isNotNull(menuExam.getSectionId()) && menuExam.getSectionId() != 0){
                         Long newSectionId = getNewIdByTenant(menuExam.getSectionId(),GoodsCopyEnum.COURSE_SECTION.getType(),newTenantId);
                         if (ObjectUtils.isNull(newSectionId)){
                             continue;
@@ -2555,8 +2556,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                     menuExam.setModuleId(newModuleId);
                     menuExam.setExamId(getNewExamId(menuExam.getExamId(),newTenantId,array));
                     menuExam.setTenantId(newTenantId);
+                    newCourseExams.add(menuExam);
+                }
+                if (CollectionUtils.isNotEmpty(newCourseExams)){
+                    iCourseMenuExamService.saveBatch(newCourseExams);
                 }
-                iCourseMenuExamService.saveBatch(examList);
             }
         }
 
@@ -2691,8 +2695,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                                 .eq(CourseMenuExam::getModuleId, oldModuleId)
                                 .eq(CourseMenuExam::getChapterId,oldChapterId));
                 if (CollectionUtils.isNotEmpty(examList)){
+                    List<CourseMenuExam> newCourseExams = new ArrayList<>();
                     for (CourseMenuExam menuExam : examList) {
-                        if (ObjectUtils.isNotNull(menuExam.getSectionId()) || menuExam.getSectionId() != 0){
+                        if (ObjectUtils.isNotNull(menuExam.getSectionId()) && menuExam.getSectionId() != 0){
                             Long newSectionId = getNewIdByTenant(menuExam.getSectionId(),GoodsCopyEnum.COURSE_SECTION.getType(),newTenantId);
                             if (ObjectUtils.isNull(newSectionId)){
                                 continue;
@@ -2705,8 +2710,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                         menuExam.setChapterId(newChapterId);
                         menuExam.setExamId(getNewExamId(menuExam.getExamId(),newTenantId,array));
                         menuExam.setTenantId(newTenantId);
+                        newCourseExams.add(menuExam);
+                    }
+                    if (CollectionUtils.isNotEmpty(newCourseExams)){
+                        iCourseMenuExamService.saveBatch(newCourseExams);
                     }
-                    iCourseMenuExamService.saveBatch(examList);
                 }
 
             }else {

+ 0 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -1324,8 +1324,6 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                             }
                         }
                     });
-                    //消息通知教务
-//                    this.informRemind(userNames);
                     break;
                 case 2: //审核未通过
                     topOldOrderGoods.forEach(item -> {