门店 id对应不上的问题

This commit is contained in:
wangw 2025-10-31 16:18:11 +08:00
parent b64c2fa598
commit bbc1eadd71
1 changed files with 13 additions and 4 deletions

View File

@ -203,7 +203,7 @@ public class PayServiceImpl implements PayService {
AssertUtil.isNull(shopUser, "会员不存在");
UserInfo userInfo = userInfoService.getById(shopUser.getUserId());
AssertUtil.isNull(userInfo, "用户信息不存在");
if (userInfo.getUsePayPwd() == 1 ) {
if (userInfo.getUsePayPwd() == 1) {
AssertUtil.isBlank(payParam.getPwd(), "支付密码不能为空");
if (userInfo.getPayPwd() == null || !userInfo.getPayPwd().equals(MD5Util.md5AsHex(payParam.getPwd()))) {
return CzgResult.failure("支付密码错误");
@ -216,8 +216,17 @@ public class PayServiceImpl implements PayService {
}
payParam.getCheckOrderPay().setUserId(shopUser.getUserId());
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
if (!shopUser.getSourceShopId().equals(orderInfo.getShopId()) && !shopUser.getMainShopId().equals(orderInfo.getShopId())) {
return CzgResult.failure("违规操作,请确认店铺后重试");
if (shopInfo.getIsHeadShop().equals(1)) {
if (!shopUser.getMainShopId().equals(orderInfo.getShopId())) {
return CzgResult.failure("违规操作,请确认店铺后重试");
}
} else {
boolean exists = shopInfoService.exists(QueryWrapper.create()
.eq(ShopInfo::getMainId, shopInfo.getMainId())
.eq(ShopInfo::getId, orderInfo.getShopId()));
if(!exists){
return CzgResult.failure("违规操作,请确认店铺后重试");
}
}
if (shopUser.getAmount().compareTo(orderInfo.getOrderAmount()) < 0) {
return CzgResult.failure("会员余额不足");
@ -501,7 +510,7 @@ public class PayServiceImpl implements PayService {
boolean isFree = checkPayVip(rechargeDTO);
Long mainShopId = shopInfoService.getMainIdByShopId(rechargeDTO.getShopId());
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId,mainShopId)
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId, mainShopId)
.eq(ShopUser::getId, shopUserId));
AssertUtil.isNull(shopUser, "充值失败 该店铺用户不存在");
MkShopRechargeVO rechargeVO = shopRechargeService.detail(rechargeDTO.getShopId());