...
|
...
|
@@ -803,3 +803,45 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu |
|
|
"evaluationItems": itemValueAdapter,
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
func (srv *SummaryEvaluationService) SummaryEvaluationFinishNotUseSuper(
|
|
|
evaluation domain.SummaryEvaluation,
|
|
|
items []*domain.EvaluationItemUsed,
|
|
|
itemValue []*domain.SummaryEvaluationValue,
|
|
|
) []*domain.SummaryEvaluationValue {
|
|
|
typeSelf := map[int]*domain.SummaryEvaluationValue{}
|
|
|
typeHrbp360 := map[int]*domain.SummaryEvaluationValue{}
|
|
|
for _, v := range itemValue {
|
|
|
switch v.Types {
|
|
|
case domain.EvaluationSelf:
|
|
|
typeSelf[v.EvaluationItemId] = v
|
|
|
case domain.Evaluation360, domain.EvaluationHrbp:
|
|
|
typeHrbp360[v.EvaluationItemId] = v
|
|
|
}
|
|
|
}
|
|
|
newItemValue := []*domain.SummaryEvaluationValue{}
|
|
|
nowTime := time.Now()
|
|
|
for _, v := range items {
|
|
|
var itemValueTemp domain.SummaryEvaluationValue
|
|
|
if v.EvaluatorId == 0 {
|
|
|
if v2, ok := typeSelf[v.Id]; ok {
|
|
|
itemValueTemp = *v2
|
|
|
}
|
|
|
} else {
|
|
|
if v2, ok := typeHrbp360[v.Id]; ok {
|
|
|
itemValueTemp = *v2
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if itemValueTemp.Id == 0 {
|
|
|
//360 hrbp,或者自评 都没有填写过
|
|
|
itemValueTemp.SetBlankValue(&evaluation, v)
|
|
|
}
|
|
|
//清理id信息
|
|
|
itemValueTemp.Id = 0
|
|
|
itemValueTemp.CreatedAt = nowTime
|
|
|
itemValueTemp.UpdatedAt = nowTime
|
|
|
newItemValue = append(newItemValue, &itemValueTemp)
|
|
|
}
|
|
|
return newItemValue
|
|
|
} |
...
|
...
|
|