Pārlūkot izejas kodu

fix 不参与店铺分成平台过滤提成

zoujiajian 2 gadi atpakaļ
vecāks
revīzija
a6d52f7624

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/views/ShopGeneralGoodsRateView.java

@@ -13,7 +13,7 @@ import lombok.Setter;
  */
 @Getter
 @Setter
-@SearchBean(tables = "(select * from goods_don where type = 1 and status is true and deleted is true) g left join yh_shop_general_goods_rate yr on yr.goods_id = g.id")
+@SearchBean(tables = "(select * from goods_don where type = 1 and status is true and deleted is true and is_distribute is true) g left join yh_shop_general_goods_rate yr on yr.goods_id = g.id")
 public class ShopGeneralGoodsRateView {
 	@DbField("yr.id")
 	private Long id;

+ 8 - 0
netflix-service/src/main/java/com/cyksj/service/shop/impl/YhShopDistributeServiceImpl.java

@@ -2,6 +2,7 @@ package com.cyksj.service.shop.impl;
 
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.mapper.GoodsDonMapper;
 import com.cyksj.mapper.shop.*;
 import com.cyksj.model.entity.*;
 import com.cyksj.service.distribute.UserBusinessFrontService;
@@ -37,6 +38,8 @@ public class YhShopDistributeServiceImpl implements YhShopDistributeService {
 	private final UserBenefitsService userBenefitsService;
 
 	private final YhShopGeneralGoodsRateMapper yhShopGeneralGoodsRateMapper;
+
+	private final GoodsDonMapper goodsDonMapper;
 	@Override
 	public void distributeWaitingSendPointsRecord(OrderDon order) {
 		BigDecimal orderMoney = order.getMoney();
@@ -54,6 +57,11 @@ public class YhShopDistributeServiceImpl implements YhShopDistributeService {
 			log.info("店主:{}自购订单orderId:{}不产生提成", order.getYhsId(), order.getId());
 			return;
 		}
+		GoodsDon goodsDon = goodsDonMapper.selectOne(Wrappers.lambdaQuery(GoodsDon.class)
+				.eq(GoodsDon::getId, order.getGoodsId()).last("limit 1"));
+		if (goodsDon == null || !goodsDon.getIsDistribute()) {
+			log.info("店铺订单orderId:{}对应平台goodsId:{}不存在或已不参与分成比例", order.getId(), order.getGoodsId());
+		}
 		Long shopUserId = yhShop.getUserId();
 		YhShopDistributeWaitingSendPoints distributeWaitingSendPoints = new YhShopDistributeWaitingSendPoints();
 		distributeWaitingSendPoints.setOrderId(order.getId());