瀏覽代碼

项目编号 debug

master
PoffyZhang 1 年之前
父節點
當前提交
d046d3da2b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java 查看文件

@@ -52,7 +52,7 @@ public class GenerateProjectCodeUtil {
// 获取项目库当前最大项目序号
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class).orderByDesc(Project::getId));
Project project = CollUtil.isEmpty(projectList) ? null : projectList.get(0);
Long projectId = Objects.isNull(project) ? DeclaredProjectContant.Project.MIN_PROJECT_ID : project.getId();
Long projectId = Objects.isNull(project) ? DeclaredProjectContant.Project.MIN_PROJECT_ID : project.getId() + 1;
if (projectId > DeclaredProjectContant.Project.MAX_PROJECT_ID){
// 超过999的项目号从1开始 1
Long newProjectId = projectId % DeclaredProjectContant.Project.MAX_PROJECT_ID;


Loading…
取消
儲存