|
|
@@ -6,6 +6,7 @@ import cn.hutool.core.lang.Opt;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
|
import org.dromara.common.core.constant.SystemConstants;
|
|
|
import org.dromara.common.core.enums.UserStatus;
|
|
|
@@ -17,6 +18,9 @@ import org.dromara.common.core.utils.StreamUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.mybatis.helper.DataPermissionHelper;
|
|
|
import org.dromara.common.tenant.helper.TenantHelper;
|
|
|
+import org.dromara.customer.api.RemoteCustomerService;
|
|
|
+import org.dromara.customer.api.RemotePartnerInfoService;
|
|
|
+import org.dromara.customer.api.RemoteSupplierInfoService;
|
|
|
import org.dromara.system.api.RemoteUserService;
|
|
|
import org.dromara.system.api.domain.bo.RemoteUserBo;
|
|
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
|
|
@@ -63,6 +67,12 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
private final SysUserRoleMapper userRoleMapper;
|
|
|
private final SysUserPostMapper userPostMapper;
|
|
|
|
|
|
+ @DubboReference
|
|
|
+ private RemoteCustomerService remoteCustomerService;
|
|
|
+ @DubboReference
|
|
|
+ private RemotePartnerInfoService remotePartnerInfoService;
|
|
|
+ @DubboReference
|
|
|
+ private RemoteSupplierInfoService remoteSupplierInfoService;
|
|
|
/**
|
|
|
* 通过用户名查询用户信息
|
|
|
*
|
|
|
@@ -286,6 +296,18 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
List<SysPostVo> posts = postService.selectPostsByUserId(userId);
|
|
|
loginUser.setRoles(BeanUtil.copyToList(roles, RoleDTO.class));
|
|
|
loginUser.setPosts(BeanUtil.copyToList(posts, PostDTO.class));
|
|
|
+ //用户子类型 用户子类型(0=平台用户,1=供应商,2=伙伴商,3=商城用户)
|
|
|
+ if(Objects.equals(userVo.getUserSonType(),"1")){
|
|
|
+ Long supplierId = remoteSupplierInfoService.selectSupplierIdByUserId(userVo.getUserId());
|
|
|
+
|
|
|
+ loginUser.setSupplierId(supplierId);
|
|
|
+ }else if(Objects.equals(userVo.getUserSonType(),"2")){
|
|
|
+ Long partnerId = remotePartnerInfoService.selectPartnerIdByUserId(userVo.getUserId());
|
|
|
+ loginUser.setPartnerId(partnerId);
|
|
|
+ }else if(Objects.equals(userVo.getUserSonType(),"3")){
|
|
|
+ Long customerId = remoteCustomerService.selectCustomerIdByUserId(userVo.getUserId());
|
|
|
+ loginUser.setCustomerId(customerId);
|
|
|
+ }
|
|
|
return loginUser;
|
|
|
}
|
|
|
|