分销提现手续费问题 分销次数限制

This commit is contained in:
张松 2025-11-06 16:21:03 +08:00
parent e4a0407016
commit 1ebd1a3950
1 changed files with 13 additions and 3 deletions

View File

@ -605,11 +605,13 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
log.info("当前分销员: {}, 上级分销员: {}, 分销等级: {}", currentDistributionUser.getId(), currentShopUser == null ? null : currentShopUser.getDistributionUserId(), level.getId());
if (config.getRewardCount() != null && config.getRewardCount() > 0) {
long count = distributionFlowService.count(new QueryWrapper().eq(MkDistributionFlow::getSourceShopUserId, currentDistributionUser.getId())
.eq(MkDistributionFlow::getShopUserId, currentDistributionUser.getId()));
long count = distributionFlowService.count(new QueryWrapper()
.eq(MkDistributionFlow::getShopId, config.getShopId()).eq(MkDistributionFlow::getShopUserId, currentDistributionUser.getId()));
if (count >= config.getRewardCount()) {
log.info("分销员{}已达到奖励次数上限, 次数: {}", currentDistributionUser.getId(), config.getRewardCount());
return;
}else {
log.info("分销员奖励次数: {}", count);
}
}
@ -730,6 +732,14 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
}
}
static void main() {
BigDecimal amount = new BigDecimal("0.18");
BigDecimal fee = amount.multiply(BigDecimal.valueOf(0.08)).setScale(2, RoundingMode.UP);
BigDecimal finalAmount = amount.subtract(fee);
System.out.println(finalAmount);
System.out.println(fee);
}
@Override
public Boolean withdraw(long userId, MkDistributionWithdrawFlowDTO withdrawFlowDTO) {
UserInfo userInfo = userInfoService.getById(userId);
@ -741,7 +751,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
throw new CzgException("请先实名认证");
}
BigDecimal fee = withdrawFlowDTO.getAmount().multiply(BigDecimal.valueOf(0.08));
BigDecimal fee = withdrawFlowDTO.getAmount().multiply(BigDecimal.valueOf(0.08)).setScale(2, RoundingMode.UP);
BigDecimal finalAmount = withdrawFlowDTO.getAmount().subtract(fee);
MkDistributionWithdrawFlow withdrawFlow = new MkDistributionWithdrawFlow().setUserId(userId)