分销员中心-实名认证

绑定邀请人
分销员:获取下级分销员分页列表
分销员:获取邀请人分页列表
This commit is contained in:
2025-10-27 20:29:52 +08:00
parent aed955c513
commit 078b8d1c5d
6 changed files with 148 additions and 1 deletions

View File

@@ -3,8 +3,11 @@ package com.czg.service.market.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson2.JSONObject;
import com.czg.account.entity.ShopInfo;
import com.czg.account.entity.ShopUser;
import com.czg.account.entity.UserInfo;
import com.czg.account.service.ShopInfoService;
import com.czg.account.service.ShopUserService;
import com.czg.account.service.UserInfoService;
@@ -24,6 +27,7 @@ import com.czg.market.vo.DistributionCenterShopVO;
import com.czg.market.vo.DistributionCenterTopVO;
import com.czg.market.entity.*;
import com.czg.market.service.*;
import com.czg.market.vo.InviteUserVO;
import com.czg.market.vo.MkDistributionConfigVO;
import com.czg.order.dto.MkDistributionPayDTO;
import com.czg.order.entity.OrderPayment;
@@ -142,7 +146,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
result.put("shopName", shopInfo.getShopName());
result.put("parentName", "");
result.put("parentPhone", "");
ShopUser shopUser = shopUserService.getShopUserInfo(userId, shopId);
ShopUser shopUser = shopUserService.getShopUserInfo(shopId, userId);
AssertUtil.isNull(shopUser, "店铺用户不存在");
if (shopUser.getDistributionUserId() != null) {
MkDistributionUser mkDistributionUser = this.getById(shopUser.getDistributionUserId());
@@ -183,6 +187,30 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
return result;
}
@Override
public void realNameAuth(UserInfo userInfo) {
AssertUtil.isTrue(IdcardUtil.isValidCard(userInfo.getIdCard()), "身份证号格式错误");
UserInfo newUserInfo = new UserInfo();
newUserInfo.setId(userInfo.getId());
newUserInfo.setRealName(userInfo.getRealName());
newUserInfo.setIdCard(userInfo.getIdCard());
userInfoService.updateById(newUserInfo);
}
@Override
public void bindInviteUser(MkDistributionUserDTO param) {
ShopUser shopUser = shopUserService.getById(param.getShopUserId());
AssertUtil.isNull(shopUser, "店铺用户不存在");
AssertUtil.isNull(shopUser.getDistributionUserId(), "店铺用户已绑定分销员");
MkDistributionUser mkDistributionUser = this.getById(param.getParentId());
AssertUtil.isNull(mkDistributionUser, "上级分销员不存在");
ShopUser newShopUser = new ShopUser();
newShopUser.setId(shopUser.getId());
newShopUser.setDistributionUserId(mkDistributionUser.getId());
newShopUser.setDistributionUserParentId(mkDistributionUser.getParentId());
shopUserService.updateById(newShopUser);
}
@Override
public Page<MkDistributionUserDTO> getDistributionUser(MkDistributionUserDTO param) {
QueryWrapper queryWrapper = new QueryWrapper();
@@ -210,6 +238,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
if (shopUser == null || shopUser.getId() == null) {
continue;
}
record.setHeadImg(shopUser.getHeadImg());
record.setShopUserName(shopUser.getNickName());
record.setShopUserPhone(shopUser.getPhone());
}
@@ -217,6 +246,15 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
return page;
}
@Override
public Page<InviteUserVO> getInviteUser(Long id, Integer page, Integer size) {
return pageAs(new Page<>(page, size), QueryWrapper.create()
.select("head_img as headImg,nick_name as shopUserName,phone as shopUserPhone,one_income as oneIncome")
.eq(MkDistributionUser::getShopId, id)
.eq(MkDistributionUser::getParentId, id)
.orderBy(MkDistributionUser::getCreateTime).desc(), InviteUserVO.class);
}
@Override
public void addDistributionUser(MkDistributionUser param) {
AssertUtil.isNull(param.getShopId(), "店铺ID不能为空");