...
|
...
|
@@ -743,3 +743,45 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge |
|
|
}
|
|
|
return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil
|
|
|
}
|
|
|
|
|
|
//根据周期和日期。获取上级评估的列表,员工的被其他人评估
|
|
|
func (srv StaffAssessServeice) ListTargetUserSuperAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) {
|
|
|
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
//获取员工的评估
|
|
|
cnt, assessList, err := assessReps.Find(map[string]interface{}{
|
|
|
"cycleId": param.CycleId,
|
|
|
"beginDay": param.BeginDay,
|
|
|
"companyId": param.CompanyId,
|
|
|
"targetUserId": param.TargetUserId,
|
|
|
"typesList": []string{string(domain.AssessSuper)},
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error())
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
var resultList []map[string]interface{}
|
|
|
for _, v := range assessList {
|
|
|
item := map[string]interface{}{
|
|
|
"id": v.Id,
|
|
|
"targetUser": v.TargetUser,
|
|
|
"executor": v.Executor,
|
|
|
}
|
|
|
resultList = append(resultList, item)
|
|
|
}
|
|
|
return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil
|
|
|
} |
...
|
...
|
|