|
|
@@ -1,5 +1,7 @@ |
|
|
|
package com.ningdatech.pmapi.projectlib.manage; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
@@ -260,13 +262,15 @@ public class ProjectLibManage { |
|
|
|
* 新增一个新的项目 新的版本号 |
|
|
|
*/ |
|
|
|
public Project newProjectWithVersion(ProjectDTO projecDto){ |
|
|
|
Project project = projectService.getById(projecDto.getId()); |
|
|
|
|
|
|
|
VUtils.isTrue(Objects.isNull(project)) |
|
|
|
Project oldProject = projectService.getById(projecDto.getId()); |
|
|
|
Project project = new Project(); |
|
|
|
VUtils.isTrue(Objects.isNull(oldProject)) |
|
|
|
.throwMessage("项目不存在!"); |
|
|
|
|
|
|
|
project.setVersion(project.getVersion() + 1); |
|
|
|
BeanUtils.copyProperties(projecDto,project); |
|
|
|
BeanUtil.copyProperties(oldProject,project, CopyOptions.create() |
|
|
|
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); |
|
|
|
BeanUtil.copyProperties(projecDto,project, CopyOptions.create() |
|
|
|
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); |
|
|
|
project.setVersion(oldProject.getVersion() + 1); |
|
|
|
project.setId(null); |
|
|
|
project.setCreateOn(LocalDateTime.now()); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
@@ -282,13 +286,15 @@ public class ProjectLibManage { |
|
|
|
} |
|
|
|
|
|
|
|
public Project saveProjectWithVersionAndStatus(ProjectDTO projecDto,Integer stageCode,Integer statusCode){ |
|
|
|
Project project = projectService.getById(projecDto.getId()); |
|
|
|
|
|
|
|
VUtils.isTrue(Objects.isNull(project)) |
|
|
|
Project oldProject = projectService.getById(projecDto.getId()); |
|
|
|
Project project = new Project(); |
|
|
|
VUtils.isTrue(Objects.isNull(oldProject)) |
|
|
|
.throwMessage("项目不存在!"); |
|
|
|
|
|
|
|
project.setVersion(project.getVersion() + 1); |
|
|
|
BeanUtils.copyProperties(projecDto,project); |
|
|
|
BeanUtil.copyProperties(oldProject,project, CopyOptions.create() |
|
|
|
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); |
|
|
|
BeanUtil.copyProperties(projecDto,project, CopyOptions.create() |
|
|
|
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); |
|
|
|
project.setVersion(oldProject.getVersion() + 1); |
|
|
|
project.setId(null); |
|
|
|
project.setCreateOn(LocalDateTime.now()); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
@@ -448,4 +454,8 @@ public class ProjectLibManage { |
|
|
|
} |
|
|
|
return user; |
|
|
|
} |
|
|
|
|
|
|
|
private void copyProperties(ProjectDTO projecDto, Project project) { |
|
|
|
|
|
|
|
} |
|
|
|
} |