作者 陈志颖

合并分支 'dev' 到 'test'

fix:修复删除账期结算单时更新分红预算单范围错误



查看合并请求 !45
@@ -458,8 +458,14 @@ func (creditAccountService *CreditAccountService) RemoveCreditAccount(removeCred @@ -458,8 +458,14 @@ func (creditAccountService *CreditAccountService) RemoveCreditAccount(removeCred
458 if creditAccountRemoved, err := creditAccountRepository.Remove(creditAccount); err != nil { 458 if creditAccountRemoved, err := creditAccountRepository.Remove(creditAccount); err != nil {
459 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 459 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
460 } else { 460 } else {
461 - // 更新相关分红预算单结算状态 461 + // 相关分红预算单ID列表
462 dividendsEstimateIds := make([]int64, 0) 462 dividendsEstimateIds := make([]int64, 0)
  463 +
  464 + for _, accountDetail := range creditAccount.AccountDetail {
  465 + dividendsEstimateIds = append(dividendsEstimateIds, accountDetail.DividendsEstimateOrderId)
  466 + }
  467 +
  468 + // 更新相关分红预算单结算状态
463 if count, dividendsEstimates, err := dividendsEstimateRepository.Find(map[string]interface{}{ 469 if count, dividendsEstimates, err := dividendsEstimateRepository.Find(map[string]interface{}{
464 "dividendsEstimateIds": dividendsEstimateIds, 470 "dividendsEstimateIds": dividendsEstimateIds,
465 }); err != nil { 471 }); err != nil {