|
|
@@ -396,6 +396,13 @@ public class CodexServiceImpl implements CodexService {
|
|
|
if (orderDonGalaxyCoinRecord != null) {
|
|
|
orderMoney = orderMoney.add(orderDonGalaxyCoinRecord.getDeductMoney());
|
|
|
}
|
|
|
+ // 续费升级订单的实际价值还包含上一次升级使用的 Codex 抵扣。
|
|
|
+ // 若不回补这部分金额,连续升级时抵扣金额会逐级变少。
|
|
|
+ CodexDeductRecord renewCodexDeductRecord = codexDeductRecordMapper.selectOne(Wrappers.lambdaQuery(CodexDeductRecord.class)
|
|
|
+ .eq(CodexDeductRecord::getOrderId, renewOrderDon.getId()).last("limit 1"));
|
|
|
+ if (renewCodexDeductRecord != null) {
|
|
|
+ orderMoney = orderMoney.add(Optional.ofNullable(renewCodexDeductRecord.getDeductMoney()).orElse(BigDecimal.ZERO));
|
|
|
+ }
|
|
|
GoodsDonSku presentSku = skuMapper.selectById(renewSkuId);
|
|
|
if (orderMoney.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
orderMoney = presentSku.getPrice();
|
|
|
@@ -427,6 +434,11 @@ public class CodexServiceImpl implements CodexService {
|
|
|
Long skuId = thisRenewOrderDon.getSkuId();
|
|
|
GoodsDonSku thisRenewSku = skuMapper.selectById(skuId);
|
|
|
BigDecimal thisOrderMoney = thisRenewOrderDon.getMoney().add(Optional.ofNullable(thisRenewOrderDon.getBalance()).orElse(BigDecimal.ZERO));
|
|
|
+ CodexDeductRecord thisRenewCodexDeductRecord = codexDeductRecordMapper.selectOne(Wrappers.lambdaQuery(CodexDeductRecord.class)
|
|
|
+ .eq(CodexDeductRecord::getOrderId, thisRenewOrderDon.getId()).last("limit 1"));
|
|
|
+ if (thisRenewCodexDeductRecord != null) {
|
|
|
+ thisOrderMoney = thisOrderMoney.add(Optional.ofNullable(thisRenewCodexDeductRecord.getDeductMoney()).orElse(BigDecimal.ZERO));
|
|
|
+ }
|
|
|
if (thisOrderMoney.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
thisOrderMoney = thisRenewSku.getPrice();
|
|
|
}
|