|
@@ -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 {
|