作者 郑周

1. 修复 代码 格式错误

... ... @@ -499,7 +499,6 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval
}
userIds := make([]int, 0)
positionIds := make([]int, 0)
projectIds := make([]int, 0)
projectCountMap := map[string]int{} // 自评逾期数量
userMap := map[int64]*domain.User{} // 用户
... ... @@ -510,22 +509,27 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval
userIds = append(userIds, it.TargetUser.UserId)
projectIds = append(projectIds, list[i].EvaluationProjectId)
}
_, users, err := userRepo.Find(map[string]interface{}{"ids": userIds, "companyId": param.CompanyId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
for i := range users {
userMap[users[i].Id] = users[i]
for _, pid := range users[i].PositionId {
positionIds = append(positionIds, pid)
if len(userIds) > 0 {
_, users, err := userRepo.Find(map[string]interface{}{"ids": userIds, "companyId": param.CompanyId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
positionIds := make([]int, 0)
for i := range users {
userMap[users[i].Id] = users[i]
for _, pid := range users[i].PositionId {
positionIds = append(positionIds, pid)
}
}
if len(positionIds) > 0 {
_, positions, err := positionRepo.Find(map[string]interface{}{"ids": positionIds, "companyId": param.CompanyId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
for i := range positions {
positionMap[positions[i].Id] = positions[i]
}
}
}
_, positions, err := positionRepo.Find(map[string]interface{}{"ids": positionIds, "companyId": param.CompanyId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
for i := range positions {
positionMap[positions[i].Id] = positions[i]
}
if len(projectIds) > 0 {
... ...