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