|
|
@@ -645,6 +645,14 @@ public class SysUserController extends BaseController {
|
|
|
if (deptLevel != 6) {
|
|
|
throw new SystemException("团队长、代理人、出单员只能归属团队中");
|
|
|
}
|
|
|
+ //如果为团队长,判断是否已经存在团队长,存在不允许添加 add by hxl 2024-05-07 ============begin
|
|
|
+ if(RoleConstants.R21.getCode().equals(sysUser.getRoleId())){
|
|
|
+ int count= sysUserService.getCountByDeptAndRoleId(sysUser);
|
|
|
+ if(count>0){
|
|
|
+ throw new SystemException("该机构已存在团队长,不允许再添加!!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // =========================add by hxl end ====================
|
|
|
} else if (RoleConstants.R18.getCode().equals(sysUser.getRoleId())) { // 42 门店长
|
|
|
if (deptLevel != 5) {
|
|
|
throw new SystemException("机构管理员只能归属机构中");
|