Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松 2025-10-29 17:03:08 +08:00
commit 2a23d080d0
1 changed files with 6 additions and 0 deletions

View File

@ -268,12 +268,18 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
if (parentShopUser.getDistributionUserParentId() != null && parentShopUser.getDistributionUserParentId().equals(shopUser.getId())) {
throw new CzgException("存在绑定关系,不可绑定");
}
//更新自己的上级
ShopUser newShopUser = new ShopUser();
newShopUser.setId(shopUser.getId());
newShopUser.setDistributionUserId(parent.getId());
newShopUser.setDistributionUserParentId(parent.getParentId());
newShopUser.setInviteTime(LocalDateTime.now());
shopUserService.updateById(newShopUser);
//更新自己的下级 的上级的上级 为自己的上级
ShopUser childShopUser = new ShopUser();
childShopUser.setDistributionUserParentId(parent.getParentId());
shopUserService.update(childShopUser, QueryWrapper.create().eq(ShopUser::getDistributionUserId, shopUser.getId()));
MkDistributionUser newDistributionUser = new MkDistributionUser();
newDistributionUser.setId(parent.getId());
newDistributionUser.setInviteCount(parent.getInviteCount() + 1);