|
@@ -2404,6 +2404,19 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
iGoodsCourseService.saveBatch(newGoodsCourseList);
|
|
|
}
|
|
|
|
|
|
+ //6 题库商品关联
|
|
|
+ List<GoodsAttached> goodsAttachedList = iGoodsAttachedService.list();
|
|
|
+ if (CollectionUtils.isNotEmpty(goodsAttachedList)){
|
|
|
+ List<GoodsAttached> newGoodsAttachedList = goodsAttachedList.stream().map(x -> {
|
|
|
+ GoodsAttached goodsAttached = BeanUtil.toBean(x, GoodsAttached.class);
|
|
|
+ goodsAttached.setId(null);
|
|
|
+ goodsAttached.setTenantId(newTenantId);
|
|
|
+ return goodsAttached;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ //关联表不需要记录(后续修改ID)
|
|
|
+ iGoodsAttachedService.saveBatch(newGoodsAttachedList);
|
|
|
+ }
|
|
|
+
|
|
|
//7 课程老师关联
|
|
|
List<GoodsCourseTeacher> teacherList = goodsCourseTeacherService.list();
|
|
|
if (CollectionUtils.isNotEmpty(teacherList)){
|
|
@@ -3366,6 +3379,29 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
iGoodsCourseService.updateBatchById(goodsCourseList);
|
|
|
}
|
|
|
|
|
|
+ //6 题库商品关联
|
|
|
+ List<GoodsAttached> goodsAttachedList = iGoodsAttachedService.list();
|
|
|
+ if (CollectionUtils.isNotEmpty(goodsAttachedList)){
|
|
|
+ for (GoodsAttached item : goodsAttachedList) {
|
|
|
+ //课程ID
|
|
|
+ item.setGoodsId(getNewId(item.getGoodsId(), GoodsCopyEnum.GOODS.getType()));
|
|
|
+ //目录ID
|
|
|
+ if (ObjectUtils.isNotNull(item.getType())){
|
|
|
+ if (item.getType() == 1){
|
|
|
+ //模快卷
|
|
|
+ item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.QUESTION_MODULE.getType()));
|
|
|
+ }else if (item.getType() == 2){
|
|
|
+ //章卷
|
|
|
+ item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.QUESTION_CHAPTER.getType()));
|
|
|
+ }else if (item.getType() == 3){
|
|
|
+ //试卷
|
|
|
+ item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.EXAM.getType()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ iGoodsAttachedService.updateBatchById(goodsAttachedList);
|
|
|
+ }
|
|
|
+
|
|
|
//7 课程老师关联
|
|
|
List<GoodsCourseTeacher> courseTeacherList = goodsCourseTeacherService.list();
|
|
|
if (CollectionUtils.isNotEmpty(courseTeacherList)){
|