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