yangdamao 2 years ago
parent
commit
cd12c61908

+ 12 - 2
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/goods/TopGoodsController.java

@@ -2,13 +2,14 @@ package com.zhongzheng.controller.goods;
 
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
-import com.zhongzheng.modules.goods.bo.GoodsBatchCopyTenantBo;
 import com.zhongzheng.modules.top.goods.service.ITopGoodsService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 商品Controller
@@ -33,4 +34,13 @@ public class TopGoodsController extends BaseController {
         return toAjax(iTopGoodsService.goodsBatchCopyTenant() ? 1 : 0);
     }
 
+    /**
+     * 商品关系ID处理(全量复制后的处理方法)
+     */
+    @ApiOperation("商品关系ID处理(全量复制后的处理方法)")
+    @GetMapping("/batch/copy/dispose")
+    public AjaxResult<Void> goodsBatchCopyDisposeTenant() {
+        return toAjax(iTopGoodsService.goodsBatchCopyDisposeTenant() ? 1 : 0);
+    }
+
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/ITopGoodsService.java

@@ -52,4 +52,5 @@ public interface ITopGoodsService extends IService<TopGoods> {
 
     boolean goodsBatchCopyTenant();
 
+    boolean goodsBatchCopyDisposeTenant();
 }

+ 799 - 338
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopGoodsServiceImpl.java

@@ -3,10 +3,13 @@ package com.zhongzheng.modules.top.goods.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.service.*;
@@ -18,10 +21,7 @@ import com.zhongzheng.modules.exam.domain.ExamPaper;
 import com.zhongzheng.modules.exam.service.IExamPaperService;
 import com.zhongzheng.modules.goods.domain.*;
 import com.zhongzheng.modules.goods.service.*;
-import com.zhongzheng.modules.grade.domain.ClassGradeInterface;
 import com.zhongzheng.modules.grade.service.IClassGradeInterfaceService;
-import com.zhongzheng.modules.inform.domain.InformRemind;
-import com.zhongzheng.modules.order.domain.OrderInputTemplate;
 import com.zhongzheng.modules.order.service.IOrderInputTemplateService;
 import com.zhongzheng.modules.pay.domain.PayServe;
 import com.zhongzheng.modules.pay.domain.PaySupply;
@@ -32,22 +32,21 @@ import com.zhongzheng.modules.polyv.domain.PolyvVideo;
 import com.zhongzheng.modules.polyv.service.IPolyvCataService;
 import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
 import com.zhongzheng.modules.system.bo.GoodsCopyEnum;
-import com.zhongzheng.modules.system.domain.SysGoodsCopyRecord;
 import com.zhongzheng.modules.system.service.ISysGoodsCopyRecordService;
 import com.zhongzheng.modules.top.goods.bo.TopGoodsAddBo;
 import com.zhongzheng.modules.top.goods.bo.TopGoodsEditBo;
 import com.zhongzheng.modules.top.goods.bo.TopGoodsQueryBo;
-import com.zhongzheng.modules.top.goods.domain.TopGoods;
-import com.zhongzheng.modules.top.goods.domain.TopGoodsCopy;
-import com.zhongzheng.modules.top.goods.domain.TopGoodsSpec;
+import com.zhongzheng.modules.top.goods.domain.*;
 import com.zhongzheng.modules.top.goods.mapper.TopGoodsMapper;
 import com.zhongzheng.modules.top.goods.service.*;
 import com.zhongzheng.modules.top.goods.vo.TopGoodsVo;
+import net.polyv.common.v1.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -446,979 +445,1441 @@ public class TopGoodsServiceImpl extends ServiceImpl<TopGoodsMapper, TopGoods> i
         }
 
         //3 规格模板
