From b941cad958368b17e790d4752dc15746050eabfc Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 11 Aug 2023 09:53:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=9F=E6=88=90code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java index c9de91a..166e8ec 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java @@ -40,7 +40,8 @@ public class GenerateProjectCodeUtil { String projectType = ProjectCodeContant.PROJECT_TYPE_PREFIX + project.getProjectType(); // 16-20 项目序号00001 Long max = projectService.count(Wrappers.lambdaQuery(Project.class) - .eq(Project::getProjectYear,project.getProjectYear())); + .eq(Project::getProjectYear,project.getProjectYear()) + .eq(Project::getNewest,Boolean.TRUE)); Long maxCurrent = max + 1; String serialNumber = String.format(ProjectCodeContant.SHUZI_5,maxCurrent); // 生成20位的项目编号 @@ -57,7 +58,8 @@ public class GenerateProjectCodeUtil { String projectType = ProjectCodeContant.PROJECT_TYPE_PREFIX + project.getProjectType(); // 16-20 项目序号00001 Long max = projectService.count(Wrappers.lambdaQuery(Project.class) - .eq(Project::getProjectYear,project.getProjectYear())); + .eq(Project::getProjectYear,project.getProjectYear()) + .eq(Project::getNewest,Boolean.TRUE)); Long maxCurrent = max + 1; String serialNumber = String.format(ProjectCodeContant.SHUZI_5,maxCurrent); // 生成20位的项目编号