|
|
@@ -14,8 +14,11 @@ import org.springframework.stereotype.Service;
|
|
|
import org.dromara.customer.domain.bo.PartnerInfoBo;
|
|
|
import org.dromara.customer.domain.vo.PartnerInfoVo;
|
|
|
import org.dromara.customer.domain.PartnerInfo;
|
|
|
+import org.dromara.customer.domain.PartnerUser;
|
|
|
import org.dromara.customer.mapper.PartnerInfoMapper;
|
|
|
+import org.dromara.customer.mapper.PartnerUserMapper;
|
|
|
import org.dromara.customer.service.IPartnerInfoService;
|
|
|
+import org.dromara.common.satoken.utils.LoginHelper;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -33,6 +36,7 @@ import java.util.Collection;
|
|
|
public class PartnerInfoServiceImpl extends ServiceImpl<PartnerInfoMapper, PartnerInfo> implements IPartnerInfoService {
|
|
|
|
|
|
private final PartnerInfoMapper baseMapper;
|
|
|
+ private final PartnerUserMapper partnerUserMapper;
|
|
|
|
|
|
/**
|
|
|
* 查询伙伴商基本信息
|
|
|
@@ -140,4 +144,21 @@ public class PartnerInfoServiceImpl extends ServiceImpl<PartnerInfoMapper, Part
|
|
|
}
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前登录用户的伙伴商信息
|
|
|
+ *
|
|
|
+ * @return 伙伴商基本信息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public PartnerInfoVo queryCurrentPartnerInfo() {
|
|
|
+ Long userId = LoginHelper.getUserId();
|
|
|
+ LambdaQueryWrapper<PartnerUser> wrapper = Wrappers.lambdaQuery();
|
|
|
+ wrapper.eq(PartnerUser::getSysUserId, userId);
|
|
|
+ PartnerUser partnerUser = partnerUserMapper.selectOne(wrapper);
|
|
|
+ if (partnerUser == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return baseMapper.selectVoById(partnerUser.getPartnerId());
|
|
|
+ }
|
|
|
}
|