空值处理

This commit is contained in:
wangw 2025-10-29 17:19:53 +08:00
parent ffde41dd97
commit 1e1474659e
1 changed files with 6 additions and 4 deletions

View File

@ -275,10 +275,12 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
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()));
if (parent.getParentId() != null) {
//更新自己的下级 的上级的上级 为自己的上级
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());