|
|
@@ -3,6 +3,7 @@ package com.hz.pm.api.projectdeclared.manage; |
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
@@ -61,11 +62,13 @@ public class DeclaredProjectHelper { |
|
|
|
*/ |
|
|
|
public void projectNameDuplicateCheck(ProjectDTO project) { |
|
|
|
String projectCode = project.getProjectCode(); |
|
|
|
String hisProjectCode = project.getHisProjectCode(); |
|
|
|
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) |
|
|
|
.eq(Project::getProjectName, project.getProjectName()) |
|
|
|
.eq(Project::getNewest, Boolean.TRUE) |
|
|
|
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) |
|
|
|
.ne(Objects.nonNull(projectCode), Project::getProjectCode, projectCode) |
|
|
|
.ne(StrUtil.isNotBlank(projectCode), Project::getProjectCode, projectCode) |
|
|
|
.eq(StrUtil.isNotBlank(hisProjectCode), Project::getHisProjectCode, hisProjectCode) |
|
|
|
.last(BizConst.LIMIT_1); |
|
|
|
if (projectService.count(query) > 0) { |
|
|
|
throw BizException.wrap("项目名【%s】已存在", project.getProjectName()); |
|
|
|