...
|
...
|
@@ -2,10 +2,12 @@ package service |
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
"strconv"
|
|
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"github.com/xuri/excelize/v2"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
|
|
|
roleService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
)
|
...
|
...
|
@@ -23,6 +25,13 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationSuper(param *command.Que |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
flagHrbp, err := roleService.GetHRBP(transactionContext, param.CompanyId, param.UserId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if flagHrbp != 1 {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "没有操作权限")
|
|
|
}
|
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
...
|
...
|
@@ -47,6 +56,16 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationSuper(param *command.Que |
|
|
if len(param.TargetUserName) > 0 {
|
|
|
condition1["targetUserName"] = "%" + param.TargetUserName + "%"
|
|
|
}
|
|
|
if len(param.SummaryEvaluationId) > 0 {
|
|
|
summaryEvaluationIds := []int{}
|
|
|
for _, v := range param.SummaryEvaluationId {
|
|
|
id, _ := strconv.Atoi(v)
|
|
|
summaryEvaluationIds = append(summaryEvaluationIds, id)
|
|
|
}
|
|
|
if len(summaryEvaluationIds) > 0 {
|
|
|
condition1["id"] = summaryEvaluationIds
|
|
|
}
|
|
|
}
|
|
|
//获取评估列表信息
|
|
|
_, evaluationList, err := evaluationRepo.Find(condition1)
|
|
|
if err != nil {
|
...
|
...
|
@@ -61,7 +80,6 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationSuper(param *command.Que |
|
|
}
|
|
|
userMap[int64(v.TargetUser.UserId)] = nil
|
|
|
targetUserIds = append(targetUserIds, v.TargetUser.UserId)
|
|
|
|
|
|
}
|
|
|
if len(targetUserIds) > 0 {
|
|
|
_, userList, err := userRepo.Find(map[string]interface{}{
|
...
|
...
|
|