|
@@ -572,7 +572,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
menuListAddBo.setMenuList(bo.getMenuList());
|
|
|
iCourseMenuService.insertByGoodsAddBo(menuListAddBo);
|
|
|
}
|
|
|
-
|
|
|
+ Long goodsId = add.getGoodsId();
|
|
|
//七大员商品,默认绑定七大员学员资料模板
|
|
|
CourseEducationType educationType = iCourseEducationTypeService.getById(add.getEducationTypeId());
|
|
|
CourseBusiness business = iCourseBusinessService.getById(add.getBusinessId());
|
|
@@ -588,9 +588,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
.eq(ProfileTp::getStatus,1));
|
|
|
profileTpList.forEach(item -> {
|
|
|
if (StringUtils.isNotBlank(item.getGoodsIds())){
|
|
|
- List<String> goodsIds = Arrays.asList(item.getGoodsIds().split(","));
|
|
|
- goodsIds.add(add.getGoodsId().toString());
|
|
|
- item.setGoodsIds(goodsIds.stream().collect(Collectors.joining(",")));
|
|
|
+ String ids = item.getGoodsIds();
|
|
|
+ item.setGoodsIds(ids+","+goodsId);
|
|
|
}
|
|
|
});
|
|
|
iProfileTpService.updateBatchById(profileTpList);
|
|
@@ -2535,15 +2534,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 +2555,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 +2694,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 +2709,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 {
|