会员余额支付

This commit is contained in:
wangw 2025-03-18 13:41:51 +08:00
parent 6253917cf3
commit 2473a4da25
1 changed files with 5 additions and 2 deletions

View File

@ -190,6 +190,11 @@ public class PayServiceImpl implements PayService {
@Override
@Transactional(noRollbackFor = PaySuccessException.class)
public CzgResult<Object> vipPayOrder(OrderPayParamDTO payParam) {
ShopInfo shopInfo = shopInfoService.getById(payParam.getShopId());
AssertUtil.isNull(shopInfo, "店铺不存在");
if(!shopInfo.getIsAccountPay().equals(1)){
return CzgResult.failure("支付失败,店铺暂未开启会员余额支付。");
}
ShopUser shopUser = new ShopUser();
if ("scanCode".equals(payParam.getPayType())) {
AssertUtil.isBlank(payParam.getAuthCode(), "会员码不能为空");
@ -197,8 +202,6 @@ public class PayServiceImpl implements PayService {
AssertUtil.isNull(o, "会员码已失效");
shopUser = shopUserService.getById(o.toString());
} else {
ShopInfo shopInfo = shopInfoService.getById(payParam.getShopId());
AssertUtil.isNull(shopInfo, "店铺不存在");
if ("userPay".equals(payParam.getPayType())) {
AssertUtil.isNull(payParam.getShopUserId(), "请选择付款人后重试");
shopUser = shopUserService.getById(payParam.getShopUserId());