...
|
...
|
@@ -40,9 +40,9 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp |
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
var (
|
|
|
usersOrg []dto.UserOrg
|
|
|
userRole []dto.UserRole
|
|
|
userMenu []dto.UserMenu
|
|
|
usersOrg []dto.UserOrg = make([]dto.UserOrg, 0)
|
|
|
userRole []dto.UserRole = make([]dto.UserRole, 0)
|
|
|
userMenu []dto.UserMenu = make([]dto.UserMenu, 0)
|
|
|
)
|
|
|
|
|
|
for _, v := range resultMenu.Menus {
|
...
|
...
|
@@ -223,18 +223,18 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw |
|
|
func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *command.CompanyUserUpdateCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
companyUserUpdateCommand.Operator)
|
|
|
departmentId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId)
|
|
|
departmentId, _ := strconv.Atoi(companyUserUpdateCommand.DepartmentId)
|
|
|
orgId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId)
|
|
|
userOrg := []int64{}
|
|
|
userRole := []int64{}
|
|
|
for _, v := range companyUserUpdateCommand.UsersOrg {
|
|
|
id, err := strconv.Atoi(v)
|
|
|
for _, v := range companyUserUpdateCommand.UserOrg {
|
|
|
id, err := strconv.Atoi(v.OrgId)
|
|
|
if err == nil {
|
|
|
userOrg = append(userOrg, int64(id))
|
|
|
}
|
|
|
}
|
|
|
for _, v := range companyUserUpdateCommand.UsersRole {
|
|
|
id, err := strconv.Atoi(v)
|
|
|
for _, v := range companyUserUpdateCommand.UserRole {
|
|
|
id, err := strconv.Atoi(v.RoleId)
|
|
|
if err == nil {
|
|
|
userRole = append(userRole, int64(id))
|
|
|
}
|
...
|
...
|
@@ -251,8 +251,8 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co |
|
|
EnableStatus: companyUserUpdateCommand.EnableStatus,
|
|
|
UserName: companyUserUpdateCommand.UsersName,
|
|
|
Phone: companyUserUpdateCommand.Phone,
|
|
|
Avatar: companyUserUpdateCommand.Avator,
|
|
|
Email: companyUserUpdateCommand.Avator,
|
|
|
Avatar: companyUserUpdateCommand.Avatar,
|
|
|
Email: companyUserUpdateCommand.Email,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
...
|
...
|
|