作者 yangfu

增加roleType过滤,返回

@@ -18,6 +18,8 @@ type RoleListQuery struct { @@ -18,6 +18,8 @@ type RoleListQuery struct {
18 RoleName string `json:"roleName"` 18 RoleName string `json:"roleName"`
19 19
20 OrgName string `json:"orgName"` 20 OrgName string `json:"orgName"`
  21 +
  22 + RoleType int `json:"roleType"`
21 } 23 }
22 24
23 func (roleListQuery *RoleListQuery) Valid(validation *validation.Validation) { 25 func (roleListQuery *RoleListQuery) Valid(validation *validation.Validation) {
1 package service 1 package service
2 2
3 import ( 3 import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
4 "strconv" 5 "strconv"
5 6
6 "github.com/linmadan/egglib-go/core/application" 7 "github.com/linmadan/egglib-go/core/application"
@@ -93,6 +94,7 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) ( @@ -93,6 +94,7 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
93 OrgName: roleListQuery.OrgName, 94 OrgName: roleListQuery.OrgName,
94 RoleName: roleListQuery.RoleName, 95 RoleName: roleListQuery.RoleName,
95 InOrgIds: roleListQuery.Operator.OrgIds, 96 InOrgIds: roleListQuery.Operator.OrgIds,
  97 + RoleType: roleListQuery.RoleType,
96 }) 98 })
97 if err != nil { 99 if err != nil {
98 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 100 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -111,6 +113,9 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) ( @@ -111,6 +113,9 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
111 if int64(v.OrgID) == roleListQuery.Operator.OrgId { 113 if int64(v.OrgID) == roleListQuery.Operator.OrgId {
112 item.AuthFlag = true 114 item.AuthFlag = true
113 } 115 }
  116 + if (item.RoleType & domain.UserTypeCompanyAdmin) > 0 {
  117 + item.AuthFlag = false
  118 + }
114 result = append(result, item) 119 result = append(result, item)
115 } 120 }
116 var cnt int64 = roleList.Count 121 var cnt int64 = roleList.Count
@@ -40,6 +40,7 @@ type UserRole struct { @@ -40,6 +40,7 @@ type UserRole struct {
40 RoleID string `json:"roleId"` 40 RoleID string `json:"roleId"`
41 RoleName string `json:"roleName"` 41 RoleName string `json:"roleName"`
42 OrgName string `json:"orgName"` 42 OrgName string `json:"orgName"`
  43 + RoleType int `json:"roleType"`
43 Description string `json:"desc"` 44 Description string `json:"desc"`
44 } 45 }
45 46
@@ -74,6 +74,7 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp @@ -74,6 +74,7 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
74 RoleID: strconv.Itoa(v.RoleID), 74 RoleID: strconv.Itoa(v.RoleID),
75 RoleName: v.RoleName, 75 RoleName: v.RoleName,
76 OrgName: v.Ext.OrgName, 76 OrgName: v.Ext.OrgName,
  77 + RoleType: v.RoleType,
77 }) 78 })
78 } 79 }
79 user := dto.CompanyUserInfo{ 80 user := dto.CompanyUserInfo{
@@ -47,6 +47,7 @@ type UserDetail struct { @@ -47,6 +47,7 @@ type UserDetail struct {
47 UserRole []struct { 47 UserRole []struct {
48 RoleID int `json:"roleId"` 48 RoleID int `json:"roleId"`
49 RoleName string `json:"roleName"` 49 RoleName string `json:"roleName"`
  50 + RoleType int `json:"roleType"`
50 Ext struct { 51 Ext struct {
51 OrgName string `json:"orgName"` 52 OrgName string `json:"orgName"`
52 } `json:"ext,omitempty"` 53 } `json:"ext,omitempty"`