会员退款
This commit is contained in:
@@ -19,8 +19,8 @@ public class VipRefundDTO {
|
||||
/**
|
||||
* 店铺用户id
|
||||
*/
|
||||
@NotNull(message = "店铺用户不能为空")
|
||||
private Long shopUserId;
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
/**
|
||||
* 退款id 会员流水id tb_shop_user_flow.id
|
||||
*/
|
||||
|
||||
@@ -403,7 +403,7 @@ public class PayServiceImpl implements PayService {
|
||||
@Override
|
||||
public CzgResult<Map<String, BigDecimal>> refundVipBefore(VipRefundDTO payParam) {
|
||||
Map<String, BigDecimal> resultMap = new HashMap<>(5);
|
||||
ShopUser shopUser = shopUserService.getById(payParam.getShopUserId());
|
||||
ShopUser shopUser = shopUserService.getShopUserInfo(payParam.getShopId(), payParam.getUserId());
|
||||
AssertUtil.isNull(shopUser, "该店铺用户不存在");
|
||||
ShopUserFlow inFlow = userFlowService.queryChain().select(ShopUserFlow::getAmount)
|
||||
.eq(ShopUserFlow::getId, payParam.getFlowId()).one();
|
||||
@@ -422,7 +422,7 @@ public class PayServiceImpl implements PayService {
|
||||
|
||||
@Override
|
||||
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)
|
||||
.eq(ShopUserFlow::getId, refPayParam.getFlowId()).one();
|
||||
AssertUtil.isNull(inFlow, "充值记录不存在");
|
||||
@@ -453,7 +453,7 @@ public class PayServiceImpl implements PayService {
|
||||
return CzgResult.failure("退款失败,该充值记录不存在");
|
||||
}
|
||||
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()));
|
||||
CzgResult<CzgRefundResp> res = refund(refPayParam.getShopId(), new CzgRefundReq(refPayOrderNo, refPayParam.getRemark(),
|
||||
refPayParam.getRefAmount().multiply(MONEY_RATE).longValue(), payment.getOrderNo(), ""));
|
||||
|
||||
Reference in New Issue
Block a user