...
|
...
|
@@ -596,6 +596,8 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu |
|
|
// 员工提交自评内容后,
|
|
|
// 员工作为被评估人,
|
|
|
// 变更360评估/人资评估/的开始时间
|
|
|
// 或者上级评估的开始时间
|
|
|
// 或者生成考核结果
|
|
|
func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain.SummaryEvaluation) error {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -619,7 +621,18 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain. |
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
if len(evaluationList) == 0 {
|
|
|
//如果没有360评估和hrbp 评估,查找上级评估
|
|
|
_, evaluationList, err = evaluationRepo.Find(map[string]interface{}{
|
|
|
"targetUserId": param.TargetUser.UserId,
|
|
|
"typesList": []int{int(domain.EvaluationSuper)},
|
|
|
"cycleId": param.CycleId,
|
|
|
"limit": 10,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
}
|
|
|
nowTime := time.Now()
|
|
|
updatedId := []int{}
|
|
|
// 变更360评估/人资评估/上级评估的开始时间
|
...
|
...
|
@@ -632,12 +645,16 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain. |
|
|
evaluationDao := dao.NewSummaryEvaluationDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
err = evaluationDao.UpdateBeginTime(updatedId, nowTime)
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
if len(evaluationList) == 0 {
|
|
|
//没有上级评估、360评估、hrbp 评估
|
|
|
//直接生成考核结果记录
|
|
|
//
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|