update 优化 删除无用校验

This commit is contained in:
疯狂的狮子Li
2024-07-02 13:18:18 +08:00
parent 8881f11302
commit 15e5be79ee
3 changed files with 0 additions and 23 deletions

View File

@@ -75,8 +75,6 @@ public class SysDeptController extends BaseController {
public R<Void> add(@Validated @RequestBody SysDeptBo dept) {
if (!deptService.checkDeptNameUnique(dept)) {
return R.fail("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
} else if (StringUtils.isNotBlank(dept.getDeptCategory()) && !deptService.checkDeptCategoryUnique(dept)) {
return R.fail("新增部门'" + dept.getDeptName() + "'失败,部门类别编码已存在");
}
return toAjax(deptService.insertDept(dept));
}

View File

@@ -100,13 +100,6 @@ public interface ISysDeptService {
*/
boolean checkDeptNameUnique(SysDeptBo dept);
/**
* 校验部门类别编码是否唯一
*
* @param dept 部门信息
* @return 结果
*/
boolean checkDeptCategoryUnique(SysDeptBo dept);
/**
* 校验部门是否有数据权限

View File

@@ -223,20 +223,6 @@ public class SysDeptServiceImpl implements ISysDeptService {
return !exist;
}
/**
* 校验部门类别编码是否唯一
*
* @param dept 部门信息
* @return 结果
*/
@Override
public boolean checkDeptCategoryUnique(SysDeptBo dept) {
boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysDept>()
.eq(SysDept::getDeptCategory, dept.getDeptCategory())
.ne(ObjectUtil.isNotNull(dept.getDeptId()), SysDept::getDeptId, dept.getDeptId()));
return !exist;
}
/**
* 校验部门是否有数据权限
*