霸王餐修改

This commit is contained in:
张松 2025-10-16 15:54:47 +08:00
parent 9cb9dda109
commit 0f45681f8a
1 changed files with 6 additions and 2 deletions

View File

@ -149,6 +149,7 @@ public class PayServiceImpl implements PayService {
CheckOrderPay checkOrderPay = BeanUtil.copyProperties(payParam, CheckOrderPay.class);
orderInfoService.checkOrderPay(checkOrderPay.setFreeDine(true).setWithCoupon(freeConfig.getWithCoupon()).setWithPoints(freeConfig.getWithPoints()));
payParam.setAmount(payParam.getAmount().multiply(freeConfig.getRechargeTimes()));
return true;
}
return false;
@ -481,11 +482,14 @@ public class PayServiceImpl implements PayService {
throw new CzgException("未开启自定义充值金额");
}
Long mainShopId = shopInfoService.getMainIdByShopId(payParam.getShopId());
BigDecimal amount = shopRechargeService.checkRecharge(mainShopId, payParam.getShopId(), shopUser.getUserId(), payParam.getRechargeDetailId(), payParam.getAmount());
if (isFree) {
BigDecimal amount = shopRechargeService.checkRecharge(mainShopId, payParam.getShopId(), shopUser.getUserId(), payParam.getRechargeDetailId(), payParam.getAmount());
payParam.setAmount(amount);
}
String payOrderNo = payParam.getPlatformType() + IdUtil.getSnowflakeNextId();
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), isFree ? "free" : "memberIn", payOrderNo,
"", amount, isFree ? payParam.getOrderId() : payParam.getActivateId()));
"", payParam.getAmount(), isFree ? payParam.getOrderId() : payParam.getActivateId()));
return ltPay(payParam.getShopId(), payParam.getPayType(), new CzgLtPayReq(payOrderNo, payParam.getAmount().multiply(MONEY_RATE).longValue(),
payParam.getPayType(), "会员充值", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
}