Commit 8bd0519cf318fe08b3ad0dca76cf1bb51b1823c3

Authored by 芋道源码
Committed by Gitee
2 parents 664abe70 9af28669

!1035 【功能修复】商城:解决商品项图片为空串时,订单项没有使用SPU图片的问题。

Merge pull request !1035 from Ordinary/master-jdk17
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePriceCalculatorHelper.java
1 package cn.iocoder.yudao.module.trade.service.price.calculator; 1 package cn.iocoder.yudao.module.trade.service.price.calculator;
2 2
3 import cn.hutool.core.lang.Assert; 3 import cn.hutool.core.lang.Assert;
  4 +import cn.hutool.core.util.StrUtil;
4 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; 5 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
5 import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO; 6 import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO;
6 import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; 7 import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO;
@@ -61,7 +62,7 @@ public class TradePriceCalculatorHelper { @@ -61,7 +62,7 @@ public class TradePriceCalculatorHelper {
61 orderItem.setSpuName(spu.getName()).setCategoryId(spu.getCategoryId()) 62 orderItem.setSpuName(spu.getName()).setCategoryId(spu.getCategoryId())
62 .setDeliveryTemplateId(spu.getDeliveryTemplateId()) 63 .setDeliveryTemplateId(spu.getDeliveryTemplateId())
63 .setGivePoint(spu.getGiveIntegral()).setUsePoint(0); 64 .setGivePoint(spu.getGiveIntegral()).setUsePoint(0);
64 - if (orderItem.getPicUrl() == null) { 65 + if (StrUtil.isBlank(orderItem.getPicUrl())) {
65 orderItem.setPicUrl(spu.getPicUrl()); 66 orderItem.setPicUrl(spu.getPicUrl());
66 } 67 }
67 }); 68 });
@@ -240,7 +241,7 @@ public class TradePriceCalculatorHelper { @@ -240,7 +241,7 @@ public class TradePriceCalculatorHelper {
240 * 241 *
241 * 和 {@link #dividePrice(List, Integer)} 逻辑一致,只是传入的是 TradeOrderItemDO 对象 242 * 和 {@link #dividePrice(List, Integer)} 逻辑一致,只是传入的是 TradeOrderItemDO 对象
242 * 243 *
243 - * @param items 订单项 244 + * @param items 订单项
244 * @param price 订单支付金额 245 * @param price 订单支付金额
245 * @return 分摊金额数组,和传入的 orderItems 一一对应 246 * @return 分摊金额数组,和传入的 orderItems 一一对应
246 */ 247 */