作者 yangfu

角色服务修改

  1 +package command
  2 +
  3 +type CompanySignUpCommand struct {
  4 + CompanyName string
  5 + Contacts string
  6 + IndustryCategory string
  7 + Password string
  8 + Phone string
  9 + Scale string
  10 +}
1 package service 1 package service
2 2
3 import ( 3 import (
  4 + "github.com/linmadan/egglib-go/core/application"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/command"
4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/query" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/query"
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
6 ) 9 )
7 10
8 type CommonService struct { 11 type CommonService struct {
@@ -13,7 +16,7 @@ func NewCommonService(options map[string]interface{}) *CommonService { @@ -13,7 +16,7 @@ func NewCommonService(options map[string]interface{}) *CommonService {
13 } 16 }
14 17
15 //GetDictionaryByCode 根据code获取字典数据 18 //GetDictionaryByCode 根据code获取字典数据
16 -func (dictionaryService *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDictionaryByCodeQuery) (interface{}, error) { 19 +func (srv *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDictionaryByCodeQuery) (interface{}, error) {
17 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic() 20 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic()
18 result, err := creationBasicGateway.GetDictionarysByCode(allied_creation_basic.ReqGetDictionaryByCode{ 21 result, err := creationBasicGateway.GetDictionarysByCode(allied_creation_basic.ReqGetDictionaryByCode{
19 DictCode: getDictionaryQuery.DictCode, 22 DictCode: getDictionaryQuery.DictCode,
@@ -23,3 +26,20 @@ func (dictionaryService *CommonService) GetDictionaryByCode(getDictionaryQuery * @@ -23,3 +26,20 @@ func (dictionaryService *CommonService) GetDictionaryByCode(getDictionaryQuery *
23 } 26 }
24 return result, nil 27 return result, nil
25 } 28 }
  29 +
  30 +//CompanySignUp 公司注册
  31 +func (srv *CommonService) CompanySignUp(signUpCommand *command.CompanySignUpCommand) (interface{}, error) {
  32 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
  33 + _, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{
  34 + CompanyName: signUpCommand.CompanyName,
  35 + Contacts: signUpCommand.Contacts,
  36 + IndustryCategory: signUpCommand.IndustryCategory,
  37 + Password: signUpCommand.Password,
  38 + Phone: signUpCommand.Phone,
  39 + Scale: signUpCommand.Scale,
  40 + })
  41 + if err != nil {
  42 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  43 + }
  44 + return signUpCommand, nil
  45 +}
@@ -28,14 +28,17 @@ type CompanyUserInfo struct { @@ -28,14 +28,17 @@ type CompanyUserInfo struct {
28 } 28 }
29 29
30 type UserOrg struct { 30 type UserOrg struct {
31 - OrgID string `json:"orgId"`  
32 - OrgName string `json:"orgName"` 31 + OrgID string `json:"orgId"`
  32 + OrgName string `json:"orgName"`
  33 + ParentId string `json:"parentId"`
  34 + IsOrg int `json:"isOrg"`
33 } 35 }
34 36
35 type UserRole struct { 37 type UserRole struct {
36 RoleID string `json:"roleId"` 38 RoleID string `json:"roleId"`
37 RoleName string `json:"roleName"` 39 RoleName string `json:"roleName"`
38 OrgName string `json:"orgName"` 40 OrgName string `json:"orgName"`
  41 + Descript string `json:"descript"`
39 } 42 }
40 43
41 type UserMenu struct { 44 type UserMenu struct {
  1 +package query
  2 +
  3 +import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  4 +
  5 +type CompanyOrgSelectorQuery struct {
  6 + //操作人
  7 + Operator domain.Operator `json:"-"`
  8 + //
  9 + PageNumber int `json:"pageNumber"`
  10 + PageSize int `json:"pageSize"`
  11 + OrgName string `json:"orgName"`
  12 +}
  1 +package query
  2 +
  3 +import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  4 +
  5 +type CompanyRoleSelectorQuery struct {
  6 + //操作人
  7 + Operator domain.Operator `json:"-"`
  8 + //
  9 + PageNumber int `json:"pageNumber"`
  10 + PageSize int `json:"pageSize"`
  11 + RoleName string `json:"roleName"`
  12 +}
@@ -16,6 +16,11 @@ import ( @@ -16,6 +16,11 @@ import (
16 type UsersService struct { 16 type UsersService struct {
17 } 17 }
18 18
  19 +func NewUsersService(options map[string]interface{}) *UsersService {
  20 + newUsersService := &UsersService{}
  21 + return newUsersService
  22 +}
  23 +
19 // 获取公司用户信息 24 // 获取公司用户信息
20 func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.CompanyUserGetQuery) (interface{}, error) { 25 func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.CompanyUserGetQuery) (interface{}, error) {
21 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 26 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
@@ -258,7 +263,7 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand * @@ -258,7 +263,7 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *
258 Avatar: cooperationUserAddCommand.Avatar, 263 Avatar: cooperationUserAddCommand.Avatar,
259 OrgId: cooperationUserAddCommand.Operator.OrgId, 264 OrgId: cooperationUserAddCommand.Operator.OrgId,
260 Phone: cooperationUserAddCommand.Phone, 265 Phone: cooperationUserAddCommand.Phone,
261 - Password: "", //TODO 填充默认密码 266 + Password: "123456", //TODO 填充默认密码
262 }) 267 })
263 data := struct { 268 data := struct {
264 UserId string `json:"userId"` 269 UserId string `json:"userId"`
@@ -380,7 +385,100 @@ func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCom @@ -380,7 +385,100 @@ func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCom
380 return cooperationUserUpdateCommand, err 385 return cooperationUserUpdateCommand, err
381 } 386 }
382 387
383 -func NewUsersService(options map[string]interface{}) *UsersService {  
384 - newUsersService := &UsersService{}  
385 - return newUsersService 388 +//CompanyOrgSelector 获取公司组织的下拉列表
  389 +func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) {
  390 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
  391 + selectorQuery.Operator.CompanyId,
  392 + selectorQuery.Operator.OrgId,
  393 + selectorQuery.Operator.UserId)
  394 + result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
  395 + CompanyId: int(selectorQuery.Operator.CompanyId),
  396 + DepName: selectorQuery.OrgName,
  397 + IsOrg: 1,
  398 + Limit: selectorQuery.PageSize,
  399 + Offset: (selectorQuery.PageNumber - 1) * selectorQuery.PageSize,
  400 + OrgCode: "",
  401 + ParentId: 0,
  402 + })
  403 + if err != nil {
  404 + return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  405 + }
  406 + var (
  407 + dataList []dto.UserOrg
  408 + item dto.UserOrg
  409 + )
  410 + for _, v := range result.Orgs {
  411 + item = dto.UserOrg{
  412 + OrgID: strconv.Itoa(v.OrgID),
  413 + OrgName: v.OrgName,
  414 + ParentId: strconv.Itoa(v.ParentID),
  415 + IsOrg: v.IsOrg,
  416 + }
  417 + dataList = append(dataList, item)
  418 + }
  419 + return int64(result.Count), dataList, nil
  420 +}
  421 +
  422 +//SelectorCompanyRole 获取公司角色的下拉列表
  423 +func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.CompanyRoleSelectorQuery) (int64, interface{}, error) {
  424 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
  425 + selectorQuery.Operator.CompanyId,
  426 + selectorQuery.Operator.OrgId,
  427 + selectorQuery.Operator.UserId)
  428 + result, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
  429 + Limit: selectorQuery.PageSize,
  430 + Offset: (selectorQuery.PageNumber - 1) * selectorQuery.PageSize,
  431 + RoleName: selectorQuery.RoleName,
  432 + })
  433 + if err != nil {
  434 + return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  435 + }
  436 + var (
  437 + dataList []dto.UserRole
  438 + item dto.UserRole
  439 + )
  440 + for _, v := range result.Roles {
  441 + item = dto.UserRole{
  442 + RoleID: strconv.Itoa(v.RoleID),
  443 + RoleName: v.RoleName,
  444 + OrgName: v.Ext.OrgName,
  445 + Descript: v.Desc,
  446 + }
  447 + dataList = append(dataList, item)
  448 + }
  449 + return int64(result.Count), dataList, nil
  450 +}
  451 +
  452 +//CompanyOrgSelector 获取公司全组织部门的下拉列表
  453 +func (usersService *UsersService) SelectorCompanyOrgAll(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) {
  454 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
  455 + selectorQuery.Operator.CompanyId,
  456 + selectorQuery.Operator.OrgId,
  457 + selectorQuery.Operator.UserId)
  458 + result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
  459 + CompanyId: int(selectorQuery.Operator.CompanyId),
  460 + DepName: "",
  461 + IsOrg: 0,
  462 + Limit: 0,
  463 + Offset: 0,
  464 + OrgCode: "",
  465 + ParentId: 0,
  466 + })
  467 + if err != nil {
  468 + return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  469 + }
  470 + var (
  471 + dataList []dto.UserOrg
  472 + item dto.UserOrg
  473 + )
  474 + for _, v := range result.Orgs {
  475 + item = dto.UserOrg{
  476 + OrgID: strconv.Itoa(v.OrgID),
  477 + OrgName: v.OrgName,
  478 + ParentId: strconv.Itoa(v.ParentID),
  479 + IsOrg: v.IsOrg,
  480 + }
  481 + dataList = append(dataList, item)
  482 + }
  483 + return int64(result.Count), dataList, nil
