作者 tangxvhui

更新

@@ -198,7 +198,10 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G @@ -198,7 +198,10 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
198 UpdatedAt: time.Time{}, 198 UpdatedAt: time.Time{},
199 Payload: string(payloadStr), 199 Payload: string(payloadStr),
200 } 200 }
201 - messageRepo.Save(&newMessage) 201 + err = messageRepo.Save(&newMessage)
  202 + if err != nil {
  203 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  204 + }
202 } 205 }
203 for _, val := range taskStageList2 { 206 for _, val := range taskStageList2 {
204 s := fmt.Sprintf("您下级%s负责的项目【%s】里程碑未按时完成,请前往辅导。", val.LeaderName, val.Name) 207 s := fmt.Sprintf("您下级%s负责的项目【%s】里程碑未按时完成,请前往辅导。", val.LeaderName, val.Name)
@@ -220,7 +223,10 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G @@ -220,7 +223,10 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
220 UpdatedAt: time.Time{}, 223 UpdatedAt: time.Time{},
221 Payload: string(payloadStr), 224 Payload: string(payloadStr),
222 } 225 }
223 - messageRepo.Save(&newMessage) 226 + err = messageRepo.Save(&newMessage)
  227 + if err != nil {
  228 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  229 + }
224 } 230 }
225 for _, val := range taskStageList3 { 231 for _, val := range taskStageList3 {
226 s := fmt.Sprintf("【您下级%s关注的项目【%s】里程碑未按时完成,请前往辅导。】", val.LeaderName, val.Name) 232 s := fmt.Sprintf("【您下级%s关注的项目【%s】里程碑未按时完成,请前往辅导。】", val.LeaderName, val.Name)
@@ -242,7 +248,10 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G @@ -242,7 +248,10 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
242 UpdatedAt: time.Time{}, 248 UpdatedAt: time.Time{},
243 Payload: string(payloadStr), 249 Payload: string(payloadStr),
244 } 250 }
245 - messageRepo.Save(&newMessage) 251 + err = messageRepo.Save(&newMessage)
  252 + if err != nil {
  253 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  254 + }
246 } 255 }
247 256
248 if err := transactionContext.CommitTransaction(); err != nil { 257 if err := transactionContext.CommitTransaction(); err != nil {
@@ -354,7 +363,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command. @@ -354,7 +363,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command.
354 UpdatedAt: time.Time{}, 363 UpdatedAt: time.Time{},
355 Payload: string(payloadStr), 364 Payload: string(payloadStr),
356 } 365 }
357 - messageRepo.Save(&newMessage) 366 + err = messageRepo.Save(&newMessage)
  367 + if err != nil {
  368 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  369 + }
358 } 370 }
359 for _, val := range taskStageList2 { 371 for _, val := range taskStageList2 {
360 s := fmt.Sprintf("【您下级%s负责的项目【%s】已超过N日未反馈进度,请前往辅导。】", val.LeaderName, val.Name) 372 s := fmt.Sprintf("【您下级%s负责的项目【%s】已超过N日未反馈进度,请前往辅导。】", val.LeaderName, val.Name)
@@ -376,7 +388,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command. @@ -376,7 +388,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command.
376 UpdatedAt: time.Time{}, 388 UpdatedAt: time.Time{},
377 Payload: string(payloadStr), 389 Payload: string(payloadStr),
378 } 390 }
379 - messageRepo.Save(&newMessage) 391 + err = messageRepo.Save(&newMessage)
  392 + if err != nil {
  393 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  394 + }
380 } 395 }
381 for _, val := range taskStageList3 { 396 for _, val := range taskStageList3 {
382 s := fmt.Sprintf("【您下级%s关注的项目【%s】已超过N日未反馈进度,请前往辅导。】", val.LeaderName, val.Name) 397 s := fmt.Sprintf("【您下级%s关注的项目【%s】已超过N日未反馈进度,请前往辅导。】", val.LeaderName, val.Name)
@@ -398,7 +413,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command. @@ -398,7 +413,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command.
398 UpdatedAt: time.Time{}, 413 UpdatedAt: time.Time{},
399 Payload: string(payloadStr), 414 Payload: string(payloadStr),
400 } 415 }
401 - messageRepo.Save(&newMessage) 416 + err = messageRepo.Save(&newMessage)
  417 + if err != nil {
  418 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  419 + }
402 } 420 }
403 if err := transactionContext.CommitTransaction(); err != nil { 421 if err := transactionContext.CommitTransaction(); err != nil {
404 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 422 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())