分销问题

会员充值问题
This commit is contained in:
2025-12-26 10:37:32 +08:00
parent 8bde6b15f6
commit 70307e3833
7 changed files with 89 additions and 52 deletions

View File

@@ -85,8 +85,6 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
private ShopUserService shopUserService;
@DubboReference
private UserInfoService userInfoService;
@DubboReference
private OrderPaymentService orderPaymentService;
@Resource
private OrderInfoService orderInfoService;
@DubboReference
@@ -706,6 +704,16 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
});
}
@Transactional
@Override
public void distributionUserAmount(MkDistributionFlow item, OrderInfo orderInfo) {
ShopUser shopUser = shopUserService.getById(item.getDistributionUserId());
updateShopInfoAmount(orderInfo.getShopId(), item.getRewardAmount().negate(), orderInfo.getId(), TableValueConstant.DistributionAmountFlow.Type.SUB, "分销扣减");
updateIncome(item.getRewardAmount().negate(), item.getRewardAmount(), BigDecimal.ZERO,
item.getDistributionUserId(), shopUser.getUserId(), item.getShopUserId(), item.getShopId(), item.getLevel());
distributionFlowService.updateById(item);
}
@Override
public void distribute(Long sourceId, String orderNo, BigDecimal amount, Long sourceUserId, Long shopId, String type) {
MkDistributionDeliver deliver = new MkDistributionDeliver().setSourceId(sourceId).setOrderNo(orderNo).setShopId(shopId).setType(type).setStatus("success");

View File

@@ -175,9 +175,9 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
// 标准充值
if (rechargeDetailId != null) {
MkShopRechargeDetail rechargeDetail = shopRechargeDetailService.getById(rechargeDetailId);
shopUserMoneyEditDTO.setMoney(rechargeDetail.getAmount());
FunUtils.asyncSafeRunVoid(() -> {
MkShopRechargeDetail rechargeDetail = shopRechargeDetailService.getById(rechargeDetailId);
shopUserMoneyEditDTO.setMoney(rechargeDetail.getAmount());
// 赠送金额
ShopUserMoneyEditDTO shopUserMoneyEditRewardDTO = new ShopUserMoneyEditDTO()
.setId(shopUserId)