作者 tangxuhui
@@ -27,10 +27,10 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin @@ -27,10 +27,10 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin
27 var orgIds []int 27 var orgIds []int
28 if len(noticeSettingListQuery.OrgName) > 0 { 28 if len(noticeSettingListQuery.OrgName) > 0 {
29 orgResult, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{ 29 orgResult, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
30 - Offset: 1,  
31 - Limit: 20, 30 + Offset: 0,
  31 + Limit: 100,
32 CompanyId: int(noticeSettingListQuery.Operator.CompanyId), 32 CompanyId: int(noticeSettingListQuery.Operator.CompanyId),
33 - IsOrg: 0, 33 + IsOrg: 0,
34 MatchOrgName: noticeSettingListQuery.OrgName, 34 MatchOrgName: noticeSettingListQuery.OrgName,
35 }) 35 })
36 if err != nil { 36 if err != nil {
@@ -9,7 +9,7 @@ type RoleItem struct { @@ -9,7 +9,7 @@ type RoleItem struct {
9 OrgName string `json:"orgName"` 9 OrgName string `json:"orgName"`
10 RoleType int `json:"roleType"` 10 RoleType int `json:"roleType"`
11 Ext Ext `json:"ext"` 11 Ext Ext `json:"ext"`
12 - AuthFlag int `json:"authFlag"` // 1:可操作(编辑,修改等) 12 + AuthFlag bool `json:"authFlag"` // 1:可操作(编辑,修改等)
13 } 13 }
14 14
15 type Ext struct { 15 type Ext struct {
@@ -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())
@@ -109,7 +111,10 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) ( @@ -109,7 +111,10 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
109 Ext: v.Ext, 111 Ext: v.Ext,
110 } 112 }
111 if int64(v.OrgID) == roleListQuery.Operator.OrgId { 113 if int64(v.OrgID) == roleListQuery.Operator.OrgId {
112 - item.AuthFlag = 1 114 + item.AuthFlag = true
  115 + }
  116 + if (item.RoleType & domain.UserTypeCompanyAdmin) > 0 {
  117 + item.AuthFlag = false
113 } 118 }
114 result = append(result, item) 119 result = append(result, item)
115 } 120 }
@@ -9,7 +9,7 @@ type CompanyUserItem struct { @@ -9,7 +9,7 @@ type CompanyUserItem struct {
9 UserId string `json:"userId"` 9 UserId string `json:"userId"`
10 UserName string `json:"userName"` 10 UserName string `json:"userName"`
11 UserType int `json:"userType"` 11 UserType int `json:"userType"`
12 - AuthFlag int `json:"authFlag"` // 1:可操作(编辑,修改等) 12 + AuthFlag bool `json:"authFlag"` // 1:可操作(编辑,修改等)
13 } 13 }
14 14
15 //CompanyUserInfo 用户数据详情 15 //CompanyUserInfo 用户数据详情
@@ -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
@@ -85,5 +86,5 @@ type CooperationUserItem struct { @@ -85,5 +86,5 @@ type CooperationUserItem struct {
85 UserName string `json:"userName"` 86 UserName string `json:"userName"`
86 OrgName string `json:"orgName"` 87 OrgName string `json:"orgName"`
87 OrgId string `json:"orgId"` 88 OrgId string `json:"orgId"`
88 - AuthFlag int `json:"authFlag"` // 1:可操作(编辑,修改等) 89 + AuthFlag bool `json:"authFlag"` // 1:可操作(编辑,修改等)
89 } 90 }
@@ -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{
@@ -211,7 +212,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co @@ -211,7 +212,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co
211 UserType: v.UserType, 212 UserType: v.UserType,
212 } 213 }
213 if v.Org.OrgId == int(companyUserListQuery.Operator.OrgId) { 214 if v.Org.OrgId == int(companyUserListQuery.Operator.OrgId) {
214 - item.AuthFlag = 1 215 + item.AuthFlag = true
215 } 216 }
216 listData = append(listData, item) 217 listData = append(listData, item)
217 } 218 }
@@ -402,7 +403,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * @@ -402,7 +403,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
402 OrgId: strconv.Itoa(v.Org.OrgId), 403 OrgId: strconv.Itoa(v.Org.OrgId),
403 } 404 }
404 if v.Org.OrgId == int(cooperationUserListQuery.Operator.OrgId) { 405 if v.Org.OrgId == int(cooperationUserListQuery.Operator.OrgId) {
405 - item.AuthFlag = 1 406 + item.AuthFlag = true
406 } 407 }
407 if !v.CooperationInfo.CooperationDeadline.IsZero() && v.CooperationInfo.CooperationDeadline.After(time.Unix(1136044800, 0)) { 408 if !v.CooperationInfo.CooperationDeadline.IsZero() && v.CooperationInfo.CooperationDeadline.After(time.Unix(1136044800, 0)) {
408 item.CooperationDeadline = v.CooperationInfo.CooperationDeadline.Format("2006-01-02") 409 item.CooperationDeadline = v.CooperationInfo.CooperationDeadline.Format("2006-01-02")
@@ -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"`