上上级 更新
This commit is contained in:
parent
9614b670d9
commit
182fb84d3c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue