Browse Source

项目名称查询

tags/24080901
WendyYang 10 months ago
parent
commit
d12e03b004
1 changed files with 33 additions and 30 deletions
  1. +33
    -30
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectHelper.java

+ 33
- 30
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectHelper.java View File

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

import cn.hutool.core.util.StrUtil;
import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -34,53 +35,55 @@ public class ProjectHelper {
public static LambdaQueryWrapper<Project> projectQuery(ProjectListReq req) {
LambdaQueryWrapper<Project> query = new LambdaQueryWrapper<>();
query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode())
.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId())
.like(req.getProjectName() != null, Project::getProjectName, req.getProjectName())
.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType())
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear())
.eq(req.getStage() != null, Project::getStage, req.getStage())
.eq(req.getStatus() != null, Project::getStatus, req.getStatus())
// 申报金额
.ge(req.getDeclareAmountMin() != null, Project::getDeclareAmount, req.getDeclareAmountMin())
.le(req.getDeclareAmountMax() != null, Project::getDeclareAmount, req.getDeclareAmountMax())
// 申报时间
.ge(req.getCreateOnMin() != null, Project::getCreateOn, req.getCreateOnMin())
.le(req.getCreateOnMax() != null, Project::getCreateOn, req.getCreateOnMax())
// 批复金额
.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin())
.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax())
.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId())
.like(StrUtil.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName())
.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType())
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear())
.eq(req.getStage() != null, Project::getStage, req.getStage())
.eq(req.getStatus() != null, Project::getStatus, req.getStatus())
// 申报金额
.ge(req.getDeclareAmountMin() != null, Project::getDeclareAmount, req.getDeclareAmountMin())
.le(req.getDeclareAmountMax() != null, Project::getDeclareAmount, req.getDeclareAmountMax())
// 申报时间
.ge(req.getCreateOnMin() != null, Project::getCreateOn, req.getCreateOnMin())
.le(req.getCreateOnMax() != null, Project::getCreateOn, req.getCreateOnMax())
// 批复金额
.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin())
.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax())

.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg())
.eq(req.getBuildOrgCode() != null, Project::getBuildOrgCode, req.getBuildOrgCode())
.like(StringUtils.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName())
.eq(req.getSuperOrgCode() != null, Project::getSuperOrgCode, req.getSuperOrgCode())
.eq(req.getIsTemporaryAugment() != null, Project::getIsTemporaryAugment, req.getIsTemporaryAugment())
//状态 阶段 list
.in(CollUtil.isNotEmpty(req.getStageList()),Project::getStage,req.getStageList())
.in(CollUtil.isNotEmpty(req.getStatusList()),Project::getStatus,req.getStatusList())
//实例code
.in(CollUtil.isNotEmpty(req.getInstCodes()),Project::getInstCode,req.getInstCodes())
//已添加评价计划的项目code
.notIn(CollUtil.isNotEmpty(req.getProjectCodes()),Project::getProjectCode,req.getProjectCodes())
.orderByDesc(Project::getUpdateOn);
.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg())
.eq(req.getBuildOrgCode() != null, Project::getBuildOrgCode, req.getBuildOrgCode())
.like(StringUtils.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName())
.eq(req.getSuperOrgCode() != null, Project::getSuperOrgCode, req.getSuperOrgCode())
.eq(req.getIsTemporaryAugment() != null, Project::getIsTemporaryAugment, req.getIsTemporaryAugment())
//状态 阶段 list
.in(CollUtil.isNotEmpty(req.getStageList()), Project::getStage, req.getStageList())
.in(CollUtil.isNotEmpty(req.getStatusList()), Project::getStatus, req.getStatusList())
//实例code
.in(CollUtil.isNotEmpty(req.getInstCodes()), Project::getInstCode, req.getInstCodes())
//已添加评价计划的项目code
.notIn(CollUtil.isNotEmpty(req.getProjectCodes()), Project::getProjectCode, req.getProjectCodes())
.orderByDesc(Project::getUpdateOn);
return query;
}

/**
* 转换VO
*
* @param app
* @return
*/
public static ProjectApplicationVO convertVOWithMap(ProjectApplication app,
Map<Long, List<ProjectCoreBusinessIndicators>> coreBizMap) {
Map<Long, List<ProjectCoreBusinessIndicators>> coreBizMap) {
ProjectApplicationVO appVo = new ProjectApplicationVO();
BeanUtils.copyProperties(app, appVo);
if(coreBizMap.containsKey(app.getId())){
if (coreBizMap.containsKey(app.getId())) {
List<ProjectCoreBusinessIndicators> projectCoreBusinessIndicators = coreBizMap.get(app.getId());
appVo.setCoreBusinessList(projectCoreBusinessIndicators);
}
return appVo;
}

public static ProjectApplicationVO convertVO(ProjectApplication app) {
ProjectApplicationVO appVo = new ProjectApplicationVO();
BeanUtils.copyProperties(app, appVo);


Loading…
Cancel
Save