zoujiajian пре 2 година
родитељ
комит
ac446208da
22 измењених фајлова са 35 додато и 503 уклоњено
  1. 0 13
      netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopGeneralGoodsRateMapper.java
  2. 0 13
      netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopUserBusinessDefaultRateConfigMapper.java
  3. 0 13
      netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopUserDistributeBusinessRateMapper.java
  4. 0 18
      netflix-dao/src/main/java/com/cyksj/model/entity/YhShopGeneralGoodsRate.java
  5. 0 31
      netflix-dao/src/main/java/com/cyksj/model/entity/YhShopUserBusinessDefaultRateConfig.java
  6. 0 43
      netflix-dao/src/main/java/com/cyksj/model/entity/YhShopUserDistributeBusinessRate.java
  7. 2 3
      netflix-dao/src/main/java/com/cyksj/model/entity/YhShopUserPlatDistributeRate.java
  8. 0 29
      netflix-dao/src/main/java/com/cyksj/model/views/ShopGeneralGoodsRateView.java
  9. 1 1
      netflix-dao/src/main/java/com/cyksj/model/views/UserBusinessDefaultRateConfigView.java
  10. 0 39
      netflix-dao/src/main/java/com/cyksj/model/views/YhShopUserBusinessDefaultRateConfigView.java
  11. 0 61
      netflix-dao/src/main/java/com/cyksj/model/views/YhShopUserDistributeBusinessRateRecordView.java
  12. 2 3
      netflix-dao/src/main/java/com/cyksj/model/views/YhShopUserDistributeRateView.java
  13. 0 14
      netflix-dao/src/main/resources/mapper/YhShopGeneralGoodsRateMapper.xml
  14. 19 7
      netflix-service/src/main/java/com/cyksj/service/distribute/impl/DistributeServiceImpl.java
  15. 3 6
      netflix-service/src/main/java/com/cyksj/service/distribute/impl/UserBusinessFrontServiceImpl.java
  16. 0 7
      netflix-service/src/main/java/com/cyksj/service/mange/CmsYhShopCommonService.java
  17. 4 95
      netflix-service/src/main/java/com/cyksj/service/mange/goods/CmsYhShopCommonServiceImpl.java
  18. 0 13
      netflix-service/src/main/java/com/cyksj/service/shop/YhShopGeneralGoodsRateService.java
  19. 3 10
      netflix-service/src/main/java/com/cyksj/service/shop/impl/YhShopDistributeServiceImpl.java
  20. 0 20
      netflix-service/src/main/java/com/cyksj/service/shop/impl/YhShopGeneralGoodsRateServiceIImpl.java
  21. 0 63
      netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/CmsYhShopGoodsController.java
  22. 1 1
      netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/YhShopUserController.java

+ 0 - 13
netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopGeneralGoodsRateMapper.java

@@ -1,13 +0,0 @@
-package com.cyksj.mapper.shop;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.cyksj.model.entity.YhShopGeneralGoodsRate;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopGeneralGoodsRateMapper
- *创建者: JavaZou
- *创建时间:2023/9/15 17:35
- */
-public interface YhShopGeneralGoodsRateMapper extends BaseMapper<YhShopGeneralGoodsRate> {
-}

+ 0 - 13
netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopUserBusinessDefaultRateConfigMapper.java

@@ -1,13 +0,0 @@
-package com.cyksj.mapper.shop;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.cyksj.model.entity.YhShopUserBusinessDefaultRateConfig;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopUserBusinessDefaultRateConfigMapper
- *创建者: JavaZou
- *创建时间:2023/9/18 17:05
- */
-public interface YhShopUserBusinessDefaultRateConfigMapper extends BaseMapper<YhShopUserBusinessDefaultRateConfig> {
-}

+ 0 - 13
netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopUserDistributeBusinessRateMapper.java

@@ -1,13 +0,0 @@
-package com.cyksj.mapper.shop;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.cyksj.model.entity.YhShopUserDistributeBusinessRate;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopUserDistributeBusinessRateMapper
- *创建者: JavaZou
- *创建时间:2023/9/18 17:29
- */
-public interface YhShopUserDistributeBusinessRateMapper extends BaseMapper<YhShopUserDistributeBusinessRate> {
-}

+ 0 - 18
netflix-dao/src/main/java/com/cyksj/model/entity/YhShopGeneralGoodsRate.java

@@ -1,18 +0,0 @@
-package com.cyksj.model.entity;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopGeneralGoodsRate
- *创建者: JavaZou
- *创建时间:2023/9/15 17:35
- */
-@Getter
-@Setter
-public class YhShopGeneralGoodsRate extends BaseEntity{
-	private Long goodsId;
-
-	private Integer rate;
-}

