Commit ed03a0a2 by fanjiaxin

联调问题处理

parent 3f6987f7
Pipeline #71610 passed with stages
in 2 minutes 7 seconds
...@@ -30,4 +30,9 @@ public interface IUserService { ...@@ -30,4 +30,9 @@ public interface IUserService {
* 查询平台默认的分佣比例 * 查询平台默认的分佣比例
*/ */
UserCommissionRatioVO getCommissionRatioDefault(); UserCommissionRatioVO getCommissionRatioDefault();
/**
* 绑定平台默认的分佣比例
*/
void bindCommissionRatioDefault();
} }
...@@ -11,9 +11,11 @@ import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.SharerInfoVO; ...@@ -11,9 +11,11 @@ import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.SharerInfoVO;
import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.UserCommissionRatioVO; import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.UserCommissionRatioVO;
import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.UserTokenVO; 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.biz.service.IUserService;
import com.netease.yanxuan.wx.store.sharer.common.exception.NoBindSharerException;
import com.netease.yanxuan.wx.store.sharer.dal.mapper.SharerInfoMapper; 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.dal.meta.model.po.SharerInfo;
import com.netease.yanxuan.wx.store.sharer.integration.constant.WeChatApi; import com.netease.yanxuan.wx.store.sharer.integration.constant.WeChatApi;
import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopSetSharerCommissionRequest;
import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopSharerListRequest; import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopSharerListRequest;
import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopSharerRegisterBindRequest; import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopSharerRegisterBindRequest;
import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatUserInfoRequest; import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatUserInfoRequest;
...@@ -48,6 +50,7 @@ public class UserServiceImpl implements IUserService { ...@@ -48,6 +50,7 @@ public class UserServiceImpl implements IUserService {
private final WeChatUserInfoRequest weChatUserRequest; private final WeChatUserInfoRequest weChatUserRequest;
private final WeChatShopSharerRegisterBindRequest weChatShopSharerRegisterBindRequest; private final WeChatShopSharerRegisterBindRequest weChatShopSharerRegisterBindRequest;
private final WeChatShopSharerListRequest weChatShopSharerListRequest; private final WeChatShopSharerListRequest weChatShopSharerListRequest;
private final WeChatShopSetSharerCommissionRequest weChatShopSetSharerCommissionRequest;
@Override @Override
...@@ -153,6 +156,18 @@ public class UserServiceImpl implements IUserService { ...@@ -153,6 +156,18 @@ public class UserServiceImpl implements IUserService {
return UserCommissionRatioVO.builder().commissionRatio(defaultCommissionRatio).build(); return UserCommissionRatioVO.builder().commissionRatio(defaultCommissionRatio).build();
} }
@Override
public void bindCommissionRatioDefault() {
// 获取用户信息
LoginUserInfo loginUserInfo = LoginUserContextHolder.get();
if (StringUtils.isBlank(loginUserInfo.getSharerAppId())) {
throw new NoBindSharerException("未绑定推客");
}
BigDecimal defaultCommissionRatio = drmSharerConfig.getDefaultCommissionRatio();
// 设置推客分佣比例
weChatShopSetSharerCommissionRequest.handle(loginUserInfo.getSharerAppId(), defaultCommissionRatio.toPlainString());
}
private SharerInfoVO getSharerRegisterBindInfo(String openId) { private SharerInfoVO getSharerRegisterBindInfo(String openId) {
// 获取推客注册与绑定信息 // 获取推客注册与绑定信息
WeChatSharerRegisterBindVO sharerRegisterBindVO = weChatShopSharerRegisterBindRequest.handle(openId); WeChatSharerRegisterBindVO sharerRegisterBindVO = weChatShopSharerRegisterBindRequest.handle(openId);
......
...@@ -59,4 +59,13 @@ public class UserController extends BaseController { ...@@ -59,4 +59,13 @@ public class UserController extends BaseController {
UserCommissionRatioVO result = iUserService.getCommissionRatioDefault(); UserCommissionRatioVO result = iUserService.getCommissionRatioDefault();
return Result.ok(result); return Result.ok(result);
} }
/**
* 绑定平台默认的分佣比例
*/
@PostMapping("/bindCommissionRatioDefault")
public Result<UserCommissionRatioVO> bindCommissionRatioDefault() {
iUserService.bindCommissionRatioDefault();
return Result.ok();
}
} }
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