Merge branch 'dev-zhengzhou' into test
正在显示
1 个修改的文件
包含
20 行增加
和
16 行删除
@@ -503,7 +503,6 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval | @@ -503,7 +503,6 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval | ||
503 | } | 503 | } |
504 | 504 | ||
505 | userIds := make([]int, 0) | 505 | userIds := make([]int, 0) |
506 | - positionIds := make([]int, 0) | ||
507 | projectIds := make([]int, 0) | 506 | projectIds := make([]int, 0) |
508 | projectCountMap := map[string]int{} // 自评逾期数量 | 507 | projectCountMap := map[string]int{} // 自评逾期数量 |
509 | userMap := map[int64]*domain.User{} // 用户 | 508 | userMap := map[int64]*domain.User{} // 用户 |
@@ -514,22 +513,27 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval | @@ -514,22 +513,27 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval | ||
514 | userIds = append(userIds, it.TargetUser.UserId) | 513 | userIds = append(userIds, it.TargetUser.UserId) |
515 | projectIds = append(projectIds, list[i].EvaluationProjectId) | 514 | projectIds = append(projectIds, list[i].EvaluationProjectId) |
516 | } | 515 | } |
517 | - _, users, err := userRepo.Find(map[string]interface{}{"ids": userIds, "companyId": param.CompanyId}) | ||
518 | - if err != nil { | ||
519 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
520 | - } | ||
521 | - for i := range users { | ||
522 | - userMap[users[i].Id] = users[i] | ||
523 | - for _, pid := range users[i].PositionId { | ||
524 | - positionIds = append(positionIds, pid) | 516 | + if len(userIds) > 0 { |
517 | + _, users, err := userRepo.Find(map[string]interface{}{"ids": userIds, "companyId": param.CompanyId}) | ||
518 | + if err != nil { | ||
519 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
520 | + } | ||
521 | + positionIds := make([]int, 0) | ||
522 | + for i := range users { | ||
523 | + userMap[users[i].Id] = users[i] | ||
524 | + for _, pid := range users[i].PositionId { | ||
525 | + positionIds = append(positionIds, pid) | ||
526 | + } | ||
527 | + } | ||
528 | + if len(positionIds) > 0 { | ||
529 | + _, positions, err := positionRepo.Find(map[string]interface{}{"ids": positionIds, "companyId": param.CompanyId}) | ||
530 | + if err != nil { | ||
531 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
532 | + } | ||
533 | + for i := range positions { | ||
534 | + positionMap[positions[i].Id] = positions[i] | ||
535 | + } | ||
525 | } | 536 | } |
526 | - } | ||
527 | - _, positions, err := positionRepo.Find(map[string]interface{}{"ids": positionIds, "companyId": param.CompanyId}) | ||
528 | - if err != nil { | ||
529 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
530 | - } | ||
531 | - for i := range positions { | ||
532 | - positionMap[positions[i].Id] = positions[i] | ||
533 | } | 537 | } |
534 | 538 | ||
535 | if len(projectIds) > 0 { | 539 | if len(projectIds) > 0 { |
-
请 注册 或 登录 后发表评论