| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private CategoryService categoryService; |
| | | |
| | | @Autowired |
| | | private GoodsService goodsService; |
| | | @Override |
| | | public RenderStepEnums step() { |
| | | return RenderStepEnums.PLATFORM_COMMISSION; |
| | |
| | | |
| | | PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO(); |
| | | //平台佣金根据分类计算 |
| | | String categoryId = cartSkuVO.getGoodsSku().getCategoryPath() |
| | | .substring(cartSkuVO.getGoodsSku().getCategoryPath().lastIndexOf(",") + 1); |
| | | if (CharSequenceUtil.isNotEmpty(categoryId)) { |
| | | Double commissionRate = categoryService.getCategoryById(categoryId).getCommissionRate(); |
| | | priceDetailDTO.setPlatFormCommissionPoint(commissionRate); |
| | | //根据商品抽成进行计算佣金 |
| | | 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())); |
| | | } |
| | | |
| | | //如果积分订单 积分订单,单独操作订单结算金额和商家结算字段 |