commit
b439d8283f
@ -35,7 +35,6 @@ import cn.lili.modules.goods.service.WholesaleService;
|
||||
import cn.lili.modules.goods.sku.GoodsSkuBuilder;
|
||||
import cn.lili.modules.goods.sku.render.SalesModelRender;
|
||||
import cn.lili.modules.member.entity.dos.FootPrint;
|
||||
import cn.lili.modules.member.service.MemberEvaluationService;
|
||||
import cn.lili.modules.promotion.entity.dos.Coupon;
|
||||
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
||||
import cn.lili.modules.promotion.entity.dto.search.PromotionGoodsSearchParams;
|
||||
@ -98,11 +97,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
*/
|
||||
@Autowired
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
/**
|
||||
* 会员评价
|
||||
*/
|
||||
@Autowired
|
||||
private MemberEvaluationService memberEvaluationService;
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
@ -675,7 +669,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
salesModelRenders.stream().filter(i -> i.getSalesMode().equals(goodsOperationDTO.getSalesModel())).findFirst().ifPresent(i -> i.renderBatch(goodsSkuList, goodsOperationDTO));
|
||||
for (GoodsSku goodsSku : goodsSkuList) {
|
||||
extendOldSkuValue(goodsSku);
|
||||
this.renderImages(goodsSku);
|
||||
this.renderImages(goodsSku, goodsOperationDTO.getGoodsGalleryList());
|
||||
}
|
||||
}
|
||||
|
||||
@ -707,7 +701,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
extendOldSkuValue(goodsSku);
|
||||
// 商品销售模式渲染器
|
||||
salesModelRenders.stream().filter(i -> i.getSalesMode().equals(goodsOperationDTO.getSalesModel())).findFirst().ifPresent(i -> i.renderSingle(goodsSku, goodsOperationDTO));
|
||||
this.renderImages(goodsSku);
|
||||
this.renderImages(goodsSku, goodsOperationDTO.getGoodsGalleryList());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -732,17 +726,21 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
*
|
||||
* @param goodsSku sku
|
||||
*/
|
||||
void renderImages(GoodsSku goodsSku) {
|
||||
void renderImages(GoodsSku goodsSku, List<String> goodsImages) {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(goodsSku.getSpecs());
|
||||
List<Map<String, String>> images = jsonObject.get("images", List.class);
|
||||
List<String> images = jsonObject.getBeanList("images", String.class);
|
||||
GoodsGallery goodsGallery;
|
||||
if (images != null && !images.isEmpty()) {
|
||||
GoodsGallery goodsGallery = goodsGalleryService.getGoodsGallery(images.get(0).get("url"));
|
||||
goodsGallery = goodsGalleryService.getGoodsGallery(images.get(0));
|
||||
} else {
|
||||
goodsGallery = goodsGalleryService.getGoodsGallery(goodsImages.get(0));
|
||||
}
|
||||
|
||||
goodsSku.setBig(goodsGallery.getOriginal());
|
||||
goodsSku.setOriginal(goodsGallery.getOriginal());
|
||||
goodsSku.setThumbnail(goodsGallery.getThumbnail());
|
||||
goodsSku.setSmall(goodsGallery.getSmall());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品分组商品sku及其规格信息
|
||||
|
Loading…
x
Reference in New Issue
Block a user