386 } 484 }
  1 +package allied_creation_user
  2 +
  3 +import (
  4 + "encoding/json"
  5 + "fmt"
  6 +
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  9 +)
  10 +
  11 +// AuthCompanySignUp 企业注册
  12 +func (gateway HttplibAlliedCreationUser) AuthCompanySignUp(param ReqAuthCompanySignUp) (*DataAuthCompanySignUp, error) {
  13 + url := gateway.baseUrL + "/auth/company-sign-up"
  14 + method := "POST"
  15 + req := gateway.CreateRequest(url, method)
  16 + log.Logger.Debug("向用户模块请求数据:企业注册。", map[string]interface{}{
  17 + "api": method + ":" + url,
  18 + "param": param,
  19 + })
  20 + req, err := req.JSONBody(param)
  21 + if err != nil {
  22 + return nil, fmt.Errorf("请求企业注册失败:%w", err)
  23 + }
  24 +
  25 + byteResult, err := req.Bytes()
  26 + if err != nil {
  27 + return nil, fmt.Errorf("获取企业注册失败:%w", err)
  28 + }
  29 + log.Logger.Debug("获取用户模块请求数据:企业注册。", map[string]interface{}{
  30 + "result": string(byteResult),
  31 + })
  32 + var result service_gateway.GatewayResponse
  33 + err = json.Unmarshal(byteResult, &result)
  34 + if err != nil {
  35 + return nil, fmt.Errorf("解析企业注册:%w", err)
  36 + }
  37 + var data DataAuthCompanySignUp
  38 + err = gateway.GetResponseData(result, &data)
  39 + return &data, err
  40 +}
  41 +
  42 +//AuthChangePassword 修改密码
  43 +func (gateway HttplibAlliedCreationUser) AuthChangePassword(param ReqAuthChangePassword) (*DataAuthChangePassword, error) {
  44 + url := gateway.baseUrL + "/auth/change-password"
  45 + method := "POST"
  46 + req := gateway.CreateRequest(url, method)
  47 + log.Logger.Debug("向用户模块请求数据:修改密码。", map[string]interface{}{
  48 + "api": method + ":" + url,
  49 + "param": param,
  50 + })
  51 + req, err := req.JSONBody(param)
  52 + if err != nil {
  53 + return nil, fmt.Errorf("请求修改密码失败:%w", err)
  54 + }
  55 +
  56 + byteResult, err := req.Bytes()
  57 + if err != nil {
  58 + return nil, fmt.Errorf("获取修改密码失败:%w", err)
  59 + }
  60 + log.Logger.Debug("获取用户模块请求数据:修改密码。", map[string]interface{}{
  61 + "result": string(byteResult),
  62 + })
  63 + var result service_gateway.GatewayResponse
  64 + err = json.Unmarshal(byteResult, &result)
  65 + if err != nil {
  66 + return nil, fmt.Errorf("解析修改密码:%w", err)
  67 + }
  68 + var data DataAuthChangePassword
  69 + err = gateway.GetResponseData(result, &data)
  70 + return &data, err
  71 +}
  72 +
  73 +// AuthCheckPassword 手机账号密码检查
  74 +func (gateway HttplibAlliedCreationUser) AuthCheckPassword(param ReqAuthCheckPassword) (*DataAuthCheckPassword, error) {
  75 + url := gateway.baseUrL + "/auth/check-password"
  76 + method := "POST"
  77 + req := gateway.CreateRequest(url, method)
  78 + log.Logger.Debug("向用户模块请求数据:手机账号密码检查。", map[string]interface{}{
  79 + "api": method + ":" + url,
  80 + "param": param,
  81 + })
  82 + req, err := req.JSONBody(param)
  83 + if err != nil {
  84 + return nil, fmt.Errorf("请求手机账号密码检查失败:%w", err)
  85 + }
  86 +
  87 + byteResult, err := req.Bytes()
  88 + if err != nil {
  89 + return nil, fmt.Errorf("获取手机账号密码检查失败:%w", err)
  90 + }
  91 + log.Logger.Debug("获取用户模块请求数据:手机账号密码检查。", map[string]interface{}{
  92 + "result": string(byteResult),
  93 + })
  94 + var result service_gateway.GatewayResponse
  95 + err = json.Unmarshal(byteResult, &result)
  96 + if err != nil {
  97 + return nil, fmt.Errorf("解析手机账号密码检查:%w", err)
  98 + }
  99 + var data DataAuthCheckPassword
  100 + err = gateway.GetResponseData(result, &data)
  101 + return &data, err
  102 +}
  103 +
  104 +// AuthDestroyAccount 注销账号 (添加用户时重新激活)
  105 +func (gateway HttplibAlliedCreationUser) AuthDestroyAccount(param ReqAuthDestroyAccount) (*DataAuthDestroyAccount, error) {
  106 + url := gateway.baseUrL + "/auth/destroy-account"
  107 + method := "POST"
  108 + req := gateway.CreateRequest(url, method)
  109 + log.Logger.Debug("向用户模块请求数据:注销账号 (添加用户时重新激活)。", map[string]interface{}{
  110 + "api": method + ":" + url,
  111 + "param": param,
  112 + })
  113 + req, err := req.JSONBody(param)
  114 + if err != nil {
  115 + return nil, fmt.Errorf("请求注销账号 (添加用户时重新激活)失败:%w", err)
  116 + }
  117 +
  118 + byteResult, err := req.Bytes()
  119 + if err != nil {
  120 + return nil, fmt.Errorf("获取注销账号 (添加用户时重新激活)失败:%w", err)
  121 + }
  122 + log.Logger.Debug("获取用户模块请求数据:注销账号 (添加用户时重新激活)。", map[string]interface{}{
  123 + "result": string(byteResult),
  124 + })
  125 + var result service_gateway.GatewayResponse
  126 + err = json.Unmarshal(byteResult, &result)
  127 + if err != nil {
  128 + return nil, fmt.Errorf("解析注销账号 (添加用户时重新激活):%w", err)
  129 + }
  130 + var data DataAuthDestroyAccount
  131 + err = gateway.GetResponseData(result, &data)
  132 + return &data, err
  133 +}
  134 +
  135 +// AuthResetPassword 重置密码(忘记密码)
  136 +func (gateway HttplibAlliedCreationUser) AuthResetPassword(param ReqAuthResetPassword) (*DataAuthResetPassword, error) {
  137 + url := gateway.baseUrL + "/auth/reset-password"
  138 + method := "POST"
  139 + req := gateway.CreateRequest(url, method)
  140 + log.Logger.Debug("向用户模块请求数据:重置密码(忘记密码)。", map[string]interface{}{
  141 + "api": method + ":" + url,
  142 + "param": param,
  143 + })
  144 + req, err := req.JSONBody(param)
  145 + if err != nil {
  146 + return nil, fmt.Errorf("请求重置密码(忘记密码)失败:%w", err)
  147 + }
  148 +
  149 + byteResult, err := req.Bytes()
  150 + if err != nil {
  151 + return nil, fmt.Errorf("获取重置密码(忘记密码)失败:%w", err)
  152 + }
  153 + log.Logger.Debug("获取用户模块请求数据:重置密码(忘记密码)。", map[string]interface{}{
  154 + "result": string(byteResult),
  155 + })
  156 + var result service_gateway.GatewayResponse
  157 + err = json.Unmarshal(byteResult, &result)
  158 + if err != nil {
  159 + return nil, fmt.Errorf("解析重置密码(忘记密码):%w", err)
  160 + }
  161 + var data DataAuthResetPassword
  162 + err = gateway.GetResponseData(result, &data)
  163 + return &data, err
  164 +}
  165 +
  166 +//AuthResetPhone 重置手机号
  167 +func (gateway HttplibAlliedCreationUser) AuthResetPhone(param ReqAuthResetPhone) (*DataAuthResetPhone, error) {
  168 + url := gateway.baseUrL + "/auth/reset-phone"
  169 + method := "POST"
  170 + req := gateway.CreateRequest(url, method)
  171 + log.Logger.Debug("向用户模块请求数据:重置手机号。", map[string]interface{}{
  172 + "api": method + ":" + url,
  173 + "param": param,
  174 + })
  175 + req, err := req.JSONBody(param)
  176 + if err != nil {
  177 + return nil, fmt.Errorf("请求重置手机号失败:%w", err)
  178 + }
  179 +
  180 + byteResult, err := req.Bytes()
  181 + if err != nil {
  182 + return nil, fmt.Errorf("获取重置手机号失败:%w", err)
  183 + }
  184 + log.Logger.Debug("获取用户模块请求数据:重置手机号。", map[string]interface{}{
  185 + "result": string(byteResult),
  186 + })
  187 + var result service_gateway.GatewayResponse
  188 + err = json.Unmarshal(byteResult, &result)
  189 + if err != nil {
  190 + return nil, fmt.Errorf("解析重置手机号:%w", err)
  191 + }
  192 + var data DataAuthResetPhone
  193 + err = gateway.GetResponseData(result, &data)
  194 + return &data, err
  195 +}
  1 +package allied_creation_user
  2 +
  3 +//企业注册
  4 +type (
  5 + ReqAuthCompanySignUp struct {
  6 + CompanyName string `json:"companyName"`
  7 + Contacts string `json:"contacts"`
  8 + IndustryCategory string `json:"industryCategory"`
  9 + Password string `json:"password"`
  10 + Phone string `json:"phone"`
  11 + Scale string `json:"scale"`
  12 + }
  13 +
  14 + DataAuthCompanySignUp struct {
  15 + }
  16 +)
  17 +
  18 +//修改密码
  19 +type (
  20 + ReqAuthChangePassword struct {
  21 + NewPassword string `json:"newPassword"`
  22 + OldPassword string `json:"oldPassword"`
  23 + UserId string `json:"userId"`
  24 + }
  25 +
  26 + DataAuthChangePassword struct {
  27 + }
  28 +)
  29 +
  30 +//手机账号密码检查
  31 +type (
  32 + ReqAuthCheckPassword struct {
  33 + }
  34 +
  35 + DataAuthCheckPassword struct {
  36 + }
  37 +)
  38 +
  39 +//注销账号 (添加用户时重新激活)
  40 +type (
  41 + ReqAuthDestroyAccount struct {
  42 + }
  43 +
  44 + DataAuthDestroyAccount struct {
  45 + }
  46 +)
  47 +
  48 +//重置手机号
  49 +type (
  50 + ReqAuthResetPhone struct{}
  51 + DataAuthResetPhone struct{}
  52 +)
  53 +
  54 +//重置密码(忘记密码)
  55 +type (
  56 + ReqAuthResetPassword struct{}
  57 + DataAuthResetPassword struct{}
  58 +)
