绑定关系

This commit is contained in:
2026-01-31 10:20:48 +08:00
parent ccc18fc229
commit c04a5b8fb1

View File

@@ -318,12 +318,12 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
@Override
@GlobalTransactional
public void bindInviteUser(Long fromUserId, Long toUserId, Long shopId) throws CzgException, ValidateException {
ShopUser shopUser = shopUserService.getById(fromUserId);
ShopUser shopUser = shopUserService.getById(toUserId);
AssertUtil.isNull(shopUser, "店铺用户不存在");
if (shopUser.getParentUserId() != null) {
throw new CzgException("店铺用户已绑定上级");
}
MkDistributionUser parent = getOne(QueryWrapper.create().eq(MkDistributionUser::getId, toUserId));
MkDistributionUser parent = getOne(QueryWrapper.create().eq(MkDistributionUser::getId, fromUserId));
AssertUtil.isNull(parent, "邀请人不存在");
if (!parent.getShopId().equals(shopId)) {
throw new CzgException("邀请人不是本店铺的分销员");