fix(权限完善):1.权限优化以下模块按钮查看权限全部归属超级管理员,只有职称角色未超级管理员用户才可以查看进入操作
deploy-hxtesting / build-and-deploy (push) Successful in 1m17s
deploy-hxtesting / build-and-deploy (push) Successful in 1m17s
1)如图一所示点击左下角个人信息弹出框中的“空间设置”、“成员管理“、”模型管理“、”全部设置“、”系统管理“ 2)点击进入”设置“页面中”空间“、”模型“、”发布集成“、”数据与扩展“、”系统管理“这几个大模块相关内容入口 2.成员管理页面增加一个字段”状态“:1-5 在职状态(试用/试用延期/正式/临时/实习)、6离职/7退休(顺便对数据进行清洗,工号首位带字母的都标记为离职其他都标记为正式) 3.检查各业务需求里所有选择员工相关都只能拉取选择正式员工!
This commit is contained in:
1 parent
b762deaf15
commit
7034d93256
49 files changed
+809
-130
No files matched your search
@@ -311,11 +311,13 @@ func (s *tenantMemberService) ListByTenant(ctx context.Context, tenantID uint64)
|
||||
|
||||
// ListMembersPage returns a slice plus total matching query (handlers parse
|
||||
// page/page_size; defensive clamps here mirror list handler limits).
|
||||
// employmentStatus 非 0 时仅返回该在职状态(users.employment_status)的成员。
|
||||
func (s *tenantMemberService) ListMembersPage(
|
||||
ctx context.Context,
|
||||
tenantID uint64,
|
||||
query string,
|
||||
page, pageSize int,
|
||||
employmentStatus int,
|
||||
) ([]*types.TenantMember, int64, error) {
|
||||
query = strings.TrimSpace(query)
|
||||
if page < 1 {
|
||||
@@ -327,12 +329,12 @@ func (s *tenantMemberService) ListMembersPage(
|
||||
if pageSize > listMembersMaxPageSize {
|
||||
pageSize = listMembersMaxPageSize
|
||||
}
|
||||
total, err := s.repo.CountFilteredByTenant(ctx, tenantID, query)
|
||||
total, err := s.repo.CountFilteredByTenant(ctx, tenantID, query, employmentStatus)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
offset := (page - 1) * pageSize
|
||||
members, err := s.repo.ListPagedByTenant(ctx, tenantID, query, offset, pageSize)
|
||||
members, err := s.repo.ListPagedByTenant(ctx, tenantID, query, employmentStatus, offset, pageSize)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
@@ -132,13 +132,13 @@ func (r *fakeTenantMemberRepo) filterTenantRows(tenantID uint64, search string)
|
||||
}
|
||||
|
||||
func (r *fakeTenantMemberRepo) CountFilteredByTenant(
|
||||
ctx context.Context, tenantID uint64, search string,
|
||||
ctx context.Context, tenantID uint64, search string, employmentStatus int,
|
||||
) (int64, error) {
|
||||
return int64(len(r.filterTenantRows(tenantID, search))), nil
|
||||
}
|
||||
|
||||
func (r *fakeTenantMemberRepo) ListPagedByTenant(
|
||||
ctx context.Context, tenantID uint64, search string, offset, limit int,
|
||||
ctx context.Context, tenantID uint64, search string, employmentStatus int, offset, limit int,
|
||||
) ([]*types.TenantMember, error) {
|
||||
all := r.filterTenantRows(tenantID, search)
|
||||
if offset >= len(all) {
|
||||
@@ -317,6 +317,9 @@ func (r *cleanupUserRepo) ListSystemAdmins(context.Context, int, int) ([]*types.
|
||||
func (r *cleanupUserRepo) RevokeSystemAdmin(context.Context, string, string) (*types.User, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (r *cleanupUserRepo) UpdateEmploymentStatus(context.Context, string, int) error {
|
||||
return nil
|
||||
}
|
||||
func (r *cleanupUserRepo) SearchUsers(context.Context, string, int) ([]*types.User, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -185,6 +185,8 @@ func (s *trainingService) ListMembers(ctx context.Context, tenantID uint64, q *i
|
||||
if q != nil {
|
||||
oq.DeptID = q.DeptID
|
||||
oq.Keyword = q.Keyword
|
||||
// 在职状态过滤(000167):选人场景按正式员工口径拉取。
|
||||
oq.EmploymentStatus = q.EmploymentStatus
|
||||
oq.Page = q.Page
|
||||
oq.PageSize = q.PageSize
|
||||
}
|
||||
|
||||
@@ -199,8 +199,11 @@ func (s *userService) Register(ctx context.Context, req *types.RegisterRequest)
|
||||
PasswordHash: string(hashedPassword),
|
||||
TenantID: 0,
|
||||
IsActive: true,
|
||||
CreatedAt: time.Now(),
|
||||
UpdatedAt: time.Now(),
|
||||
// 在职状态随工号规则落库(首位字母→离职,否则→正式,000167):
|
||||
// Excel 批量导入 / CASDOOR 同步 / 管理员开户都经此漏斗,一处生效。
|
||||
EmploymentStatus: types.EmploymentStatusFromUsername(req.Username),
|
||||
CreatedAt: time.Now(),
|
||||
UpdatedAt: time.Now(),
|
||||
}
|
||||
if createdTenant != nil {
|
||||
user.TenantID = createdTenant.ID
|
||||
@@ -906,6 +909,15 @@ func (s *userService) RevokeSystemAdmin(ctx context.Context, userID, actorID str
|
||||
// UpdateUserPreferences applies a partial update over the user's
|
||||
// preferences blob. PATCH semantics: only keys present in `patch`
|
||||
// (non-nil pointer fields) replace the existing value; everything else
|
||||
// UpdateEmploymentStatus 修改人员在册在职状态(000167)。调用方(成员管理
|
||||
// handler,Owner+)已校验 1-7;此处仅做兜底校验后直写 users 列。
|
||||
func (s *userService) UpdateEmploymentStatus(ctx context.Context, userID string, status int) error {
|
||||
if !types.IsValidEmploymentStatus(status) {
|
||||
return errors.New("employment_status must be one of 1-7")
|
||||
}
|
||||
return s.userRepo.UpdateEmploymentStatus(ctx, userID, status)
|
||||
}
|
||||
|
||||
// is preserved. This lets the front-end PUT only the preference that
|
||||
// changed without having to read-modify-write the whole struct, and
|
||||
// also makes the endpoint forward-compatible — older clients that
|
||||
|
||||
@@ -79,6 +79,9 @@ type stubUserRepoForAuth struct {
|
||||
}
|
||||
|
||||
func (s *stubUserRepoForAuth) CreateUser(context.Context, *types.User) error { return nil }
|
||||
func (s *stubUserRepoForAuth) UpdateEmploymentStatus(context.Context, string, int) error {
|
||||
return nil
|
||||
}
|
||||
func (s *stubUserRepoForAuth) GetUserByID(_ context.Context, id string) (*types.User, error) {
|
||||
user, ok := s.users[id]
|
||||
if !ok {
|
||||
|
||||
Reference in new issue
Block a user