会员充值 赠送 退款记录

This commit is contained in:
wangw 2025-03-19 10:49:00 +08:00
parent 15cc93c0ee
commit 29ae670ec0
1 changed files with 11 additions and 1 deletions

View File

@ -524,7 +524,17 @@ public class PayServiceImpl implements PayService {
//更新会员余额 并生成流水
shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
userFlowService.updateRefund(inFlow.getId(), refPayParam.getRefAmount());
if (giftFlow != null) {
if (giftFlow != null && (giftFlow.getAmount().subtract(refPayParam.getRefAmount())).compareTo(BigDecimal.ZERO) > 0) {
ShopUserMoneyEditDTO giftFlowEdit = new ShopUserMoneyEditDTO()
.setId(shopUser.getId())
.setMoney(giftFlow.getAmount())
.setType(0)
.setRemark("退款")
.setBizEnum(ShopUserFlowBizEnum.RECHARGE_REFUND)
.setRelationId(refPaymentId)
.setRechargeId(giftFlow.getId());
//更新会员余额 并生成流水
shopUserService.updateMoney(shopUser.getShopId(), giftFlowEdit);
userFlowService.updateRefund(giftFlow.getId(), giftFlow.getAmount());
}
//移除优惠券