...
|
...
|
@@ -8,6 +8,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/dto"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
|
|
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
|
|
|
)
|
...
|
...
|
@@ -24,9 +25,7 @@ func NewUsersService(options map[string]interface{}) *UsersService { |
|
|
// 获取公司用户信息
|
|
|
func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.CompanyUserGetQuery) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
companyUserGetQuery.Operator.CompanyId,
|
|
|
companyUserGetQuery.Operator.OrgId,
|
|
|
companyUserGetQuery.Operator.UserId)
|
|
|
companyUserGetQuery.Operator)
|
|
|
userid, _ := strconv.Atoi(companyUserGetQuery.UsersId)
|
|
|
resultUser, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{
|
|
|
UserId: userid,
|
...
|
...
|
@@ -98,9 +97,7 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp |
|
|
// 创建公司用户信息
|
|
|
func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.CompanyUserAddCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
companyUserAddCommand.Operator.CompanyId,
|
|
|
companyUserAddCommand.Operator.OrgId,
|
|
|
companyUserAddCommand.Operator.UserId)
|
|
|
companyUserAddCommand.Operator)
|
|
|
departmentId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
|
|
|
orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
|
|
|
userOrg := []int64{}
|
...
|
...
|
@@ -148,9 +145,7 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command. |
|
|
// 启用禁用公司用户信息
|
|
|
func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *command.CompanyUserEnableCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
companyUserEnableCommand.Operator.CompanyId,
|
|
|
companyUserEnableCommand.Operator.OrgId,
|
|
|
companyUserEnableCommand.Operator.UserId)
|
|
|
companyUserEnableCommand.Operator)
|
|
|
|
|
|
var userIds []int64
|
|
|
for i := range companyUserEnableCommand.UsersIds {
|
...
|
...
|
@@ -169,7 +164,7 @@ func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *co |
|
|
|
|
|
// 返回公司用户信息列表
|
|
|
func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.CompanyUserListQuery) (int64, interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
|
|
|
result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
|
|
|
Offset: (companyUserListQuery.PageNumber - 1) * companyUserListQuery.PageSize,
|
|
|
Limit: companyUserListQuery.PageSize,
|
...
|
...
|
@@ -208,9 +203,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co |
|
|
// 批量重置密码
|
|
|
func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPasswordCommand *command.CompanyUserResetPasswordCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
companyUserResetPasswordCommand.Operator.CompanyId,
|
|
|
companyUserResetPasswordCommand.Operator.OrgId,
|
|
|
companyUserResetPasswordCommand.Operator.UserId)
|
|
|
companyUserResetPasswordCommand.Operator)
|
|
|
var userIds []int64
|
|
|
for i := range companyUserResetPasswordCommand.UserIds {
|
|
|
id, _ := strconv.Atoi(companyUserResetPasswordCommand.UserIds[i])
|
...
|
...
|
@@ -229,9 +222,7 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw |
|
|
// 更新公司用户信息
|
|
|
func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *command.CompanyUserUpdateCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
companyUserUpdateCommand.Operator.CompanyId,
|
|
|
companyUserUpdateCommand.Operator.OrgId,
|
|
|
companyUserUpdateCommand.Operator.UserId)
|
|
|
companyUserUpdateCommand.Operator)
|
|
|
departmentId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId)
|
|
|
orgId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId)
|
|
|
userOrg := []int64{}
|
...
|
...
|
@@ -272,9 +263,7 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co |
|
|
// 创建共创用户信息
|
|
|
func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *command.CooperationUserAddCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
cooperationUserAddCommand.Operator.CompanyId,
|
|
|
cooperationUserAddCommand.Operator.OrgId,
|
|
|
cooperationUserAddCommand.Operator.UserId)
|
|
|
cooperationUserAddCommand.Operator)
|
|
|
result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{
|
|
|
CompanyId: cooperationUserAddCommand.Operator.CompanyId,
|
|
|
CooperationCompany: cooperationUserAddCommand.CooperationCompany,
|
...
|
...
|
@@ -304,9 +293,7 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand * |
|
|
// 启用禁用共创用户信息
|
|
|
func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCommand *command.CooperationUserEnableCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
cooperationUserEnableCommand.Operator.CompanyId,
|
|
|
cooperationUserEnableCommand.Operator.OrgId,
|
|
|
cooperationUserEnableCommand.Operator.UserId)
|
|
|
cooperationUserEnableCommand.Operator)
|
|
|
var userIds []int64
|
|
|
for i := range cooperationUserEnableCommand.UsersIds {
|
|
|
id, _ := strconv.Atoi(cooperationUserEnableCommand.UsersIds[i])
|
...
|
...
|
@@ -325,9 +312,7 @@ func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCom |
|
|
// 获取共创用户信息
|
|
|
func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *query.CooperationUserGetQuery) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
cooperationUserGetQuery.Operator.CompanyId,
|
|
|
cooperationUserGetQuery.Operator.OrgId,
|
|
|
cooperationUserGetQuery.Operator.UserId)
|
|
|
cooperationUserGetQuery.Operator)
|
|
|
userId, _ := strconv.Atoi(cooperationUserGetQuery.UserId)
|
|
|
result, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{
|
|
|
UserId: userId,
|
...
|
...
|
@@ -352,7 +337,7 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu |
|
|
|
|
|
// 返回共创用户信息列表
|
|
|
func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *query.CooperationUserListQuery) (int64, interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
|
|
|
result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
|
|
|
Offset: (cooperationUserListQuery.PageNumber - 1) * cooperationUserListQuery.PageSize,
|
|
|
Limit: cooperationUserListQuery.PageSize,
|
...
|
...
|
@@ -390,9 +375,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * |
|
|
// 批量重置密码
|
|
|
func (usersService *UsersService) CooperationUserResetPassword(cooperationUserResetPasswordCommand *command.CooperationUserResetPasswordCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
cooperationUserResetPasswordCommand.Operator.CompanyId,
|
|
|
cooperationUserResetPasswordCommand.Operator.OrgId,
|
|
|
cooperationUserResetPasswordCommand.Operator.UserId)
|
|
|
cooperationUserResetPasswordCommand.Operator)
|
|
|
var userIds []int64
|
|
|
for i := range cooperationUserResetPasswordCommand.UserIds {
|
|
|
id, _ := strconv.Atoi(cooperationUserResetPasswordCommand.UserIds[i])
|
...
|
...
|
@@ -412,9 +395,7 @@ func (usersService *UsersService) CooperationUserResetPassword(cooperationUserRe |
|
|
// 编辑共创用户信息
|
|
|
func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCommand *command.CooperationUserUpdateCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
cooperationUserUpdateCommand.Operator.CompanyId,
|
|
|
cooperationUserUpdateCommand.Operator.OrgId,
|
|
|
cooperationUserUpdateCommand.Operator.UserId)
|
|
|
cooperationUserUpdateCommand.Operator)
|
|
|
_, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{
|
|
|
UserId: cooperationUserUpdateCommand.UserId,
|
|
|
CooperationCompany: cooperationUserUpdateCommand.CooperationCompany,
|
...
|
...
|
@@ -436,9 +417,7 @@ func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCom |
|
|
//CompanyOrgSelector 获取公司组织的下拉列表
|
|
|
func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
selectorQuery.Operator.CompanyId,
|
|
|
selectorQuery.Operator.OrgId,
|
|
|
selectorQuery.Operator.UserId)
|
|
|
selectorQuery.Operator)
|
|
|
result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
|
|
|
CompanyId: int(selectorQuery.Operator.CompanyId),
|
|
|
DepName: selectorQuery.OrgName,
|
...
|
...
|
@@ -470,9 +449,7 @@ func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.Compan |
|
|
//SelectorCompanyRole 获取公司角色的下拉列表
|
|
|
func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.CompanyRoleSelectorQuery) (int64, interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
selectorQuery.Operator.CompanyId,
|
|
|
selectorQuery.Operator.OrgId,
|
|
|
selectorQuery.Operator.UserId)
|
|
|
selectorQuery.Operator)
|
|
|
result, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
|
|
|
Limit: selectorQuery.PageSize,
|
|
|
Offset: (selectorQuery.PageNumber - 1) * selectorQuery.PageSize,
|
...
|
...
|
@@ -500,9 +477,7 @@ func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.Compa |
|
|
//CompanyOrgSelector 获取公司全组织部门的下拉列表
|
|
|
func (usersService *UsersService) SelectorCompanyOrgAll(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
selectorQuery.Operator.CompanyId,
|
|
|
selectorQuery.Operator.OrgId,
|
|
|
selectorQuery.Operator.UserId)
|
|
|
selectorQuery.Operator)
|
|
|
result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
|
|
|
CompanyId: int(selectorQuery.Operator.CompanyId),
|
|
|
DepName: "",
|
...
|
...
|
|