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 3826cb4..bf0d4c0 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 @@ -276,9 +276,8 @@ public class ProjectLibManage { ? Boolean.TRUE : Boolean.FALSE; //采取批量删除 批量添加的方式 projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectId,project.getId())); - projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectCode,project.getProjectCode())); + .eq(ProjectApplication::getProjectCode,project.getProjectCode()) + .eq(ProjectApplication::getProjectVersion,project.getVersion())); if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { Project finalProject = project; List applications = projectDto.getApplicationList().stream().map(application -> { @@ -289,6 +288,7 @@ public class ProjectLibManage { projectApplication.setProjectCode(finalProject.getProjectCode()); projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); + projectApplication.setProjectVersion(finalProject.getVersion()); return projectApplication; }).collect(Collectors.toList()); projectApplicationService.saveOrUpdateBatch(applications); @@ -402,9 +402,8 @@ public class ProjectLibManage { ? Boolean.TRUE : Boolean.FALSE; //采取批量删除 批量添加的方式 projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectId,project.getId())); - projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectCode,project.getProjectCode())); + .eq(ProjectApplication::getProjectCode,project.getProjectCode()) + .eq(ProjectApplication::getProjectVersion,project.getVersion())); if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { Project finalProject = project; List applications = projectDto.getApplicationList().stream().map(application -> { @@ -413,6 +412,7 @@ public class ProjectLibManage { projectApplication.setId(null); projectApplication.setProjectId(finalProject.getId()); projectApplication.setProjectCode(finalProject.getProjectCode()); + projectApplication.setProjectVersion(finalProject.getVersion()); return projectApplication; }).collect(Collectors.toList()); projectApplicationService.saveOrUpdateBatch(applications);