1、产品订购、延期、续期等日期计算优化;2、账户明细现金支付值错误修复;

This commit is contained in:
gaoqr
2025-09-26 18:24:35 +08:00
parent 9c2f49395f
commit 836b61ac6b
2 changed files with 18 additions and 12 deletions
@@ -69,10 +69,12 @@ public class IncomeExpenseServiceImpl implements IncomeExpenseService {
if (ObjectUtil.isNotNull(purchaseId)) {
// 查询对应的购买记录
PurchaseRecordDO record = purchaseService.getRecord(purchaseId);
respVO.setProductPrice(record.getTotalAmount());
respVO.setRechargePayAmount(record.getAccountBalanceSpent());
respVO.setRechargePayAmount(record.getAlipaySpent().add(record.getWechatSpent()));
respVO.setGiftPayAmount(record.getGiftMoneySpent());
if (ObjectUtil.isNotNull(record)) {
respVO.setProductPrice(record.getTotalAmount());
respVO.setBalancePayAmount(record.getAccountBalanceSpent());
respVO.setRechargePayAmount(record.getAlipaySpent().add(record.getWechatSpent()));
respVO.setGiftPayAmount(record.getGiftMoneySpent());
}
}
} else if (TradeTypeEnum.MANUAL_ADJUST.getCode().equals(tradeType)) {
respVO.setRechargeAmount(i.getCashAmountChange());
@@ -86,7 +86,7 @@ public class PayProductProcessor {
private PurchaseRecordDO previousPurchaseRecord;
// 本地订购产品的开始时间
private LocalDate startTime = LocalDate.now();
private LocalDate startTime;
// 产品结束时间
private LocalDate endTime;
@@ -740,18 +740,22 @@ public class PayProductProcessor {
.orElse(endTime);
}
// 2、 判断是否过期
if (maxDelayEnd.isBefore(today)) {
// 已过期,从今天开始
startTime = today;
// 2、订单的生效时间
startTime = today;
// 3、 计算有效期叠加的起点
LocalDate purchaseStart;
if (today.isAfter(maxDelayEnd)) {
// 已过期 → 从今天开始累加
purchaseStart = today;
} else {
// 未过期,从上次结束时间继续
startTime = today.isBefore(maxDelayEnd) ? today : maxDelayEnd;;
// 未过期 → 从 maxDelayEnd 的下一天开始累加
purchaseStart = maxDelayEnd;
}
// 加正常时间
if (ObjectUtil.isNotNull(duration) && durationUnit != null) {
endTime = addTime(startTime, duration, durationUnit);
endTime = addTime(purchaseStart, duration, durationUnit);
}
// 加赠送时间