|
@@ -1239,6 +1239,22 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
}else {
|
|
|
supply.setSupplyId(null);
|
|
|
supply.setTenantId(newTenantId);
|
|
|
+ //服务类型ID
|
|
|
+ if (ObjectUtil.isNotNull(supply.getServerId())){
|
|
|
+ PayServe payServe = iPayServeService.getById(supply.getServerId());
|
|
|
+ if (ObjectUtils.isNotNull(payServe)){
|
|
|
+ PayServe newPayServer = iPayServeService.getPayServeByTenant(payServe.getServeName(),newTenantId);
|
|
|
+ if (ObjectUtils.isNotNull(newPayServer)){
|
|
|
+ supply.setServerId(newPayServer.getServeId());
|
|
|
+ }else {
|
|
|
+ //新增服务
|
|
|
+ payServe.setServeId(null);
|
|
|
+ payServe.setTenantId(newTenantId);
|
|
|
+ iPayServeService.save(payServe);
|
|
|
+ supply.setServerId(newPayServer.getServeId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
iPaySupplyService.save(supply);
|
|
|
goods.setSupplyId(supply.getSupplyId());
|
|
|
}
|
|
@@ -1273,6 +1289,33 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
}else {
|
|
|
business.setId(null);
|
|
|
business.setTenantId(newTenantId);
|
|
|
+ //项目ID
|
|
|
+ if (ObjectUtils.isNotNull(business.getProjectId())){
|
|
|
+ CourseProjectType projectType = iCourseProjectTypeService.getById(business.getProjectId());
|
|
|
+ if (ObjectUtil.isNotNull(projectType)){
|
|
|
+ CourseProjectType newProject = iCourseProjectTypeService.getProjectByTenant(projectType.getEncoder(), newTenantId);
|
|
|
+ if (ObjectUtil.isNotNull(newProject)){
|
|
|
+ business.setProjectId(newProject.getId().intValue());
|
|
|
+ }else {
|
|
|
+ //新增项目
|
|
|
+ //判断项目的教育类型是否存在
|
|
|
+ CourseEducationType educationType = iCourseEducationTypeService.getById(projectType.getEducationId());
|
|
|
+ CourseEducationType newEducationType = iCourseEducationTypeService.getEducationTypeBytenant(educationType.getEncoder(), newTenantId);
|
|
|
+ if (ObjectUtil.isNotNull(newEducationType)){
|
|
|
+ projectType.setEducationId(newEducationType.getId().intValue());
|
|
|
+ }else {
|
|
|
+ educationType.setId(null);
|
|
|
+ educationType.setTenantId(newTenantId);
|
|
|
+ iCourseEducationTypeService.save(educationType);
|
|
|
+ projectType.setEducationId(educationType.getId().intValue());
|
|
|
+ }
|
|
|
+ projectType.setId(null);
|
|
|
+ projectType.setTenantId(newTenantId);
|
|
|
+ iCourseProjectTypeService.save(projectType);
|
|
|
+ business.setProjectId(projectType.getId().intValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
iCourseBusinessService.save(business);
|
|
|
goods.setBusinessId(business.getId());
|
|
|
}
|
|
@@ -1322,6 +1365,17 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
}else {
|
|
|
project.setId(null);
|
|
|
project.setTenantId(newTenantId);
|
|
|
+ //判断项目的教育类型是否存在
|
|
|
+ CourseEducationType educationType = iCourseEducationTypeService.getById(project.getEducationId());
|
|
|
+ CourseEducationType newEducationType = iCourseEducationTypeService.getEducationTypeBytenant(educationType.getEncoder(), newTenantId);
|
|
|
+ if (ObjectUtil.isNotNull(newEducationType)){
|
|
|
+ project.setEducationId(newEducationType.getId().intValue());
|
|
|
+ }else {
|
|
|
+ educationType.setId(null);
|
|
|
+ educationType.setTenantId(newTenantId);
|
|
|
+ iCourseEducationTypeService.save(educationType);
|
|
|
+ project.setEducationId(educationType.getId().intValue());
|
|
|
+ }
|
|
|
iCourseProjectTypeService.save(project);
|
|
|
goods.setProjectId(project.getId().intValue());
|
|
|
}
|
|
@@ -1343,6 +1397,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
return false;
|
|
|
}
|