Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
2a23d080d0
|
|
@ -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