From 090091834d9b3046d5183d2af2564c92fae039d1 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 14 Jul 2023 10:08:50 +0800 Subject: [PATCH] =?UTF-8?q?debug=20=E7=8A=B6=E6=80=81=20=E8=B0=93=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/projectlib/handle/ArchivedHandle.java | 1 + .../pmapi/projectlib/handle/ProjectApprovalHandle.java | 1 + .../projectlib/handle/ProjectFinalInspectionHandle.java | 3 ++- .../handle/ProjectPreliminaryInspectionHandle.java | 1 + .../pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java | 13 ++++++++++--- .../pmapi/projectlib/handle/TenderPurchaseHandle.java | 1 + .../pmapi/projectlib/handle/UnitInnerAuditHandle.java | 3 ++- 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java index 75c2482..58b8d57 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java @@ -58,6 +58,7 @@ public class ArchivedHandle extends AbstractProcessBusinessHandle { ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.FINAL_ACCEPTANCE_PASS.name()) + .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); if(Objects.nonNull(projectStatusChange)){ processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java index 5645ce5..67b843e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java @@ -88,6 +88,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PLAN_REVIEW_PASS.name()) + .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java index b778224..659b22d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java @@ -7,6 +7,7 @@ import java.util.Objects; import cn.hutool.core.collection.CollUtil; import com.google.common.collect.Lists; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -60,7 +61,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) .orderByDesc(ProjectInst::getCreatOn) - .last("limit 1")); + .last(BizConst.LIMIT_1)); if (Objects.isNull(projectInst)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java index e71b0f8..658c4f2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java @@ -78,6 +78,7 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD.name()) + .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); if(Objects.nonNull(projectStatusChange)){ processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java index b2982b8..48afa8a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java @@ -1,6 +1,7 @@ package com.ningdatech.pmapi.projectlib.handle; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; @@ -57,7 +58,9 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle { ProjectStatusChange startChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectId) .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()) - .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode())); + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()).orderByDesc(ProjectStatusChange::getCreateOn) + .orderByDesc(ProjectStatusChange::getCreateOn) + .last(BizConst.LIMIT_1)); if(Objects.nonNull(startChange)){ processDetailVO.setFinishTime(startChange.getCreateOn()); } @@ -66,7 +69,9 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle { ProjectStatusChange passChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectId) .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()) - .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode())); + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()) + .orderByDesc(ProjectStatusChange::getCreateOn) + .last(BizConst.LIMIT_1)); if(Objects.nonNull(passChange)){ processDetailVO.setFinishTime(passChange.getCreateOn()); } @@ -75,7 +80,9 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle { ProjectStatusChange rejectChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectId) .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()) - .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode())); + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()) + .orderByDesc(ProjectStatusChange::getCreateOn) + .last(BizConst.LIMIT_1)); if(Objects.nonNull(rejectChange)){ processDetailVO.setFinishTime(rejectChange.getCreateOn()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java index 62f99c4..bd39aa3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java @@ -75,6 +75,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name()) + .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java index 34fcc73..14b592b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -67,7 +68,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode()) .orderByDesc(ProjectInst::getCreatOn) - .last("limit 1")); + .last(BizConst.LIMIT_1)); ProcessProgressVo instanceDetail = null; // 未找到当前版本项目的单位内部审核流程且当前项目版本号大于1(是被驳回重新申报的项目)