Browse Source

项目库详情修改

tags/24080901
CMM 1 year ago
parent
commit
947a214b53
4 changed files with 21 additions and 42 deletions
  1. +4
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  2. +9
    -31
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  3. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java
  4. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 4
- 11
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java View File

@@ -130,7 +130,7 @@ public class ConstructionPlanManage {
projectInfo.setSuperOrg(user.getEmpPosUnitName());
}

//如果是重新提交的话 判断下 项目是否存在
//如果是撤回重新提交的话 判断下 项目是否存在
if(Objects.nonNull(projectInfo.getId())){
//新申报的项目不允许带项目id
projectInfo.setId(null);
@@ -175,14 +175,7 @@ public class ConstructionPlanManage {
log.info("建设方案项目申报成功 【{}】", instanceId);

// 保存建设项目相关
Project buildProject;
if (dto.getRestart()){
// 如果是重新提交,不用生成新版本
modifyProject(oldProject, instanceId, oldProject.getConstructionPlanFile());
buildProject = oldProject;
}else {
buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject);
}
Project buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject);

//发送给第一个审批人消息
noticeManage.sendFirtUser(buildProject,model.getFormName(),instanceId,
@@ -192,7 +185,7 @@ public class ConstructionPlanManage {
}

/**
* 重新建设方案
* 驳回 重新提交建设方案
*
* @param dto
* @return
@@ -217,7 +210,7 @@ public class ConstructionPlanManage {
}

/**
* 提交预审项目 时 更新信息
* 提交建设方案项目 时 更新信息
*
* @param project
* @param instanceId


+ 9
- 31
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -370,6 +370,7 @@ public class ProjectLibManage {
projectApplication.setProjectCode(finalProject.getProjectCode());
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode());
projectApplication.setBuildOrgName(finalProject.getBuildOrgName());
projectApplication.setIsConstruct(Boolean.TRUE);
return projectApplication;
}).collect(Collectors.toList());
projectApplicationService.saveBatch(applications);
@@ -492,6 +493,7 @@ public class ProjectLibManage {
app.setProjectId(project.getId());
app.setBuildOrgName(project.getBuildOrgName());
app.setBuildOrgCode(project.getBuildOrgCode());
app.setIsConstruct(Boolean.TRUE);
return app;
})
.collect(Collectors.toList());
@@ -673,28 +675,10 @@ public class ProjectLibManage {
vo.buildDynamicForm(projectInfo.getDynamicForm());
// 查询应用
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()));

// 查出同一项目编号,建设方案申报前的项目ID
List<Long> projectIdList = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectCode, projectInfo.getProjectCode())
.eq(Project::getIsConstruct, Boolean.FALSE)).stream()
.map(Project::getId).collect(Collectors.toList());
List<ProjectApplication> applicationList;
// 如果是建设方案申报后的项目,过滤掉初步方案的应用信息
if (Boolean.TRUE.equals(projectInfo.getIsConstruct())){
applicationList = applications.stream()
.filter(a -> !projectIdList.contains(a.getProjectCode()))
.collect(Collectors.toList());
}
// 如果不是,展示初步方案的应用信息
else {
applicationList = applications.stream()
.filter(a -> projectIdList.contains(a.getProjectCode()))
.collect(Collectors.toList());
}
.eq(ProjectApplication::getProjectCode, vo.getProjectCode())
.eq(ProjectApplication::getIsConstruct,projectInfo.getIsConstruct()));

Optional.ofNullable(applicationList).ifPresent(apps ->
Optional.ofNullable(applications).ifPresent(apps ->
vo.setProjectApplications(CollUtils.convert(apps,
ProjectHelper::convertVO)
));
@@ -781,20 +765,14 @@ public class ProjectLibManage {
vo.buildDynamicForm(projectInfo.getDynamicForm());
// 查询应用
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()));
// 查出同一项目编号,建设方案申报前的项目ID
List<Long> projectIdList = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectCode, projectInfo.getProjectCode())
.eq(Project::getIsConstruct, Boolean.FALSE)).stream()
.map(Project::getId).collect(Collectors.toList());
List<ProjectApplication> applicationList = applications.stream()
.filter(a -> projectIdList.contains(a.getProjectId()))
.collect(Collectors.toList());
.eq(ProjectApplication::getProjectCode, vo.getProjectCode())
.eq(ProjectApplication::getIsConstruct,Boolean.FALSE));

Optional.ofNullable(applicationList).ifPresent(apps ->
Optional.ofNullable(applications).ifPresent(apps ->
vo.setProjectApplications(CollUtils.convert(apps,
ProjectHelper::convertVO)
));

return vo;
}



+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java View File

@@ -181,4 +181,7 @@ public class ProjectApplication implements Serializable {

@ApiModelProperty("项目编码")
private String projectCode;

@ApiModelProperty("是否为建设方案申报")
private Boolean isConstruct;
}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -1107,6 +1107,11 @@ public class TodoCenterManage {
projectApplication.setId(null);
projectApplication.setProjectId(project.getId());
projectApplication.setProjectCode(project.getProjectCode());
if (!InstTypeEnum.UNIT_INNER_AUDIT.getCode().equals(instType) &&
!InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType) &&
!InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) {
projectApplication.setIsConstruct(Boolean.TRUE);
}
return projectApplication;
}).collect(Collectors.toList());
projectApplicationService.saveBatch(applications);


Loading…
Cancel
Save