+ 0 - 31
netflix-dao/src/main/java/com/cyksj/model/entity/YhShopUserBusinessDefaultRateConfig.java

@@ -1,31 +0,0 @@
-package com.cyksj.model.entity;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopUserBusinessDefaultRateConfig
- *创建者: JavaZou
- *创建时间:2023/9/18 17:05
- */
-@Getter
-@Setter
-public class YhShopUserBusinessDefaultRateConfig extends BaseEntity {
-	private Long goodsId;
-
-	/**
-	 * 标准配置分销者比例
-	 */
-	private Integer rate;
-
-	/**
-	 * 最高可配置分销者比例
-	 */
-	private Integer maxRate;
-
-	/**
-	 * 超过配置最高分销者比例是否平台承担
-	 */
-	private Boolean isPlatPay;
-}

+ 0 - 43
netflix-dao/src/main/java/com/cyksj/model/entity/YhShopUserDistributeBusinessRate.java

@@ -1,43 +0,0 @@
-package com.cyksj.model.entity;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import javax.validation.constraints.NotNull;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopUserDistributeBusinessRate
- *创建者: JavaZou
- *创建时间:2023/9/18 17:29
- */
-@Getter
-@Setter
-public class YhShopUserDistributeBusinessRate extends BaseEntity {
-	/**
-	 * 商务用户id
-	 */
-	@NotNull
-	private Long businessId;
-
-	/**
-	 * 平台id
-	 */
-	private Long goodsId;
-
-	/**
-	 * 规格id
-	 */
-	private Long skuId;
-
-	/**
-	 * 首单提成比例
-	 */
-	private Integer firstOrderRate;
-
-	/**
-	 * 首单续费提成比例
-	 */
-	private Integer renewOrderRate;
-}
-

+ 2 - 3
netflix-dao/src/main/java/com/cyksj/model/entity/YhShopUserPlatDistributeRate.java

@@ -19,8 +19,7 @@ import java.util.Date;
  */
 @Getter
 @Setter
