mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
软件购买支付方式从入参选择直接保存修改为实际扣款补位
This commit is contained in:
+21
-1
@@ -133,6 +133,9 @@ public class PayProductProcessorNew {
|
|||||||
// 是否只用了赠送金
|
// 是否只用了赠送金
|
||||||
private boolean justPayGift = false;
|
private boolean justPayGift = false;
|
||||||
|
|
||||||
|
// 最终存储的支付方式,通过实际支付做二进制部位,例如有可能选择了现金+赠送金但是只用了赠送金,就只补赠送金位
|
||||||
|
private int payMethod;
|
||||||
|
|
||||||
public PayProductProcessorNew(ProductsDO productsDO, ProductsDetailDO productsDetailDO, PurchaseRecordDO orgInitialPurchaseRecord, PreviouProductDelayRespVO previouProductDelayRespVO,
|
public PayProductProcessorNew(ProductsDO productsDO, ProductsDetailDO productsDetailDO, PurchaseRecordDO orgInitialPurchaseRecord, PreviouProductDelayRespVO previouProductDelayRespVO,
|
||||||
OrganAmountDO organAmountDO, Long organId, ChenfengPayConfig payConfig, MybatisIdProperties mybatisIdProperties, SnowflakeSerialNoWorker3rd snowflakeSerialNoWorker3rd) {
|
OrganAmountDO organAmountDO, Long organId, ChenfengPayConfig payConfig, MybatisIdProperties mybatisIdProperties, SnowflakeSerialNoWorker3rd snowflakeSerialNoWorker3rd) {
|
||||||
this.productsDO = productsDO;
|
this.productsDO = productsDO;
|
||||||
@@ -228,6 +231,11 @@ public class PayProductProcessorNew {
|
|||||||
// 更新余额
|
// 更新余额
|
||||||
organAmountDO.setAmount(organAmountDO.getAmount());
|
organAmountDO.setAmount(organAmountDO.getAmount());
|
||||||
organAmountDO.setGiftAmount(gift.subtract(usedGift));
|
organAmountDO.setGiftAmount(gift.subtract(usedGift));
|
||||||
|
|
||||||
|
// 有效扣除累加payMethod
|
||||||
|
if (usedGift.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
payMethod |= PayProductChannelCodeEnumNew.GIFT.getCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -242,6 +250,11 @@ public class PayProductProcessorNew {
|
|||||||
// 更新余额
|
// 更新余额
|
||||||
organAmountDO.setAmount(balance.subtract(usedBalance));
|
organAmountDO.setAmount(balance.subtract(usedBalance));
|
||||||
organAmountDO.setGiftAmount(organAmountDO.getGiftAmount());
|
organAmountDO.setGiftAmount(organAmountDO.getGiftAmount());
|
||||||
|
|
||||||
|
// 有效扣除累加payMethod
|
||||||
|
if (usedBalance.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
payMethod |= PayProductChannelCodeEnumNew.BALANCE.getCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -274,7 +287,7 @@ public class PayProductProcessorNew {
|
|||||||
.purchaseDurationUnit(productsDetailDO.getDurationUnit())
|
.purchaseDurationUnit(productsDetailDO.getDurationUnit())
|
||||||
.startTime(startTime)
|
.startTime(startTime)
|
||||||
.endTime(endTime)
|
.endTime(endTime)
|
||||||
.paymentMethod(payType)
|
.paymentMethod(payMethod)
|
||||||
.totalAmount(productPrice)
|
.totalAmount(productPrice)
|
||||||
.originalAmount(originalPrice)
|
.originalAmount(originalPrice)
|
||||||
.monthAverageAmount(monthAverageAmount)
|
.monthAverageAmount(monthAverageAmount)
|
||||||
@@ -293,8 +306,14 @@ public class PayProductProcessorNew {
|
|||||||
payOrderDO.setPurchaseId(purchaseId);
|
payOrderDO.setPurchaseId(purchaseId);
|
||||||
if (PayProductChannelCodeEnumNew.hasAlipay(payType)) {
|
if (PayProductChannelCodeEnumNew.hasAlipay(payType)) {
|
||||||
payOrderDO.setChannelCode(PayChannelCodeEnum.ALIPAY_PC);
|
payOrderDO.setChannelCode(PayChannelCodeEnum.ALIPAY_PC);
|
||||||
|
// 有效扣除累加payMethod
|
||||||
|
payMethod |= PayProductChannelCodeEnumNew.ALIPAY.getCode();
|
||||||
|
purchaseRecordDO.setPaymentMethod(payMethod);
|
||||||
} else if (PayProductChannelCodeEnumNew.hasWechat(payType)) {
|
} else if (PayProductChannelCodeEnumNew.hasWechat(payType)) {
|
||||||
payOrderDO.setChannelCode(PayChannelCodeEnum.WECHAT_NATIVE);
|
payOrderDO.setChannelCode(PayChannelCodeEnum.WECHAT_NATIVE);
|
||||||
|
// 有效扣除累加payMethod
|
||||||
|
payMethod |= PayProductChannelCodeEnumNew.WECHAT.getCode();
|
||||||
|
purchaseRecordDO.setPaymentMethod(payMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录第三方支付金额
|
// 记录第三方支付金额
|
||||||
@@ -303,6 +322,7 @@ public class PayProductProcessorNew {
|
|||||||
purchaseRecordDO.setStatus(PurchaseRecordStatusEnum.PENDING.getStatus());
|
purchaseRecordDO.setStatus(PurchaseRecordStatusEnum.PENDING.getStatus());
|
||||||
// 更新为不可开票,等异步回调后修改为可开票
|
// 更新为不可开票,等异步回调后修改为可开票
|
||||||
purchaseRecordDO.setIsInvocing(null);
|
purchaseRecordDO.setIsInvocing(null);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
BigDecimal amount = organAmountDO.getAmount();
|
BigDecimal amount = organAmountDO.getAmount();
|
||||||
BigDecimal giftAmount = organAmountDO.getGiftAmount();
|
BigDecimal giftAmount = organAmountDO.getGiftAmount();
|
||||||
|
|||||||
Reference in New Issue
Block a user