会员消费充值增成长值增加

This commit is contained in:
张松 2025-09-29 16:04:52 +08:00
parent 4f0e0acacb
commit 99f42514cf
3 changed files with 12 additions and 5 deletions

View File

@ -28,7 +28,7 @@ public interface MkShopRechargeService extends IService<MkShopRecharge> {
BigDecimal checkRecharge(Long mainShopId, @NotNull(message = "店铺不能为空") Long shopId, Long userId, Long rechargeDetailId, @DecimalMin("0.01") BigDecimal money);
void recharge(Long shopId, Long shopUserId, Long relatedId, BigDecimal amount, Long paymentId, String payType, ShopUserFlowBizEnum bizEnum);
void recharge(Long shopId, Long shopUserId, Long rechargeDetailId, BigDecimal amount, Long paymentId, String payType, ShopUserFlowBizEnum bizEnum);
List<RechargeListVO> getList(long loginIdAsLong);

View File

@ -156,8 +156,8 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
}
@Override
public void recharge(Long shopId, Long shopUserId, Long relatedId, BigDecimal amount, Long paymentId, String payType, ShopUserFlowBizEnum bizEnum) {
log.info("充值回调, 用户id: {}, 金额: {}, 关联id: {}", shopUserId, amount, relatedId);
public void recharge(Long shopId, Long shopUserId, Long rechargeDetailId, BigDecimal amount, Long paymentId, String payType, ShopUserFlowBizEnum bizEnum) {
log.info("充值回调, 用户id: {}, 金额: {}, rechargeDetailId: {}", shopUserId, amount, rechargeDetailId);
ShopUser shopUser = shopUserService.getById(shopUserId);
ShopUserMoneyEditDTO shopUserMoneyEditDTO = new ShopUserMoneyEditDTO()
.setId(shopUserId)
@ -165,8 +165,8 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
.setBizEnum(bizEnum)
.setRelationId(paymentId);
// 标准充值
if (relatedId != null) {
MkShopRechargeDetail rechargeDetail = shopRechargeDetailService.getById(relatedId);
if (rechargeDetailId != null) {
MkShopRechargeDetail rechargeDetail = shopRechargeDetailService.getById(rechargeDetailId);
shopUserMoneyEditDTO.setMoney(rechargeDetail.getAmount().add(rechargeDetail.getRewardAmount()));
// 发放积分
if (rechargeDetail.getRewardPoints() != null) {

View File

@ -14,6 +14,7 @@ import com.czg.account.entity.*;
import com.czg.account.service.*;
import com.czg.config.RabbitPublisher;
import com.czg.config.RedisCst;
import com.czg.constant.TableValueConstant;
import com.czg.entity.notify.CzgPayNotifyDTO;
import com.czg.entity.notify.CzgRefundNotifyDTO;
import com.czg.enums.ShopTableStatusEnum;
@ -843,6 +844,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
// 会员加入
memberConfigService.joinMemberByCondition(orderInfo.getShopId(), orderInfo.getUserId());
// 会员消费赠送成长值
memberConfigService.deliver(orderInfo.getShopId(), orderInfo.getUserId(), TableValueConstant.MemberExpFlow.Type.COST, orderInfo.getPayAmount(), null, orderInfo.getId());
} else if ("memberIn".equals(payment.getPayType()) || "free".equals(payment.getPayType())) {
boolean isFree = "free".equals(payment.getPayType());
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
@ -890,6 +893,10 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
} else if ("memberPay".equals(payment.getPayType())) {
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
memberConfigService.joinMember(payment.getShopId(), shopUser.getUserId(), payment.getRelatedId());
// 充值赠送积分
memberConfigService.deliver(shopUser.getMainShopId(), shopUser.getUserId(), TableValueConstant.MemberExpFlow.Type.COST, payment.getAmount(), null, payment.getId());
}
}
}