-@SearchBean(tables = "goods_don g left join yh_shop_user_plat_distribute_rate ydr on g.id = ydr.goods_id :uid:" +
-		" left join yh_shop_general_goods_rate ygr on ygr.goods_id = g.id",
+@SearchBean(tables = "goods_don g left join yh_shop_user_plat_distribute_rate ydr on g.id = ydr.goods_id :uid:",
 		where = "g.type = 1 and g.status is true and g.deleted is true and g.is_distribute is true")
 public class YhShopUserPlatDistributeRate {
 	@TableId(value = "id", type = IdType.AUTO)
@@ -43,7 +42,7 @@ public class YhShopUserPlatDistributeRate {
 	/**
 	 * 分销比例
 	 */
-	@DbField("ifnull(ydr.rate,ygr.rate)")
+	@DbField("ifnull(ydr.rate,g.rate)")
 	private Integer rate = 0;
 
 	/**

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

@@ -1,29 +0,0 @@
-package com.cyksj.model.views;
-
-import com.ejlchina.searcher.bean.DbField;
-import com.ejlchina.searcher.bean.SearchBean;
-import lombok.Getter;
-import lombok.Setter;
-
-/*
- *项目名: yhlxj
- *文件名: ShopGeneralGoodsRateView
- *创建者: JavaZou
- *创建时间:2023/9/18 11:09
- */
-@Getter
-@Setter
-@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;
-
-	@DbField("g.id")
-	private Long goodsId;
-
-	@DbField("g.title")
-	private String title;
-
-	@DbField("ifnull(yr.rate,0)")
-	private Integer rate;
-}

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

@@ -19,7 +19,7 @@ public class UserBusinessDefaultRateConfigView {
 	@DbField("uc.id")
 	private Long id;
 
-	@DbField("uc.goods_id")
+	@DbField("g.id")
 	private Long goodsId;
 
 	@DbField("g.type")

+ 0 - 39
netflix-dao/src/main/java/com/cyksj/model/views/YhShopUserBusinessDefaultRateConfigView.java

@@ -1,39 +0,0 @@
-package com.cyksj.model.views;
-
-import com.ejlchina.searcher.bean.DbField;
-import com.ejlchina.searcher.bean.SearchBean;
-import lombok.Getter;
-import lombok.Setter;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopUserBusinessDefaultRateConfigView
- *创建者: JavaZou
- *创建时间:2023/9/18 17:01
- */
-@Getter
-@Setter
-@SearchBean(tables = "goods_don g left join yh_shop_user_business_default_rate_config uc on g.id = uc.goods_id"
-		, where = "g.type = 1 and g.deleted is true and g.status is true and g.is_distribute is true")
-public class YhShopUserBusinessDefaultRateConfigView {
-	@DbField("uc.id")
-	private Long id;
-
-	@DbField("g.id")
-	private Long goodsId;
-
-	@DbField("g.type")
-	private Integer type;
-
-	@DbField("g.title")
-	private String goodsName;
-
-	@DbField("uc.rate")
-	private Integer rate = 0;
-
-	@DbField("uc.max_rate")
-	private Integer maxRate;
-
-	@DbField("uc.is_plat_pay")
-	private Boolean isPlatPay;
-}

+ 0 - 61
netflix-dao/src/main/java/com/cyksj/model/views/YhShopUserDistributeBusinessRateRecordView.java

@@ -1,61 +0,0 @@
-package com.cyksj.model.views;
-
-import com.ejlchina.searcher.bean.DbField;
-import com.ejlchina.searcher.bean.SearchBean;
-import lombok.Getter;
-import lombok.Setter;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopUserDistributeBusinessRateRecordView
- *创建者: JavaZou
- *创建时间:2023/9/18 17:36
- */
-@Getter
-@Setter
-@SearchBean(tables = "goods_don g left join goods_don_sku gdk on gdk.goods_id = g.id" +
-		" left join yh_shop_user_distribute_business_rate ur on ur.sku_id = gdk.id :business_id:",
-		where = "g.type = 1 and g.deleted is true and g.status is true and g.is_distribute is true")
-public class YhShopUserDistributeBusinessRateRecordView {
-	@DbField("ur.id")
-	private Long id;
-
-	/**
-	 * 商务用户id
-	 */
-	@DbField("ifnull(ur.business_id,:bid:)")
-	private Long businessId;
-
-	/**
-	 * 平台id
-	 */
-	@DbField("g.id")
-	private Long goodsId;
-
-	@DbField("g.title")
-	private String goodsName;
-
-	/**
-	 * 规格id
-	 */
-	@DbField("gdk.id")
-	private Long skuId;
-
-	@DbField("gdk.spec_val")
-	private String specVal;
-
-	/**
-	 * 首单提成比例
-	 */
-	@DbField("ifnull(ur.first_order_rate,0)")
-	private Integer firstOrderRate;
-
-	/**
-	 * 首单续费提成比例
-	 */
-	@DbField("ifnull(ur.renew_order_rate,0)")
-	private Integer renewOrderRate;
-
-	@DbField("g.type")
-	private Integer type;
-}

+ 2 - 3
netflix-dao/src/main/java/com/cyksj/model/views/YhShopUserDistributeRateView.java

@@ -15,8 +15,7 @@ import lombok.Setter;
 @Setter
 @SearchBean(tables = "goods_don g left join goods_don_category_relate gcr on gcr.goods_id = g.id" +
 		" left join goods_don_category gc on gc.id = gcr.category" +
-		" left join yh_shop_user_plat_distribute_rate upr on upr.goods_id = g.id and upr.rate > 0 :uid:" +
-		" left join yh_shop_general_goods_rate ygr on ygr.goods_id = g.id",
+		" left join yh_shop_user_plat_distribute_rate upr on upr.goods_id = g.id :uid:",
 		where = "g.type = 1 and g.deleted is true and g.status is true and g.is_distribute is true")
 public class YhShopUserDistributeRateView {
 
@@ -29,6 +28,6 @@ public class YhShopUserDistributeRateView {
 	@DbField("g.title")
 	private String title;
 
-	@DbField("ifnull(upr.rate,ygr.rate)")
+	@DbField("ifnull(upr.rate,g.rate)")
 	private Integer rate;
 }

+ 0 - 14
netflix-dao/src/main/resources/mapper/YhShopGeneralGoodsRateMapper.xml

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.cyksj.mapper.YhShopGeneralGoodsRateMapper">
-    <insert id="saveOrUpdateBatch">
-        insert into yh_shop_general_goods_rate(`goods_id`,`rate`,`created_time`,`update_time`)
-        values
-        <foreach collection="list" item="entity" separator=",">
-            (#{entity.goodsId},#{entity.rate},now(),now())
-        </foreach>
-        ON DUPLICATE KEY update rate = values(rate),
-        update_time = values(update_time)
-    </insert>
-</mapper>

+ 19 - 7
netflix-service/src/main/java/com/cyksj/service/distribute/impl/DistributeServiceImpl.java

@@ -126,6 +126,12 @@ public class DistributeServiceImpl implements DistributeService {
 				.eq(YhShop::getUserId, userDistribute.getUserId())
 				.eq(YhShop::getVerifyStatus, YhShop.Status.success).last("limit 1"));
 		for (UserPlatDistributeRate rate : userDistributeReq.getRates()) {
+			if (rate.getRate() == null) {
+				rate.setRate(0);
+			}
+			if (rate.getSecondRate() == null) {
+				rate.setSecondRate(0);
+			}
 			if (rate.getRate() < 0 || rate.getRate() > 100) {
 				throw new BusinessRuntimeException("比例错误");
 			}
@@ -167,13 +173,19 @@ public class DistributeServiceImpl implements DistributeService {
 					}
 				}
 			} else {
-				userPlatDistributeRateMapper.updateById(rate);
-				if (yhShop != null) {
-					//同步店铺分销比例
-					yhShopUserPlatDistributeRateMapper.update(null, Wrappers.lambdaUpdate(YhShopUserPlatDistributeRate.class)
-							.eq(YhShopUserPlatDistributeRate::getUserId, userDistribute.getUserId())
-							.eq(YhShopUserPlatDistributeRate::getGoodsId, rate.getGoodsId())
-							.set(YhShopUserPlatDistributeRate::getRate, rate.getRate()));
+				UserPlatDistributeRate dbPlateRate = userPlatDistributeRateMapper.selectById(rate.getId());
+				if (dbPlateRate == null) {
+					continue;
+				}
+				if (dbPlateRate.getRate() != rate.getRate() || dbPlateRate.getSecondRate() != rate.getSecondRate()) {
+					userPlatDistributeRateMapper.updateById(rate);
+					if (yhShop != null && dbPlateRate.getRate() != rate.getRate()) {
+						//同步店铺分销比例
+						yhShopUserPlatDistributeRateMapper.update(null, Wrappers.lambdaUpdate(YhShopUserPlatDistributeRate.class)
+								.eq(YhShopUserPlatDistributeRate::getUserId, userDistribute.getUserId())
+								.eq(YhShopUserPlatDistributeRate::getGoodsId, rate.getGoodsId())
+								.set(YhShopUserPlatDistributeRate::getRate, rate.getRate()));
+					}
 				}
 			}
 		}

+ 3 - 6
netflix-service/src/main/java/com/cyksj/service/distribute/impl/UserBusinessFrontServiceImpl.java

@@ -10,7 +10,6 @@ import com.cyksj.mapper.manage.distribute.UserBusinessDefaultRateConfigMapper;
 import com.cyksj.mapper.manage.distribute.UserDistributeBusinessOrderDonRecordMapper;
 import com.cyksj.mapper.manage.distribute.UserDistributeBusinessRateMapper;
 import com.cyksj.mapper.shop.YhShopUserDistributeBusinessOrderDonRecordMapper;
-import com.cyksj.mapper.shop.YhShopUserDistributeBusinessRateMapper;
 import com.cyksj.model.entity.*;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.distribute.UserBusinessFrontService;
@@ -46,9 +45,7 @@ public class UserBusinessFrontServiceImpl implements UserBusinessFrontService {
 
 	private final UserBusinessDefaultRateConfigMapper defaultRateConfigMapper;
 
-	private final UserDistributeSpecialMapper UserDistributeSpecialMapper;
-
-	private final YhShopUserDistributeBusinessRateMapper yhShopUserDistributeBusinessRateMapper;
+	private final UserDistributeSpecialMapper userDistributeSpecialMapper;
 
 	private final YhShopUserDistributeBusinessOrderDonRecordMapper yhShopBusinessOrderDonRecordMapper;
 
@@ -63,7 +60,7 @@ public class UserBusinessFrontServiceImpl implements UserBusinessFrontService {
 		}
 		UserDistributeBusinessRate businessRate = userDistributeBusinessRateMapper.selectOne(wrapper);
 		//06-21 奈飞平台商务比例特殊处理
-		UserDistributeSpecial userDistributeSpecial = UserDistributeSpecialMapper.selectOne(Wrappers.lambdaQuery(UserDistributeSpecial.class)
+		UserDistributeSpecial userDistributeSpecial = userDistributeSpecialMapper.selectOne(Wrappers.lambdaQuery(UserDistributeSpecial.class)
 				.eq(UserDistributeSpecial::getSkuId, order.getSkuId())
 				.eq(UserDistributeSpecial::getSharedId, sharedId)
 				.eq(UserDistributeSpecial::getBusinessId, businessId)
@@ -184,7 +181,7 @@ public class UserBusinessFrontServiceImpl implements UserBusinessFrontService {
 		//和渠道商务用一套提成比例
 		UserDistributeBusinessRate businessRate = userDistributeBusinessRateMapper.selectOne(wrapper);
 		//06-21 奈飞平台商务比例特殊处理
-		UserDistributeSpecial userDistributeSpecial = UserDistributeSpecialMapper.selectOne(Wrappers.lambdaQuery(UserDistributeSpecial.class)
+		UserDistributeSpecial userDistributeSpecial = userDistributeSpecialMapper.selectOne(Wrappers.lambdaQuery(UserDistributeSpecial.class)
 				.eq(UserDistributeSpecial::getSkuId, order.getSkuId())
 				.eq(UserDistributeSpecial::getSharedId, shopUserId)
 				.eq(UserDistributeSpecial::getBusinessId, businessId)

+ 0 - 7
netflix-service/src/main/java/com/cyksj/service/mange/CmsYhShopCommonService.java

@@ -13,18 +13,11 @@ import java.util.List;
  *创建时间:2023/9/15 17:26
  */
 public interface CmsYhShopCommonService {
-	void setGeneralGoodsRate(List<YhShopGeneralGoodsRate> rates);
-
 	void verifyYhShopApply(YhShopVerifyReq verifyReq);
 
 	void setYhShopGoodsRate(List<YhShopUserPlatDistributeRate> yhShopUserPlatDistributeRates, Long businessId, Long userId);
 
 	void setYhShopBusiness(YhShop yhShop);
-
-	void setBusinessDefaultRate(List<YhShopUserBusinessDefaultRateConfig> configs);
-
-	void setBusinessRate(List<UserDistributeBusinessRate> rates);
-
 	void verifyYhShopApplyMoney(DistributeApplyMoneyReq distributeApplyMoneyReq);
 
 	void updateVerifyImg(DistributeApplyMoneyReq distributeApplyMoneyReq);

+ 4 - 95
netflix-service/src/main/java/com/cyksj/service/mange/goods/CmsYhShopCommonServiceImpl.java

@@ -1,34 +1,27 @@
 package com.cyksj.service.mange.goods;
 
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.lang.Assert;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.mapper.GoodsDonMapper;
+import com.cyksj.mapper.manage.distribute.UserBusinessDefaultRateConfigMapper;
 import com.cyksj.mapper.manage.distribute.UserDistributeMapper;
 import com.cyksj.mapper.shop.*;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.request.DistributeApplyMoneyReq;
 import com.cyksj.model.request.YhShopVerifyReq;
-import com.cyksj.model.views.GoodsDonSkuView;
 import com.cyksj.service.mange.CmsYhShopCommonService;
 import com.cyksj.service.mange.business.UserBusinessRateService;
-import com.cyksj.service.shop.YhShopGeneralGoodsRateService;
 import com.cyksj.service.shop.YhShopUserPlatDistributeRateService;
 import com.cyksj.service.user.UserBenefitsService;
-import com.ejlchina.searcher.BeanSearcher;
-import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.dao.DuplicateKeyException;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 
@@ -44,8 +37,6 @@ import java.util.Optional;
 public class CmsYhShopCommonServiceImpl implements CmsYhShopCommonService {
 	private final GoodsDonMapper goodsDonMapper;
 
-	private final YhShopGeneralGoodsRateService yhShopGeneralGoodsRateService;
-
 	private final YhShopMapper yhShopMapper;
 
 	private final YhShopApplyRecordMapper yhShopApplyRecordMapper;
@@ -54,39 +45,15 @@ public class CmsYhShopCommonServiceImpl implements CmsYhShopCommonService {
 
 	private final YhShopUserPlatDistributeRateService yhShopUserPlatDistributeRateService;
 
-	private final YhShopUserBusinessDefaultRateConfigMapper yhShopUserBusinessDefaultRateConfigMapper;
-
-	private final YhShopUserDistributeBusinessRateMapper yhShopUserDistributeBusinessRateMapper;
-
 	private final YhShopDistributeMoneyApplyMapper yhShopDistributeMoneyApplyMapper;
 
 	private final UserBenefitsService userBenefitsService;
 
-	private final BeanSearcher beanSearcher;
-
-	private final YhShopUserBusinessDefaultRateConfigMapper defaultRateConfigMapper;
+	private final UserBusinessDefaultRateConfigMapper defaultRateConfigMapper;
 
 	private final UserDistributeMapper userDistributeMapper;
 
 	private final YhShopUserPlatDistributeRateMapper yhShopUserPlatDistributeRateMapper;
-	@Override
-	public void setGeneralGoodsRate(List<YhShopGeneralGoodsRate> rates) {
-		List<YhShopGeneralGoodsRate> saveShopGoodsRate = new ArrayList<>(rates.size());
-		rates.forEach(data -> {
-			Integer rate = data.getRate();
-			Long goodsId = data.getGoodsId();
-			if (goodsId != null && rate != null && rate >= 0 && rate <= 100) {
-				GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
-				if (goodsDon != null) {
-					saveShopGoodsRate.add(data);
-				}
-			}
-		});
-
-		if (CollUtil.isNotEmpty(saveShopGoodsRate)) {
-			yhShopGeneralGoodsRateService.saveOrUpdateBatch(saveShopGoodsRate);
-		}
-	}
 
 	@Override
 	@Transactional(rollbackFor = Throwable.class)
@@ -195,64 +162,6 @@ public class CmsYhShopCommonServiceImpl implements CmsYhShopCommonService {
 		yhShopMapper.updateById(dbShop);
 	}
 
-	@Override
-	public void setBusinessDefaultRate(List<YhShopUserBusinessDefaultRateConfig> configs) {
-		configs.forEach(rateConfig -> {
-			Long rateConfigId = rateConfig.getId();
-			YhShopUserBusinessDefaultRateConfig config = Optional.ofNullable(yhShopUserBusinessDefaultRateConfigMapper.selectById(rateConfigId)).orElse(new YhShopUserBusinessDefaultRateConfig());
-			BeanUtil.copyProperties(rateConfig, config);
-			Number number = beanSearcher.searchCount(GoodsDonSkuView.class, MapUtils.builder()
-					.field(GoodsDonSkuView::getGoodsId, rateConfig.getGoodsId())
-					.field(GoodsDonSkuView::getGoodsDonDeleted, true)
-					.build());
-			if (number.intValue() == 0) {
-				yhShopUserBusinessDefaultRateConfigMapper.delete(Wrappers.lambdaQuery(YhShopUserBusinessDefaultRateConfig.class)
-						.eq(YhShopUserBusinessDefaultRateConfig::getGoodsId, rateConfig.getGoodsId()));
-				return;
-			}
-			if (config.getRate() == null || config.getRate() < 0 || config.getRate() > 100) {
-				throw BusinessRuntimeException.getInstance("请输入正确的比例");
-			}
-			if (rateConfig.getId() == null) {
-				try {
-					yhShopUserBusinessDefaultRateConfigMapper.insert(config);
-					return;
-				} catch (DuplicateKeyException e) {
-				}
-			}
-			yhShopUserBusinessDefaultRateConfigMapper.updateById(config);
-		});
-	}
-
-	@Override
-	public void setBusinessRate(List<UserDistributeBusinessRate> rates) {
-		rates.forEach(yhShopUserDistributeBusinessRate -> {
-			Long rateId = yhShopUserDistributeBusinessRate.getId();
-			YhShopUserDistributeBusinessRate businessRate = Optional.ofNullable(yhShopUserDistributeBusinessRateMapper.selectById(rateId)).orElse(new YhShopUserDistributeBusinessRate());
-			BeanUtil.copyProperties(yhShopUserDistributeBusinessRate, businessRate);
-			Number number = beanSearcher.searchCount(GoodsDonSkuView.class, MapUtils.builder()
-					.field(GoodsDonSkuView::getGoodsId, yhShopUserDistributeBusinessRate.getGoodsId())
-					.field(GoodsDonSkuView::getSkuId, yhShopUserDistributeBusinessRate.getSkuId())
-					.field(GoodsDonSkuView::getGoodsDonDeleted, true)
-					.build());
-			if (number.intValue() == 0) {
-				yhShopUserDistributeBusinessRateMapper.delete(Wrappers.lambdaQuery(YhShopUserDistributeBusinessRate.class)
-						.eq(YhShopUserDistributeBusinessRate::getBusinessId, yhShopUserDistributeBusinessRate.getBusinessId())
-						.eq(YhShopUserDistributeBusinessRate::getGoodsId, yhShopUserDistributeBusinessRate.getGoodsId())
-						.eq(YhShopUserDistributeBusinessRate::getSkuId, yhShopUserDistributeBusinessRate.getSkuId()));
-				return;
-			}
-			if (businessRate.getId() == null) {
-				try {
-					yhShopUserDistributeBusinessRateMapper.insert(businessRate);
-				} catch (DuplicateKeyException e) {
-				}
-			} else {
-				yhShopUserDistributeBusinessRateMapper.updateById(businessRate);
-			}
-		});
-	}
-
 	@Override
 	@Transactional(rollbackFor = Throwable.class)
 	public void verifyYhShopApplyMoney(DistributeApplyMoneyReq distributeApplyMoneyReq) {
@@ -308,8 +217,8 @@ public class CmsYhShopCommonServiceImpl implements CmsYhShopCommonService {
 	}
 
 	public void checkDistributorAndBusinessRate(Integer distributeGoodsRate, Long goodsId, String goodsName) {
-		YhShopUserBusinessDefaultRateConfig defaultGoodsRateConfig = defaultRateConfigMapper.selectOne(Wrappers.lambdaQuery(YhShopUserBusinessDefaultRateConfig.class)
-				.eq(YhShopUserBusinessDefaultRateConfig::getGoodsId, goodsId)
+		UserBusinessDefaultRateConfig defaultGoodsRateConfig = defaultRateConfigMapper.selectOne(Wrappers.lambdaQuery(UserBusinessDefaultRateConfig.class)
+				.eq(UserBusinessDefaultRateConfig::getGoodsId, goodsId)
 				.last("limit 1"));
 		Optional.ofNullable(defaultGoodsRateConfig).ifPresent(config -> {
 			if (distributeGoodsRate > config.getMaxRate()) {

+ 0 - 13
netflix-service/src/main/java/com/cyksj/service/shop/YhShopGeneralGoodsRateService.java

@@ -1,13 +0,0 @@
-package com.cyksj.service.shop;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.cyksj.model.entity.YhShopGeneralGoodsRate;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopGeneralGoodsRateService
- *创建者: JavaZou
- *创建时间:2023/9/21 17:06
- */
-public interface YhShopGeneralGoodsRateService extends IService<YhShopGeneralGoodsRate> {
-}

+ 3 - 10
netflix-service/src/main/java/com/cyksj/service/shop/impl/YhShopDistributeServiceImpl.java

@@ -37,8 +37,6 @@ public class YhShopDistributeServiceImpl implements YhShopDistributeService {
 
 	private final UserBenefitsService userBenefitsService;
 
-	private final YhShopGeneralGoodsRateMapper yhShopGeneralGoodsRateMapper;
-
 	private final GoodsDonMapper goodsDonMapper;
 	@Override
 	public void distributeWaitingSendPointsRecord(OrderDon order) {
@@ -75,18 +73,13 @@ public class YhShopDistributeServiceImpl implements YhShopDistributeService {
 				.eq(YhShopUserPlatDistributeRate::getGoodsId, order.getGoodsId()).last("limit 1"));
 		Integer rate = null;
 		if (yhShopUserPlatDistributeRate == null) {
-			log.info("未配置店铺主userId:{}对应平台goodsId:{}的比例,走通用比例", shopUserId, order.getGoodsId());
+			log.info("未配置店铺主userId:{}对应平台goodsId:{}的比例,走商品通用比例", shopUserId, order.getGoodsId());
 		} else {
 			rate = yhShopUserPlatDistributeRate.getRate();
 		}
 		if (rate == null) {
-			//获取平台配置的通用比例
-			YhShopGeneralGoodsRate yhShopGeneralGoodsRate = yhShopGeneralGoodsRateMapper.selectOne(Wrappers.lambdaQuery(YhShopGeneralGoodsRate.class)
-					.eq(YhShopGeneralGoodsRate::getGoodsId, order.getGoodsId()).last("limit 1"));
-			if (yhShopGeneralGoodsRate != null) {
-				log.info("店铺通用比例为:{}", yhShopGeneralGoodsRate.getRate());
-				rate = yhShopGeneralGoodsRate.getRate();
-			}
+			//未配置比例 默认使用 平台的分销比例
+			rate = goodsDon.getRate();
 		}
 		if (rate == null || rate <= 0) {
 			log.info("配置店铺主userId:{}对应平台goodsId:{}的比例为0", shopUserId, order.getGoodsId());

+ 0 - 20
netflix-service/src/main/java/com/cyksj/service/shop/impl/YhShopGeneralGoodsRateServiceIImpl.java

@@ -1,20 +0,0 @@
-package com.cyksj.service.shop.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.cyksj.mapper.shop.YhShopGeneralGoodsRateMapper;
-import com.cyksj.model.entity.YhShopGeneralGoodsRate;
-import com.cyksj.service.shop.YhShopGeneralGoodsRateService;
-import lombok.RequiredArgsConstructor;
-import org.springframework.stereotype.Service;
-
-/*
- *项目名: yhlxj
- *文件名: YhShopGeneralGoodsRateServiceIImpl
- *创建者: JavaZou
- *创建时间:2023/9/21 17:06
- */
-
-@Service
-@RequiredArgsConstructor
-public class YhShopGeneralGoodsRateServiceIImpl extends ServiceImpl<YhShopGeneralGoodsRateMapper, YhShopGeneralGoodsRate> implements YhShopGeneralGoodsRateService {
-}

+ 0 - 63
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/CmsYhShopGoodsController.java

@@ -131,26 +131,6 @@ public class CmsYhShopGoodsController {
         return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 
-    /**
-     * 设置店铺平台通用 分销比例配置
-     */
-    @PutMapping("/set/distribute/general/goods/rate")
-    public Result<String> setGeneralGoodsRate(@RequestBody List<YhShopGeneralGoodsRate> rates) {
-        cmsYhShopCommonService.setGeneralGoodsRate(rates);
-        return GatewayResponse.SUCCESS.newBuilder().toResult();
-    }
-
-    /**
-     * 通用平台分销比例展示
-     */
-    @GetMapping("/get/distribute/general/goods/rate")
-    public Result<List<ShopGeneralGoodsRateView>> getShopGeneralGoodsRate() {
-        List<ShopGeneralGoodsRateView> shopGeneralGoodsRateViews = beanSearcher.searchAll(ShopGeneralGoodsRateView.class, MapUtils.builder()
-                .orderBy(ShopGeneralGoodsRateView::getGoodsId).asc()
-                .build());
-        return GatewayResponse.SUCCESS.newBuilder().toResult(shopGeneralGoodsRateViews);
-    }
-
     /**
      * 店铺管理列表
      */
@@ -321,49 +301,6 @@ public class CmsYhShopGoodsController {
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
     }
 
-    /**
-     * 设置店铺商务默认分销比例
-     */
-    @PutMapping("/set/business/default/rate")
-    public Result<String> setBusinessDefaultRate(@RequestBody List<YhShopUserBusinessDefaultRateConfig> configs) {
-        cmsYhShopCommonService.setBusinessDefaultRate(configs);
-        return GatewayResponse.SUCCESS.newBuilder().toResult();
-    }
-
-    /**
-     * 店铺商务默认比例列表展示
-     */
-    @GetMapping("/get/business/default/rate")
-    public Result<List<YhShopUserBusinessDefaultRateConfigView>> setBusinessDefaultRate() {
-        List<YhShopUserBusinessDefaultRateConfigView> search = beanSearcher.searchAll(YhShopUserBusinessDefaultRateConfigView.class, MapUtils.flatBuilder(request.getParameterMap()).build());
-        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
-    }
-
-    /**
-     * 设置店铺商务分销比例
-     */
-    @PutMapping("/set/business/rate")
-    public Result<String> setBusinessRate(@RequestBody @Validated List<UserDistributeBusinessRate> rates) {
-        cmsYhShopCommonService.setBusinessRate(rates);
-        return GatewayResponse.SUCCESS.newBuilder().toResult();
-    }
-
-    /**
-     * 查看店铺 商务分销比例
-     */
-    @GetMapping("/get/business/rate")
-    public Result<List<YhShopUserDistributeBusinessRateRecordView>> getBusinessRate(Long businessId, Integer type) {
-        if (type == null) type = 1;
-        List<YhShopUserDistributeBusinessRateRecordView> yhShopUserDistributeBusinessRateRecordViews = beanSearcher.searchAll(YhShopUserDistributeBusinessRateRecordView.class, MapUtils.builder()
-                .put("business_id", String.format(" and ur.business_id = %s", businessId))
-                .put("bid", businessId)
-                .field(YhShopUserDistributeBusinessRateRecordView::getType, type)
-                .orderBy(YhShopUserDistributeBusinessRateRecordView::getGoodsId).asc()
-                .orderBy(YhShopUserDistributeBusinessRateRecordView::getSkuId).asc()
-                .build());
-        return GatewayResponse.SUCCESS.newBuilder().toResult(yhShopUserDistributeBusinessRateRecordViews);
-    }
-
     /**
      * 商务人员列表 详情
      */

+ 1 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/YhShopUserController.java

@@ -155,7 +155,7 @@ public class YhShopUserController {
 				.orderBy(YhShopUserDistributeRateView::getRate).desc()
 				.build());
 		YhShopUserDistributeDetailView detailView = new YhShopUserDistributeDetailView();
-		Map<String, List<YhShopUserDistributeRateView>> collect = rateViews.stream().filter(ct->StrUtil.isNotBlank(ct.getCategoryName())).collect(Collectors.groupingBy(YhShopUserDistributeRateView::getCategoryName));
+		Map<String, List<YhShopUserDistributeRateView>> collect = rateViews.stream().filter(ct -> StrUtil.isNotBlank(ct.getCategoryName()) && ct.getRate() > 0).collect(Collectors.groupingBy(YhShopUserDistributeRateView::getCategoryName));
 		detailView.setRateViews(collect);
 		detailView.setWMoney(BigDecimal.valueOf(wMoneyPoints.doubleValue()).divide(BigDecimal.valueOf(100)));
 		detailView.setReMoney(BigDecimal.valueOf(reMoneyPoints.doubleValue()).divide(BigDecimal.valueOf(100)));