|
|
|
@@ -120,7 +120,8 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
} |
|
|
|
|
|
|
|
// 4. 扣减计算 |
|
|
|
Integer payment = cardInfo.getSaleAmount() * record.getDeductionAmount() / cardInfo.getAmount(); |
|
|
|
Double paymentD = 1.0 * cardInfo.getSaleAmount() * record.getDeductionAmount() / cardInfo.getAmount(); |
|
|
|
Integer payment = paymentD.intValue(); |
|
|
|
Double dChargeFee = Math.ceil(payment * 1.0D * payAccount.getRate() / 10000); |
|
|
|
Integer real_payment = payment - dChargeFee.intValue(); |
|
|
|
Integer remain_real_pament = cardInfo.getRemainingShareFeeAmount() - real_payment; |
|
|
|
@@ -182,7 +183,8 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
|
|
|
|
// 8. 补贴 |
|
|
|
// 补贴额 = 商城补贴总额/卡券面额 * 抵扣额(本次支付额) |
|
|
|
Integer subsidyFee = record.getDeductionAmount() * coupon.getSubsidyNum() / cardInfo.getAmount(); |
|
|
|
Double subsidyFeeD = 1.0 * record.getDeductionAmount() * coupon.getSubsidyNum() / cardInfo.getAmount(); |
|
|
|
Integer subsidyFee = subsidyFeeD.intValue(); |
|
|
|
logger.info("补贴额: " + subsidyFee); |
|
|
|
if(subsidyFee > 0) { |
|
|
|
// 有补贴时入库 |
|
|
|
|