feat: 组织架构重构 - 公司成员与部门成员模块,登录逻辑及权限改造

- 新增 org_company_member 表及模块(公司成员:owner/member 角色)
- 新增 org_department_member 表及模块(部门成员:一用户可属多部门)
- 移除 sys_user 的 companyId/departmentId/positionId 字段
- 重构 UserMenuServiceImpl 权限逻辑:super→全系统 / owner→公司菜单 / member→职位菜单
- 修复 RoleAspect 中 role='company' 应为 'admin' 的 BUG
- CurrentUserContext 注入 CompanyMemberService,新增 getCurrentMemberRole()
- 登录时公司选择逻辑:优先 lastCompanyId,需状态可用且未过期
- 超管(super)登录跳过公司校验
- 创建公司时自动创建拥有者账号并写入 org_company_member(role=owner)
- 联系人字段替换为拥有者姓名+拥有者电话
- org_company 表新增 owner_name/owner_phone 字段
- sys_user.phone 唯一约束修正
- 同步更新 SQL 设计文件(31张表 DDL)
This commit is contained in:
小蟑螂
2026-03-29 01:30:00 +08:00
parent 749779d452
commit 3b5e2abd43
47 changed files with 2531 additions and 561 deletions
@@ -60,7 +60,7 @@ public class PermissionAspect {
case "super":
hasPermission = annotation.allowSuper();
break;
case "company":
case "admin":
hasPermission = annotation.allowCompany();
break;
case "user":
@@ -55,7 +55,7 @@ public class RoleAspect {
case "super":
hasPermission = annotation.allowSuper();
break;
case "company":
case "admin":
hasPermission = annotation.allowCompany();
break;
case "user":