mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update 会员累计充值金额
This commit is contained in:
@@ -94,11 +94,16 @@ public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
|
||||
*/
|
||||
@Override
|
||||
public MemberWalletVO selectMemberWalletInfo(String walletCode) {
|
||||
// 查询数据库,字段为null默认返回0
|
||||
MemberWalletVO memberWalletVO = memberWalletInfoMapper.selectMemberWalletInfo(walletCode);
|
||||
|
||||
// 总余额
|
||||
memberWalletVO.setTotalBalance(memberWalletVO.getPrincipalBalance().add(memberWalletVO.getGiftBalance()));
|
||||
|
||||
// 总充值金额 = 累计本金充值 + 累计赠送金额
|
||||
memberWalletVO.setTotalRechargeAmount(memberWalletVO.getAccumulatedRechargePrincipal().add(memberWalletVO.getAccumulatedRechargeGift()));
|
||||
|
||||
// 累计消费金额 = 累计充值 + 累计赠送 - 本金余额 - 赠送金余额
|
||||
// 累计消费金额 = 总充值金额 - 本金余额 - 赠送金余额
|
||||
BigDecimal accumulatedConsumptionAmount = memberWalletVO.getTotalRechargeAmount()
|
||||
.subtract(memberWalletVO.getPrincipalBalance())
|
||||
.subtract(memberWalletVO.getGiftBalance());
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MemberWalletVO {
|
||||
private String merchantName;
|
||||
|
||||
/**
|
||||
* 本金金额
|
||||
* 本金余额
|
||||
*/
|
||||
private BigDecimal principalBalance;
|
||||
|
||||
@@ -43,6 +43,11 @@ public class MemberWalletVO {
|
||||
*/
|
||||
private BigDecimal giftBalance;
|
||||
|
||||
/**
|
||||
* 总余额
|
||||
*/
|
||||
private BigDecimal totalBalance;
|
||||
|
||||
/**
|
||||
* 累计本金充值
|
||||
*/
|
||||
@@ -59,7 +64,7 @@ public class MemberWalletVO {
|
||||
private BigDecimal totalRechargeAmount;
|
||||
|
||||
/**
|
||||
* 累计消费
|
||||
* 累计消费 = 总充值金额 - 本金余额 - 赠送金余额
|
||||
*/
|
||||
private BigDecimal accumulatedConsumptionAmount;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MemberWalletInfoVO {
|
||||
/**
|
||||
* 累计消费
|
||||
*/
|
||||
private BigDecimal accumulatedConsumptionAmount;
|
||||
// private BigDecimal accumulatedConsumptionAmount;
|
||||
|
||||
/**
|
||||
* 总充值金额
|
||||
|
||||
Reference in New Issue
Block a user