From 18a9f86a8c1fdb6c42c4212dcaa1de437f6f4861 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 15 十月 2025 14:25:37 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/user_action' into user_action
---
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