正在显示
1 个修改的文件
包含
9 行增加
和
4 行删除
@@ -145,7 +145,6 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred | @@ -145,7 +145,6 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred | ||
145 | } | 145 | } |
146 | 146 | ||
147 | // 预算明细 | 147 | // 预算明细 |
148 | - var creditAccounts []*domain.CreditAccount | ||
149 | var accountDetail []*domain.AccountDetail | 148 | var accountDetail []*domain.AccountDetail |
150 | var settlementAmount float64 | 149 | var settlementAmount float64 |
151 | for _, dividendsEstimate := range dividendsEstimates { | 150 | for _, dividendsEstimate := range dividendsEstimates { |
@@ -201,13 +200,19 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred | @@ -201,13 +200,19 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred | ||
201 | if creditAccount, err13 := creditAccountRepository.Save(newCreditAccount); err13 != nil { | 200 | if creditAccount, err13 := creditAccountRepository.Save(newCreditAccount); err13 != nil { |
202 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err13.Error()) | 201 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err13.Error()) |
203 | } else { | 202 | } else { |
204 | - creditAccounts = append(creditAccounts, creditAccount) | 203 | + // 变更分红预算单结算状态 |
204 | + for i, _ := range dividendsEstimates { | ||
205 | + dividendsEstimates[i].DividendsAccountStatus = 2 | ||
206 | + } | ||
207 | + _, err3 := dividendsEstimateRepository.UpdateMany(dividendsEstimates) | ||
208 | + if err3 != nil { | ||
209 | + return nil, err3 | ||
205 | } | 210 | } |
206 | - | ||
207 | if err14 := transactionContext.CommitTransaction(); err14 != nil { | 211 | if err14 := transactionContext.CommitTransaction(); err14 != nil { |
208 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err14.Error()) | 212 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err14.Error()) |
209 | } | 213 | } |
210 | - return creditAccounts, nil | 214 | + return creditAccount, nil |
215 | + } | ||
211 | } | 216 | } |
212 | } | 217 | } |
213 | 218 |
-
请 注册 或 登录 后发表评论