正在显示
1 个修改的文件
包含
7 行增加
和
8 行删除
| @@ -724,7 +724,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmMoneyIncentives | @@ -724,7 +724,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmMoneyIncentives | ||
| 724 | Org: organization, | 724 | Org: organization, |
| 725 | Company: company, | 725 | Company: company, |
| 726 | Operator: nil, | 726 | Operator: nil, |
| 727 | - OperateTime: time.Now(), | 727 | + OperateTime: time.Time{}, |
| 728 | IsCanceled: false, | 728 | IsCanceled: false, |
| 729 | CreatedAt: time.Now(), | 729 | CreatedAt: time.Now(), |
| 730 | DeletedAt: time.Time{}, | 730 | DeletedAt: time.Time{}, |
| @@ -732,13 +732,12 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmMoneyIncentives | @@ -732,13 +732,12 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmMoneyIncentives | ||
| 732 | } | 732 | } |
| 733 | dividendsEstimates = append(dividendsEstimates, dividendsEstimate) | 733 | dividendsEstimates = append(dividendsEstimates, dividendsEstimate) |
| 734 | } | 734 | } |
| 735 | - var dividendsEstimatesSaved []*domain.DividendsEstimate | ||
| 736 | - for _, dividendsEstimate := range dividendsEstimates { | ||
| 737 | - if dividendsEstimateSaved, err := dividendsEstimateRepository.Save(dividendsEstimate); err != nil { | ||
| 738 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 739 | - } else { | ||
| 740 | - dividendsEstimatesSaved = append(dividendsEstimatesSaved, dividendsEstimateSaved) | ||
| 741 | - } | 735 | + dividendsEstimatesSaved, err := dividendsEstimateRepository.SaveMany(dividendsEstimates) |
| 736 | + if err != nil { | ||
| 737 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 738 | + } | ||
| 739 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
| 740 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 742 | } | 741 | } |
| 743 | if confirmMoneyIncentivesEstimateCommand.Action == 1 { // 只预算,不入库 | 742 | if confirmMoneyIncentivesEstimateCommand.Action == 1 { // 只预算,不入库 |
| 744 | return dividendsEstimatesSaved, nil | 743 | return dividendsEstimatesSaved, nil |
-
请 注册 或 登录 后发表评论