Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
wangw 2025-10-29 15:58:21 +08:00
commit e7d407de1d
2 changed files with 8 additions and 6 deletions

View File

@ -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<MkDistribut
public Map<String, Object> 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<MkDistribut
if (StrUtil.isNotBlank(key)) {
queryWrapper.and(and -> {
and.or(or -> {
or.like(OrderInfo::getOrderNo, key);
or.like(OrderPayment::getOrderNo, key);
});
and.or(or -> {
or.like(ShopUser::getNickName, key);

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());