From 06e4450e32f83ca594a96c983f2fc3881663f74b Mon Sep 17 00:00:00 2001 From: WendyYang Date: Tue, 27 Feb 2024 15:05:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E6=AE=B5=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=8F=98=E6=9B=B4=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statemachine/event/TenderStatusChangeEvent.java | 4 ++-- .../api/projectdeclared/manage/ConstructionManage.java | 1 - .../projectdeclared/manage/FinalAcceptanceManage.java | 14 ++++++++++---- .../pm/api/projectdeclared/model/entity/Purchase.java | 6 +++--- .../api/projectdeclared/service/IPurchaseService.java | 18 ++++++++++++++++++ .../projectlib/model/enumeration/TenderStatusEnum.java | 2 +- 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/TenderStatusChangeEvent.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/TenderStatusChangeEvent.java index 3aa3369..f658695 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/TenderStatusChangeEvent.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/TenderStatusChangeEvent.java @@ -44,7 +44,7 @@ public enum TenderStatusChangeEvent { /** * 信创符合性申请不通过 */ - XCFHX_APPLY_FAILED(null, 303, null), + XCFHX_APPLY_FAILED(null, 302, null), /** * 终验申报 */ @@ -56,7 +56,7 @@ public enum TenderStatusChangeEvent { /** * 终验申报拒绝 */ - FINALLY_INSPECTED_FAILED(null, 502, null); + FINALLY_INSPECTED_FAILED(null, 501, null); private final Integer passStatusCode; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java index c55cf78..6c2c51a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java @@ -616,7 +616,6 @@ public class ConstructionManage { } tenderStateMachineUtil.pass(purchase); - purchase.setUpdateOn(now); purchase.setPreliminaryInspectionMaterials(req.getPreliminaryInspectionMaterials()); purchase.setIsCompletedLogCollection(req.getIsCompletedLogCollection()); purchase.setActualPerformanceIndicators(req.getActualPerformanceIndicators()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java index 93a3cb4..d52b5cb 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java @@ -97,6 +97,7 @@ public class FinalAcceptanceManage { private final TenderStateMachineUtil tenderStateMachineUtil; private final IProjectInstService projectInstService; + /** * 待采购的-项目列表 * @@ -108,8 +109,13 @@ public class FinalAcceptanceManage { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); //待终验 并且还未过期 //只能看自己单位的 + Set projectIds = purchaseService.listProjectIdByStatus(TenderStatusEnum.FINALLY_INSPECTED_FAILED, + TenderStatusEnum.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY); + if (projectIds.isEmpty()) { + return PageVo.empty(); + } query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr()); - query.eq(Project::getStatus, ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); + query.in(Project::getId, projectIds); query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode()); query.eq(Project::getNewest, Boolean.TRUE); query.orderByAsc(Project::getApprovalDate); @@ -118,11 +124,11 @@ public class FinalAcceptanceManage { if ((total = page.getTotal()) == 0) { return PageVo.empty(); } - List projectIds = new ArrayList<>(); + List allProjectIds = new ArrayList<>(); for (Project project : page.getRecords()) { - projectIds.add(project.getId()); + allProjectIds.add(project.getId()); } - List purchases = purchaseService.listByProjectIds(projectIds); + List purchases = purchaseService.listByProjectIds(allProjectIds); Map> purchaseMap = CollUtils.group(purchases, Purchase::getProjectId); Map contractMap = contractService.listByProjectIds(projectIds); Map> paymentPlansMap = projectAnnualPaymentPlanService.listByProjectIds(projectIds); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java index 7d782ea..67bd2b3 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java @@ -1,8 +1,6 @@ package com.hz.pm.api.projectdeclared.model.entity; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import com.hz.pm.api.common.compare.Compare; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -37,9 +35,11 @@ public class Purchase { private Long projectId; @ApiModelProperty("创建时间") + @TableField(fill = FieldFill.INSERT) private LocalDateTime createOn; @ApiModelProperty("修改时间") + @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateOn; @ApiModelProperty("创建人 工号") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IPurchaseService.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IPurchaseService.java index d24d9eb..b477429 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IPurchaseService.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IPurchaseService.java @@ -1,10 +1,18 @@ package com.hz.pm.api.projectdeclared.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.IService; import com.hz.pm.api.projectdeclared.model.entity.Purchase; +import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; +import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum; +import com.ningdatech.basic.util.CollUtils; +import io.swagger.models.auth.In; +import java.util.Arrays; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; /** *

@@ -28,4 +36,14 @@ public interface IPurchaseService extends IService { .orderByAsc(Purchase::getId)); } + default Set listProjectIdByStatus(TenderStatusEnum... status){ + List statusCodes = Arrays.stream(status) + .map(TenderStatusEnum::getTenderStatus) + .collect(Collectors.toList()); + LambdaQueryWrapper query = Wrappers.lambdaQuery(Purchase.class) + .select(Purchase::getProjectId) + .in(Purchase::getStatus, statusCodes); + return CollUtils.fieldSet(list(query), Purchase::getProjectId); + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderStatusEnum.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderStatusEnum.java index b9275eb..ab7d9b6 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderStatusEnum.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderStatusEnum.java @@ -28,7 +28,7 @@ public enum TenderStatusEnum { XCFHX_APPLY_FAILED(ProjectStatusEnum.ON_FIRST_INSPECTED, 303, "信创符合性申请不通过"), TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY(ProjectStatusEnum.ON_FIRST_INSPECTED, 401, "待终验申报"), ON_FINALLY_INSPECTED_APPLY(ProjectStatusEnum.ON_FINALLY_INSPECTED, 501, "终验申报中"), - FINALLY_INSPECTED_FAILED(ProjectStatusEnum.ON_FINALLY_INSPECTED, 502, "终验申报不同过"), + FINALLY_INSPECTED_FAILED(ProjectStatusEnum.ON_FINALLY_INSPECTED, 502, "终验申报不通过"), FINALLY_INSPECTED_PASSED(ProjectStatusEnum.ACCEPTED, 601, "终验完成"); private final ProjectStatusEnum projectStatus;