From b83b070dc8cc823c877aa3a2ade134272ec0641a Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期一, 07 七月 2025 17:02:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java
index 8d35dba..d2f95b9 100644
--- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java
+++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CommissionRender.java
@@ -1,11 +1,12 @@
 package cn.lili.modules.order.cart.render.impl;
 
-import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import cn.lili.common.enums.PromotionTypeEnum;
 import cn.lili.common.utils.CurrencyUtil;
+import cn.lili.modules.goods.entity.dos.Goods;
 import cn.lili.modules.goods.service.CategoryService;
+import cn.lili.modules.goods.service.GoodsService;
 import cn.lili.modules.order.cart.entity.dto.TradeDTO;
 import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
 import cn.lili.modules.order.cart.entity.enums.RenderStepEnums;
@@ -38,6 +39,8 @@
     @Autowired
     private CategoryService categoryService;
 
+    @Autowired
+    private GoodsService goodsService;
     @Override
     public RenderStepEnums step() {
         return RenderStepEnums.PLATFORM_COMMISSION;
@@ -64,11 +67,17 @@
 
                 PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO();
                 //骞冲彴浣i噾鏍规嵁鍒嗙被璁$畻
-                String categoryId = cartSkuVO.getGoodsSku().getCategoryPath()
-                        .substring(cartSkuVO.getGoodsSku().getCategoryPath().lastIndexOf(",") + 1);
-                if (CharSequenceUtil.isNotEmpty(categoryId)) {
-                    Double commissionRate = categoryService.getCategoryById(categoryId).getCommissionRate();
-                    priceDetailDTO.setPlatFormCommissionPoint(commissionRate);
+                //鏍规嵁鍟嗗搧鎶芥垚杩涜璁$畻浣i噾
+                String goodsId = cartSkuVO.getGoodsSku().getGoodsId();
+                Goods goods = goodsService.getById(goodsId);
+//                String categoryId = cartSkuVO.getGoodsSku().getCategoryPath()
+//                        .substring(cartSkuVO.getGoodsSku().getCategoryPath().lastIndexOf(",") + 1);
+//                if (CharSequenceUtil.isNotEmpty(categoryId)) {
+//                    Double commissionRate = categoryService.getCategoryById(categoryId).getCommissionRate();
+//                    priceDetailDTO.setPlatFormCommissionPoint(commissionRate);
+//                }
+                if (goods != null&&goods.getCommission()!=null) {
+                    priceDetailDTO.setPlatFormCommissionPoint(Double.valueOf(goods.getCommission().toString()));
                 }
 
                 //濡傛灉绉垎璁㈠崟 绉垎璁㈠崟锛屽崟鐙搷浣滆鍗曠粨绠楅噾棰濆拰鍟嗗缁撶畻瀛楁

--
Gitblit v1.8.0