瀏覽代碼

modify:

1. 适配改造列表增加查询参数;
tags/24082201
WendyYang 2 月之前
父節點
當前提交
faf71f8424
共有 3 個檔案被更改,包括 43 行新增5 行删除
  1. +26
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  2. +16
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/PurchaseAdaptionListReq.java
  3. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/impl/PurchaseServiceImpl.java

+ 26
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java 查看文件

@@ -54,6 +54,7 @@ import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.projectlib.service.IPurchaseStatusChangeService;
import com.hz.pm.api.sys.manage.ProcessModelManage;
import com.hz.pm.api.user.helper.MhUnitCache;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
@@ -101,6 +102,7 @@ import java.util.stream.Stream;
@RequiredArgsConstructor
public class PurchaseManage {

private final MhUnitCache mhUnitCache;
private final IProjectService projectService;
private final UserInfoHelper userInfoHelper;
private final IContractService contractService;
@@ -471,10 +473,6 @@ public class PurchaseManage {

private PageVo<PurchaseAdaptionListVO> queryData(PurchaseAdaptionListReq req) {
LambdaQueryWrapper<Purchase> query = Wrappers.lambdaQuery(Purchase.class)
.like(StrUtil.isNotBlank(req.getBidName()), Purchase::getBidName, req.getBidName())
.le(req.getCreateOnMax() != null, Purchase::getCreateOn, req.getCreateOnMax())
.ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin())
.eq(req.getStatus() != null, Purchase::getStatus, req.getStatus())
.eq(Purchase::getBidType, BidTypeEnum.BUILD_APP.getCode())
.notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT
+ "and np.stage = {0}", ProjectStatus.STOPPED.getCode())
@@ -483,6 +481,17 @@ public class PurchaseManage {
if (!purchaseService.buildPurchaseQueryPermission(query, user)) {
return PageVo.empty();
}
if (req.hasProjectQuery()) {
List<Long> projectIds = filterProjectIdsForPurchase(req);
if (projectIds.isEmpty()) {
return PageVo.empty();
}
query.in(Purchase::getProjectId, projectIds);
}
query.like(StrUtil.isNotBlank(req.getBidName()), Purchase::getBidName, req.getBidName())
.le(req.getCreateOnMax() != null, Purchase::getCreateOn, req.getCreateOnMax())
.ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin())
.eq(req.getStatus() != null, Purchase::getStatus, req.getStatus());
Page<Purchase> page = purchaseService.page(req.page(), query);
if (page.getTotal() == 0) {
return PageVo.empty();
@@ -514,6 +523,19 @@ public class PurchaseManage {
return PageVo.of(data, page.getTotal());
}

private List<Long> filterProjectIdsForPurchase(PurchaseAdaptionListReq req) {
LambdaQueryWrapper<Project> projQuery = Wrappers.lambdaQuery(Project.class)
.select(Project::getId)
.ne(Project::getStage, ProjectStatus.STOPPED.getCode())
.eq(Project::getNewest, Boolean.TRUE)
.like(StrUtil.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName())
.like(StrUtil.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName())
.in(req.getBuildOrgCode() != null, Project::getBuildOrgCode,
mhUnitCache.getViewChildIdsRecursion(req.getBuildOrgCode()));
List<Project> projects = projectService.list(projQuery);
return CollUtils.fieldList(projects, Project::getId);
}


public PageVo<PurchaseAdaptionListVO> adaptList(PurchaseAdaptionListReq req) {
return queryData(req);


+ 16
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/PurchaseAdaptionListReq.java 查看文件

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectdeclared.model.req;

import cn.hutool.core.util.StrUtil;
import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -22,6 +23,15 @@ public class PurchaseAdaptionListReq extends PagePo {

private String bidName;

@ApiModelProperty("建设单位")
private String buildOrgName;

@ApiModelProperty("项目名称")
private String projectName;

@ApiModelProperty("建设单位编码")
private Long buildOrgCode;

@ApiModelProperty("标段状态")
private Integer status;

@@ -33,4 +43,10 @@ public class PurchaseAdaptionListReq extends PagePo {

private Boolean display;

public boolean hasProjectQuery() {
return StrUtil.isNotBlank(this.buildOrgName)
|| StrUtil.isNotBlank(this.projectName)
|| this.buildOrgCode != null;
}

}

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/impl/PurchaseServiceImpl.java 查看文件

@@ -134,7 +134,7 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
log.warn("没有取到权限信息 当前查询 没有权限条件");
queryState = false;
} else {
final String existsSql = "select 1 from nd_project np where np.id = nd_purchase.project_id and np.build_org_code";
final String existsSql = ExistsSqlConst.PURCHASE_EXISTS_PROJECT + " and np.build_org_code";
switch (datascope.get().getRole()) {
case NORMAL_MEMBER:
//普通用户 只能看到自己单位去申报的


Loading…
取消
儲存