Commit 5b0cf5bc by 刘运星

Merge remote-tracking branch 'origin/feature-sharer-20250306' into feature-sharer-20250306

# Conflicts:
#	yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/UserServiceImpl.java
parents 4d1825c6 258ec9f6
Pipeline #71940 passed with stages
in 56 seconds
......@@ -20,6 +20,7 @@ import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.UserCommissionRatio
import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.UserTokenVO;
import com.netease.yanxuan.wx.store.sharer.biz.service.IUserService;
import com.netease.yanxuan.wx.store.sharer.common.exception.NoBindSharerException;
import com.netease.yanxuan.wx.store.sharer.common.exception.WeChatException;
import com.netease.yanxuan.wx.store.sharer.dal.mapper.SharerInfoMapper;
import com.netease.yanxuan.wx.store.sharer.dal.meta.model.po.SharerInfo;
import com.netease.yanxuan.wx.store.sharer.integration.constant.WeChatApi;
......@@ -36,6 +37,7 @@ import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatUserI
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* @Description 用户-业务实现类
* @Author fanjiaxin
......@@ -60,6 +62,9 @@ public class UserServiceImpl implements IUserService {
Date now = new Date();
// 获取用户信息
WeChatUserInfoVO userInfoVO = weChatUserRequest.handle(bo.getCode());
if (null == userInfoVO) {
throw new WeChatException("获取用户信息失败");
}
// 获取本地用户信息
LambdaQueryWrapper<SharerInfo> sharerInfoLqw = Wrappers.lambdaQuery();
sharerInfoLqw.eq(SharerInfo::getOpenId, userInfoVO.getOpenid());
......@@ -120,6 +125,7 @@ public class UserServiceImpl implements IUserService {
BigDecimal commissionRatio = sharerCommissionRatio
.multiply(new BigDecimal(WeChatApi.WECHAT_COMMISSION_RATIO_MULTIPLIER))
.setScale(0, RoundingMode.DOWN);
log.info("op:refreshUserInfo:setSharerCommission,openId:{}", loginUserInfo.getOpenId());
// 设置推客分佣比例
weChatShopSetSharerCommissionRequest.handle(sharerInfoVO.getSharer_appid(),
commissionRatio.longValue());
......@@ -185,7 +191,8 @@ public class UserServiceImpl implements IUserService {
if (StringUtils.isBlank(loginUserInfo.getSharerAppId())) {
throw new NoBindSharerException("未绑定推客");
}
BigDecimal sharerCommissionRatio = drmSharerConfig.getSharerCommissionRatio(loginUserInfo.getOpenId());
log.info("op:bindCommissionRatioDefault:setSharerCommission,openId:{}", loginUserInfo.getOpenId());
BigDecimal sharerCommissionRatio = drmSharerConfig.getSharerCommissionRatioOrDefault(loginUserInfo.getOpenId());
BigDecimal commissionRatio = sharerCommissionRatio
.multiply(new BigDecimal(WeChatApi.WECHAT_COMMISSION_RATIO_MULTIPLIER))
.setScale(0, RoundingMode.DOWN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment