作者 tangxvhui

添加字段 SummaryEvaluationValue

... ... @@ -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())
}
... ...
... ... @@ -17,6 +17,7 @@ type SummaryEvaluationValue struct {
Score string `json:"score"` //评定得分
Types EvaluationType `json:"types"` //评估类型
Remark string `json:"remark"` //填写的内容反馈
Executor StaffDesc `json:"executor"` //填写评估的用户,执行人
Weight float64 `json:"weight"` //"权重"
Rating RatingLevel `json:"rating"` //评级时的填写值
CreatedAt time.Time `json:"createdAt"` //数据创建时间
... ...