作者 郑周

Merge branch 'dev-zhengzhou' into test

... ... @@ -503,7 +503,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{} // 用户
... ... @@ -514,16 +513,19 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval
userIds = append(userIds, it.TargetUser.UserId)
projectIds = append(projectIds, list[i].EvaluationProjectId)
}
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())
... ... @@ -531,6 +533,8 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval
for i := range positions {
positionMap[positions[i].Id] = positions[i]
}
}
}
if len(projectIds) > 0 {
targetCount, err := staffAssessDaoRepo.CountUncompletedSelfAssess(param.CompanyId, projectIds)
... ...