...
|
...
|
@@ -461,12 +461,13 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
evaluationItemMap := map[int]*domain.EvaluationItemUsed{}
|
|
|
evaluationValueMap := map[int]*domain.SummaryEvaluationValue{}
|
|
|
for _, v := range itemList {
|
|
|
newValue := &domain.SummaryEvaluationValue{}
|
|
|
newValue.SetBlankValue(evaluationData, v)
|
|
|
evaluationValueMap[v.Id] = newValue
|
|
|
evaluationItemMap[v.Id] = v
|
|
|
}
|
|
|
for _, v := range itemValueList {
|
|
|
if mValue, ok := evaluationValueMap[v.EvaluationItemId]; ok {
|
...
|
...
|
@@ -479,11 +480,13 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu |
|
|
if !ok {
|
|
|
continue
|
|
|
}
|
|
|
evaluationItem, ok := evaluationItemMap[v.EvaluationItemId]
|
|
|
if !ok {
|
|
|
continue
|
|
|
}
|
|
|
updatedData.UpdatedAt = nowTime
|
|
|
updatedData.Value = v.Value
|
|
|
updatedData.Remark = v.Remark
|
|
|
//计算得分
|
|
|
err = updatedData.SummaryEvaluationScore()
|
|
|
//填充评估填写值
|
|
|
err = updatedData.FillValue(evaluationItem, v.Value, v.Remark)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -845,11 +848,14 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval |
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
evaluationItemMap := map[int]*domain.EvaluationItemUsed{}
|
|
|
evaluationValueMap := map[int]*domain.SummaryEvaluationValue{}
|
|
|
for _, v := range itemList {
|
|
|
newValue := &domain.SummaryEvaluationValue{}
|
|
|
//初始一个空白的value
|
|
|
newValue.SetBlankValue(evaluationData, v)
|
|
|
evaluationValueMap[v.Id] = newValue
|
|
|
evaluationItemMap[v.Id] = v
|
|
|
}
|
|
|
for _, v := range itemValueList {
|
|
|
if mValue, ok := evaluationValueMap[v.EvaluationItemId]; ok {
|
...
|
...
|
@@ -862,18 +868,23 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval |
|
|
if !ok {
|
|
|
continue
|
|
|
}
|
|
|
evaluationItem, ok := evaluationItemMap[v.EvaluationItemId]
|
|
|
if !ok {
|
|
|
continue
|
|
|
}
|
|
|
if defaultValue, ok := hrbpOr360ItemValue[v.EvaluationItemId]; ok {
|
|
|
updatedData.Value = defaultValue.Value
|
|
|
//填充值
|
|
|
err = updatedData.FillValue(evaluationItem, defaultValue.Value, v.Remark)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
} else {
|
|
|
updatedData.Value = v.Value
|
|
|
err = updatedData.FillValue(evaluationItem, v.Value, v.Remark)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
}
|
|
|
updatedData.UpdatedAt = nowTime
|
|
|
updatedData.Remark = v.Remark
|
|
|
//计算得分
|
|
|
err = updatedData.SummaryEvaluationScore()
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
}
|
|
|
evaluationValueList := []*domain.SummaryEvaluationValue{}
|
|
|
for _, v := range evaluationValueMap {
|
...
|
...
|
|