作者 yangfu

登录优化

... ... @@ -668,20 +668,25 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
var (
companys []dto.CompanyItem
orgs []dto.OrgItem
companys []dto.CompanyItem
orgs []dto.OrgItem
mapCompany = make(map[int]interface{})
)
for _, v := range result.Users {
companys = append(companys, dto.CompanyItem{
CompanyId: v.Company.CompanyId,
CompanyName: v.Company.CompanyName,
})
for _, vv := range v.UserOrg {
for i := range result.Users {
user := result.Users[i]
if _, ok := mapCompany[user.Company.CompanyId]; !ok {
companys = append(companys, dto.CompanyItem{
CompanyId: user.Company.CompanyId,
CompanyName: user.Company.CompanyName,
})
}
for j := range user.UserOrg {
org := user.UserOrg[j]
orgs = append(orgs, dto.OrgItem{
OrganizationId: vv.OrgID,
OrganizationName: vv.OrgName,
CompanyId: v.Company.CompanyId,
OrganizationId: org.OrgID,
OrganizationName: org.OrgName,
CompanyId: user.Company.CompanyId,
})
}
}
... ...
... ... @@ -56,7 +56,7 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics
var cooperationModes = make([]interface{}, 0)
if len(modeNumbers) > 0 {
models, err := gateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
PageSize: 20,
PageSize: domain.NormalQueryRowCount,
PageNumber: 1,
//CompanyId: cmd.Operator.CompanyId,
//OrgId: cmd.Operator.OrgId,
... ... @@ -88,8 +88,8 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics
projects, err := gateway.CooperationProjectsSearch(allied_creation_cooperation.ReqCooperationProjectSearch{
PageNumber: 1,
PageSize: 1,
//CompanyId: cmd.Operator.CompanyId,
OrgId: cmd.Operator.OrgId,
CompanyId: cmd.Operator.CompanyId,
OrgId: cmd.Operator.OrgId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -43,3 +43,8 @@ const (
OrgStatusEnable = 1
OrgStatusDisable = 2
)
const (
MaxQueryRowCount = 1000
NormalQueryRowCount = 100
)
... ...