@@ -104,7 +104,7 @@ type ( @@ -104,7 +104,7 @@ type (
104 ReqOrgSearch struct { 104 ReqOrgSearch struct {
105 CompanyId int `json:"companyId"` 105 CompanyId int `json:"companyId"`
106 DepName string `json:"depName"` 106 DepName string `json:"depName"`
107 - IsOrg int `json:"isOrg"` 107 + IsOrg int `json:"isOrg"` //否是组织(是:1 不是:2)
108 Limit int `json:"limit"` 108 Limit int `json:"limit"`
109 Offset int `json:"offset"` 109 Offset int `json:"offset"`
110 OrgCode string `json:"orgCode"` 110 OrgCode string `json:"orgCode"`
@@ -119,3 +119,33 @@ func (controller *UsersController) CooperationUserResetPassword() { @@ -119,3 +119,33 @@ func (controller *UsersController) CooperationUserResetPassword() {
119 data, err := usersService.CooperationUserResetPassword(cooperationUserResetPasswordCommand) 119 data, err := usersService.CooperationUserResetPassword(cooperationUserResetPasswordCommand)
120 controller.Response(data, err) 120 controller.Response(data, err)
121 } 121 }
  122 +
  123 +//CompanyOrgSelector 组织选择表
  124 +func (controller *UsersController) SelectorCompanyOrg() {
  125 + usersService := service.NewUsersService(nil)
  126 + selectorQuery := &query.CompanyOrgSelectorQuery{}
  127 + controller.Unmarshal(selectorQuery)
  128 + selectorQuery.Operator = controller.GetOperator()
  129 + cnt, data, err := usersService.SelectorCompanyOrg(selectorQuery)
  130 + controller.returnPageListData(cnt, data, err, selectorQuery.PageNumber)
  131 +}
  132 +
  133 +//SelectorCompanyRole 角色选择表
  134 +func (controller *UsersController) SelectorCompanyRole() {
  135 + usersService := service.NewUsersService(nil)
  136 + selectorQuery := &query.CompanyRoleSelectorQuery{}
  137 + controller.Unmarshal(selectorQuery)
  138 + selectorQuery.Operator = controller.GetOperator()
  139 + cnt, data, err := usersService.SelectorCompanyRole(selectorQuery)
  140 + controller.returnPageListData(cnt, data, err, selectorQuery.PageNumber)
  141 +}
  142 +
  143 +//CompanyOrgSelector 全组织部门选择表
  144 +func (controller *UsersController) SelectorCompanyOrgAll() {
  145 + usersService := service.NewUsersService(nil)
  146 + selectorQuery := &query.CompanyOrgSelectorQuery{}
  147 + controller.Unmarshal(selectorQuery)
  148 + selectorQuery.Operator = controller.GetOperator()
  149 + _, data, err := usersService.SelectorCompanyOrgAll(selectorQuery)
  150 + controller.Response(data, err)
  151 +}
@@ -18,4 +18,7 @@ func init() { @@ -18,4 +18,7 @@ func init() {
18 web.Router("/v1/web/users/cooperation-user/:userId", &web_client.UsersController{}, "Get:CooperationUserGet") 18 web.Router("/v1/web/users/cooperation-user/:userId", &web_client.UsersController{}, "Get:CooperationUserGet")
19 web.Router("/v1/web/users/cooperation-user/enable", &web_client.UsersController{}, "Put:CooperationUserEnable") 19 web.Router("/v1/web/users/cooperation-user/enable", &web_client.UsersController{}, "Put:CooperationUserEnable")
20 web.Router("/v1/web/users/cooperation-user/reset-password", &web_client.UsersController{}, "Put:CooperationUserResetPassword") 20 web.Router("/v1/web/users/cooperation-user/reset-password", &web_client.UsersController{}, "Put:CooperationUserResetPassword")
  21 + web.Router("/v1/web/users/selector/org", &web_client.UsersController{}, "Post:SelectorCompanyOrg")
  22 + web.Router("/v1/web/users/selector/role", &web_client.UsersController{}, "Post:SelectorCompanyRole")
  23 + web.Router("/v1/web/users/selector/org/all", &web_client.UsersController{}, "Post:SelectorCompanyOrgAll")
21 } 24 }