From cffb16b1767f5a5282e953cce8e674bade546178 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期一, 07 七月 2025 17:02:39 +0800 Subject: [PATCH] 添加改价记录功能 修改结算流程 添加定时任务 --- 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