From fff6cbcd798c47da78d39cd23f0e991f9bb843ed Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 20 Apr 2023 17:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=81=E7=BA=A7=E8=81=94=E5=AE=A1=20?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; }