作者 tangxvhui

修复bug

@@ -230,6 +230,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp( @@ -230,6 +230,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(
230 evaluationFinishList[0].BeginTime = nowTime 230 evaluationFinishList[0].BeginTime = nowTime
231 } 231 }
232 evaluationFinishList[0].Status = domain.EvaluationCompleted 232 evaluationFinishList[0].Status = domain.EvaluationCompleted
  233 + err = evaluationRepo.Save(evaluationFinishList[0])
  234 + if err != nil {
  235 + return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
  236 + }
233 //添加确认绩效成绩提醒短信提醒 237 //添加确认绩效成绩提醒短信提醒
234 err = notify.AddNotifyConfirmEvaluationScore(evaluationFinishList[0]) 238 err = notify.AddNotifyConfirmEvaluationScore(evaluationFinishList[0])
235 if err != nil { 239 if err != nil {
@@ -237,17 +241,17 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp( @@ -237,17 +241,17 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(
237 } 241 }
238 } 242 }
239 } 243 }
240 - if noSuper && len(evaluationFinishList) > 0 {  
241 - //不存在上级评估  
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 {  
247 - err = evaluationRepo.Save(evaluationFinishList[0])  
248 - if err != nil {  
249 - return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())  
250 - }  
251 - } 244 + // if noSuper && len(evaluationFinishList) > 0 {
  245 + //不存在上级评估
  246 + // err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinishList[0], evaluationValue)
  247 + // if err != nil {
  248 + // return err
  249 + // }
  250 + // } else if len(evaluationList) == 0 && len(evaluationFinishList) > 0 {
  251 + // err = evaluationRepo.Save(evaluationFinishList[0])
  252 + // if err != nil {
  253 + // return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
  254 + // }
  255 + // }
252 return nil 256 return nil
253 } 257 }
@@ -192,6 +192,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf( @@ -192,6 +192,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(
192 evaluationFinish.BeginTime = nowTime 192 evaluationFinish.BeginTime = nowTime
193 } 193 }
194 evaluationFinish.Status = domain.EvaluationCompleted 194 evaluationFinish.Status = domain.EvaluationCompleted
  195 + err = evaluationRepo.Save(evaluationFinish)
  196 + if err != nil {
  197 + return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
  198 + }
195 //添加确认绩效成绩提醒短信提醒 199 //添加确认绩效成绩提醒短信提醒
196 err = notify.AddNotifyConfirmEvaluationScore(evaluationFinish) 200 err = notify.AddNotifyConfirmEvaluationScore(evaluationFinish)
197 if err != nil { 201 if err != nil {
@@ -199,45 +203,45 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf( @@ -199,45 +203,45 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(
199 } 203 }
200 } 204 }
201 } 205 }
  206 + _ = noSuper
  207 + // if noSuper && evaluationFinish != nil {
  208 + //没有上级评估 同步数据到考核结果
202 209
203 - if noSuper && evaluationFinish != nil {  
204 - //没有上级评估 同步数据到考核结果  
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 - // } 210 + // itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
  211 + // "transactionContext": transactionContext,
  212 + // })
  213 + // _, itemList, err := itemUsedRepo.Find(map[string]interface{}{
  214 + // "evaluationProjectId": evaluationData.EvaluationProjectId,
  215 + // "nodeType": domain.LinkNodeSelfAssessment,
  216 + // })
  217 + // if err != nil {
  218 + // return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  219 + // }
  220 + // //提取非360,hrbp 的评估项
  221 + // updateValue := []*domain.SummaryEvaluationValue{}
  222 + // for _, val := range itemList {
  223 + // if val.EvaluatorId != 0 {
  224 + // continue
  225 + // }
  226 + // for _, val2 := range evaluationValue {
  227 + // if val.Id == val2.EvaluationItemId {
  228 + // updateValue = append(updateValue, val2)
  229 + // break
  230 + // }
  231 + // }
  232 + // }
  233 + // //同步数据
  234 + // err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinish, updateValue)
  235 + // if err != nil {
  236 + // return err
  237 + // }
234 238
235 - } else if len(targetEvaluation) == 0 && evaluationFinish != nil {  
236 - err = evaluationRepo.Save(evaluationFinish)  
237 - if err != nil {  
238 - return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())  
239 - }  
240 - } 239 + // } else if len(targetEvaluation) == 0 && evaluationFinish != nil {
  240 + // err = evaluationRepo.Save(evaluationFinish)
  241 + // if err != nil {
  242 + // return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
  243 + // }
  244 + // }
241 245
242 return nil 246 return nil
243 } 247 }