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