fix:车间对象增加负责人id属性。系统部门编码做唯一校验
This commit is contained in:
@@ -116,8 +116,9 @@ public class SysDeptController extends BaseController
|
||||
{
|
||||
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
String s = autoCodeUtil.genSerialCode("DEPT_CODE", null);
|
||||
dept.setDeptCode(s);
|
||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptCodeUnique(dept))) {
|
||||
return AjaxResult.error("新增部门'" + dept.getDeptCode() + "'失败,部门编码已存在");
|
||||
}
|
||||
dept.setCreateBy(getUsername());
|
||||
return toAjax(deptService.insertDept(dept));
|
||||
}
|
||||
@@ -132,6 +133,9 @@ public class SysDeptController extends BaseController
|
||||
{
|
||||
Long deptId = dept.getDeptId();
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptCodeUnique(dept))) {
|
||||
return AjaxResult.error("新增部门'" + dept.getDeptCode() + "'失败,部门编码已存在");
|
||||
}
|
||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||
{
|
||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
|
||||
Reference in New Issue
Block a user