|
@@ -531,6 +531,18 @@ func (userService *UserService) ListUser(listUserQuery *query.ListUserQuery) (in |
|
@@ -531,6 +531,18 @@ func (userService *UserService) ListUser(listUserQuery *query.ListUserQuery) (in |
531
|
queryOptions["userBaseId"] = userBase.UserBaseId
|
531
|
queryOptions["userBaseId"] = userBase.UserBaseId
|
532
|
}
|
532
|
}
|
533
|
}
|
533
|
}
|
|
|
534
|
+ if len(listUserQuery.DepName) > 0 {
|
|
|
535
|
+ orgRepository, _, _ := factory.FastPgOrg(transactionContext, 0)
|
|
|
536
|
+ _, orgs, err := orgRepository.Find(map[string]interface{}{"companyId": listUserQuery.CompanyId, "matchOrgName": listUserQuery.DepName})
|
|
|
537
|
+ if err != nil {
|
|
|
538
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
539
|
+ }
|
|
|
540
|
+ if len(orgs) > 0 {
|
|
|
541
|
+ queryOptions["inDepartmentIds"] = domain.Organizations(orgs).OrgIds()
|
|
|
542
|
+ }
|
|
|
543
|
+ listUserQuery.DepName = ""
|
|
|
544
|
+ delete(queryOptions, "depName")
|
|
|
545
|
+ }
|
534
|
if count, users, err := userRepository.Find(queryOptions); err != nil {
|
546
|
if count, users, err := userRepository.Find(queryOptions); err != nil {
|
535
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
547
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
536
|
} else {
|
548
|
} else {
|