会员充值链路

This commit is contained in:
wangw 2025-03-10 14:32:18 +08:00
parent 0ddd267fb3
commit 2218e8ac32
2 changed files with 7 additions and 2 deletions

View File

@ -81,6 +81,7 @@ public class ShopActivateServiceImpl extends ServiceImpl<ShopActivateMapper, Sho
@Override
public void giveActivate(ShopUser shopUser, BigDecimal memAmount, Long relationId) {
log.info("充钱4 会员充值奖励5");
ShopActivate activate = queryChain().select().eq(ShopActivate::getShopId, shopUser.getShopId())
.le(ShopActivate::getAmount, memAmount)
.orderBy(ShopActivate::getGiftAmount, false)

View File

@ -451,8 +451,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
//校验优惠券
List<ShopActivateCouponRecord> records = couponRecordService.listAs(
QueryWrapper.create()
.where(ShopActivateCouponRecord::getId).in(param.getCouponList())
.and(ShopActivateCouponRecord::getStatus).eq(0),ShopActivateCouponRecord.class);
.where(ShopActivateCouponRecord::getId).in(param.getCouponList())
.and(ShopActivateCouponRecord::getStatus).eq(0), ShopActivateCouponRecord.class);
if (CollUtil.isEmpty(records)) {
throw new ValidateException("生成支付订单失败,优惠券信息不存在");
} else if (records.size() != param.getCouponList().size()) {
@ -531,6 +531,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
} else {
shopUserMoneyEditDTO.setBizEnum(ShopUserFlowBizEnum.CASH_IN);
}
log.info("充钱1 是否是霸王餐:{}", isFree);
if (isFree) {
if (StrUtil.isBlank(czgCallBackDto.getExtParam())) {
throw new ValidateException("霸王餐支付,订单号处理失败");
@ -542,9 +543,12 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
.set(OrderInfo::getPayAmount, 0)
.update();
}
log.info("充钱2");
//更新会员余额 并生成流水
Long flowId = shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
log.info("充钱3 更新钱:{}", flowId);
if (!isFree) {
log.info("充钱4 会员充值奖励");
//会员活动
activateService.giveActivate(shopUser,
new BigDecimal(czgCallBackDto.getAmount()).divide(new BigDecimal(100), 2, RoundingMode.DOWN), flowId);