Commit 8bd0519cf318fe08b3ad0dca76cf1bb51b1823c3
Committed by
Gitee
!1035 【功能修复】商城:解决商品项图片为空串时,订单项没有使用SPU图片的问题。
Merge pull request !1035 from Ordinary/master-jdk17
Showing
1 changed file
with
3 additions
and
2 deletions
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePriceCalculatorHelper.java
| 1 | 1 | package cn.iocoder.yudao.module.trade.service.price.calculator; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.lang.Assert; |
| 4 | +import cn.hutool.core.util.StrUtil; | |
| 4 | 5 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | 6 | import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO; |
| 6 | 7 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| ... | ... | @@ -61,7 +62,7 @@ public class TradePriceCalculatorHelper { |
| 61 | 62 | orderItem.setSpuName(spu.getName()).setCategoryId(spu.getCategoryId()) |
| 62 | 63 | .setDeliveryTemplateId(spu.getDeliveryTemplateId()) |
| 63 | 64 | .setGivePoint(spu.getGiveIntegral()).setUsePoint(0); |
| 64 | - if (orderItem.getPicUrl() == null) { | |
| 65 | + if (StrUtil.isBlank(orderItem.getPicUrl())) { | |
| 65 | 66 | orderItem.setPicUrl(spu.getPicUrl()); |
| 66 | 67 | } |
| 67 | 68 | }); |
| ... | ... | @@ -240,7 +241,7 @@ public class TradePriceCalculatorHelper { |
| 240 | 241 | * |
| 241 | 242 | * 和 {@link #dividePrice(List, Integer)} 逻辑一致,只是传入的是 TradeOrderItemDO 对象 |
| 242 | 243 | * |
| 243 | - * @param items 订单项 | |
| 244 | + * @param items 订单项 | |
| 244 | 245 | * @param price 订单支付金额 |
| 245 | 246 | * @return 分摊金额数组,和传入的 orderItems 一一对应 |
| 246 | 247 | */ | ... | ... |