Browse Source

modify:

1. 项目名称校验修改;
tags/24102401
WendyYang 1 month ago
parent
commit
74df8e3fca
8 changed files with 30 additions and 7 deletions
  1. +4
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectHelper.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  3. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectManageUtil.java
  4. +4
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AmountApprovalManage.java
  5. +3
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  6. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java
  7. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectLibListItemVO.java
  8. +9
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectService.java

+ 4
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectHelper.java View File

@@ -3,6 +3,7 @@ package com.hz.pm.api.projectdeclared.manage;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -61,11 +62,13 @@ public class DeclaredProjectHelper {
*/
public void projectNameDuplicateCheck(ProjectDTO project) {
String projectCode = project.getProjectCode();
String hisProjectCode = project.getHisProjectCode();
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectName, project.getProjectName())
.eq(Project::getNewest, Boolean.TRUE)
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode())
.ne(Objects.nonNull(projectCode), Project::getProjectCode, projectCode)
.ne(StrUtil.isNotBlank(projectCode), Project::getProjectCode, projectCode)
.eq(StrUtil.isNotBlank(hisProjectCode), Project::getHisProjectCode, hisProjectCode)
.last(BizConst.LIMIT_1);
if (projectService.count(query) > 0) {
throw BizException.wrap("项目名【%s】已存在", project.getProjectName());


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java View File

@@ -533,7 +533,7 @@ public class PurchaseManage {
project.setStage(ProjectStatus.ON_PURCHASING.getStage());
projectService.updateById(project);
Wrapper<ProjectStatusChange> query = Wrappers.lambdaQuery(ProjectStatusChange.class)
.eq(ProjectStatusChange::getProjectId, project.getProjectCode())
.eq(ProjectStatusChange::getProjectCode, project.getProjectCode())
.in(ProjectStatusChange::getEvent,
ProjectStateChangeEvent.SUBMIT_PURCHASE_CONTRACT_RECORD,
ProjectStateChangeEvent.SUBMIT_PURCHASE_ORG_CONFIRM,


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectManageUtil.java View File

@@ -14,7 +14,6 @@ import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO;
import com.hz.pm.api.user.helper.MhUnitCache;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;

import java.util.List;
@@ -102,7 +101,7 @@ public class ProjectManageUtil {
query.select(Project::getId, Project::getStage, Project::getStatus, Project::getProjectCode,
Project::getBuildOrgCode, Project::getBuildOrgName, Project::getApprovalAmount, Project::getApprovalDate,
Project::getCreateOn, Project::getProjectName, Project::getProjectYear, Project::getIsMajorProject,
Project::getDeclareAmount, Project::getReviewAmount, Project::getUnitStrip);
Project::getDeclareAmount, Project::getReviewAmount, Project::getUnitStrip, Project::getConstructionPlanSealFile);
}

/**
@@ -151,4 +150,5 @@ public class ProjectManageUtil {
BeanUtils.copyProperties(app, appVo);
return appVo;
}

}

+ 4
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AmountApprovalManage.java View File

@@ -108,7 +108,8 @@ public class AmountApprovalManage {
}
ProjectManageUtil.projectQuery(query, req);
ProjectManageUtil.projectBaseQuery(query);
query.eq(Project::getNewest, Boolean.TRUE)
query.eq(Project::getAnnualPlanOpened, Boolean.TRUE)
.eq(Project::getNewest, Boolean.TRUE)
.ne(Project::getStage, ProjectStatus.STOPPED.getCode())
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode());
buildAmountApprovalFilter(req.getIsAmountApproval(), query);
@@ -158,7 +159,8 @@ public class AmountApprovalManage {
}
ProjectManageUtil.projectQuery(query, req);
ProjectManageUtil.projectBaseQuery(query);
query.eq(Project::getNewest, Boolean.TRUE)
query.eq(Project::getAnnualPlanOpened, Boolean.TRUE)
.eq(Project::getNewest, Boolean.TRUE)
.ne(Project::getStage, ProjectStatus.STOPPED.getCode())
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode());
buildAmountApprovalFilter(req.getIsAmountApproval(), query);


+ 3
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java View File

@@ -715,15 +715,17 @@ public class ProjectLibManage {
String projectCode = project.getProjectCode();
if (ProjectStatus.CHANGE_APPLY_PASSED.eq(project.getStatus())) {
Wrapper<Project> newProjectQuery = Wrappers.lambdaQuery(Project.class)
.select(Project::getId, Project::getProjectCode)
.select(Project::getId, Project::getProjectCode, Project::getProjectName)
.eq(Project::getHisProjectCode, project.getHisProjectCode())
.eq(Project::getNewest, Boolean.TRUE)
.last(BizConst.LIMIT_1);
Project newProject = projectService.getOne(newProjectQuery);
retProjectDetail.setNewProjectId(newProject.getId());
retProjectDetail.setNewProjectName(newProject.getProjectName());
retProjectDetail.setNewProjectCode(newProject.getProjectCode());
}
if (StrUtil.isNotBlank(project.getHisProjectCode())) {
retProjectDetail.setHisProjectName(projectService.getProjectName(project.getHisProjectCode()));
retProjectDetail.setHisProjectId(ProjectIdCodeCacheUtil.newest(project.getHisProjectCode()));
}
if (DecimalUtil.noNullAndGtZero(project.getApprovalAmount())) {


+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java View File

@@ -601,11 +601,15 @@ public class ProjectDetailVO {
@ApiModelProperty("历史项目编码")
private String hisProjectCode;

private String hisProjectName;

@ApiModelProperty("历史项目id")
private Long hisProjectId;

private String newProjectCode;

private String newProjectName;

private Long newProjectId;

}

+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectLibListItemVO.java View File

@@ -185,4 +185,7 @@ public class ProjectLibListItemVO {
@ApiModelProperty("会议ID")
private Long meetingId;

@ApiModelProperty("建设方案盖章件")
private String constructionPlanSealFile;

}

+ 9
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectService.java View File

@@ -102,4 +102,13 @@ public interface IProjectService extends IService<Project> {

Page<ProjectChangeListDTO> pageChangeList(Wrapper<Project> wrapper, Page<ProjectChangeListDTO> page);

default String getProjectName(String projectCode){
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.select(Project::getProjectName)
.eq(Project::getProjectCode, projectCode)
.eq(Project::getNewest, Boolean.TRUE)
.last(BizConst.LIMIT_1);
return Optional.ofNullable(getOne(query)).flatMap(p -> Optional.ofNullable(p.getProjectName())).orElse(null);
}

}

Loading…
Cancel
Save