diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index c2c8568..a3b833d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -28,6 +28,7 @@ import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.handle.ProcessExecuteChainHandle; import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; +import com.ningdatech.pmapi.projectlib.model.dto.ProjectApplicationDTO; import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; @@ -312,20 +313,19 @@ public class ProjectLibManage { .eq(Project::getProjectCode,project.getProjectCode())); //继承它的app - List apps = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectId, oldProject.getId())); - if(CollUtil.isNotEmpty(apps)){ - List newApps = apps.stream() + List applicationList = projecDto.getApplicationList(); + if(CollUtil.isNotEmpty(applicationList)){ + List apps = applicationList.stream() .map(a -> { - a.setProjectId(project.getId()); - return a; + ProjectApplication app = BeanUtil.copyProperties(a,ProjectApplication.class); + app.setProjectId(project.getId()); + return app; }) .collect(Collectors.toList()); - projectApplicationService.saveBatch(newApps); + projectApplicationService.saveBatch(apps); } } - return project; }