上级 可提现金额
This commit is contained in:
parent
dd64b83c37
commit
1f1bd65bb1
|
|
@ -162,6 +162,8 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
|||
result.put("parentPhone", "");
|
||||
ShopUser shopUser = shopUserService.getShopUserInfo(shopId, userId);
|
||||
AssertUtil.isNull(shopUser, "店铺用户不存在");
|
||||
UserInfo userInfo = userInfoService.getById(shopUser.getId());
|
||||
result.put("cashOutAmount", userInfo.getDistributionAmount() == null ? 0.0 : userInfo.getDistributionAmount());
|
||||
if (shopUser.getDistributionUserId() != null) {
|
||||
MkDistributionUser mkDistributionUser = this.getById(shopUser.getDistributionUserId());
|
||||
AssertUtil.isNull(mkDistributionUser, "上级分销员不存在");
|
||||
|
|
@ -180,6 +182,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
|||
distributionUser.put("status", mkDistributionUser.getStatus() == 9);
|
||||
distributionUser.put("totalIncome", mkDistributionUser.getTotalIncome());
|
||||
distributionUser.put("pendingIncome", mkDistributionUser.getPendingIncome());
|
||||
|
||||
if (mkDistributionUser.getDistributionLevelId() != null) {
|
||||
List<MkDistributionLevelConfig> levelConfigList = mkDistributionConfigVO.getLevelConfigList();
|
||||
boolean isNextLevel = false;
|
||||
|
|
@ -274,10 +277,10 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
|||
newShopUser.setDistributionUserParentId(parent.getParentId());
|
||||
newShopUser.setInviteTime(LocalDateTime.now());
|
||||
shopUserService.updateById(newShopUser);
|
||||
if (parent.getParentId() != null) {
|
||||
if (parentShopUser.getDistributionUserParentId() != null) {
|
||||
//更新自己的下级 的上级的上级 为自己的上级
|
||||
ShopUser childShopUser = new ShopUser();
|
||||
childShopUser.setDistributionUserParentId(parent.getParentId());
|
||||
childShopUser.setDistributionUserParentId(parentShopUser.getDistributionUserParentId());
|
||||
shopUserService.update(childShopUser, QueryWrapper.create().eq(ShopUser::getDistributionUserId, shopUser.getId()));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue