diff --git a/src/bean/vo/response/system_role.go b/src/bean/vo/response/system_role.go index 6c0821dc1478a30826df571827dd09af79765890..162d45714ec1ab83abcfc474def3aecbc691a7d3 100644 --- a/src/bean/vo/response/system_role.go +++ b/src/bean/vo/response/system_role.go @@ -55,17 +55,17 @@ type SystemRoleListRes struct { } type SystemAllotUserList struct { - Id int32 `json:"id" ` // id - SystemAccount string `json:"system_account"` // 系统账号 - IsAdmin int `json:"is_admin"` // 用户类型 - Phone string `json:"phone"` // 联系人电话 - OrganizationId string `json:"organization_id"` // 所属组织 - OrganizationName string `json:"organization_name" xorm:"name"` // 所属组织 - State int `json:"state"` // 状态0禁用1启用 - CreatedTime time.Time `json:"created_time"` // 创建时间 - SystemId string `json:"system_id" xorm:"system_id"` // 系统账号id - UrSystemId string `json:"ur_system_id" xorm:"ur_system_id"` // 系统账号id - IsBind int `json:"is_bind"` // 是否绑定 0否1是 + Id int32 `json:"id" ` // id + SystemAccount string `json:"system_account"` // 系统账号 + IsAdmin int `json:"is_admin"` // 用户类型 + Phone string `json:"phone"` // 联系人电话 + OrganizationId string `json:"organization_id"` // 所属组织 + OrganizationName string `json:"organization_name" xorm:"name"` // 所属组织 + State int `json:"state"` // 状态0禁用1启用 + CreatedTime time.Time `json:"created_time"` // 创建时间 + //SystemId string `json:"system_id" xorm:"system_id"` // 系统账号id + UrUserId int `json:"ur_user_id" xorm:"ur_user_id"` // 用户id + IsBind int `json:"is_bind"` // 是否绑定 0否1是 } type SystemAllotUserListRes struct { @@ -77,6 +77,6 @@ type SystemAllotUserListRes struct { OrganizationName string `json:"organization_name"` // 所属组织 State int `json:"state"` // 状态0禁用1启用 CreatedTime jsontime.Time `json:"created_time"` // 创建时间 - SystemId string `json:"system_id"` // 系统账号id - IsBind int `json:"is_bind"` // 是否绑定 0否1是 + //SystemId string `json:"system_id"` // 系统账号id + IsBind int `json:"is_bind"` // 是否绑定 0否1是 } diff --git a/src/router/dict.go b/src/router/dict.go index 20b6cca0ce27e7c6ed71dec393ce625456cfc5b1..5f31d2d7125ffa1b7c4aef7754d998fd8bc2502a 100644 --- a/src/router/dict.go +++ b/src/router/dict.go @@ -8,12 +8,11 @@ import ( "gitlab.wodcloud.com/smart-operation/so-operation-api/src/router/middleware/header" ) -// InitSystemLoginRouter 初始化登录相关路由 +// initDictRoute 初始化字典相关路由 func initDictRoute(e *gin.Engine) { base := e.Group(fmt.Sprintf("%s/dict", conf.Options.Prefix), header.SetContext) //系统字典 - dict := new(controller.Dict) base.POST("", dict.Add) //新增字典 base.PUT("", dict.Update) //修改字典 diff --git a/src/service/system_menu.go b/src/service/system_menu.go index 29fe1e8a4db03a4a32a6015ea3ebd63190c9082e..2c8c64dc452fa0e70f8b9fa2e26039a736690d08 100644 --- a/src/service/system_menu.go +++ b/src/service/system_menu.go @@ -304,8 +304,8 @@ func (s *SystemMenu) GetSystemTree(search string) (interface{}, error) { Join("INNER", []string{"system_role_menu", "srm"}, "sur.role_id = srm.role_id"). Join("INNER", []string{"system_menu", "sm"}, "sm.menu_id = srm.menu_id"). Join("INNER", []string{"system_role", "sr"}, "sur.role_id = sr.role_id"). - Select("max(sur.system_id::varchar) as system_id,sm.*"). - Where("sm.is_deleted = 0 and sm.state = 1 and sur.role_id = ?", s.User.Id). + Select("max(sur.user_id) as user_id,sm.*"). + Where("sm.is_deleted = 0 and sm.state = 1 and sur.user_id = ?", s.User.Id). And("sr.state = 1 and sr.is_deleted = 0"). GroupBy("sm.id"). OrderBy("sm.level").OrderBy("sm.sort").Find(&menus); err != nil { @@ -317,7 +317,7 @@ func (s *SystemMenu) GetSystemTree(search string) (interface{}, error) { // 组装树形 for i, v := range menus { if v.Level == 1 { - if !strings.Contains(v.MenuName, search) { + if !strings.Contains(v.SystemType, search) { continue } changeMenuTreePer(&menus[i], menus, search) diff --git a/src/service/system_role.go b/src/service/system_role.go index 89c01fbe18d2fa2b68491e6e2608710cf2eaf3c2..0aa806b94669d406ba742da1dae93f6c5f381c5b 100644 --- a/src/service/system_role.go +++ b/src/service/system_role.go @@ -301,6 +301,9 @@ func SystemAllotUserList(params *request.SystemAllotUserListReq) (resultData []r modelObj.Where("su.system_account like ? or su.phone ? ", params.Search, params.Search) } + if systemRole.RoleType == 1 { + modelObj.Where("so.data_type < 2") + } if systemRole.RoleType == 2 { modelObj.Where("so.data_type = 2") } @@ -355,10 +358,10 @@ func SystemAllotUserList(params *request.SystemAllotUserListReq) (resultData []r OrganizationName: v.OrganizationName, State: v.State, CreatedTime: jsontime.Time(v.CreatedTime), - SystemId: v.SystemId, - IsBind: 0, + //SystemId: v.SystemId, + IsBind: 0, } - if v.UrSystemId != "" { + if v.UrUserId != 0 { SystemUserListRes.IsBind = 1 } SystemUserListResArr = append(SystemUserListResArr, SystemUserListRes)