分销员购买保存shopUserId

This commit is contained in:
张松 2025-10-29 15:54:44 +08:00
parent a101862f34
commit 9e5a18b80b
1 changed files with 2 additions and 2 deletions

View File

@ -67,14 +67,14 @@ public class DistributionPayServiceImpl implements DistributionPayService {
if (!isRecharge && !TableValueConstant.DistributionConfig.OpenType.PAY.getCode().equals(detail.getOpenType())) {
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());
orderPaymentService.save(orderPayment);
InitInfo initInfo = new InitInfo().setConfig(detail);
if (!isRecharge) {
ShopUser shopUserInfo = shopUserService.getShopUserInfo(payParam.getShopId(), userId);
UserInfo userInfo = userInfoService.getById(userId);
initInfo.setPayment(orderPayment).setShopUser(shopUserInfo)
.setOpenId("aliPay".equals(payParam.getPayType()) ? userInfo.getAlipayOpenId() : userInfo.getWechatOpenId());