Commit b974a331 authored by renjie's avatar renjie

Merge branch 'dev-zrj' into 'staging'

推广礼金bug

See merge request !6
parents 68a2d3c0 840e792f
......@@ -209,8 +209,8 @@ public class PaymentServiceImpl implements PaymentService {
if (byName.getPromotionCode() != null) {
Account account = accountRepository.findByPromotion(byName.getPromotionCode());
if (account != null) {
byName.getPromotion().setCommission(byName.getPromotion().getCommission() + byTradeNo.getAmount());
accountRepository.save(byName);
account.getPromotion().setCommission(account.getPromotion().getCommission() + byTradeNo.getAmount());
accountRepository.save(account);
}
}
......@@ -341,8 +341,8 @@ public class PaymentServiceImpl implements PaymentService {
if (byName.getPromotionCode() != null) {
Account account = accountRepository.findByPromotion(byName.getPromotionCode());
if (account != null) {
byName.getPromotion().setCommission(byName.getPromotion().getCommission() + byTradeNo.getAmount());
accountRepository.save(byName);
account.getPromotion().setCommission(account.getPromotion().getCommission() + byTradeNo.getAmount());
accountRepository.save(account);
}
}
}
......@@ -518,6 +518,14 @@ public class PaymentServiceImpl implements PaymentService {
userBalanceRepository.incrementBalance(userBalance, amount, 0);
}
if (account.getPromotionCode() != null) {
Account account1 = accountRepository.findByPromotion(account.getPromotionCode());
if (account1 != null) {
account1.getPromotion().setCommission(account1.getPromotion().getCommission() + amount);
accountRepository.save(account1);
}
}
return userBalanceRepository.findById(username).orElse(null);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment