|
|
@@ -17,6 +17,7 @@ import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; |
|
|
|
import com.ningdatech.pmapi.common.helper.RegionCacheHelper; |
|
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
|
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; |
|
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
|
import com.ningdatech.pmapi.common.util.BizUtils; |
|
|
|
import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
|
import com.ningdatech.pmapi.datascope.model.DataScopeDTO; |
|
|
@@ -74,6 +75,8 @@ public class ProjectLibManage { |
|
|
|
private final GenerateProjectCodeUtil generateProjectCodeUtil; |
|
|
|
private final IProjectInstService projectInstService; |
|
|
|
|
|
|
|
private final StateMachineUtils stateMachineUtils; |
|
|
|
|
|
|
|
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { |
|
|
|
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); |
|
|
|
Page<Project> page = projectService.page(req.page(), query); |
|
|
@@ -189,6 +192,7 @@ public class ProjectLibManage { |
|
|
|
projectService.save(project); |
|
|
|
}else{ |
|
|
|
//否则是重新提交的 新生成一个新版本的项目 |
|
|
|
projectDto.setSponsor(employeeCode); |
|
|
|
project = newProjectWithVersion(projectDto); |
|
|
|
} |
|
|
|
|
|
|
@@ -261,6 +265,36 @@ public class ProjectLibManage { |
|
|
|
project.setVersion(project.getVersion() + 1); |
|
|
|
BeanUtils.copyProperties(projecDto,project); |
|
|
|
project.setId(null); |
|
|
|
project.setCreateOn(LocalDateTime.now()); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
stateMachineUtils.pass(project); |
|
|
|
projectService.save(project); |
|
|
|
|
|
|
|
projectService.update(Wrappers.lambdaUpdate(Project.class) |
|
|
|
.set(Project::getNewest,Boolean.FALSE) |
|
|
|
.ne(Project::getId,project.getId()) |
|
|
|
.eq(Project::getProjectCode,project.getProjectCode())); |
|
|
|
|
|
|
|
return project; |
|
|
|
} |
|
|
|
|
|
|
|
public Project saveProjectWithVersionAndStatus(ProjectDTO projecDto,Integer stageCode,Integer statusCode){ |
|
|
|
Project project = projectService.getById(projecDto.getId()); |
|
|
|
|
|
|
|
VUtils.isTrue(Objects.isNull(project)) |
|
|
|
.throwMessage("项目不存在!"); |
|
|
|
|
|
|
|
project.setVersion(project.getVersion() + 1); |
|
|
|
BeanUtils.copyProperties(projecDto,project); |
|
|
|
project.setId(null); |
|
|
|
project.setCreateOn(LocalDateTime.now()); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
if(Objects.nonNull(stageCode)){ |
|
|
|
project.setStage(stageCode); |
|
|
|
} |
|
|
|
if(Objects.nonNull(statusCode)){ |
|
|
|
project.setStatus(statusCode); |
|
|
|
} |
|
|
|
projectService.save(project); |
|
|
|
|
|
|
|
projectService.update(Wrappers.lambdaUpdate(Project.class) |
|
|
@@ -338,6 +372,7 @@ public class ProjectLibManage { |
|
|
|
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); |
|
|
|
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); |
|
|
|
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param); |
|
|
|
query.eq(Project::getNewest,Boolean.TRUE); |
|
|
|
List<Project> projects = projectService.list(query); |
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|