商品索引生成是,对索引值的非空处理

This commit is contained in:
Chopper 2021-07-05 09:25:03 +08:00
parent de2777e244
commit 6926cd583d

View File

@ -625,11 +625,12 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
}
//设置规格商品缩略图
//如果规格没有图片则用商品图片复盖有则增加规格图片放在商品图片集合之前
if (StringUtils.isNotEmpty(spec.getValue().toString())) {
if (spec.getValue() != null && StringUtils.isNotEmpty(spec.getValue().toString())) {
thumbnail = goodsGalleryService.getGoodsGallery(images.get(0).get("url")).getThumbnail();
small = goodsGalleryService.getGoodsGallery(images.get(0).get("url")).getSmall();
}
} else {
if (spec.getValue() != null) {
//设置商品名称
goodsName.append(" ").append(spec.getValue());
//规格简短信息
@ -637,6 +638,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
}
}
}
}
//设置规格信息
sku.setGoodsName(goodsName.toString());
sku.setThumbnail(thumbnail);