-        List<GoodsSpecTemplate> specTemplateList = goodsSpecTemplateService.list();
+        List<GoodsSpecTemplate> specTemplateList = goodsSpecTemplateService.list(new LambdaQueryWrapper<GoodsSpecTemplate>().eq(GoodsSpecTemplate::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(specTemplateList)){
-            List<GoodsSpecTemplate> newSpecTemplateList = specTemplateList.stream().map(x -> {
-                GoodsSpecTemplate specTemplate = BeanUtil.toBean(x, GoodsSpecTemplate.class);
+            List<TopGoodsSpecTemplate> newSpecTemplateList = specTemplateList.stream().map(x -> {
+                TopGoodsSpecTemplate specTemplate = BeanUtil.toBean(x, TopGoodsSpecTemplate.class);
                 specTemplate.setSpecTemplateId(null);
-                specTemplate.setTenantId(newTenantId);
                 specTemplate.setOId(x.getSpecTemplateId());
                 return specTemplate;
             }).collect(Collectors.toList());
-            goodsSpecTemplateService.saveBatch(newSpecTemplateList);
+            topGoodsSpecTemplateService.saveBatch(newSpecTemplateList);
             //记录
             newSpecTemplateList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.GOODS_SPEC_TEMPLATE.getType());
                 record.setNewId(item.getSpecTemplateId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //4 规格属性
-        List<GoodsSpecAttribute> attributeList = goodsSpecAttributeService.list();
+        List<GoodsSpecAttribute> attributeList = goodsSpecAttributeService.list(new LambdaQueryWrapper<GoodsSpecAttribute>().eq(GoodsSpecAttribute::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(attributeList)){
-            List<GoodsSpecAttribute> newAttributeList = attributeList.stream().map(x -> {
-                GoodsSpecAttribute attribute = BeanUtil.toBean(x, GoodsSpecAttribute.class);
+            List<TopGoodsSpecAttribute> newAttributeList = attributeList.stream().map(x -> {
+                TopGoodsSpecAttribute attribute = BeanUtil.toBean(x, TopGoodsSpecAttribute.class);
                 attribute.setSpecAttributeId(null);
-                attribute.setTenantId(newTenantId);
                 attribute.setOId(x.getSpecAttributeId());
                 return attribute;
             }).collect(Collectors.toList());
-            goodsSpecAttributeService.saveBatch(newAttributeList);
+            topGoodsSpecAttributeService.saveBatch(newAttributeList);
             //记录
             newAttributeList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.GOODS_SPEC_ATTRIBUTE.getType());
                 record.setNewId(item.getSpecAttributeId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //5 规格属性关联
-        List<GoodsSpecAttributeRelation> attributeRelationList = goodsSpecAttributeRelationService.list();
+        List<GoodsSpecAttributeRelation> attributeRelationList = goodsSpecAttributeRelationService.list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>().eq(GoodsSpecAttributeRelation::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(attributeRelationList)){
-            List<GoodsSpecAttributeRelation> newAttributeRelationList = attributeRelationList.stream().map(x -> {
-                GoodsSpecAttributeRelation relation = BeanUtil.toBean(x, GoodsSpecAttributeRelation.class);
+            List<TopGoodsSpecAttributeRelation> newAttributeRelationList = attributeRelationList.stream().map(x -> {
+                TopGoodsSpecAttributeRelation relation = BeanUtil.toBean(x, TopGoodsSpecAttributeRelation.class);
                 relation.setId(null);
-                relation.setTenantId(newTenantId);
                 return relation;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            goodsSpecAttributeRelationService.saveBatch(newAttributeRelationList);
+            topGoodsSpecAttributeRelationService.saveBatch(newAttributeRelationList);
         }
 
         //6 商品课程关联
-        List<GoodsCourse> goodsCourseList = iGoodsCourseService.list();
+        List<GoodsCourse> goodsCourseList = iGoodsCourseService.list(new LambdaQueryWrapper<GoodsCourse>().eq(GoodsCourse::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(goodsCourseList)){
-            List<GoodsCourse> newGoodsCourseList = goodsCourseList.stream().map(x -> {
-                GoodsCourse goodsCourse = BeanUtil.toBean(x, GoodsCourse.class);
+            List<TopGoodsCourse> newGoodsCourseList = goodsCourseList.stream().map(x -> {
+                TopGoodsCourse goodsCourse = BeanUtil.toBean(x, TopGoodsCourse.class);
                 goodsCourse.setId(null);
-                goodsCourse.setTenantId(newTenantId);
                 return goodsCourse;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iGoodsCourseService.saveBatch(newGoodsCourseList);
+            iTopGoodsCourseService.saveBatch(newGoodsCourseList);
         }
 
         //6 题库商品关联
-        List<GoodsAttached> goodsAttachedList = iGoodsAttachedService.list();
+        List<GoodsAttached> goodsAttachedList = iGoodsAttachedService.list(new LambdaQueryWrapper<GoodsAttached>().eq(GoodsAttached::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(goodsAttachedList)){
-            List<GoodsAttached> newGoodsAttachedList = goodsAttachedList.stream().map(x -> {
-                GoodsAttached goodsAttached = BeanUtil.toBean(x, GoodsAttached.class);
+            List<TopGoodsAttached> newGoodsAttachedList = goodsAttachedList.stream().map(x -> {
+                TopGoodsAttached goodsAttached = BeanUtil.toBean(x, TopGoodsAttached.class);
                 goodsAttached.setId(null);
-                goodsAttached.setTenantId(newTenantId);
                 return goodsAttached;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iGoodsAttachedService.saveBatch(newGoodsAttachedList);
+            iTopGoodsAttachedService.saveBatch(newGoodsAttachedList);
         }
 
         //7 课程老师关联
-        List<GoodsCourseTeacher> teacherList = goodsCourseTeacherService.list();
+        List<GoodsCourseTeacher> teacherList = goodsCourseTeacherService.list(new LambdaQueryWrapper<GoodsCourseTeacher>().eq(GoodsCourseTeacher::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(teacherList)){
-            List<GoodsCourseTeacher> newTeacherList = teacherList.stream().map(x -> {
-                GoodsCourseTeacher courseTeacher = BeanUtil.toBean(x, GoodsCourseTeacher.class);
+            List<TopGoodsCourseTeacher> newTeacherList = teacherList.stream().map(x -> {
+                TopGoodsCourseTeacher courseTeacher = BeanUtil.toBean(x, TopGoodsCourseTeacher.class);
                 courseTeacher.setId(null);
-                courseTeacher.setTenantId(newTenantId);
                 return courseTeacher;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            goodsCourseTeacherService.saveBatch(newTeacherList);
+            topGoodsCourseTeacherService.saveBatch(newTeacherList);
         }
 
         //8 课程
-        List<Course> courseList = iCourseService.list();
+        List<Course> courseList = iCourseService.list(new LambdaQueryWrapper<Course>().eq(Course::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(courseList)){
-            List<Course> newCourseList = courseList.stream().map(x -> {
-                Course course = BeanUtil.toBean(x, Course.class);
+            List<TopCourse> newCourseList = courseList.stream().map(x -> {
+                TopCourse course = BeanUtil.toBean(x, TopCourse.class);
                 course.setCourseId(null);
-                course.setTenantId(newTenantId);
                 course.setOId(x.getCourseId());
                 return course;
             }).collect(Collectors.toList());
-            iCourseService.saveBatch(newCourseList);
+            iTopCourseService.saveBatch(newCourseList);
             //记录
             newCourseList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE.getType());
                 record.setNewId(item.getCourseId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //9 业务层次
-        List<CourseBusiness> businessList = iCourseBusinessService.list();
+        List<CourseBusiness> businessList = iCourseBusinessService.list(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(businessList)){
-            List<CourseBusiness> newBusinessList = businessList.stream().map(x -> {
-                CourseBusiness business = BeanUtil.toBean(x, CourseBusiness.class);
+            List<TopCourseBusiness> newBusinessList = businessList.stream().map(x -> {
+                TopCourseBusiness business = BeanUtil.toBean(x, TopCourseBusiness.class);
                 business.setId(null);
-                business.setTenantId(newTenantId);
                 business.setOId(x.getId());
                 return business;
             }).collect(Collectors.toList());
-            iCourseBusinessService.saveBatch(newBusinessList);
+            iTopCourseBusinessService.saveBatch(newBusinessList);
             //记录
             newBusinessList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_BUSINESS.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //10 课程章
-        List<CourseChapter> chapterList = iCourseChapterService.list();
+        List<CourseChapter> chapterList = iCourseChapterService.list(new LambdaQueryWrapper<CourseChapter>().eq(CourseChapter::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(chapterList)){
-            List<CourseChapter> newChapterList = chapterList.stream().map(x -> {
-                CourseChapter courseChapter = BeanUtil.toBean(x, CourseChapter.class);
+            List<TopCourseChapter> newChapterList = chapterList.stream().map(x -> {
+                TopCourseChapter courseChapter = BeanUtil.toBean(x, TopCourseChapter.class);
                 courseChapter.setChapterId(null);
-                courseChapter.setTenantId(newTenantId);
                 courseChapter.setOId(x.getChapterId());
                 return courseChapter;
             }).collect(Collectors.toList());
-            iCourseChapterService.saveBatch(newChapterList);
+            iTopCourseChapterService.saveBatch(newChapterList);
             //记录
             newChapterList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_CHAPTER.getType());
                 record.setNewId(item.getChapterId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //11 课程章业务层次关联
-        List<CourseChapterBusiness> chapterBusinesseList = iCourseChapterBusinessService.list();
+        List<CourseChapterBusiness> chapterBusinesseList = iCourseChapterBusinessService.list(new LambdaQueryWrapper<CourseChapterBusiness>().eq(CourseChapterBusiness::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(chapterBusinesseList)){
-            List<CourseChapterBusiness> newChapterBusinesseList = chapterBusinesseList.stream().map(x -> {
-                CourseChapterBusiness courseChapterBusiness = BeanUtil.toBean(x, CourseChapterBusiness.class);
+            List<TopCourseChapterBusiness> newChapterBusinesseList = chapterBusinesseList.stream().map(x -> {
+                TopCourseChapterBusiness courseChapterBusiness = BeanUtil.toBean(x, TopCourseChapterBusiness.class);
                 courseChapterBusiness.setId(null);
-                courseChapterBusiness.setTenantId(newTenantId);
                 return courseChapterBusiness;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseChapterBusinessService.saveBatch(newChapterBusinesseList);
+            iTopCourseChapterBusinessService.saveBatch(newChapterBusinesseList);
         }
 
         //12 课程章节关联
-        List<CourseChapterSection> chapterSectionList = iCourseChapterSectionService.list();
+        List<CourseChapterSection> chapterSectionList = iCourseChapterSectionService.list(new LambdaQueryWrapper<CourseChapterSection>().eq(CourseChapterSection::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(chapterSectionList)){
-            List<CourseChapterSection> newChapterSectionList = chapterSectionList.stream().map(x -> {
-                CourseChapterSection courseChapterSection = BeanUtil.toBean(x, CourseChapterSection.class);
+            List<TopCourseChapterSection> newChapterSectionList = chapterSectionList.stream().map(x -> {
+                TopCourseChapterSection courseChapterSection = BeanUtil.toBean(x, TopCourseChapterSection.class);
                 courseChapterSection.setId(null);
-                courseChapterSection.setTenantId(newTenantId);
                 return courseChapterSection;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseChapterSectionService.saveBatch(newChapterSectionList);
+            iTopCourseChapterSectionService.saveBatch(newChapterSectionList);
         }
 
         //13 教育类型关联
-        List<CourseEducationTier> educationTiers = iCourseEducationTierService.list();
+        List<CourseEducationTier> educationTiers = iCourseEducationTierService.list(new LambdaQueryWrapper<CourseEducationTier>().eq(CourseEducationTier::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(educationTiers)){
-            List<CourseEducationTier> newEducationTiers = educationTiers.stream().map(x -> {
-                CourseEducationTier courseEducationTier = BeanUtil.toBean(x, CourseEducationTier.class);
+            List<TopCourseEducationTier> newEducationTiers = educationTiers.stream().map(x -> {
+                TopCourseEducationTier courseEducationTier = BeanUtil.toBean(x, TopCourseEducationTier.class);
                 courseEducationTier.setId(null);
-                courseEducationTier.setTenantId(newTenantId);
                 return courseEducationTier;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseEducationTierService.saveBatch(newEducationTiers);
+            iTopCourseEducationTierService.saveBatch(newEducationTiers);
         }
 
         //14 教育类型
-        List<CourseEducationType> educationTypeList = iCourseEducationTypeService.list();
+        List<CourseEducationType> educationTypeList = iCourseEducationTypeService.list(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(educationTypeList)){
-            List<CourseEducationType> newEducationTypeList = educationTypeList.stream().map(x -> {
-                CourseEducationType educationType = BeanUtil.toBean(x, CourseEducationType.class);
+            List<TopCourseEducationType> newEducationTypeList = educationTypeList.stream().map(x -> {
+                TopCourseEducationType educationType = BeanUtil.toBean(x, TopCourseEducationType.class);
                 educationType.setId(null);
-                educationType.setTenantId(newTenantId);
                 educationType.setOId(x.getId());
                 return educationType;
             }).collect(Collectors.toList());
-            iCourseEducationTypeService.saveBatch(newEducationTypeList);
+            iTopCourseEducationTypeService.saveBatch(newEducationTypeList);
             //记录
             newEducationTypeList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //15 课程讲义
-        List<CourseHandouts> handoutsList = iCourseHandoutsService.list();
+        List<CourseHandouts> handoutsList = iCourseHandoutsService.list(new LambdaQueryWrapper<CourseHandouts>().eq(CourseHandouts::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(handoutsList)){
-            List<CourseHandouts> newHandoutsList = handoutsList.stream().map(x -> {
-                CourseHandouts handouts = BeanUtil.toBean(x, CourseHandouts.class);
+            List<TopCourseHandouts> newHandoutsList = handoutsList.stream().map(x -> {
+                TopCourseHandouts handouts = BeanUtil.toBean(x, TopCourseHandouts.class);
                 handouts.setHandoutsId(null);
-                handouts.setTenantId(newTenantId);
                 handouts.setOId(x.getHandoutsId());
                 return handouts;
             }).collect(Collectors.toList());
-            iCourseHandoutsService.saveBatch(newHandoutsList);
+            iTopCourseHandoutsService.saveBatch(newHandoutsList);
             //记录
             newHandoutsList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_HANDOUTS.getType());
                 record.setNewId(item.getHandoutsId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //16 讲义业务层次关联
-        List<CourseHandoutsBusiness> handoutsBusinessList = iCourseHandoutsBusinessService.list();
+        List<CourseHandoutsBusiness> handoutsBusinessList = iCourseHandoutsBusinessService.list(new LambdaQueryWrapper<CourseHandoutsBusiness>().eq(CourseHandoutsBusiness::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(handoutsBusinessList)){
-            List<CourseHandoutsBusiness> newHandoutsBusinessList = handoutsBusinessList.stream().map(x -> {
-                CourseHandoutsBusiness handoutsBusiness = BeanUtil.toBean(x, CourseHandoutsBusiness.class);
+            List<TopCourseHandoutsBusiness> newHandoutsBusinessList = handoutsBusinessList.stream().map(x -> {
+                TopCourseHandoutsBusiness handoutsBusiness = BeanUtil.toBean(x, TopCourseHandoutsBusiness.class);
                 handoutsBusiness.setId(null);
-                handoutsBusiness.setTenantId(newTenantId);
                 return handoutsBusiness;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseHandoutsBusinessService.saveBatch(newHandoutsBusinessList);
+            iTopCourseHandoutsBusinessService.saveBatch(newHandoutsBusinessList);
         }
 
         //17 课程目录关联
-        List<CourseMenu> courseMenuList = iCourseMenuService.list();
+        List<CourseMenu> courseMenuList = iCourseMenuService.list(new LambdaQueryWrapper<CourseMenu>().eq(CourseMenu::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(courseMenuList)){
-            List<CourseMenu> newCourseMenuList = courseMenuList.stream().map(x -> {
-                CourseMenu courseMenu = BeanUtil.toBean(x, CourseMenu.class);
+            List<TopCourseMenu> newCourseMenuList = courseMenuList.stream().map(x -> {
+                TopCourseMenu courseMenu = BeanUtil.toBean(x, TopCourseMenu.class);
                 courseMenu.setId(null);
-                courseMenu.setTenantId(newTenantId);
                 return courseMenu;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseMenuService.saveBatch(newCourseMenuList);
+            iTopCourseMenuService.saveBatch(newCourseMenuList);
         }
 
         //18 课程目录试卷关联 course_menu_exam
-        List<CourseMenuExam> menuExamList = iCourseMenuExamService.list();
+        List<CourseMenuExam> menuExamList = iCourseMenuExamService.list(new LambdaQueryWrapper<CourseMenuExam>().eq(CourseMenuExam::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(menuExamList)){
-            List<CourseMenuExam> newMenuExamList = menuExamList.stream().map(x -> {
-                CourseMenuExam menuExam = BeanUtil.toBean(x, CourseMenuExam.class);
+            List<TopCourseMenuExam> newMenuExamList = menuExamList.stream().map(x -> {
+                TopCourseMenuExam menuExam = BeanUtil.toBean(x, TopCourseMenuExam.class);
                 menuExam.setId(null);
-                menuExam.setTenantId(newTenantId);
                 return menuExam;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseMenuExamService.saveBatch(newMenuExamList);
+            iTopCourseMenuExamService.saveBatch(newMenuExamList);
         }
 
         //19 课程模块
-        List<CourseModule> moduleList = iCourseModuleService.list();
+        List<CourseModule> moduleList = iCourseModuleService.list(new LambdaQueryWrapper<CourseModule>().eq(CourseModule::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(moduleList)){
-            List<CourseModule> newModuleList = moduleList.stream().map(x -> {
-                CourseModule module = BeanUtil.toBean(x, CourseModule.class);
+            List<TopCourseModule> newModuleList = moduleList.stream().map(x -> {
+                TopCourseModule module = BeanUtil.toBean(x, TopCourseModule.class);
                 module.setModuleId(null);
-                module.setTenantId(newTenantId);
                 module.setOId(x.getModuleId());
                 return module;
             }).collect(Collectors.toList());
-            iCourseModuleService.saveBatch(newModuleList);
+            iTopCourseModuleService.saveBatch(newModuleList);
             //记录
             newModuleList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_MODULE.getType());
                 record.setNewId(item.getModuleId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //20 课程模块业务关联
-        List<CourseModuleBusiness> moduleBusinessList = iCourseModuleBusinessService.list();
+        List<CourseModuleBusiness> moduleBusinessList = iCourseModuleBusinessService.list(new LambdaQueryWrapper<CourseModuleBusiness>().eq(CourseModuleBusiness::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(moduleBusinessList)){
-            List<CourseModuleBusiness> newModuleBusinessList = moduleBusinessList.stream().map(x -> {
-                CourseModuleBusiness moduleBusiness = BeanUtil.toBean(x, CourseModuleBusiness.class);
+            List<TopCourseModuleBusiness> newModuleBusinessList = moduleBusinessList.stream().map(x -> {
+                TopCourseModuleBusiness moduleBusiness = BeanUtil.toBean(x, TopCourseModuleBusiness.class);
                 moduleBusiness.setId(null);
-                moduleBusiness.setTenantId(newTenantId);
                 return moduleBusiness;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseModuleBusinessService.saveBatch(newModuleBusinessList);
+            iTopCourseModuleBusinessService.saveBatch(newModuleBusinessList);
         }
 
         //21 课程模块章关联
-        List<CourseModuleChapter> moduleChapterList = iCourseModuleChapterService.list();
+        List<CourseModuleChapter> moduleChapterList = iCourseModuleChapterService.list(new LambdaQueryWrapper<CourseModuleChapter>().eq(CourseModuleChapter::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(moduleChapterList)){
-            List<CourseModuleChapter> newModuleChapterList = moduleChapterList.stream().map(x -> {
-                CourseModuleChapter moduleChapter = BeanUtil.toBean(x, CourseModuleChapter.class);
+            List<TopCourseModuleChapter> newModuleChapterList = moduleChapterList.stream().map(x -> {
+                TopCourseModuleChapter moduleChapter = BeanUtil.toBean(x, TopCourseModuleChapter.class);
                 moduleChapter.setId(null);
-                moduleChapter.setTenantId(newTenantId);
                 return moduleChapter;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseModuleChapterService.saveBatch(newModuleChapterList);
+            iTopCourseModuleChapterService.saveBatch(newModuleChapterList);
         }
 
         //22 课程项目
-        List<CourseProjectType> projectTypeList = iCourseProjectTypeService.list();
+        List<CourseProjectType> projectTypeList = iCourseProjectTypeService.list(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(projectTypeList)){
-            List<CourseProjectType> newProjectTypeList = projectTypeList.stream().map(x -> {
-                CourseProjectType projectType = BeanUtil.toBean(x, CourseProjectType.class);
+            List<TopCourseProjectType> newProjectTypeList = projectTypeList.stream().map(x -> {
+                TopCourseProjectType projectType = BeanUtil.toBean(x, TopCourseProjectType.class);
                 projectType.setId(null);
-                projectType.setTenantId(newTenantId);
                 projectType.setOId(x.getId());
                 return projectType;
             }).collect(Collectors.toList());
-            iCourseProjectTypeService.saveBatch(newProjectTypeList);
+            iTopCourseProjectTypeService.saveBatch(newProjectTypeList);
             //记录
             newProjectTypeList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_PROJECT_TYPE.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //23 课程节
-        List<CourseSection> sectionList = iCourseSectionService.list();
+        List<CourseSection> sectionList = iCourseSectionService.list(new LambdaQueryWrapper<CourseSection>().eq(CourseSection::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(sectionList)){
-            List<CourseSection> newSectionList = sectionList.stream().map(x -> {
-                CourseSection section = BeanUtil.toBean(x, CourseSection.class);
+            List<TopCourseSection> newSectionList = sectionList.stream().map(x -> {
+                TopCourseSection section = BeanUtil.toBean(x, TopCourseSection.class);
                 section.setSectionId(null);
-                section.setTenantId(newTenantId);
                 section.setOId(x.getSectionId());
                 return section;
             }).collect(Collectors.toList());
-            iCourseSectionService.saveBatch(newSectionList);
+            iTopCourseSectionService.saveBatch(newSectionList);
             //记录
             newSectionList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_SECTION.getType());
                 record.setNewId(item.getSectionId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //24 课程节业务关联
-        List<CourseSectionBusiness> sectionBusinessList = iCourseSectionBusinessService.list();
+        List<CourseSectionBusiness> sectionBusinessList = iCourseSectionBusinessService.list(new LambdaQueryWrapper<CourseSectionBusiness>().eq(CourseSectionBusiness::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(sectionBusinessList)){
-            List<CourseSectionBusiness> newSectionBusinessList = sectionBusinessList.stream().map(x -> {
-                CourseSectionBusiness sectionBusiness = BeanUtil.toBean(x, CourseSectionBusiness.class);
+            List<TopCourseSectionBusiness> newSectionBusinessList = sectionBusinessList.stream().map(x -> {
+                TopCourseSectionBusiness sectionBusiness = BeanUtil.toBean(x, TopCourseSectionBusiness.class);
                 sectionBusiness.setId(null);
-                sectionBusiness.setTenantId(newTenantId);
                 return sectionBusiness;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseSectionBusinessService.saveBatch(newSectionBusinessList);
+            iTopCourseSectionBusinessService.saveBatch(newSectionBusinessList);
         }
 
         //25 课程节观看权限关联
-        List<CourseSectionWatchPer> sectionWatchPerList = iCourseSectionWatchPerService.list();
+        List<CourseSectionWatchPer> sectionWatchPerList = iCourseSectionWatchPerService.list(new LambdaQueryWrapper<CourseSectionWatchPer>().eq(CourseSectionWatchPer::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(sectionWatchPerList)){
-            List<CourseSectionWatchPer> newSectionWatchPerList = sectionWatchPerList.stream().map(x -> {
-                CourseSectionWatchPer sectionWatchPer = BeanUtil.toBean(x, CourseSectionWatchPer.class);
+            List<TopCourseSectionWatchPer> newSectionWatchPerList = sectionWatchPerList.stream().map(x -> {
+                TopCourseSectionWatchPer sectionWatchPer = BeanUtil.toBean(x, TopCourseSectionWatchPer.class);
                 sectionWatchPer.setId(null);
-                sectionWatchPer.setTenantId(newTenantId);
                 return sectionWatchPer;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseSectionWatchPerService.saveBatch(newSectionWatchPerList);
+            iTopCourseSectionWatchPerService.saveBatch(newSectionWatchPerList);
         }
 
         //26 课程科目
-        List<CourseSubject> subjectList = iCourseSubjectService.list();
+        List<CourseSubject> subjectList = iCourseSubjectService.list(new LambdaQueryWrapper<CourseSubject>().eq(CourseSubject::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(subjectList)){
-            List<CourseSubject> newSubjectList = subjectList.stream().map(x -> {
-                CourseSubject subject = BeanUtil.toBean(x, CourseSubject.class);
+            List<TopCourseSubject> newSubjectList = subjectList.stream().map(x -> {
+                TopCourseSubject subject = BeanUtil.toBean(x, TopCourseSubject.class);
                 subject.setId(null);
-                subject.setTenantId(newTenantId);
                 subject.setOId(x.getId());
                 return subject;
             }).collect(Collectors.toList());
-            iCourseSubjectService.saveBatch(newSubjectList);
+            iTopCourseSubjectService.saveBatch(newSubjectList);
             //记录
             newSubjectList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_SUBJECT.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //27 课程科目项目关联
-        List<CourseSubjectProject> subjectProjectList = iCourseSubjectProjectService.list();
+        List<CourseSubjectProject> subjectProjectList = iCourseSubjectProjectService.list(new LambdaQueryWrapper<CourseSubjectProject>().eq(CourseSubjectProject::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(subjectProjectList)){
-            List<CourseSubjectProject> newSubjectProjectList = subjectProjectList.stream().map(x -> {
-                CourseSubjectProject subjectProject = BeanUtil.toBean(x, CourseSubjectProject.class);
+            List<TopCourseSubjectProject> newSubjectProjectList = subjectProjectList.stream().map(x -> {
+                TopCourseSubjectProject subjectProject = BeanUtil.toBean(x, TopCourseSubjectProject.class);
                 subjectProject.setId(null);
-                subjectProject.setTenantId(newTenantId);
                 return subjectProject;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseSubjectProjectService.saveBatch(newSubjectProjectList);
+            iTopCourseSubjectProjectService.saveBatch(newSubjectProjectList);
         }
 
         //28 试卷
-        List<Exam> examList = iExamService.list();
+        List<Exam> examList = iExamService.list(new LambdaQueryWrapper<Exam>().eq(Exam::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(examList)){
-            List<Exam> newExamList = examList.stream().map(x -> {
-                Exam exam = BeanUtil.toBean(x, Exam.class);
+            List<TopExam> newExamList = examList.stream().map(x -> {
+                TopExam exam = BeanUtil.toBean(x, TopExam.class);
                 exam.setExamId(null);
-                exam.setTenantId(newTenantId);
                 exam.setOId(x.getExamId());
                 return exam;
             }).collect(Collectors.toList());
-            iExamService.saveBatch(newExamList);
+            iTopExamService.saveBatch(newExamList);
             //记录
             newExamList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.EXAM.getType());
                 record.setNewId(item.getExamId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //29 试卷类型
-        List<ExamPaper> examPaperList = iExamPaperService.list();
+        List<ExamPaper> examPaperList = iExamPaperService.list(new LambdaQueryWrapper<ExamPaper>().eq(ExamPaper::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(examPaperList)){
-            List<ExamPaper> newExamPaperList = examPaperList.stream().map(x -> {
-                ExamPaper examPaper = BeanUtil.toBean(x, ExamPaper.class);
+            List<TopExamPaper> newExamPaperList = examPaperList.stream().map(x -> {
+                TopExamPaper examPaper = BeanUtil.toBean(x, TopExamPaper.class);
                 examPaper.setPaperId(null);
-                examPaper.setTenantId(newTenantId);
                 examPaper.setOId(x.getPaperId());
                 return examPaper;
             }).collect(Collectors.toList());
-            iExamPaperService.saveBatch(newExamPaperList);
+            iTopExamPaperService.saveBatch(newExamPaperList);
             //记录
             newExamPaperList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.EXAM_PAPER.getType());
                 record.setNewId(item.getPaperId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //30 试卷题目关联
-        List<ExamQuestion> examQuestionList = iExamQuestionService.list();
+        List<ExamQuestion> examQuestionList = iExamQuestionService.list(new LambdaQueryWrapper<ExamQuestion>().eq(ExamQuestion::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(examQuestionList)){
-            List<ExamQuestion> newExamQuestionList = examQuestionList.stream().map(x -> {
-                ExamQuestion examQuestion = BeanUtil.toBean(x, ExamQuestion.class);
+            List<TopExamQuestion> newExamQuestionList = examQuestionList.stream().map(x -> {
+                TopExamQuestion examQuestion = BeanUtil.toBean(x, TopExamQuestion.class);
                 examQuestion.setId(null);
-                examQuestion.setTenantId(newTenantId);
                 return examQuestion;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iExamQuestionService.saveBatch(newExamQuestionList);
+            iTopExamQuestionService.saveBatch(newExamQuestionList);
         }
 
         //31 专业
-        List<Major> majorList = iMajorService.list();
+        List<Major> majorList = iMajorService.list(new LambdaQueryWrapper<Major>().eq(Major::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(majorList)){
-            List<Major> newMajorList = majorList.stream().map(x -> {
-                Major major = BeanUtil.toBean(x, Major.class);
+            List<TopMajor> newMajorList = majorList.stream().map(x -> {
+                TopMajor major = BeanUtil.toBean(x, TopMajor.class);
                 major.setId(null);
-                major.setTenantId(newTenantId);
                 major.setOId(x.getId());
                 return major;
             }).collect(Collectors.toList());
-            iMajorService.saveBatch(newMajorList);
+            iTopMajorService.saveBatch(newMajorList);
             //记录
             newMajorList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.MAJOR.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //32 专业项目关联
-        List<MajorProject> majorProjectList = iMajorProjectService.list();
+        List<MajorProject> majorProjectList = iMajorProjectService.list(new LambdaQueryWrapper<MajorProject>().eq(MajorProject::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(majorProjectList)){
-            List<MajorProject> newMajorProjectList = majorProjectList.stream().map(x -> {
-                MajorProject majorProject = BeanUtil.toBean(x, MajorProject.class);
+            List<TopMajorProject> newMajorProjectList = majorProjectList.stream().map(x -> {
+                TopMajorProject majorProject = BeanUtil.toBean(x, TopMajorProject.class);
                 majorProject.setId(null);
-                majorProject.setTenantId(newTenantId);
                 return majorProject;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iMajorProjectService.saveBatch(newMajorProjectList);
+            iTopMajorProjectService.saveBatch(newMajorProjectList);
         }
 
         //33 服务
-        List<PayServe> serveList = iPayServeService.list();
+        List<PayServe> serveList = iPayServeService.list(new LambdaQueryWrapper<PayServe>().eq(PayServe::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(serveList)){
-            List<PayServe> newServeList = serveList.stream().map(x -> {
-                PayServe serve = BeanUtil.toBean(x, PayServe.class);
+            List<TopPayServe> newServeList = serveList.stream().map(x -> {
+                TopPayServe serve = BeanUtil.toBean(x, TopPayServe.class);
                 serve.setServeId(null);
-                serve.setTenantId(newTenantId);
                 serve.setOId(x.getServeId());
                 return serve;
             }).collect(Collectors.toList());
-            iPayServeService.saveBatch(newServeList);
+            iTopPayServeService.saveBatch(newServeList);
             //记录
             newServeList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.PAY_SERVE.getType());
                 record.setNewId(item.getServeId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //34 服务供应
-        List<PaySupply> paySup = iPaySupplyService.list();
+        List<PaySupply> paySup = iPaySupplyService.list(new LambdaQueryWrapper<PaySupply>().eq(PaySupply::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(paySup)){
-            List<PaySupply> newPaySup = paySup.stream().map(x -> {
-                PaySupply supply = BeanUtil.toBean(x, PaySupply.class);
+            List<TopPaySupply> newPaySup = paySup.stream().map(x -> {
+                TopPaySupply supply = BeanUtil.toBean(x, TopPaySupply.class);
                 supply.setSupplyId(null);
-                supply.setTenantId(newTenantId);
                 supply.setOId(x.getSupplyId());
                 return supply;
             }).collect(Collectors.toList());
-            iPaySupplyService.saveBatch(newPaySup);
+            iTopPaySupplyService.saveBatch(newPaySup);
             //记录
             newPaySup.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.PAY_SUPPLY.getType());
                 record.setNewId(item.getSupplyId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //35 课程流
-        List<CourseStreaming> streamingList = iCourseStreamingService.list();
+        List<CourseStreaming> streamingList = iCourseStreamingService.list(new LambdaQueryWrapper<CourseStreaming>().eq(CourseStreaming::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(streamingList)){
-            List<CourseStreaming> newStreamingList = streamingList.stream().map(x -> {
-                CourseStreaming streaming = BeanUtil.toBean(x, CourseStreaming.class);
+            List<TopCourseStreaming> newStreamingList = streamingList.stream().map(x -> {
+                TopCourseStreaming streaming = BeanUtil.toBean(x, TopCourseStreaming.class);
                 streaming.setId(null);
-                streaming.setTenantId(newTenantId);
                 streaming.setOId(x.getId());
                 return streaming;
             }).collect(Collectors.toList());
-            iCourseStreamingService.saveBatch(newStreamingList);
+            iTopCourseStreamingService.saveBatch(newStreamingList);
             //记录
             newStreamingList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.COURSE_STREAMING.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //36 课程流业务层次
-        List<CourseStreamingBusiness> streamingBusinessList = iCourseStreamingBusinessService.list();
+        List<CourseStreamingBusiness> streamingBusinessList = iCourseStreamingBusinessService.list(new LambdaQueryWrapper<CourseStreamingBusiness>().eq(CourseStreamingBusiness::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(streamingBusinessList)){
-            List<CourseStreamingBusiness> newStreamingBusinessList = streamingBusinessList.stream().map(x -> {
-                CourseStreamingBusiness streamingBusiness = BeanUtil.toBean(x, CourseStreamingBusiness.class);
+            List<TopCourseStreamingBusiness> newStreamingBusinessList = streamingBusinessList.stream().map(x -> {
+                TopCourseStreamingBusiness streamingBusiness = BeanUtil.toBean(x, TopCourseStreamingBusiness.class);
                 streamingBusiness.setId(null);
-                streamingBusiness.setTenantId(newTenantId);
                 return streamingBusiness;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iCourseStreamingBusinessService.saveBatch(newStreamingBusinessList);
+            iTopCourseStreamingBusinessService.saveBatch(newStreamingBusinessList);
         }
 
         //37 保利威资源类型
-        List<PolyvCata> polyvCataList = iPolyvCataService.list();
+        List<PolyvCata> polyvCataList = iPolyvCataService.list(new LambdaQueryWrapper<PolyvCata>().eq(PolyvCata::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(polyvCataList)){
-            List<PolyvCata> newPolyvCataList = polyvCataList.stream().map(x -> {
-                PolyvCata cata = BeanUtil.toBean(x, PolyvCata.class);
+            List<TopPolyvCata> newPolyvCataList = polyvCataList.stream().map(x -> {
+                TopPolyvCata cata = BeanUtil.toBean(x, TopPolyvCata.class);
                 cata.setId(null);
-                cata.setTenantId(newTenantId);
                 cata.setOId(x.getId());
                 return cata;
             }).collect(Collectors.toList());
-            iPolyvCataService.saveBatch(newPolyvCataList);
+            iTopPolyvCataService.saveBatch(newPolyvCataList);
             //记录
             newPolyvCataList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.POLYV_CATA.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //38 保利威视频资源
-        List<PolyvVideo> polyvVideoList = iPolyvVideoService.list();
+        List<PolyvVideo> polyvVideoList = iPolyvVideoService.list(new LambdaQueryWrapper<PolyvVideo>().eq(PolyvVideo::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(polyvVideoList)){
-            List<PolyvVideo> newPolyvVideoList = polyvVideoList.stream().map(x -> {
-                PolyvVideo video = BeanUtil.toBean(x, PolyvVideo.class);
+            List<TopPolyvVideo> newPolyvVideoList = polyvVideoList.stream().map(x -> {
+                TopPolyvVideo video = BeanUtil.toBean(x, TopPolyvVideo.class);
                 video.setPolyvId(null);
-                video.setTenantId(newTenantId);
                 video.setOId(x.getPolyvId());
                 return video;
             }).collect(Collectors.toList());
-            iPolyvVideoService.saveBatch(newPolyvVideoList);
+            iTopPolyvVideoService.saveBatch(newPolyvVideoList);
             //记录
             newPolyvVideoList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.POLYV_VIDEO.getType());
                 record.setNewId(item.getPolyvId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //39 资料字段
-        List<ProfileField> fieldList = iProfileFieldService.list();
+        List<ProfileField> fieldList = iProfileFieldService.list(new LambdaUpdateWrapper<ProfileField>().eq(ProfileField::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(fieldList)){
-            List<ProfileField> newFieldList = fieldList.stream().map(x -> {
-                ProfileField field = BeanUtil.toBean(x, ProfileField.class);
+            List<TopProfileField> newFieldList = fieldList.stream().map(x -> {
+                TopProfileField field = BeanUtil.toBean(x, TopProfileField.class);
                 field.setFieldId(null);
-                field.setTenantId(newTenantId);
                 field.setOId(x.getFieldId());
                 return field;
             }).collect(Collectors.toList());
-            iProfileFieldService.saveBatch(newFieldList);
+            iTopProfileFieldService.saveBatch(newFieldList);
             //记录
             newFieldList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.PROFILE_FIELD.getType());
                 record.setNewId(item.getFieldId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //40 资料模板
-        List<ProfileTp> fProfileTpList = iProfileTpService.list();
+        List<ProfileTp> fProfileTpList = iProfileTpService.list(new LambdaQueryWrapper<ProfileTp>().eq(ProfileTp::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(fProfileTpList)){
-            List<ProfileTp> newFProfileTpList = fProfileTpList.stream().map(x -> {
-                ProfileTp fProfileTp = BeanUtil.toBean(x, ProfileTp.class);
+            List<TopProfileTp> newFProfileTpList = fProfileTpList.stream().map(x -> {
+                TopProfileTp fProfileTp = BeanUtil.toBean(x, TopProfileTp.class);
                 fProfileTp.setProfileTpId(null);
-                fProfileTp.setTenantId(newTenantId);
                 fProfileTp.setOId(x.getProfileTpId());
                 return fProfileTp;
             }).collect(Collectors.toList());
-            iProfileTpService.saveBatch(newFProfileTpList);
+            iTopProfileTpService.saveBatch(newFProfileTpList);
             //记录
             newFProfileTpList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.PROFILE_TP.getType());
                 record.setNewId(item.getProfileTpId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //41 资料模板业务层次关联
-        List<ProfileTpBusiness> tpBusinessList = iProfileTpBusinessService.list();
+        List<ProfileTpBusiness> tpBusinessList = iProfileTpBusinessService.list(new LambdaQueryWrapper<ProfileTpBusiness>().eq(ProfileTpBusiness::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(tpBusinessList)){
-            List<ProfileTpBusiness> newTpBusinessList = tpBusinessList.stream().map(x -> {
-                ProfileTpBusiness tpBusiness = BeanUtil.toBean(x, ProfileTpBusiness.class);
+            List<TopProfileTpBusiness> newTpBusinessList = tpBusinessList.stream().map(x -> {
+                TopProfileTpBusiness tpBusiness = BeanUtil.toBean(x, TopProfileTpBusiness.class);
                 tpBusiness.setId(null);
-                tpBusiness.setTenantId(newTenantId);
                 return tpBusiness;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iProfileTpBusinessService.saveBatch(newTpBusinessList);
+            iTopProfileTpBusinessService.saveBatch(newTpBusinessList);
         }
 
         //42 题目
-        List<Question> questionList = iQuestionService.list();
+        List<Question> questionList = iQuestionService.list(new LambdaQueryWrapper<Question>().eq(Question::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(questionList)){
-            List<Question> newQuestionList = questionList.stream().map(x -> {
-                Question question = BeanUtil.toBean(x, Question.class);
+            List<TopQuestion> newQuestionList = questionList.stream().map(x -> {
+                TopQuestion question = BeanUtil.toBean(x, TopQuestion.class);
                 question.setQuestionId(null);
-                question.setTenantId(newTenantId);
                 question.setOId(x.getQuestionId());
                 return question;
             }).collect(Collectors.toList());
-            iQuestionService.saveBatch(newQuestionList);
+            iTopQuestionService.saveBatch(newQuestionList);
             //记录
             newQuestionList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.QUESTION.getType());
                 record.setNewId(item.getQuestionId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //43 题目业务层次关联
-        List<QuestionBusiness> questionBusinessList = iQuestionBusinessService.list();
+        List<QuestionBusiness> questionBusinessList = iQuestionBusinessService.list(new LambdaQueryWrapper<QuestionBusiness>().eq(QuestionBusiness::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(questionBusinessList)){
-            List<QuestionBusiness> newQuestionBusinessList = questionBusinessList.stream().map(x -> {
-                QuestionBusiness questionBusiness = BeanUtil.toBean(x, QuestionBusiness.class);
+            List<TopQuestionBusiness> newQuestionBusinessList = questionBusinessList.stream().map(x -> {
+                TopQuestionBusiness questionBusiness = BeanUtil.toBean(x, TopQuestionBusiness.class);
                 questionBusiness.setId(null);
-                questionBusiness.setTenantId(newTenantId);
                 return questionBusiness;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iQuestionBusinessService.saveBatch(newQuestionBusinessList);
+            iTopQuestionBusinessService.saveBatch(newQuestionBusinessList);
         }
 
         //44 题目章
-        List<QuestionChapter> questionChapterList = iQuestionChapterService.list();
+        List<QuestionChapter> questionChapterList = iQuestionChapterService.list(new LambdaQueryWrapper<QuestionChapter>().eq(QuestionChapter::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(questionChapterList)){
-            List<QuestionChapter> newQuestionChapterList = questionChapterList.stream().map(x -> {
-                QuestionChapter questionChapter = BeanUtil.toBean(x, QuestionChapter.class);
+            List<TopQuestionChapter> newQuestionChapterList = questionChapterList.stream().map(x -> {
+                TopQuestionChapter questionChapter = BeanUtil.toBean(x, TopQuestionChapter.class);
                 questionChapter.setChapterExamId(null);
-                questionChapter.setTenantId(newTenantId);
                 questionChapter.setOId(x.getChapterExamId());
                 return questionChapter;
             }).collect(Collectors.toList());
-            iQuestionChapterService.saveBatch(newQuestionChapterList);
+            iTopQuestionChapterService.saveBatch(newQuestionChapterList);
             //记录
             newQuestionChapterList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.QUESTION_CHAPTER.getType());
                 record.setNewId(item.getChapterExamId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //45 题库章试卷关联
-        List<QuestionChapterExam> questionChapterExamList = iQuestionChapterExamService.list();
+        List<QuestionChapterExam> questionChapterExamList = iQuestionChapterExamService.list(new LambdaQueryWrapper<QuestionChapterExam>().eq(QuestionChapterExam::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(questionChapterExamList)){
-            List<QuestionChapterExam> newQuestionChapterExamList = questionChapterExamList.stream().map(x -> {
-                QuestionChapterExam questionChapterExam = BeanUtil.toBean(x, QuestionChapterExam.class);
+            List<TopQuestionChapterExam> newQuestionChapterExamList = questionChapterExamList.stream().map(x -> {
+                TopQuestionChapterExam questionChapterExam = BeanUtil.toBean(x, TopQuestionChapterExam.class);
                 questionChapterExam.setId(null);
-                questionChapterExam.setTenantId(newTenantId);
                 return questionChapterExam;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iQuestionChapterExamService.saveBatch(newQuestionChapterExamList);
+            iTopQuestionChapterExamService.saveBatch(newQuestionChapterExamList);
         }
 
         //46 题库模块
-        List<QuestionModule> questionModuleList = iQuestionModuleService.list();
+        List<QuestionModule> questionModuleList = iQuestionModuleService.list(new LambdaQueryWrapper<QuestionModule>().eq(QuestionModule::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(questionModuleList)){
-            List<QuestionModule> newQuestionModuleList = questionModuleList.stream().map(x -> {
-                QuestionModule questionModule = BeanUtil.toBean(x, QuestionModule.class);
+            List<TopQuestionModule> newQuestionModuleList = questionModuleList.stream().map(x -> {
+                TopQuestionModule questionModule = BeanUtil.toBean(x, TopQuestionModule.class);
                 questionModule.setModuleExamId(null);
-                questionModule.setTenantId(newTenantId);
                 questionModule.setOId(x.getModuleExamId());
                 return questionModule;
             }).collect(Collectors.toList());
-            iQuestionModuleService.saveBatch(newQuestionModuleList);
+            iTopQuestionModuleService.saveBatch(newQuestionModuleList);
             //记录
             newQuestionModuleList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.QUESTION_MODULE.getType());
                 record.setNewId(item.getModuleExamId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //47 题库模块章关联
-        List<QuestionModuleChapter> questionModuleChapterList = iQuestionModuleChapterService.list();
+        List<QuestionModuleChapter> questionModuleChapterList = iQuestionModuleChapterService.list(new LambdaQueryWrapper<QuestionModuleChapter>().eq(QuestionModuleChapter::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(questionModuleChapterList)){
-            List<QuestionModuleChapter> newQuestionModuleChapterList = questionModuleChapterList.stream().map(x -> {
-                QuestionModuleChapter questionModuleChapter = BeanUtil.toBean(x, QuestionModuleChapter.class);
+            List<TopQuestionModuleChapter> newQuestionModuleChapterList = questionModuleChapterList.stream().map(x -> {
+                TopQuestionModuleChapter questionModuleChapter = BeanUtil.toBean(x, TopQuestionModuleChapter.class);
                 questionModuleChapter.setId(null);
-                questionModuleChapter.setTenantId(newTenantId);
                 return questionModuleChapter;
             }).collect(Collectors.toList());
             //关联表不需要记录(后续修改ID)
-            iQuestionModuleChapterService.saveBatch(newQuestionModuleChapterList);
+            iTopQuestionModuleChapterService.saveBatch(newQuestionModuleChapterList);
         }
 
         //48 证书
-        List<CertificateCommon> certificateCommonList = iCertificateCommonService.list();
+        List<CertificateCommon> certificateCommonList = iCertificateCommonService.list(new LambdaQueryWrapper<CertificateCommon>().eq(CertificateCommon::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(certificateCommonList)){
-            List<CertificateCommon> newCertificateCommonList = certificateCommonList.stream().map(x -> {
-                CertificateCommon common = BeanUtil.toBean(x, CertificateCommon.class);
+            List<TopCertificateCommon> newCertificateCommonList = certificateCommonList.stream().map(x -> {
+                TopCertificateCommon common = BeanUtil.toBean(x, TopCertificateCommon.class);
                 common.setId(null);
-                common.setTenantId(newTenantId);
                 common.setOId(x.getId());
                 return common;
             }).collect(Collectors.toList());
-            iCertificateCommonService.saveBatch(newCertificateCommonList);
+            iTopCertificateCommonService.saveBatch(newCertificateCommonList);
             //记录
             newCertificateCommonList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.CERTIFICATE_COMMON.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //49 证书类型
-        List<Certificate> certificateList = iCertificateService.list();
+        List<Certificate> certificateList = iCertificateService.list(new LambdaQueryWrapper<Certificate>().eq(Certificate::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(certificateList)){
-            List<Certificate> newCertificateList = certificateList.stream().map(x -> {
-                Certificate certificate = BeanUtil.toBean(x, Certificate.class);
+            List<TopCertificate> newCertificateList = certificateList.stream().map(x -> {
+                TopCertificate certificate = BeanUtil.toBean(x, TopCertificate.class);
                 certificate.setId(null);
-                certificate.setTenantId(newTenantId);
                 certificate.setOId(x.getId());
                 return certificate;
             }).collect(Collectors.toList());
-            iCertificateService.saveBatch(newCertificateList);
+            iTopCertificateService.saveBatch(newCertificateList);
             //记录
             newCertificateList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.CERTIFICATE.getType());
                 record.setNewId(item.getId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
         //50 证书模板
-        List<CertificateTp> certificateTpList = iCertificateTpService.list();
+        List<CertificateTp> certificateTpList = iCertificateTpService.list(new LambdaQueryWrapper<CertificateTp>().eq(CertificateTp::getTenantId,tenantId));
         if (CollectionUtils.isNotEmpty(certificateTpList)){
-            List<CertificateTp> newCertificateTpList = certificateTpList.stream().map(x -> {
-                CertificateTp certificateTp = BeanUtil.toBean(x, CertificateTp.class);
+            List<TopCertificateTp> newCertificateTpList = certificateTpList.stream().map(x -> {
+                TopCertificateTp certificateTp = BeanUtil.toBean(x, TopCertificateTp.class);
                 certificateTp.setTpId(null);
-                certificateTp.setTenantId(newTenantId);
                 certificateTp.setOId(x.getTpId());
                 return certificateTp;
             }).collect(Collectors.toList());
-            iCertificateTpService.saveBatch(newCertificateTpList);
+            iTopCertificateTpService.saveBatch(newCertificateTpList);
             //记录
             newCertificateTpList.forEach(item -> {
-                SysGoodsCopyRecord record = new SysGoodsCopyRecord();
+                TopGoodsCopy record = new TopGoodsCopy();
                 record.setType(GoodsCopyEnum.CERTIFICATE_TP.getType());
                 record.setNewId(item.getTpId());
                 record.setOldId(item.getOId());
                 record.setCreateTime(DateUtils.getNowTime());
                 record.setUpdateTime(DateUtils.getNowTime());
-                record.setTenantId(newTenantId);
                 copyRecordList.add(record);
             });
         }
 
-        //通知规则
-        List<InformRemind> informRemindList = iInformRemindService.list();
-        if (CollectionUtils.isNotEmpty(informRemindList)){
-            List<InformRemind> newInformRemind = informRemindList.stream().map(x -> {
-                InformRemind informRemind = BeanUtil.toBean(x, InformRemind.class);
-                informRemind.setId(null);
-                informRemind.setTenantId(newTenantId);
-                return informRemind;
-            }).collect(Collectors.toList());
-            iInformRemindService.saveBatch(newInformRemind);
+        //保存记录
+        iTopGoodsCopyService.saveBatch(copyRecordList);
+        return true;
+    }
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean goodsBatchCopyDisposeTenant() {
+        List<TopGoods> goodsList = list();
+        if (CollectionUtils.isEmpty(goodsList)){
+            return true;
+        }
+        //处理关联ID
+        for (TopGoods goods : goodsList) {
+            //供应方ID
+            goods.setSupplyId(getNewId(goods.getSupplyId(), GoodsCopyEnum.PAY_SUPPLY.getType()));
+            //教育类型
+            goods.setEducationTypeId(getNewId(goods.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+            //业务层次
+            goods.setBusinessId(getNewId(goods.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+            //所属专业
+            goods.setMajorId(getNewId(goods.getMajorId(), GoodsCopyEnum.MAJOR.getType()));
+            //项目
+            goods.setProjectId(getNewId(goods.getProjectId().longValue(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+            //讲义
+            goods.setHandoutsId(getNewId(goods.getHandoutsId(), GoodsCopyEnum.COURSE_HANDOUTS.getType()));
+            //科目
+            goods.setSubjectIds(getNewIds(goods.getSubjectIds(), GoodsCopyEnum.COURSE_SUBJECT.getType()));
+            //证书类型
+            goods.setCertificateTypeId(getNewId(goods.getCertificateTypeId(), GoodsCopyEnum.CERTIFICATE.getType()));
+            //证书
+            goods.setCertificateId(getNewId(goods.getCertificateId(), GoodsCopyEnum.CERTIFICATE_COMMON.getType()));
+            //证书模板
+            goods.setCertificateTpId(getNewId(goods.getCertificateTpId(), GoodsCopyEnum.CERTIFICATE_TP.getType()));
+            //规格模板
+            goods.setSpecTemplateId(getNewId(goods.getSpecTemplateId(), GoodsCopyEnum.GOODS_SPEC_TEMPLATE.getType()));
         }
 
-        //下单模板
-        List<OrderInputTemplate> inputTemplateList = iOrderInputTemplateService.list();
-        if (CollectionUtils.isNotEmpty(inputTemplateList)){
-            List<OrderInputTemplate> newTemplateList = inputTemplateList.stream().map(x -> {
-                OrderInputTemplate inputTemplate = BeanUtil.toBean(x, OrderInputTemplate.class);
-                inputTemplate.setId(null);
-                inputTemplate.setTenantId(newTenantId);
-                return inputTemplate;
-            }).collect(Collectors.toList());
-            iOrderInputTemplateService.saveBatch(newTemplateList);
+        updateBatchById(goodsList);
+
+
+        //2 商品规格
+        List<TopGoodsSpec> specList = topGoodsSpecService.list();
+        if (CollectionUtils.isNotEmpty(specList)){
+            for (TopGoodsSpec item : specList) {
+                //规格模板ID
+                item.setSpecTemplateId(getNewId(item.getSpecTemplateId(), GoodsCopyEnum.GOODS_SPEC_TEMPLATE.getType()));
+            }
+            topGoodsSpecService.updateBatchById(specList);
         }
 
-        //班级官方通知模板
-        List<ClassGradeInterface> gradeInterfaceList = iClassGradeInterfaceService.list();
-        if (CollectionUtils.isNotEmpty(gradeInterfaceList)){
-            List<ClassGradeInterface> newGradeInterfaceList = gradeInterfaceList.stream().map(x -> {
-                ClassGradeInterface gradeInterface = BeanUtil.toBean(x, ClassGradeInterface.class);
-                gradeInterface.setId(null);
-                gradeInterface.setTenantId(newTenantId);
-                return gradeInterface;
-            }).collect(Collectors.toList());
-            iClassGradeInterfaceService.saveBatch(newGradeInterfaceList);
+        //3 规格模板
+        List<TopGoodsSpecTemplate> specTemplateList = topGoodsSpecTemplateService.list();
+        if (CollectionUtils.isNotEmpty(specTemplateList)){
+            for (TopGoodsSpecTemplate item : specTemplateList) {
+                //教育类型
+                item.setEducationTypeId(getNewId(item.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+            }
+            topGoodsSpecTemplateService.updateBatchById(specTemplateList);
+        }
+
+        //4 规格属性
+        List<TopGoodsSpecAttribute> specAttributeList = topGoodsSpecAttributeService.list();
+        if (CollectionUtils.isNotEmpty(specAttributeList)){
+            for (TopGoodsSpecAttribute item : specAttributeList) {
+                //规格ID
+                item.setSpecId(getNewId(item.getSpecId(), GoodsCopyEnum.GOODS_SPEC.getType()));
+            }
+            topGoodsSpecAttributeService.updateBatchById(specAttributeList);
+        }
+
+        //5 规格属性关联
+        List<TopGoodsSpecAttributeRelation> attributeRelationList = topGoodsSpecAttributeRelationService.list();
+        if (CollectionUtils.isNotEmpty(attributeRelationList)){
+            for (TopGoodsSpecAttributeRelation item : attributeRelationList) {
+                //规格属性IDs
+                item.setSpecAttributeIds(getNewIds(item.getSpecAttributeIds(), GoodsCopyEnum.GOODS_SPEC_ATTRIBUTE.getType()));
+                //商品ID
+                item.setGoodsId(getNewId(item.getGoodsId(),GoodsCopyEnum.GOODS.getType()));
+                //规格模板ID
+                item.setSpecTemplateId(getNewId(item.getSpecTemplateId(),GoodsCopyEnum.GOODS_SPEC_TEMPLATE.getType()));
+            }
+            topGoodsSpecAttributeRelationService.updateBatchById(attributeRelationList);
+        }
+
+        //6 商品课程关联
+        List<TopGoodsCourse> goodsCourseList = iTopGoodsCourseService.list();
+        if (CollectionUtils.isNotEmpty(goodsCourseList)){
+            for (TopGoodsCourse item : goodsCourseList) {
+                //商品ID
+                item.setGoodsId(getNewId(item.getGoodsId(), GoodsCopyEnum.GOODS.getType()));
+                //课程ID
+                item.setCourseId(getNewId(item.getCourseId(),GoodsCopyEnum.COURSE.getType()));
+            }
+            iTopGoodsCourseService.updateBatchById(goodsCourseList);
+        }
+
+        //6 题库商品关联
+        List<TopGoodsAttached> goodsAttachedList = iTopGoodsAttachedService.list();
+        if (CollectionUtils.isNotEmpty(goodsAttachedList)){
+            for (TopGoodsAttached 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()));
+                    }
+                }
+            }
+            iTopGoodsAttachedService.updateBatchById(goodsAttachedList);
+        }
+
+        //7 课程老师关联
+        List<TopGoodsCourseTeacher> courseTeacherList = topGoodsCourseTeacherService.list();
+        if (CollectionUtils.isNotEmpty(courseTeacherList)){
+            for (TopGoodsCourseTeacher item : courseTeacherList) {
+                //商品ID
+                item.setGoodsId(getNewId(item.getGoodsId(), GoodsCopyEnum.GOODS.getType()));
+                //课程IDS
+                item.setCourseIds(getNewIds(item.getCourseIds(),GoodsCopyEnum.COURSE.getType()));
+            }
+            topGoodsCourseTeacherService.updateBatchById(courseTeacherList);
+        }
+
+        //8 课程
+        List<TopCourse> courseList = iTopCourseService.list();
+        if (CollectionUtils.isNotEmpty(courseList)){
+            for (TopCourse item : courseList) {
+                //教育类型
+                item.setEducationTypeId(getNewId(item.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+                //所属专业
+                item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.MAJOR.getType()));
+                //项目
+                item.setProjectId(getNewId(item.getProjectId(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+                //科目
+                item.setSubjectId(getNewId(item.getSubjectId(), GoodsCopyEnum.COURSE_SUBJECT.getType()));
+            }
+            iTopCourseService.updateBatchById(courseList);
+        }
+
+        //9 业务层次
+        List<TopCourseBusiness> businessList = iTopCourseBusinessService.list();
+        if (CollectionUtils.isNotEmpty(businessList)){
+            for (TopCourseBusiness item : businessList) {
+                //项目
+                if (ObjectUtils.isNotNull(item.getProjectId())){
+                    item.setProjectId(getNewId(item.getProjectId().longValue(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+                }
+            }
+            iTopCourseBusinessService.updateBatchById(businessList);
+        }
+
+        //10 课程章
+        //11 课程章业务层次关联
+        List<TopCourseChapterBusiness> courseChapterBusinessList = iTopCourseChapterBusinessService.list();
+        if (CollectionUtils.isNotEmpty(courseChapterBusinessList)){
+            for (TopCourseChapterBusiness item : courseChapterBusinessList) {
+                //章ID
+                item.setChapterId(getNewId(item.getChapterId(),GoodsCopyEnum.COURSE_CHAPTER.getType()));
+                //教育类型
+                item.setEducationTypeId(getNewId(item.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+                //项目
+                item.setProjectId(getNewId(item.getProjectId(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+                //科目
+                item.setSubjectId(getNewId(item.getSubjectId(), GoodsCopyEnum.COURSE_SUBJECT.getType()));
+            }
+            iTopCourseChapterBusinessService.updateBatchById(courseChapterBusinessList);
+        }
+
+        //12 课程章节关联
+        List<TopCourseChapterSection> chapterSectionList = iTopCourseChapterSectionService.list();
+        if (CollectionUtils.isNotEmpty(chapterSectionList)){
+            for (TopCourseChapterSection item : chapterSectionList) {
+                //章ID
+                item.setChapterId(getNewId(item.getChapterId(),GoodsCopyEnum.COURSE_CHAPTER.getType()));
+                //节ID
+                item.setSectionId(getNewId(item.getSectionId(), GoodsCopyEnum.COURSE_SECTION.getType()));
+            }
+            iTopCourseChapterSectionService.updateBatchById(chapterSectionList);
+        }
+
+        //13 教育类型关联
+        List<TopCourseEducationTier> educationTierList = iTopCourseEducationTierService.list();
+        if (CollectionUtils.isNotEmpty(educationTierList)){
+            for (TopCourseEducationTier item : educationTierList) {
+                //教育类型ID
+                item.setEducationId(getNewId(item.getEducationId(),GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+            }
+            iTopCourseEducationTierService.updateBatchById(educationTierList);
+        }
+
+        //14 教育类型
+        //15 课程讲义
+        //16 讲义业务层次关联
+        List<TopCourseHandoutsBusiness> handoutsBusinessList = iTopCourseHandoutsBusinessService.list();
+        if (CollectionUtils.isNotEmpty(handoutsBusinessList)){
+            for (TopCourseHandoutsBusiness item : handoutsBusinessList) {
+                //教育类型
+                item.setEducationId(getNewId(item.getEducationId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+                //科目
+                item.setSubjectId(getNewId(item.getSubjectId(), GoodsCopyEnum.COURSE_SUBJECT.getType()));
+                //讲义ID
+                item.setHandoutsId(getNewId(item.getHandoutsId(), GoodsCopyEnum.COURSE_HANDOUTS.getType()));
+            }
+            iTopCourseHandoutsBusinessService.updateBatchById(handoutsBusinessList);
+        }
+
+        //17 课程目录关联
+        List<TopCourseMenu> courseMenuList = iTopCourseMenuService.list();
+        if (CollectionUtils.isNotEmpty(courseMenuList)){
+            for (TopCourseMenu item : courseMenuList) {
+                //课程ID
+                item.setCourseId(getNewId(item.getCourseId(), GoodsCopyEnum.COURSE.getType()));
+                //目录ID
+                if (ObjectUtils.isNotNull(item.getType())){
+                    if (item.getType() == 1){
+                        //模快
+                        item.setMenuId(getNewId(item.getMenuId(), GoodsCopyEnum.COURSE_MODULE.getType()));
+                    }else if (item.getType() == 2){
+                        //章
+                        item.setMenuId(getNewId(item.getMenuId(), GoodsCopyEnum.COURSE_CHAPTER.getType()));
+                    }else if (item.getType() == 3){
+                        //节
+                        item.setMenuId(getNewId(item.getMenuId(), GoodsCopyEnum.COURSE_SECTION.getType()));
+                    }
+                }
+            }
+            iTopCourseMenuService.updateBatchById(courseMenuList);
+        }
+
+        //18 课程目录试卷关联
+        List<TopCourseMenuExam> courseMenuExamList = iTopCourseMenuExamService.list();
+        if (CollectionUtils.isNotEmpty(courseMenuExamList)){
+            for (TopCourseMenuExam item : courseMenuExamList) {
+                //课程ID
+                item.setCourseId(getNewId(item.getCourseId(), GoodsCopyEnum.COURSE.getType()));
+                //模快
+                item.setModuleId(getNewId(item.getModuleId(), GoodsCopyEnum.COURSE_MODULE.getType()));
+                //章
+                item.setChapterId(getNewId(item.getChapterId(), GoodsCopyEnum.COURSE_CHAPTER.getType()));
+                //节
+                item.setSectionId(getNewId(item.getSectionId(), GoodsCopyEnum.COURSE_SECTION.getType()));
+                //试卷
+                item.setExamId(getNewId(item.getExamId(), GoodsCopyEnum.EXAM.getType()));
+            }
+            iTopCourseMenuExamService.updateBatchById(courseMenuExamList);
+        }
+
+        //19 课程模块
+        //20 课程模块业务关联
+        List<TopCourseModuleBusiness> moduleBusinessList = iTopCourseModuleBusinessService.list();
+        if (CollectionUtils.isNotEmpty(moduleBusinessList)){
+            for (TopCourseModuleBusiness item : moduleBusinessList) {
+                //教育类型
+                item.setEducationTypeId(getNewId(item.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+                //科目
+                item.setSubjectId(getNewId(item.getSubjectId(), GoodsCopyEnum.COURSE_SUBJECT.getType()));
+                //项目
+                item.setProjectId(getNewId(item.getProjectId(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+                //模块
+                item.setModuleId(getNewId(item.getModuleId(), GoodsCopyEnum.COURSE_MODULE.getType()));
+            }
+            iTopCourseModuleBusinessService.updateBatchById(moduleBusinessList);
+        }
+
+        //21 课程模块章关联
+        List<TopCourseModuleChapter> moduleChapterList = iTopCourseModuleChapterService.list();
+        if (CollectionUtils.isNotEmpty(moduleChapterList)){
+            for (TopCourseModuleChapter item : moduleChapterList) {
+                //模块
+                item.setModuleId(getNewId(item.getModuleId(), GoodsCopyEnum.COURSE_MODULE.getType()));
+                //模块
+                item.setChapterId(getNewId(item.getChapterId(), GoodsCopyEnum.COURSE_CHAPTER.getType()));
+            }
+            iTopCourseModuleChapterService.updateBatchById(moduleChapterList);
+        }
+
+        //22 课程项目
+        List<TopCourseProjectType> projectTypeList = iTopCourseProjectTypeService.list();
+        if (CollectionUtils.isNotEmpty(projectTypeList)){
+            for (TopCourseProjectType item : projectTypeList) {
+                //教育类型
+                if (ObjectUtils.isNotNull(item.getEducationId())){
+                    item.setEducationId(getNewId(item.getEducationId().longValue(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                }
+            }
+            iTopCourseProjectTypeService.updateBatchById(projectTypeList);
+        }
+
+        //23 课程节
+        //24 课程节业务关联
+        List<TopCourseSectionBusiness> sectionBusinessList = iTopCourseSectionBusinessService.list();
+        if (CollectionUtils.isNotEmpty(sectionBusinessList)){
+            for (TopCourseSectionBusiness item : sectionBusinessList) {
+                //教育类型
+                item.setEducationTypeId(getNewId(item.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+                //科目
+                item.setSubjectId(getNewId(item.getSubjectId(), GoodsCopyEnum.COURSE_SUBJECT.getType()));
+                //项目
+                item.setProjectId(getNewId(item.getProjectId(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+                //节
+                item.setSectionId(getNewId(item.getSectionId(), GoodsCopyEnum.COURSE_SECTION.getType()));
+            }
+            iTopCourseSectionBusinessService.updateBatchById(sectionBusinessList);
+        }
+
+        //25 课程节观看权限关联
+        List<TopCourseSectionWatchPer> sectionWatchPerList = iTopCourseSectionWatchPerService.list();
+        if (CollectionUtils.isNotEmpty(sectionWatchPerList)){
+            for (TopCourseSectionWatchPer item : sectionWatchPerList) {
+                //课程ID
+                item.setCourseId(getNewId(item.getCourseId(), GoodsCopyEnum.COURSE.getType()));
+                //模快
+                item.setModuleId(getNewId(item.getModuleId(), GoodsCopyEnum.COURSE_MODULE.getType()));
+                //章
+                item.setChapterId(getNewId(item.getChapterId(), GoodsCopyEnum.COURSE_CHAPTER.getType()));
+                //节
+                item.setSectionId(getNewId(item.getSectionId(), GoodsCopyEnum.COURSE_SECTION.getType()));
+                //商品
+                item.setGoodsId(getNewId(item.getGoodsId(), GoodsCopyEnum.GOODS.getType()));
+            }
+            iTopCourseSectionWatchPerService.updateBatchById(sectionWatchPerList);
+        }
+
+        //26 课程科目
+        //27 课程科目项目关联
+        List<TopCourseSubjectProject> subjectProjectList = iTopCourseSubjectProjectService.list();
+        if (CollectionUtils.isNotEmpty(subjectProjectList)){
+            for (TopCourseSubjectProject item : subjectProjectList) {
+                //科目
+                item.setSubjectId(getNewId(item.getSubjectId(), GoodsCopyEnum.COURSE_SUBJECT.getType()));
+                //项目
+                item.setProjectId(getNewId(item.getProjectId(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+            }
+            iTopCourseSubjectProjectService.updateBatchById(subjectProjectList);
+        }
+
+        //28 试卷
+        List<TopExam> examList = iTopExamService.list();
+        if (CollectionUtils.isNotEmpty(examList)){
+            for (TopExam item : examList) {
+                //试卷类型
+                item.setExamPaperId(getNewId(item.getExamPaperId(), GoodsCopyEnum.EXAM_PAPER.getType()));
+            }
+            iTopExamService.updateBatchById(examList);
+        }
+
+        //29 试卷类型
+        //30 试卷题目关联
+        List<TopExamQuestion> examQuestionList = iTopExamQuestionService.list();
+        if (CollectionUtils.isNotEmpty(examQuestionList)){
+            for (TopExamQuestion item : examQuestionList) {
+                //试卷
+                item.setExamId(getNewId(item.getExamId(), GoodsCopyEnum.EXAM.getType()));
+                //题目
+                item.setQuestionId(getNewId(item.getQuestionId(), GoodsCopyEnum.QUESTION.getType()));
+            }
+            iTopExamQuestionService.updateBatchById(examQuestionList);
+        }
+
+        //31 专业
+        //32 专业项目关联
+        List<TopMajorProject> majorProjectList = iTopMajorProjectService.list();
+        if (CollectionUtils.isNotEmpty(majorProjectList)){
+            for (TopMajorProject item : majorProjectList) {
+                //项目
+                item.setProjectId(getNewId(item.getProjectId(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+                //专业
+                item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.MAJOR.getType()));
+            }
+            iTopMajorProjectService.updateBatchById(majorProjectList);
+        }
+
+        //33 服务
+        //34 服务供应
+        List<TopPaySupply> paySupplyList = iTopPaySupplyService.list();
+        if (CollectionUtils.isNotEmpty(paySupplyList)){
+            for (TopPaySupply item : paySupplyList) {
+                //服务类型
+                item.setServerId(getNewId(item.getServerId(), GoodsCopyEnum.PAY_SERVE.getType()));
+            }
+            iTopPaySupplyService.updateBatchById(paySupplyList);
+        }
+
+        //35 课程流
+        List<TopCourseStreaming> streamingList = iTopCourseStreamingService.list();
+        if (CollectionUtils.isNotEmpty(streamingList)){
+            for (TopCourseStreaming item : streamingList) {
+                //本地保利威视频ID
+                item.setPolyvId(getNewId(item.getPolyvId(), GoodsCopyEnum.POLYV_VIDEO.getType()));
+            }
+            iTopCourseStreamingService.updateBatchById(streamingList);
+        }
+
+        //36 课程流业务层次
+        List<TopCourseStreamingBusiness> streamingBusinessList = iTopCourseStreamingBusinessService.list();
+        if (CollectionUtils.isNotEmpty(streamingBusinessList)){
+            for (TopCourseStreamingBusiness item : streamingBusinessList) {
+                //教育类型
+                item.setEducationTypeId(getNewId(item.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+                //流ID
+                item.setStreamingId(getNewId(item.getStreamingId(), GoodsCopyEnum.COURSE_STREAMING.getType()));
+                //项目
+                item.setProjectId(getNewId(item.getProjectId(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+            }
+            iTopCourseStreamingBusinessService.updateBatchById(streamingBusinessList);
+        }
+
+        //37 保利威资源类型
+        //38 保利威视频资源
+        //39 资料字段
+        //40 资料模板
+        List<TopProfileTp> profileTpList = iTopProfileTpService.list();
+        if (CollectionUtils.isNotEmpty(profileTpList)){
+            for (TopProfileTp item : profileTpList) {
+                //商品
+                item.setGoodsIds(getNewIds(item.getGoodsIds(), GoodsCopyEnum.GOODS.getType()));
+            }
+            iTopProfileTpService.updateBatchById(profileTpList);
+        }
+
+        //41 资料模板业务层次关联
+        List<TopProfileTpBusiness> profileTpBusinessList = iTopProfileTpBusinessService.list();
+        if (CollectionUtils.isNotEmpty(profileTpBusinessList)){
+            for (TopProfileTpBusiness item : profileTpBusinessList) {
+                //教育类型
+                item.setEducationTypeId(getNewId(item.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+                //资料模板ID
+                item.setProfileTpId(getNewId(item.getProfileTpId(), GoodsCopyEnum.PROFILE_TP.getType()));
+            }
+            iTopProfileTpBusinessService.updateBatchById(profileTpBusinessList);
+        }
+
+        //42 题目
+        //43 题目业务层次关联
+        List<TopQuestionBusiness> questionBusinessList = iTopQuestionBusinessService.list();
+        if (CollectionUtils.isNotEmpty(questionBusinessList)){
+            for (TopQuestionBusiness item : questionBusinessList) {
+                //教育类型
+                item.setEducationTypeId(getNewId(item.getEducationTypeId(), GoodsCopyEnum.COURSE_EDUCATION_TYPE.getType()));
+                //业务层次
+                item.setBusinessId(getNewId(item.getBusinessId(), GoodsCopyEnum.COURSE_BUSINESS.getType()));
+                //科目
+                item.setSubjectId(getNewId(item.getSubjectId(), GoodsCopyEnum.COURSE_SUBJECT.getType()));
+                //项目
+                item.setProjectId(getNewId(item.getProjectId(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+                if (ObjectUtils.isNotNull(item.getType())){
+                    if (item.getType() == 1){
+                        //题目
+                        item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.QUESTION.getType()));
+                    }else if (item.getType() == 2){
+                        //试卷
+                        item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.EXAM.getType()));
+                    }else if (item.getType() == 3){
+                        //章卷
+                        item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.QUESTION_CHAPTER.getType()));
+                    }else if (item.getType() == 4){
+                        //模块卷
+                        item.setMajorId(getNewId(item.getMajorId(), GoodsCopyEnum.QUESTION_MODULE.getType()));
+                    }
+
+                }
+            }
+            iTopQuestionBusinessService.updateBatchById(questionBusinessList);
+        }
+
+        //44 题目章
+        //45 题库章试卷关联
+        List<TopQuestionChapterExam> chapterExamList = iTopQuestionChapterExamService.list();
+        if (CollectionUtils.isNotEmpty(chapterExamList)){
+            for (TopQuestionChapterExam item : chapterExamList) {
+                //章卷
+                item.setChapterExamId(getNewId(item.getChapterExamId(), GoodsCopyEnum.QUESTION_CHAPTER.getType()));
+                //试卷
+                item.setExamId(getNewId(item.getExamId(), GoodsCopyEnum.EXAM.getType()));
+            }
+            iTopQuestionChapterExamService.updateBatchById(chapterExamList);
+        }
+
+        //46 题库模块
+        //47 题库模块章关联
+        List<TopQuestionModuleChapter> questionModuleChapterList = iTopQuestionModuleChapterService.list();
+        if (CollectionUtils.isNotEmpty(questionModuleChapterList)){
+            for (TopQuestionModuleChapter item : questionModuleChapterList) {
+                //章卷
+                item.setChapterExamId(getNewId(item.getChapterExamId(), GoodsCopyEnum.QUESTION_CHAPTER.getType()));
+                //模块卷
+                item.setModuleExamId(getNewId(item.getModuleExamId(), GoodsCopyEnum.QUESTION_MODULE.getType()));
+            }
+            iTopQuestionModuleChapterService.updateBatchById(questionModuleChapterList);
+        }
+
+        //48 证书
+        List<TopCertificateCommon> certificateCommonList = iTopCertificateCommonService.list();
+        if (CollectionUtils.isNotEmpty(certificateCommonList)){
+            for (TopCertificateCommon item : certificateCommonList) {
+                //证书类型
+                item.setCertificateTypeId(getNewId(item.getCertificateTypeId(), GoodsCopyEnum.CERTIFICATE.getType()));
+            }
+            iTopCertificateCommonService.updateBatchById(certificateCommonList);
+        }
+
+        //49 证书类型
+        //50 证书模板
+        List<TopCertificateTp> certificateTpList = iTopCertificateTpService.list();
+        if (CollectionUtils.isNotEmpty(certificateTpList)){
+            for (TopCertificateTp item : certificateTpList) {
+                //证书类型
+                item.setTypeId(getNewId(item.getTypeId(), GoodsCopyEnum.CERTIFICATE.getType()));
+                //证书
+                item.setCertificateId(getNewId(item.getCertificateId(), GoodsCopyEnum.CERTIFICATE_COMMON.getType()));
+            }
+            iTopCertificateTpService.updateBatchById(certificateTpList);
         }
 
-        //保存记录
-        iSysGoodsCopyRecordService.saveBatch(copyRecordList);
         return true;
     }
 
+    private Long getNewId(Long oldId, Integer type){
+        if (ObjectUtils.isNull(oldId) || oldId <= 0L){
+            return null;
+        }
+        try {
+            TopGoodsCopy record = iTopGoodsCopyService.getOne(new LambdaQueryWrapper<TopGoodsCopy>()
+                    .eq(TopGoodsCopy::getOldId, oldId)
+                    .eq(TopGoodsCopy::getType, type));
+            if (ObjectUtils.isEmpty(record)){
+//                throw new CustomException(String.format("新ID查找失败old:%s,type:%s",oldId,type));
+                return null;
+            }
+            return record.getNewId();
+        }catch (Exception e){
+//            throw new CustomException(String.format("(getone报错)新ID查找失败old:%s,type:%s",oldId,type));
+            return null;
+        }
+    }
+
+    private String getNewIds(String oldIds, Integer type){
+        if (StringUtils.isBlank(oldIds)){
+            return null;
+        }
+        List<Long> collect = Arrays.asList(oldIds.split(",")).stream().map(x -> Long.valueOf(x)).collect(Collectors.toList());
+        List<Long> ids = collect.stream().filter(x -> x > 0L).collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(ids)){
+            return null;
+        }
+        List<TopGoodsCopy> records = iTopGoodsCopyService.list(new LambdaQueryWrapper<TopGoodsCopy>()
+                .in(TopGoodsCopy::getOldId, ids)
+                .eq(TopGoodsCopy::getType, type));
+        if (ObjectUtils.isEmpty(records)){
+            throw new CustomException(String.format("新ID查找失败old:%s,type:%s",oldIds,type));
+        }
+        return records.stream().map(x -> x.getNewId().toString()).collect(Collectors.joining(","));
+    }
 
 }

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

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
-import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.top.goods.bo.TopProfileTpBusinessAddBo;
 import com.zhongzheng.modules.top.goods.bo.TopProfileTpBusinessEditBo;
 import com.zhongzheng.modules.top.goods.bo.TopProfileTpBusinessQueryBo;
@@ -68,8 +67,6 @@ public class TopProfileTpBusinessServiceImpl extends ServiceImpl<TopProfileTpBus
     public Boolean insertByAddBo(TopProfileTpBusinessAddBo bo) {
         TopProfileTpBusiness add = BeanUtil.toBean(bo, TopProfileTpBusiness.class);
         validEntityBeforeSave(add);
-        add.setCreateTime(DateUtils.getNowTime());
-        add.setUpdateTime(DateUtils.getNowTime());
         return this.save(add);
     }
 
@@ -77,7 +74,6 @@ public class TopProfileTpBusinessServiceImpl extends ServiceImpl<TopProfileTpBus
     public Boolean updateByEditBo(TopProfileTpBusinessEditBo bo) {
         TopProfileTpBusiness update = BeanUtil.toBean(bo, TopProfileTpBusiness.class);
         validEntityBeforeSave(update);
-        update.setUpdateTime(DateUtils.getNowTime());
         return this.updateById(update);
     }