diff --git a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkDistributionAmountFlowServiceImpl.java b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkDistributionAmountFlowServiceImpl.java index d29ee59c..d4d5de2d 100644 --- a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkDistributionAmountFlowServiceImpl.java +++ b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkDistributionAmountFlowServiceImpl.java @@ -7,6 +7,7 @@ import com.czg.account.entity.UserInfo; import com.czg.constant.TableValueConstant; import com.czg.market.vo.MkDistributionAmountFlowVO; import com.czg.order.entity.OrderInfo; +import com.czg.order.entity.OrderPayment; import com.czg.utils.MyQueryWrapper; import com.czg.utils.PageUtil; import com.mybatisflex.core.paginate.Page; @@ -71,10 +72,11 @@ public class MkDistributionAmountFlowServiceImpl extends ServiceImpl openPageInfo(Long shopId, LocalDateTime startTime, LocalDateTime endTime, String key) { QueryWrapper queryWrapper = new MyQueryWrapper() .selectAll(MkDistributionAmountFlow.class) - .leftJoin(OrderInfo.class).on(OrderInfo::getId, MkDistributionAmountFlow::getSourceId) - .leftJoin(ShopUser.class).on(ShopUser::getId, OrderInfo::getUserId) + .leftJoin(OrderPayment.class).on(OrderPayment::getId, MkDistributionAmountFlow::getSourceId) + .leftJoin(ShopUser.class).on(ShopUser::getId, OrderPayment::getSourceId) .eq(MkDistributionAmountFlow::getShopId, shopId) - .select(OrderInfo::getOrderNo) + .select(OrderPayment::getOrderNo) + .eq(MkDistributionAmountFlow::getType, TableValueConstant.DistributionAmountFlow.Type.OPEN.getCode()) .select(ShopUser::getPhone, ShopUser::getNickName); if (startTime != null) { queryWrapper.ge(MkDistributionAmountFlow::getCreateTime, startTime); @@ -87,7 +89,7 @@ public class MkDistributionAmountFlowServiceImpl extends ServiceImpl { and.or(or -> { - or.like(OrderInfo::getOrderNo, key); + or.like(OrderPayment::getOrderNo, key); }); and.or(or -> { or.like(ShopUser::getNickName, key); diff --git a/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/DistributionPayServiceImpl.java b/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/DistributionPayServiceImpl.java index d7783e43..1e86e7df 100644 --- a/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/DistributionPayServiceImpl.java +++ b/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/DistributionPayServiceImpl.java @@ -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());