| Line 55... |
Line 55... |
| 55 |
private NotificationService notificationService;
|
55 |
private NotificationService notificationService;
|
| 56 |
|
56 |
|
| 57 |
@Override
|
57 |
@Override
|
| 58 |
public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
|
58 |
public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
|
| 59 |
String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException {
|
59 |
String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException {
|
| 60 |
if (amount == 0)
|
60 |
if (Math.round(amount) == 0)
|
| 61 |
return;
|
61 |
return;
|
| 62 |
UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
|
62 |
UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
|
| 63 |
int walletAmount = walletService.getWalletAmount(retailerId);
|
63 |
int walletAmount = walletService.getWalletAmount(retailerId);
|
| 64 |
// userWallet = userWalletRepository.selectByIdForUpdate(userWallet.getId());
|
64 |
// userWallet = userWalletRepository.selectByIdForUpdate(userWallet.getId());
|
| 65 |
userWallet.setAmount(walletAmount + Math.round(amount));
|
65 |
userWallet.setAmount(walletAmount + Math.round(amount));
|