From 74b2727536bd7360645e8fd1b1be11cd6d297a27 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 16 Aug 2023 16:36:37 +0800 Subject: [PATCH] =?UTF-8?q?debug=20=E7=BB=AD=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=B5=84=E9=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ProjectRenewalFundManage.java | 40 ++++++++++------------ 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index 6908a4e..6614ee9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java @@ -157,28 +157,26 @@ public class ProjectRenewalFundManage { BeanUtils.copyProperties(dto,declaration); //有2个条件要判断 续建资金 - if(Objects.isNull(dto.getId())){ - //1. 如果有审核中的 是不能继续申请的 - long pendingCount = projectRenewalFundDeclarationService.count(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) - .eq(ProjectRenewalFundDeclaration::getProjectId, projectId) - .eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PENDING.name())); - VUtils.isTrue(pendingCount > 0L).throwMessage("当前有在审核的续建项目 不能再申请了"); + //1. 如果有审核中的 是不能继续申请的 + long pendingCount = projectRenewalFundDeclarationService.count(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) + .eq(ProjectRenewalFundDeclaration::getProjectId, projectId) + .eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PENDING.name())); + VUtils.isTrue(pendingCount > 0L).throwMessage("当前有在审核的续建项目 不能再申请了"); - //2.是要当前最新资金的下年度 才能申请 - VUtils.isTrue(Objects.isNull(dto.getProjectYear())).throwMessage("新建的续建项目信息 年度不能为空"); - ProjectRenewalFundDeclaration lastRenewalFund = projectRenewalFundDeclarationService.getOne(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) - .eq(ProjectRenewalFundDeclaration::getProjectId, projectId) - .eq(ProjectRenewalFundDeclaration::getApprovalStatus,ProjectRenewalApprovalStatusEnum.PASS.name()) - .orderByDesc(ProjectRenewalFundDeclaration::getProjectYear) - .last(BizConst.LIMIT_1)); - //如果没有续建资金信息 就要比 当前项目的年度要大 - if(Objects.isNull(lastRenewalFund)){ - VUtils.isTrue(project.getProjectYear() >= dto.getProjectYear()) - .throwMessage("续建资金年度错误!"); - }else{ - VUtils.isTrue(lastRenewalFund.getProjectYear() >= dto.getProjectYear()) - .throwMessage("续建资金年度错误!"); - } + //2.是要当前最新资金的下年度 才能申请 + VUtils.isTrue(Objects.isNull(dto.getProjectYear())).throwMessage("新建的续建项目信息 年度不能为空"); + ProjectRenewalFundDeclaration lastRenewalFund = projectRenewalFundDeclarationService.getOne(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) + .eq(ProjectRenewalFundDeclaration::getProjectId, projectId) + .eq(ProjectRenewalFundDeclaration::getApprovalStatus,ProjectRenewalApprovalStatusEnum.PASS.name()) + .orderByDesc(ProjectRenewalFundDeclaration::getProjectYear) + .last(BizConst.LIMIT_1)); + //如果没有续建资金信息 就要比 当前项目的年度要大 + if(Objects.isNull(lastRenewalFund)){ + VUtils.isTrue(project.getProjectYear() >= dto.getProjectYear()) + .throwMessage("续建资金年度错误!"); + }else{ + VUtils.isTrue(lastRenewalFund.getProjectYear() >= dto.getProjectYear()) + .throwMessage("续建资金年度错误!"); } declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name());