作者 tangxuhui
... ... @@ -27,8 +27,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin
var orgIds []int
if len(noticeSettingListQuery.OrgName) > 0 {
orgResult, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
Offset: 1,
Limit: 20,
Offset: 0,
Limit: 100,
CompanyId: int(noticeSettingListQuery.Operator.CompanyId),
IsOrg: 0,
MatchOrgName: noticeSettingListQuery.OrgName,
... ...
... ... @@ -9,7 +9,7 @@ type RoleItem struct {
OrgName string `json:"orgName"`
RoleType int `json:"roleType"`
Ext Ext `json:"ext"`
AuthFlag int `json:"authFlag"` // 1:可操作(编辑,修改等)
AuthFlag bool `json:"authFlag"` // 1:可操作(编辑,修改等)
}
type Ext struct {
... ...
... ... @@ -18,6 +18,8 @@ type RoleListQuery struct {
RoleName string `json:"roleName"`
OrgName string `json:"orgName"`
RoleType int `json:"roleType"`
}
func (roleListQuery *RoleListQuery) Valid(validation *validation.Validation) {
... ...
package service
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"strconv"
"github.com/linmadan/egglib-go/core/application"
... ... @@ -93,6 +94,7 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
OrgName: roleListQuery.OrgName,
RoleName: roleListQuery.RoleName,
InOrgIds: roleListQuery.Operator.OrgIds,
RoleType: roleListQuery.RoleType,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -109,7 +111,10 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
Ext: v.Ext,
}
if int64(v.OrgID) == roleListQuery.Operator.OrgId {
item.AuthFlag = 1
item.AuthFlag = true
}
if (item.RoleType & domain.UserTypeCompanyAdmin) > 0 {
item.AuthFlag = false
}
result = append(result, item)
}
... ...
... ... @@ -9,7 +9,7 @@ type CompanyUserItem struct {
UserId string `json:"userId"`
UserName string `json:"userName"`
UserType int `json:"userType"`
AuthFlag int `json:"authFlag"` // 1:可操作(编辑,修改等)
AuthFlag bool `json:"authFlag"` // 1:可操作(编辑,修改等)
}
//CompanyUserInfo 用户数据详情
... ... @@ -40,6 +40,7 @@ type UserRole struct {
RoleID string `json:"roleId"`
RoleName string `json:"roleName"`
OrgName string `json:"orgName"`
RoleType int `json:"roleType"`
Description string `json:"desc"`
}
... ... @@ -85,5 +86,5 @@ type CooperationUserItem struct {
UserName string `json:"userName"`
OrgName string `json:"orgName"`
OrgId string `json:"orgId"`
AuthFlag int `json:"authFlag"` // 1:可操作(编辑,修改等)
AuthFlag bool `json:"authFlag"` // 1:可操作(编辑,修改等)
}
... ...
... ... @@ -74,6 +74,7 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
RoleID: strconv.Itoa(v.RoleID),
RoleName: v.RoleName,
OrgName: v.Ext.OrgName,
RoleType: v.RoleType,
})
}
user := dto.CompanyUserInfo{
... ... @@ -211,7 +212,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co
UserType: v.UserType,
}
if v.Org.OrgId == int(companyUserListQuery.Operator.OrgId) {
item.AuthFlag = 1
item.AuthFlag = true
}
listData = append(listData, item)
}
... ... @@ -402,7 +403,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
OrgId: strconv.Itoa(v.Org.OrgId),
}
if v.Org.OrgId == int(cooperationUserListQuery.Operator.OrgId) {
item.AuthFlag = 1
item.AuthFlag = true
}
if !v.CooperationInfo.CooperationDeadline.IsZero() && v.CooperationInfo.CooperationDeadline.After(time.Unix(1136044800, 0)) {
item.CooperationDeadline = v.CooperationInfo.CooperationDeadline.Format("2006-01-02")
... ...
... ... @@ -47,6 +47,7 @@ type UserDetail struct {
UserRole []struct {
RoleID int `json:"roleId"`
RoleName string `json:"roleName"`
RoleType int `json:"roleType"`
Ext struct {
OrgName string `json:"orgName"`
} `json:"ext,omitempty"`
... ...