From 0cb5d03a6188515f1c3c596409958f9c24605b58 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 30 Aug 2024 17:05:23 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E6=8B=9B=E6=A0=87=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E3=80=81=E9=A1=B9=E7=9B=AE=E7=AB=8B=E9=A1=B9=E3=80=81?= =?UTF-8?q?=E9=80=82=E9=85=8D=E6=94=B9=E9=80=A0=E3=80=81=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=BA=93=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/projectdeclared/controller/PurchaseController.java | 4 ++-- .../com/hz/pm/api/projectdeclared/manage/PurchaseManage.java | 12 +++++++++++- .../java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml | 12 ++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java index 0b736ab..0c369d0 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java @@ -88,8 +88,8 @@ public class PurchaseController { @GetMapping("/adaptionProgressStatistics") @ApiOperation("获取采购进度统计") - public AdaptionProgressStatVO adaptionProgressStatistics() { - return purchaseManage.adaptionProgressStatistics(); + public AdaptionProgressStatVO adaptionProgressStatistics(PurchaseAdaptionListReq req) { + return purchaseManage.adaptionProgressStatistics(req); } @GetMapping("/pageAdaption") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java index 2b19e00..16d7471 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java @@ -540,7 +540,7 @@ public class PurchaseManage { projectService.updateById(project); } - public AdaptionProgressStatVO adaptionProgressStatistics() { + public AdaptionProgressStatVO adaptionProgressStatistics(PurchaseAdaptionListReq req) { LambdaQueryWrapper query = Wrappers.lambdaQuery(Purchase.class) .select(Purchase::getStatus, Purchase::getId) .eq(Purchase::getBidType, BidTypeEnum.BUILD_APP.getCode()) @@ -554,6 +554,16 @@ public class PurchaseManage { if (!purchaseService.buildPurchaseQueryPermission(query, user)) { return null; } + if (req.hasProjectQuery()) { + List projectIds = filterProjectIdsForPurchase(req); + if (projectIds.isEmpty()) { + return null; + } + 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()); List purchases = purchaseService.list(query); return adaptionProgressStatistics(purchases); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml index 52e7ac5..49644e5 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml @@ -362,6 +362,18 @@ and p.stage = #{req.stage} + + and p.status in + + #{statusItem} + + + + and p.stage in + + #{stageItem} + + and p.project_year = #{req.projectYear}