作者 tangxvhui

调整逻辑

@@ -239,10 +239,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp( @@ -239,10 +239,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(
239 } 239 }
240 if noSuper && len(evaluationFinishList) > 0 { 240 if noSuper && len(evaluationFinishList) > 0 {
241 //不存在上级评估 241 //不存在上级评估
242 - // err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinishList[0], evaluationValue)  
243 - // if err != nil {  
244 - // return err  
245 - // } 242 + err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinishList[0], evaluationValue)
  243 + if err != nil {
  244 + return err
  245 + }
246 } else if len(evaluationList) == 0 && len(evaluationFinishList) > 0 { 246 } else if len(evaluationList) == 0 && len(evaluationFinishList) > 0 {
247 err = evaluationRepo.Save(evaluationFinishList[0]) 247 err = evaluationRepo.Save(evaluationFinishList[0])
248 if err != nil { 248 if err != nil {
@@ -203,34 +203,34 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf( @@ -203,34 +203,34 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(
203 if noSuper && evaluationFinish != nil { 203 if noSuper && evaluationFinish != nil {
204 //没有上级评估 同步数据到考核结果 204 //没有上级评估 同步数据到考核结果
205 205
206 - // itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{  
207 - // "transactionContext": transactionContext,  
208 - // })  
209 - // _, itemList, err := itemUsedRepo.Find(map[string]interface{}{  
210 - // "evaluationProjectId": evaluationData.EvaluationProjectId,  
211 - // "nodeType": domain.LinkNodeSelfAssessment,  
212 - // })  
213 - // if err != nil {  
214 - // return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
215 - // }  
216 - // //提取非360,hrbp 的评估项  
217 - // updateValue := []*domain.SummaryEvaluationValue{}  
218 - // for _, val := range itemList {  
219 - // if val.EvaluatorId != 0 {  
220 - // continue  
221 - // }  
222 - // for _, val2 := range evaluationValue {  
223 - // if val.Id == val2.EvaluationItemId {  
224 - // updateValue = append(updateValue, val2)  
225 - // break  
226 - // }  
227 - // }  
228 - // }  
229 - // //同步数据  
230 - // err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinish, updateValue)  
231 - // if err != nil {  
232 - // return err  
233 - // } 206 + itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
  207 + "transactionContext": transactionContext,
  208 + })
  209 + _, itemList, err := itemUsedRepo.Find(map[string]interface{}{
  210 + "evaluationProjectId": evaluationData.EvaluationProjectId,
  211 + "nodeType": domain.LinkNodeSelfAssessment,
  212 + })
  213 + if err != nil {
  214 + return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  215 + }
  216 + //提取非360,hrbp 的评估项
  217 + updateValue := []*domain.SummaryEvaluationValue{}
  218 + for _, val := range itemList {
  219 + if val.EvaluatorId != 0 {
  220 + continue
  221 + }
  222 + for _, val2 := range evaluationValue {
  223 + if val.Id == val2.EvaluationItemId {
  224 + updateValue = append(updateValue, val2)
  225 + break
  226 + }
  227 + }
  228 + }
  229 + //同步数据
  230 + err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinish, updateValue)
  231 + if err != nil {
  232 + return err
  233 + }
234 234
235 } else if len(targetEvaluation) == 0 && evaluationFinish != nil { 235 } else if len(targetEvaluation) == 0 && evaluationFinish != nil {
236 err = evaluationRepo.Save(evaluationFinish) 236 err = evaluationRepo.Save(evaluationFinish)