会员退款

This commit is contained in:
2025-03-06 13:58:38 +08:00
parent 441ed07f77
commit fdb00148b5
2 changed files with 5 additions and 5 deletions

View File

@@ -19,8 +19,8 @@ public class VipRefundDTO {
/** /**
* 店铺用户id * 店铺用户id
*/ */
@NotNull(message = "店铺用户不能为空") @NotNull(message = "用户不能为空")
private Long shopUserId; private Long userId;
/** /**
* 退款id 会员流水id tb_shop_user_flow.id * 退款id 会员流水id tb_shop_user_flow.id
*/ */

View File

@@ -403,7 +403,7 @@ public class PayServiceImpl implements PayService {
@Override @Override
public CzgResult<Map<String, BigDecimal>> refundVipBefore(VipRefundDTO payParam) { public CzgResult<Map<String, BigDecimal>> refundVipBefore(VipRefundDTO payParam) {
Map<String, BigDecimal> resultMap = new HashMap<>(5); Map<String, BigDecimal> resultMap = new HashMap<>(5);
ShopUser shopUser = shopUserService.getById(payParam.getShopUserId()); ShopUser shopUser = shopUserService.getShopUserInfo(payParam.getShopId(), payParam.getUserId());
AssertUtil.isNull(shopUser, "该店铺用户不存在"); AssertUtil.isNull(shopUser, "该店铺用户不存在");
ShopUserFlow inFlow = userFlowService.queryChain().select(ShopUserFlow::getAmount) ShopUserFlow inFlow = userFlowService.queryChain().select(ShopUserFlow::getAmount)
.eq(ShopUserFlow::getId, payParam.getFlowId()).one(); .eq(ShopUserFlow::getId, payParam.getFlowId()).one();
@@ -422,7 +422,7 @@ public class PayServiceImpl implements PayService {
@Override @Override
public CzgResult<Object> refundVip(VipRefundDTO refPayParam) { public CzgResult<Object> refundVip(VipRefundDTO refPayParam) {
ShopUser shopUser = shopUserService.getById(refPayParam.getShopUserId()); ShopUser shopUser = shopUserService.getShopUserInfo(refPayParam.getShopId(), refPayParam.getUserId());
ShopUserFlow inFlow = userFlowService.queryChain().select(ShopUserFlow::getAmount) ShopUserFlow inFlow = userFlowService.queryChain().select(ShopUserFlow::getAmount)
.eq(ShopUserFlow::getId, refPayParam.getFlowId()).one(); .eq(ShopUserFlow::getId, refPayParam.getFlowId()).one();
AssertUtil.isNull(inFlow, "充值记录不存在"); AssertUtil.isNull(inFlow, "充值记录不存在");
@@ -453,7 +453,7 @@ public class PayServiceImpl implements PayService {
return CzgResult.failure("退款失败,该充值记录不存在"); return CzgResult.failure("退款失败,该充值记录不存在");
} }
String refPayOrderNo = "REFVIP" + IdUtil.getSnowflakeNextId(); String refPayOrderNo = "REFVIP" + IdUtil.getSnowflakeNextId();
refPaymentId = initOrderPayment(new OrderPayment(refPayParam.getShopId(), refPayParam.getShopUserId(), refPaymentId = initOrderPayment(new OrderPayment(refPayParam.getShopId(), shopUser.getId(),
"memberRefund", refPayOrderNo, null, refPayParam.getRefAmount())); "memberRefund", refPayOrderNo, null, refPayParam.getRefAmount()));
CzgResult<CzgRefundResp> res = refund(refPayParam.getShopId(), new CzgRefundReq(refPayOrderNo, refPayParam.getRemark(), CzgResult<CzgRefundResp> res = refund(refPayParam.getShopId(), new CzgRefundReq(refPayOrderNo, refPayParam.getRemark(),
refPayParam.getRefAmount().multiply(MONEY_RATE).longValue(), payment.getOrderNo(), "")); refPayParam.getRefAmount().multiply(MONEY_RATE).longValue(), payment.getOrderNo(), ""));