|
@@ -312,7 +312,7 @@ func (creditAccountService *CreditAccountService) ListCreditAccount(listCreditAc |
|
@@ -312,7 +312,7 @@ func (creditAccountService *CreditAccountService) ListCreditAccount(listCreditAc |
312
|
}
|
312
|
}
|
313
|
}
|
313
|
}
|
314
|
|
314
|
|
315
|
-// PayCreditAccount 支付账期结算(支付分红)
|
315
|
+// PayCreditAccount 支付分红
|
316
|
func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAccountCommand *command.PayCreditAccountCommand) (interface{}, error) {
|
316
|
func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAccountCommand *command.PayCreditAccountCommand) (interface{}, error) {
|
317
|
if err := payCreditAccountCommand.ValidateCommand(); err != nil {
|
317
|
if err := payCreditAccountCommand.ValidateCommand(); err != nil {
|
318
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
318
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
@@ -342,7 +342,9 @@ func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAcco |
|
@@ -342,7 +342,9 @@ func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAcco |
342
|
}
|
342
|
}
|
343
|
|
343
|
|
344
|
// 获取待支付的账期结算单
|
344
|
// 获取待支付的账期结算单
|
345
|
- creditAccount, err := creditAccountRepository.FindOne(map[string]interface{}{"creditAccountId": creditAccountId})
|
345
|
+ creditAccount, err := creditAccountRepository.FindOne(map[string]interface{}{
|
|
|
346
|
+ "creditAccountId": creditAccountId,
|
|
|
347
|
+ })
|
346
|
if err != nil {
|
348
|
if err != nil {
|
347
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
349
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
348
|
}
|
350
|
}
|
|
@@ -360,7 +362,6 @@ func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAcco |
|
@@ -360,7 +362,6 @@ func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAcco |
360
|
if creditAccountSaved, err4 := creditAccountRepository.Save(creditAccount); err4 != nil {
|
362
|
if creditAccountSaved, err4 := creditAccountRepository.Save(creditAccount); err4 != nil {
|
361
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err4.Error())
|
363
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err4.Error())
|
362
|
} else {
|
364
|
} else {
|
363
|
- // TODO 更新分红预算单结算状态(已支付)
|
|
|
364
|
if err3 := transactionContext.CommitTransaction(); err3 != nil {
|
365
|
if err3 := transactionContext.CommitTransaction(); err3 != nil {
|
365
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err3.Error())
|
366
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err3.Error())
|
366
|
}
|
367
|
}
|