...
|
...
|
@@ -14,7 +14,6 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/xredis"
|
|
|
)
|
|
|
|
|
|
// Evaluation360List 获取360综评列表
|
...
|
...
|
@@ -337,108 +336,108 @@ func (srv *SummaryEvaluationService) GetEvaluation360Complete(param *command.Que |
|
|
}
|
|
|
|
|
|
// EditEvaluation360 编辑提交360综评
|
|
|
func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvaluationValue) (map[string][]adapter.EvaluationItemAdapter, error) {
|
|
|
lock := xredis.NewLockSummaryEvaluationId(param.SummaryEvaluationId)
|
|
|
err := lock.Lock()
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未能完全提交评估内容")
|
|
|
}
|
|
|
defer func() {
|
|
|
lock.UnLock()
|
|
|
}()
|
|
|
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()
|
|
|
}()
|
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
|
|
|
summaryEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if summaryEvaluation.Executor.UserId != param.ExecutorId {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
}
|
|
|
if summaryEvaluation.CompanyId != param.CompanyId {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
}
|
|
|
|
|
|
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
"targetUserId": summaryEvaluation.TargetUser.UserId,
|
|
|
"typesList": []int{int(domain.EvaluationFinish)},
|
|
|
"cycleId": summaryEvaluation.CycleId,
|
|
|
"limit": 1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
// 如果目标员工已经确认考核结果,就不能在进行评估编辑
|
|
|
if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!")
|
|
|
}
|
|
|
|
|
|
// 自评评估内容(自评模板、筛选项目评估人)
|
|
|
_, itemList, err := itemUsedRepo.Find(map[string]interface{}{
|
|
|
"evaluationProjectId": summaryEvaluation.EvaluationProjectId,
|
|
|
"nodeType": domain.LinkNodeSelfAssessment,
|
|
|
"evaluatorId": param.ExecutorId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
// 评估内容对应的分数
|
|
|
_, itemValueList, err := itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": summaryEvaluation.Id})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
err = srv.editEvaluationValue(summaryEvaluation, &itemValueList, itemList, param.EvaluationItems, nil, param.IsTemporary)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
if !param.IsTemporary {
|
|
|
//变更评估状态为已填写
|
|
|
summaryEvaluation.Status = domain.EvaluationCompleted
|
|
|
}
|
|
|
|
|
|
//保存填写值
|
|
|
for _, v := range itemValueList {
|
|
|
err = itemValueRepo.Save(v)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//保存填写值
|
|
|
err = evaluationRepo.Save(summaryEvaluation)
|
|
|
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())
|
|
|
}
|
|
|
|
|
|
if !param.IsTemporary {
|
|
|
err = srv.AfterCompletedEvaluation360Hrbp(summaryEvaluation)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
|
|
|
itemValueAdapter := srv.buildSummaryItemValue(itemList, itemValueList)
|
|
|
return map[string][]adapter.EvaluationItemAdapter{
|
|
|
"evaluationItems": itemValueAdapter,
|
|
|
}, nil
|
|
|
}
|
|
|
// func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvaluationValue) (map[string][]adapter.EvaluationItemAdapter, error) {
|
|
|
// lock := xredis.NewLockSummaryEvaluationId(param.SummaryEvaluationId)
|
|
|
// err := lock.Lock()
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未能完全提交评估内容")
|
|
|
// }
|
|
|
// defer func() {
|
|
|
// lock.UnLock()
|
|
|
// }()
|
|
|
// 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()
|
|
|
// }()
|
|
|
// evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
|
|
|
// summaryEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// if summaryEvaluation.Executor.UserId != param.ExecutorId {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
// }
|
|
|
// if summaryEvaluation.CompanyId != param.CompanyId {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
// }
|
|
|
|
|
|
// _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
// "targetUserId": summaryEvaluation.TargetUser.UserId,
|
|
|
// "typesList": []int{int(domain.EvaluationFinish)},
|
|
|
// "cycleId": summaryEvaluation.CycleId,
|
|
|
// "limit": 1,
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// // 如果目标员工已经确认考核结果,就不能在进行评估编辑
|
|
|
// if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!")
|
|
|
// }
|
|
|
|
|
|
// // 自评评估内容(自评模板、筛选项目评估人)
|
|
|
// _, itemList, err := itemUsedRepo.Find(map[string]interface{}{
|
|
|
// "evaluationProjectId": summaryEvaluation.EvaluationProjectId,
|
|
|
// "nodeType": domain.LinkNodeSelfAssessment,
|
|
|
// "evaluatorId": param.ExecutorId,
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
|
|
|
// // 评估内容对应的分数
|
|
|
// _, itemValueList, err := itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": summaryEvaluation.Id})
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
|
|
|
// err = srv.editEvaluationValue(summaryEvaluation, &itemValueList, itemList, param.EvaluationItems, nil, param.IsTemporary)
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
// }
|
|
|
// if !param.IsTemporary {
|
|
|
// //变更评估状态为已填写
|
|
|
// summaryEvaluation.Status = domain.EvaluationCompleted
|
|
|
// }
|
|
|
|
|
|
// //保存填写值
|
|
|
// for _, v := range itemValueList {
|
|
|
// err = itemValueRepo.Save(v)
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// //保存填写值
|
|
|
// err = evaluationRepo.Save(summaryEvaluation)
|
|
|
// 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())
|
|
|
// }
|
|
|
|
|
|
// if !param.IsTemporary {
|
|
|
// err = srv.AfterCompletedEvaluation360Hrbp(summaryEvaluation)
|
|
|
// if err != nil {
|
|
|
// return nil, err
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// itemValueAdapter := srv.buildSummaryItemValue(itemList, itemValueList)
|
|
|
// return map[string][]adapter.EvaluationItemAdapter{
|
|
|
// "evaluationItems": itemValueAdapter,
|
|
|
// }, nil
|
|
|
// }
|
|
|
|
|
|
// EvaluationHRBPList 获取人资综评列表
|
|
|
func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEvaluationHRList) (map[string]interface{}, error) {
|
...
|
...
|
@@ -726,128 +725,128 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBPComplete(param *command.Qu |
|
|
}
|
|
|
|
|
|
// EditEvaluationHRBP 编辑提交人资综评
|
|
|
func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvaluationValue) (map[string][]adapter.EvaluationItemAdapter, error) {
|
|
|
lock := xredis.NewLockSummaryEvaluationId(param.SummaryEvaluationId)
|
|
|
err := lock.Lock()
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未能完全提交评估内容")
|
|
|
}
|
|
|
defer func() {
|
|
|
lock.UnLock()
|
|
|
}()
|
|
|
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()
|
|
|
}()
|
|
|
|
|
|
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
|
|
|
// 必须是HRBP权限的人才能编辑操作
|
|
|
hrbp, err := roleService.GetHrBp(transactionContext, param.CompanyId, param.ExecutorId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if hrbp != domain.RoleTypeSystem {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
}
|
|
|
|
|
|
summaryEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if summaryEvaluation.Types != domain.EvaluationHrbp {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
}
|
|
|
if summaryEvaluation.CompanyId != param.CompanyId {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
}
|
|
|
|
|
|
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
"targetUserId": summaryEvaluation.TargetUser.UserId,
|
|
|
"typesList": []int{int(domain.EvaluationFinish)},
|
|
|
"cycleId": summaryEvaluation.CycleId,
|
|
|
"limit": 1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
// 如果目标员工已经确认考核结果,就不能在进行评估编辑
|
|
|
if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!")
|
|
|
}
|
|
|
|
|
|
// 自评评估内容(自评模板、筛选项目评估人)
|
|
|
_, itemList, err := itemUsedRepo.Find(map[string]interface{}{
|
|
|
"evaluationProjectId": summaryEvaluation.EvaluationProjectId,
|
|
|
"nodeType": domain.LinkNodeSelfAssessment,
|
|
|
"evaluatorId": -1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
// 评估内容对应的分数
|
|
|
_, itemValueList, err := itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": summaryEvaluation.Id})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
err = srv.editEvaluationValue(summaryEvaluation, &itemValueList, itemList, param.EvaluationItems, nil, param.IsTemporary)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
if !param.IsTemporary {
|
|
|
//变更评估状态为已填写
|
|
|
summaryEvaluation.Status = domain.EvaluationCompleted
|
|
|
}
|
|
|
//保存填写值
|
|
|
for _, v := range itemValueList {
|
|
|
err = itemValueRepo.Save(v)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 针对HRBP类型,更新最后一次操作的HRBP人
|
|
|
user, err := userRepo.FindOne(map[string]interface{}{"id": param.ExecutorId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
summaryEvaluation.Executor.UserId = param.ExecutorId
|
|
|
summaryEvaluation.Executor.Account = user.Account
|
|
|
summaryEvaluation.Executor.UserName = user.Name
|
|
|
summaryEvaluation.Executor.CompanyName = "" // 暂时无用
|
|
|
summaryEvaluation.Status = domain.EvaluationCompleted
|
|
|
|
|
|
//保存填写值
|
|
|
err = evaluationRepo.Save(summaryEvaluation)
|
|
|
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())
|
|
|
}
|
|
|
|
|
|
if !param.IsTemporary {
|
|
|
err = srv.AfterCompletedEvaluation360Hrbp(summaryEvaluation)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
itemValueAdapter := srv.buildSummaryItemValue(itemList, itemValueList)
|
|
|
return map[string][]adapter.EvaluationItemAdapter{
|
|
|
"evaluationItems": itemValueAdapter,
|
|
|
}, nil
|
|
|
}
|
|
|
// func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvaluationValue) (map[string][]adapter.EvaluationItemAdapter, error) {
|
|
|
// lock := xredis.NewLockSummaryEvaluationId(param.SummaryEvaluationId)
|
|
|
// err := lock.Lock()
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未能完全提交评估内容")
|
|
|
// }
|
|
|
// defer func() {
|
|
|
// lock.UnLock()
|
|
|
// }()
|
|
|
// 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()
|
|
|
// }()
|
|
|
|
|
|
// userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
|
|
|
// // 必须是HRBP权限的人才能编辑操作
|
|
|
// hrbp, err := roleService.GetHrBp(transactionContext, param.CompanyId, param.ExecutorId)
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// if hrbp != domain.RoleTypeSystem {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
// }
|
|
|
|
|
|
// summaryEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// if summaryEvaluation.Types != domain.EvaluationHrbp {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
// }
|
|
|
// if summaryEvaluation.CompanyId != param.CompanyId {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
|
|
|
// }
|
|
|
|
|
|
// _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
// "targetUserId": summaryEvaluation.TargetUser.UserId,
|
|
|
// "typesList": []int{int(domain.EvaluationFinish)},
|
|
|
// "cycleId": summaryEvaluation.CycleId,
|
|
|
// "limit": 1,
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// // 如果目标员工已经确认考核结果,就不能在进行评估编辑
|
|
|
// if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!")
|
|
|
// }
|
|
|
|
|
|
// // 自评评估内容(自评模板、筛选项目评估人)
|
|
|
// _, itemList, err := itemUsedRepo.Find(map[string]interface{}{
|
|
|
// "evaluationProjectId": summaryEvaluation.EvaluationProjectId,
|
|
|
// "nodeType": domain.LinkNodeSelfAssessment,
|
|
|
// "evaluatorId": -1,
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
|
|
|
// // 评估内容对应的分数
|
|
|
// _, itemValueList, err := itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": summaryEvaluation.Id})
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
|
|
|
// err = srv.editEvaluationValue(summaryEvaluation, &itemValueList, itemList, param.EvaluationItems, nil, param.IsTemporary)
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
// }
|
|
|
// if !param.IsTemporary {
|
|
|
// //变更评估状态为已填写
|
|
|
// summaryEvaluation.Status = domain.EvaluationCompleted
|
|
|
// }
|
|
|
// //保存填写值
|
|
|
// for _, v := range itemValueList {
|
|
|
// err = itemValueRepo.Save(v)
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// // 针对HRBP类型,更新最后一次操作的HRBP人
|
|
|
// user, err := userRepo.FindOne(map[string]interface{}{"id": param.ExecutorId})
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// summaryEvaluation.Executor.UserId = param.ExecutorId
|
|
|
// summaryEvaluation.Executor.Account = user.Account
|
|
|
// summaryEvaluation.Executor.UserName = user.Name
|
|
|
// summaryEvaluation.Executor.CompanyName = "" // 暂时无用
|
|
|
// summaryEvaluation.Status = domain.EvaluationCompleted
|
|
|
|
|
|
// //保存填写值
|
|
|
// err = evaluationRepo.Save(summaryEvaluation)
|
|
|
// 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())
|
|
|
// }
|
|
|
|
|
|
// if !param.IsTemporary {
|
|
|
// err = srv.AfterCompletedEvaluation360Hrbp(summaryEvaluation)
|
|
|
// if err != nil {
|
|
|
// return nil, err
|
|
|
// }
|
|
|
// }
|
|
|
// itemValueAdapter := srv.buildSummaryItemValue(itemList, itemValueList)
|
|
|
// return map[string][]adapter.EvaluationItemAdapter{
|
|
|
// "evaluationItems": itemValueAdapter,
|
|
|
// }, nil
|
|
|
// }
|
|
|
|
|
|
// 修改周期考核的分数
|
|
|
func (srv *SummaryEvaluationService) ModifyFinishScore(param *command.ModifyFinishScore) error {
|
...
|
...
|
|