Browse Source

modify:

1. 各阶段项目列表修改;
tags/24082301
WendyYang 4 months ago
parent
commit
6d677014b7
5 changed files with 44 additions and 54 deletions
  1. +19
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectManageUtil.java
  2. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/user/util/LoginUserUtil.java
  3. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/controller/WorkbenchController.java
  4. +20
    -44
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java
  5. +0
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/model/WorkbenchProjectLibReq.java

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

@@ -1,20 +1,20 @@
package com.hz.pm.api.projectlib.helper;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators;
import com.hz.pm.api.user.helper.MhUnitCache;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hz.pm.api.common.model.constant.ExistsSqlConst;
import com.hz.pm.api.common.statemachine.event.AbstractStateChangeEvent;
import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators;
import com.hz.pm.api.projectlib.model.entity.Project;
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 cn.hutool.core.collection.CollUtil;
import com.hz.pm.api.user.helper.MhUnitCache;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.Map;
@@ -106,6 +106,18 @@ public class ProjectManageUtil {
return query;
}

public static void projectQueryByProjectStatusChange(LambdaQueryWrapper<Project> query,
AbstractStateChangeEvent event) {
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE +
" and npsc.event = {0}", event);
}

public static void projectQueryByPurchaseStatusChange(LambdaQueryWrapper<Project> query,
AbstractStateChangeEvent event) {
query.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE_STATUS_CHANGE +
" and npsc.event ={0}", event.name());
}

/**
* 转换VO
*


+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/user/util/LoginUserUtil.java View File

@@ -34,4 +34,8 @@ public class LoginUserUtil extends AbstractLoginUserUtil {
return detail.getUserRoleList().stream().anyMatch(w -> RoleEnum.EXPERT.eq(w.getCode()));
}

public static Long getMhUnitId() {
return loginUserDetail().getMhUnitId();
}

}

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/workbench/controller/WorkbenchController.java View File

@@ -65,7 +65,7 @@ public class WorkbenchController {
}

@GetMapping("/pageProjectLib")
@ApiOperation("项目列表")
@ApiOperation("各阶段项目列表")
public PageVo<ProjectLibListItemVO> pageProjectLib(WorkbenchProjectLibReq req) {
return workbenchManage.pageProjectLib(req);
}


+ 20
- 44
hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java View File

@@ -71,6 +71,7 @@ import java.util.function.BiFunction;
import java.util.function.Predicate;
import java.util.stream.Collectors;

import static com.hz.pm.api.projectlib.helper.ProjectManageUtil.projectQueryByProjectStatusChange;
import static com.hz.pm.api.workbench.model.vo.ProjectProcessStatVO.TenderAdaptFinishStatVO;

/**
@@ -514,12 +515,7 @@ public class WorkbenchManage {

public PageVo<ProjectLibListItemVO> pageProjectLib(WorkbenchProjectLibReq req) {
Assert.notNull(req.getProcessNode(), "节点不能为空");
Long unitId;
if (req.getUnitId() != null) {
unitId = req.getUnitId();
} else {
unitId = LoginUserUtil.loginUserDetail().getMhUnitId();
}
Long unitId = Optional.ofNullable(req.getUnitId()).orElseGet(LoginUserUtil::getMhUnitId);
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(unitId);
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear())
@@ -533,7 +529,7 @@ public class WorkbenchManage {
.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin())
.ge(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax())
.eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip())
.eq(Project::getStage, ProjectStatus.STOPPED.getCode())
.ne(Project::getStage, ProjectStatus.STOPPED.getCode())
.eq(Project::getNewest, Boolean.TRUE)
.orderByDesc(Project::getUpdateOn);
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT);
@@ -568,44 +564,24 @@ public class WorkbenchManage {
if (page.getTotal() == 0) {
return PageVo.empty();
}
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectLibListItemVO item = new ProjectLibListItemVO();
item.setId(w.getId());
item.setProjectName(w.getProjectName());
// 项目申报
item.setFromType("1");
item.setProjectCode(w.getProjectCode());
item.setArea(w.getArea());
item.setAreaCode(w.getAreaCode());
item.setCreateOn(w.getCreateOn());
item.setDeclaredAmount(w.getDeclareAmount());
item.setStage(w.getStage());
item.setStatus(w.getStatus());
item.setProjectType(w.getProjectType());
item.setProjectYear(w.getProjectYear());
item.setBuildOrg(w.getBuildOrgName());
item.setBizDomain(w.getBizDomain());
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
item.setApprovedAmount(w.getApprovalAmount());
item.setReviewAmount(w.getReviewAmount());
item.setPrePlanProjectId(w.getPrePlanProjectId());
return item;
});
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(),
w -> ProjectLibListItemVO.builder()
.id(w.getId())
.projectName(w.getProjectName())
.projectCode(w.getProjectCode())
.projectType(w.getProjectType())
.projectYear(w.getProjectYear())
.buildOrg(w.getBuildOrgName())
.buildOrgCode(w.getBuildOrgCode())
.bizDomain(w.getBizDomain())
.approvedAmount(w.getApprovalAmount())
.reviewAmount(w.getReviewAmount())
.declaredAmount(w.getDeclareAmount())
.createOn(w.getCreateOn())
.stage(w.getStage())
.status(w.getStatus())
.build());
return PageVo.of(records, page.getTotal());
}

private static void projectQueryByProjectStatusChange
(LambdaQueryWrapper<Project> query, AbstractStateChangeEvent event) {
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE +
" and npsc.event = {0}", event);
}

private static void projectQueryByPurchaseStatusChange
(LambdaQueryWrapper<Project> query, AbstractStateChangeEvent event) {
query.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE_STATUS_CHANGE +
" and npsc.event ={0}", event.name());
}

}

+ 0
- 2
hz-pm-api/src/main/java/com/hz/pm/api/workbench/model/WorkbenchProjectLibReq.java View File

@@ -7,8 +7,6 @@ import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

import static com.hz.pm.api.projectlib.handle.AbstractProcessHandle.ProcessNode;

/**
* <p>
* WorkbenchProjectLibReq


Loading…
Cancel
Save