分销员购买保存shopUserId
This commit is contained in:
parent
a101862f34
commit
9e5a18b80b
|
|
@ -67,14 +67,14 @@ public class DistributionPayServiceImpl implements DistributionPayService {
|
||||||
if (!isRecharge && !TableValueConstant.DistributionConfig.OpenType.PAY.getCode().equals(detail.getOpenType())) {
|
if (!isRecharge && !TableValueConstant.DistributionConfig.OpenType.PAY.getCode().equals(detail.getOpenType())) {
|
||||||
throw new CzgException("当前未开启购买分销配置");
|
throw new CzgException("当前未开启购买分销配置");
|
||||||
}
|
}
|
||||||
|
ShopUser shopUserInfo = shopUserService.getShopUserInfo(payParam.getShopId(), userId);
|
||||||
|
|
||||||
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(isRecharge ? payParam.getShopId() : userId)
|
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(isRecharge ? payParam.getShopId() : shopUserInfo.getId())
|
||||||
.setPayType(isRecharge ? "distributionRecharge" : "distribution").setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId()).setAmount(detail.getPayAmount());
|
.setPayType(isRecharge ? "distributionRecharge" : "distribution").setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId()).setAmount(detail.getPayAmount());
|
||||||
orderPaymentService.save(orderPayment);
|
orderPaymentService.save(orderPayment);
|
||||||
|
|
||||||
InitInfo initInfo = new InitInfo().setConfig(detail);
|
InitInfo initInfo = new InitInfo().setConfig(detail);
|
||||||
if (!isRecharge) {
|
if (!isRecharge) {
|
||||||
ShopUser shopUserInfo = shopUserService.getShopUserInfo(payParam.getShopId(), userId);
|
|
||||||
UserInfo userInfo = userInfoService.getById(userId);
|
UserInfo userInfo = userInfoService.getById(userId);
|
||||||
initInfo.setPayment(orderPayment).setShopUser(shopUserInfo)
|
initInfo.setPayment(orderPayment).setShopUser(shopUserInfo)
|
||||||
.setOpenId("aliPay".equals(payParam.getPayType()) ? userInfo.getAlipayOpenId() : userInfo.getWechatOpenId());
|
.setOpenId("aliPay".equals(payParam.getPayType()) ? userInfo.getAlipayOpenId() : userInfo.getWechatOpenId());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue