写在最前面, 商品新增最重要的需要把前端的流程看懂,需要把对应的逻辑搞清楚!!!









②. 点击保存信息,出现如下的json格式

{"spuName":"华为 HUAWEI Mate 30","spuDescription":"华为 HUAWEI Mate 30","catalogId":225,"brandId":2,"weight":0.198,"publishStatus":0,"decript":["https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//4b2fa163-5335-409f-8a20-c00fddad4afc_73366cc235d68202.jpg","https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//b958cd48-240b-4710-8894-b59b4754e5a5_528211b97272d88a.jpg"],"images":["https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//12e97063-6e8d-45a8-8819-67d34639d77b_0d40c24b264aa511.jpg","https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//00c885f8-bd24-4347-803c-2fb620ef32be_1f15cdbcf9e1273c.jpg","https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//c124b04d-d4c6-4571-8d87-9ec32dbf9221_3c24f9cd69534030.jpg","https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//26a73fd6-c484-4f3c-81e6-c52468bc2839_23d9fbb256ea5d4a.jpg","https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//90e6dcbd-e1c6-4501-88fc-a4876344ffe7_28f296629cca865e.jpg","https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//e8a27264-3023-4741-8093-1a7d5d17b2eb_73ab4d2e818d2211.jpg","https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//5820aa70-f054-4c21-88cf-8754244793f4_8bf441260bffa42f.jpg","https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//5c79b79b-5bea-43fa-8d82-0371ecd14b9d_919c850652e98031.jpg"],"bounds":{"buyBounds":500,"growBounds":500},"baseAttrs":[{"attrId":2,"attrValues":"2019","showDesc":0},{"attrId":5,"attrValues":"LIO-AN00m","showDesc":0},{"attrId":8,"attrValues":"158.1","showDesc":0},{"attrId":9,"attrValues":"其他","showDesc":0},{"attrId":10,"attrValues":"高通(Qualcomm)","showDesc":0},{"attrId":11,"attrValues":"HUAWEI Kirin 980","showDesc":0}],"skus":[{"attr":[{"attrId":3,"attrName":"颜色","attrValue":"星河银"},{"attrId":12,"attrName":"版本","attrValue":"8GB+125GB"}],"skuName":"华为 HUAWEI Mate 30 星河银 8GB+125GB","price":"5799","skuTitle":"华为 HUAWEI Mate 30 星河银 8GB+125GB 麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四射 4G全网通手机","skuSubtitle":"【全新正品、现货速发】送品牌无线充+三合一数据线+蓝牙耳机+钢化膜【选购mate30e】","images":[{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//12e97063-6e8d-45a8-8819-67d34639d77b_0d40c24b264aa511.jpg","defaultImg":1},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//e8a27264-3023-4741-8093-1a7d5d17b2eb_73ab4d2e818d2211.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//5c79b79b-5bea-43fa-8d82-0371ecd14b9d_919c850652e98031.jpg","defaultImg":0}],"descar":["星河银","8GB+125GB"],"fullCount":3,"discount":0.98,"countStatus":0,"fullPrice":10000,"reducePrice":50,"priceStatus":0,"memberPrice":[{"id":2,"name":"铜牌会员","price":0},{"id":3,"name":"银牌会员","price":0}]},{"attr":[{"attrId":3,"attrName":"颜色","attrValue":"星河银"},{"attrId":12,"attrName":"版本","attrValue":"8GB+256GB"}],"skuName":"华为 HUAWEI Mate 30 星河银 8GB+256GB","price":"6299","skuTitle":"华为 HUAWEI Mate 30 星河银 8GB+256GB 麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四射 4G全网通手机 ","skuSubtitle":"【全新正品、现货速发】送品牌无线充+三合一数据线+蓝牙耳机+钢化膜【选购mate30e】","images":[{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//12e97063-6e8d-45a8-8819-67d34639d77b_0d40c24b264aa511.jpg","defaultImg":1},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//e8a27264-3023-4741-8093-1a7d5d17b2eb_73ab4d2e818d2211.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//5c79b79b-5bea-43fa-8d82-0371ecd14b9d_919c850652e98031.jpg","defaultImg":0}],"descar":["星河银","8GB+256GB"],"fullCount":0,"discount":0,"countStatus":0,"fullPrice":0,"reducePrice":0,"priceStatus":0,"memberPrice":[{"id":2,"name":"铜牌会员","price":6259},{"id":3,"name":"银牌会员","price":6159}]},{"attr":[{"attrId":3,"attrName":"颜色","attrValue":"亮黑色"},{"attrId":12,"attrName":"版本","attrValue":"8GB+125GB"}],"skuName":"华为 HUAWEI Mate 30 亮黑色 8GB+125GB","price":"5799","skuTitle":"华为 HUAWEI Mate 30 亮黑色 8GB+125GB 麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四射 4G全网通手机","skuSubtitle":"【全新正品、现货速发】送品牌无线充+三合一数据线+蓝牙耳机+钢化膜【选购mate30e】","images":[{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//00c885f8-bd24-4347-803c-2fb620ef32be_1f15cdbcf9e1273c.jpg","defaultImg":1},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//90e6dcbd-e1c6-4501-88fc-a4876344ffe7_28f296629cca865e.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//5820aa70-f054-4c21-88cf-8754244793f4_8bf441260bffa42f.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0}],"descar":["亮黑色","8GB+125GB"],"fullCount":0,"discount":0,"countStatus":0,"fullPrice":0,"reducePrice":0,"priceStatus":0,"memberPrice":[{"id":2,"name":"铜牌会员","price":0},{"id":3,"name":"银牌会员","price":0}]},{"attr":[{"attrId":3,"attrName":"颜色","attrValue":"亮黑色"},{"attrId":12,"attrName":"版本","attrValue":"8GB+256GB"}],"skuName":"华为 HUAWEI Mate 30 亮黑色 8GB+256GB","price":"6299","skuTitle":"华为 HUAWEI Mate 30 亮黑色 8GB+256GB 麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四射 4G全网通手机","skuSubtitle":"【全新正品、现货速发】送品牌无线充+三合一数据线+蓝牙耳机+钢化膜【选购mate30e】","images":[{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//00c885f8-bd24-4347-803c-2fb620ef32be_1f15cdbcf9e1273c.jpg","defaultImg":1},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//90e6dcbd-e1c6-4501-88fc-a4876344ffe7_28f296629cca865e.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//5820aa70-f054-4c21-88cf-8754244793f4_8bf441260bffa42f.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0}],"descar":["亮黑色","8GB+256GB"],"fullCount":0,"discount":0,"countStatus":0,"fullPrice":0,"reducePrice":0,"priceStatus":0,"memberPrice":[{"id":2,"name":"铜牌会员","price":0},{"id":3,"name":"银牌会员","price":0}]},{"attr":[{"attrId":3,"attrName":"颜色","attrValue":"翡冷翠"},{"attrId":12,"attrName":"版本","attrValue":"8GB+125GB"}],"skuName":"华为 HUAWEI Mate 30 翡冷翠 8GB+125GB","price":"5799","skuTitle":"华为 HUAWEI Mate 30 翡冷翠 8GB+125GB 麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四射 4G全网通手机","skuSubtitle":"【全新正品、现货速发】送品牌无线充+三合一数据线+蓝牙耳机+钢化膜【选购mate30e】","images":[{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//12e97063-6e8d-45a8-8819-67d34639d77b_0d40c24b264aa511.jpg","defaultImg":1},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//e8a27264-3023-4741-8093-1a7d5d17b2eb_73ab4d2e818d2211.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//5c79b79b-5bea-43fa-8d82-0371ecd14b9d_919c850652e98031.jpg","defaultImg":0}],"descar":["翡冷翠","8GB+125GB"],"fullCount":0,"discount":0,"countStatus":0,"fullPrice":0,"reducePrice":0,"priceStatus":0,"memberPrice":[{"id":2,"name":"铜牌会员","price":0},{"id":3,"name":"银牌会员","price":0}]},{"attr":[{"attrId":3,"attrName":"颜色","attrValue":"翡冷翠"},{"attrId":12,"attrName":"版本","attrValue":"8GB+256GB"}],"skuName":"华为 HUAWEI Mate 30 翡冷翠 8GB+256GB","price":"6299","skuTitle":"华为 HUAWEI Mate 30 翡冷翠 8GB+256GB 麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四射 4G全网通手机","skuSubtitle":"【全新正品、现货速发】送品牌无线充+三合一数据线+蓝牙耳机+钢化膜【选购mate30e】","images":[{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//00c885f8-bd24-4347-803c-2fb620ef32be_1f15cdbcf9e1273c.jpg","defaultImg":1},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//e8a27264-3023-4741-8093-1a7d5d17b2eb_73ab4d2e818d2211.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//5c79b79b-5bea-43fa-8d82-0371ecd14b9d_919c850652e98031.jpg","defaultImg":0}],"descar":["翡冷翠","8GB+256GB"],"fullCount":0,"discount":0,"countStatus":0,"fullPrice":0,"reducePrice":0,"priceStatus":0,"memberPrice":[{"id":2,"name":"铜牌会员","price":0},{"id":3,"name":"银牌会员","price":0}]},{"attr":[{"attrId":3,"attrName":"颜色","attrValue":"罗兰紫"},{"attrId":12,"attrName":"版本","attrValue":"8GB+125GB"}],"skuName":"华为 HUAWEI Mate 30 罗兰紫 8GB+125GB","price":"5799","skuTitle":"华为 HUAWEI Mate 30 罗兰紫 8GB+125GB 麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四射 4G全网通手机","skuSubtitle":"【全新正品、现货速发】送品牌无线充+三合一数据线+蓝牙耳机+钢化膜【选购mate30e】","images":[{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//12e97063-6e8d-45a8-8819-67d34639d77b_0d40c24b264aa511.jpg","defaultImg":1},{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//c124b04d-d4c6-4571-8d87-9ec32dbf9221_3c24f9cd69534030.jpg","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//26a73fd6-c484-4f3c-81e6-c52468bc2839_23d9fbb256ea5d4a.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0}],"descar":["罗兰紫","8GB+125GB"],"fullCount":0,"discount":0,"countStatus":0,"fullPrice":0,"reducePrice":0,"priceStatus":0,"memberPrice":[{"id":2,"name":"铜牌会员","price":0},{"id":3,"name":"银牌会员","price":0}]},{"attr":[{"attrId":3,"attrName":"颜色","attrValue":"罗兰紫"},{"attrId":12,"attrName":"版本","attrValue":"8GB+256GB"}],"skuName":"华为 HUAWEI Mate 30 罗兰紫 8GB+256GB","price":"6299","skuTitle":"华为 HUAWEI Mate 30 罗兰紫 8GB+256GB 麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四射 4G全网通手机","skuSubtitle":"【全新正品、现货速发】送品牌无线充+三合一数据线+蓝牙耳机+钢化膜【选购mate30e】","images":[{"imgUrl":"","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//00c885f8-bd24-4347-803c-2fb620ef32be_1f15cdbcf9e1273c.jpg","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//c124b04d-d4c6-4571-8d87-9ec32dbf9221_3c24f9cd69534030.jpg","defaultImg":0},{"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-03-18//26a73fd6-c484-4f3c-81e6-c52468bc2839_23d9fbb256ea5d4a.jpg","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0},{"imgUrl":"","defaultImg":0}],"descar":["罗兰紫","8GB+256GB"],"fullCount":0,"discount":0,"countStatus":0,"fullPrice":0,"reducePrice":0,"priceStatus":0,"memberPrice":[{"id":2,"name":"铜牌会员","price":0},{"id":3,"name":"银牌会员","price":0}]}]}
①. 数据库ID都是用bigint类型储存的,这里需要将实体类中的int改为Long、将价格都改为BigDecimal类型
②. 实体类具体如下
@Data
public class SpuSaveVo {
private String spuName; //商品名称
private String spuDescription;//商品描述
private Long catalogId;//选择分类
private Long brandId;//选择品牌
private BigDecimal weight;//商品重量(Kg)
private int publishStatus;//是否发布
private List<String> decript;//商品介绍
private List<String> images;//商品图集
private Bounds bounds;//设置积分
private List<BaseAttrs> baseAttrs;
private List<Skus> skus;
}
@Data
public class Bounds {
private BigDecimal buyBounds;
private BigDecimal growBounds;
}
@Data
public class BaseAttrs {
private Long attrId;//属性的ID
private String attrValues;//属性的值
private int showDesc;//是否快速展示
}
@Data
public class Skus {
private List<Attr> attr;
private String skuName; //sku名称
private BigDecimal price;//价钱
private String skuTitle;//sku的标题
private String skuSubtitle;//sku副标题
private List<Images> images;//图片、展示的图片、有一张设为了默认
private List<String> descar;// ["星河银", "8GB+125GB"]
private int fullCount;// 设置折扣、满3件
private BigDecimal discount;//打多少折
private int countStatus;//打折 可叠加优惠
private BigDecimal fullPrice;//设置满减、满1000
private BigDecimal reducePrice;//满减多少元
private int priceStatus;//满减 可叠加优惠
private List<MemberPrice> memberPrice;//会员信息
}
@Data
public class Attr {
private Long attrId;//属性id
private String attrName;//属性名称
private String attrValue;//属性值
}
@Data
public class MemberPrice {
private Long id;//会员id
private String name;//会员名称
private BigDecimal price;//这个商品会员的价钱是多少
}

@Data
public class SpuSaveVo {
private String spuName; //商品名称
private String spuDescription;//商品描述
private Long catalogId;//选择分类
private Long brandId;//选择品牌
private BigDecimal weight;//商品重量(Kg)
private int publishStatus;//是否发布
private List<String> decript;//商品介绍
private List<String> images;//商品图集
private Bounds bounds;//设置积分
private List<BaseAttrs> baseAttrs;
private List<Skus> skus;
}









@Data
public class BaseAttrs {
private Long attrId;//属性的ID
private String attrValues;//属性的值
private int showDesc;//是否快速展示
}


@Data
public class Bounds {
private BigDecimal buyBounds;
private BigDecimal growBounds;
}


@Data
public class Skus {
private List<Attr> attr;
private String skuName; //sku名称
private BigDecimal price;//价钱
private String skuTitle;//sku的标题
private String skuSubtitle;//sku副标题
private List<Images> images;//图片、展示的图片、有一张设为了默认
private List<String> descar;// ["星河银", "8GB+125GB"]
private int fullCount;// 设置折扣、满3件
private BigDecimal discount;//打多少折
private int countStatus;//打折 可叠加优惠
private BigDecimal fullPrice;//设置满减、满1000
private BigDecimal reducePrice;//满减多少元
private int priceStatus;//满减 可叠加优惠
private List<MemberPrice> memberPrice;//会员信息
}


@Data
public class Images {
private String imgUrl;
private int defaultImg;
}


@Data
public class Attr {
private Long attrId;//属性id
private String attrName;//属性名称
private String attrValue;//属性值
}




@Data
public class SkuReductionTo {
private Long skuId;
private int fullCount;
private BigDecimal discount;
private int countStatus;
private BigDecimal fullPrice;
private BigDecimal reducePrice;
private int priceStatus;
private List<MemberPrice> memberPrice;
}
@Data
public class MemberPrice {
private Long id;
private String name;
private BigDecimal price;
}
/**
* //TODO 高级部分来完善
* 商品大保存
* @param vo
*/
@Transactional
@Override
public void saveSpuInfo(SpuSaveVo vo) {
//1.保存spu的基本信息 psm_spu_info
SpuInfoEntity infoEntity=new SpuInfoEntity();
BeanUtils.copyProperties(vo,infoEntity);
infoEntity.setCreateTime(new Date());
infoEntity.setUpdateTime(new Date());
this.saveBaseSpuInfo(infoEntity);
//2.保存spu的描述信息 psm_spu_info_desc
List<String> decript = vo.getDecript();
SpuInfoDescEntity descEntity = new SpuInfoDescEntity();
descEntity.setSpuId(infoEntity.getId());
descEntity.setDecript(String.join(",",decript));
spuInfoDescService.saveSpuInfoDesc(descEntity);
//3.保存spu的的图片集 psm_spu_images
List<String> images = vo.getImages();
spuImagesService.saveImages(infoEntity.getId(),images);
//4.保存spu的规格参数 pms_product_attr_value
List<BaseAttrs> baseAttrs = vo.getBaseAttrs();
List<ProductAttrValueEntity> collect = baseAttrs.stream().map(item -> {
ProductAttrValueEntity valueEntity = new ProductAttrValueEntity();
valueEntity.setSpuId(infoEntity.getId());
valueEntity.setAttrValue(item.getAttrValues());
valueEntity.setQuickShow(item.getShowDesc());
valueEntity.setAttrId(item.getAttrId());
AttrEntity attrEntity = attrService.getById(item.getAttrId());
if (attrEntity != null) {
valueEntity.setAttrName(attrEntity.getAttrName());
}
return valueEntity;
}).collect(Collectors.toList());
attrValueService.saveProductAttr(collect);
//保存spu的积分信息 gulimall_sms -- sms_spu_bounds
Bounds bounds = vo.getBounds();
SpuBoundTO spuBoundTO = new SpuBoundTO();
BeanUtils.copyProperties(bounds,spuBoundTO);
spuBoundTO.setSpuId(infoEntity.getId());
R r = couponFeignService.saveSpuBounds(spuBoundTO);
if(r.getCode()!=0){
log.error("远程保存spu积分信息失败");
}
//5.保存当前spu对于的所有的sku表
//5.1 psm_sku_info 基本信息
List<Skus> skus = vo.getSkus();
if(!CollectionUtils.isEmpty(skus)){
skus.forEach((item)->{
String defaltImg="";
for (Images image : item.getImages()) {
if(image.getDefaultImg()==1){
defaltImg=image.getImgUrl();
}
}
SkuInfoEntity skuInfoEntity = new SkuInfoEntity();
//spu_id、sku_desc、catelog_id、brand_id、sku_default_img、sele_count
//sku_name、sku_title、sku_subtitle、price、
BeanUtils.copyProperties(item,skuInfoEntity);
skuInfoEntity.setSpuId(infoEntity.getId());
skuInfoEntity.setCatalogId(infoEntity.getCatalogId());
skuInfoEntity.setBrandId(infoEntity.getBrandId());
skuInfoEntity.setSkuDefaultImg(defaltImg);
skuInfoEntity.setSaleCount(0L);
skuInfoService.saveSkuInfo(skuInfoEntity);
Long skuId = skuInfoEntity.getSkuId();
//5.2 sku的图片信息
List<SkuImagesEntity> skuImagesEntities = item.getImages().stream().map(skuImg -> {
SkuImagesEntity imagesEntity = new SkuImagesEntity();
BeanUtils.copyProperties(skuImg, imagesEntity);
imagesEntity.setSkuId(skuId);
return imagesEntity;
}).filter(entity -> {
//返回true就是需要,返回false就是剔除
return !StringUtils.isEmpty(entity.getImgUrl());
}).collect(Collectors.toList());
//TODO 没有图片路径的不用保存
skuImagesService.saveBatch(skuImagesEntities);
//5.3 sku的销售属性值 psm_sku_sale_attr_value
List<Attr> attr = item.getAttr();
List<SkuSaleAttrValueEntity> valueEntities = attr.stream().map(attr1 -> {
SkuSaleAttrValueEntity valueEntity = new SkuSaleAttrValueEntity();
BeanUtils.copyProperties(attr1, valueEntity);
valueEntity.setSkuId(skuId);
AttrEntity attrEntity = attrService.getById(attr1.getAttrId());
if (attrEntity != null) {
valueEntity.setAttrName(attrEntity.getAttrName());
}
return valueEntity;
}).collect(Collectors.toList());
valueService.saveBatch(valueEntities);
//5.4 sku的优惠满减等信息 gulimall_sms->sms_sku_ladder --sms_sku_full_reduction -- sms_ member_price -- sms_spu_bounds
SkuReductionTo skuReductionTo = new SkuReductionTo();
skuReductionTo.setSkuId(skuId);
BeanUtils.copyProperties(item,skuReductionTo);
if(skuReductionTo.getFullCount()>0||skuReductionTo.getFullPrice().compareTo(new BigDecimal(0))==1){
R r1 = couponFeignService.saveSkuReduction(skuReductionTo);
if(r1.getCode()!=0){
log.error("远程保存sku优惠信息失败");
}
}
});
}
}
//编写远程调用接口
@Component
@FeignClient(value = "gulimall-coupon")
public interface CouponFeignService {
/**
* 1、CouponFeignService.saveSpuBounds(spuBoundTo);
* 1)、@RequestBody将这个对象转为json。
* 2)、找到gulimall-coupon服务,给/coupon/spubounds/save发送请求。
* 将上一步转的json放在请求体位置,发送请求;
* 3)、对方服务收到请求。请求体里有json数据。
* (@RequestBody SpuBoundsEntity spuBounds);将请求体的json转为SpuBoundsEntity;
* 只要json数据模型是兼容的。双方服务无需使用同一个to
* @param spuBoundTo
* @return
*/
@PostMapping("/coupon/spubounds/save")
R saveSpuBounds(@RequestBody SpuBoundTO spuBoundTo);
@PostMapping("/coupon/skufullreduction/saveinfo")
R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}
@Data
public class SkuReductionTo {
private Long skuId;
private int fullCount;
private BigDecimal discount;
private int countStatus;
private BigDecimal fullPrice;
private BigDecimal reducePrice;
private int priceStatus;
private List<MemberPrice> memberPrice;
}
@RestController
@RequestMapping("coupon/skufullreduction")
public class SkuFullReductionController {
@Autowired
private SkuFullReductionService skuFullReductionService;
@PostMapping("/saveinfo")
public R saveinfo(@RequestBody SkuReductionTo skuReductionTo){
skuFullReductionService.saveSkuReduction(skuReductionTo);
return R.ok();
}
}
@Override
public void saveSkuReduction(SkuReductionTo reductionTo) {
//1、// //5.4)、sku的优惠、满减等信息;gulimall_sms->sms_sku_ladder\sms_sku_full_reduction\sms_member_price
//sms_sku_ladder
SkuLadderEntity skuLadderEntity = new SkuLadderEntity();
skuLadderEntity.setSkuId(reductionTo.getSkuId());
skuLadderEntity.setFullCount(reductionTo.getFullCount());
skuLadderEntity.setDiscount(reductionTo.getDiscount());
skuLadderEntity.setAddOther(reductionTo.getCountStatus());
if(reductionTo.getFullCount() > 0){
skuLadderService.save(skuLadderEntity);
}
//2、sms_sku_full_reduction
SkuFullReductionEntity reductionEntity = new SkuFullReductionEntity();
BeanUtils.copyProperties(reductionTo,reductionEntity);
if(reductionEntity.getFullPrice().compareTo(new BigDecimal("0"))==1){
this.save(reductionEntity);
}
//3、sms_member_price
List<MemberPrice> memberPrice = reductionTo.getMemberPrice();
if(!CollectionUtils.isEmpty(memberPrice)){
List<MemberPriceEntity> collect = memberPrice.stream().map(item -> {
MemberPriceEntity priceEntity = new MemberPriceEntity();
priceEntity.setSkuId(reductionTo.getSkuId());
priceEntity.setMemberLevelId(item.getId());
priceEntity.setMemberLevelName(item.getName());
priceEntity.setMemberPrice(item.getPrice());
priceEntity.setAddOther(1);
return priceEntity;
}).filter(item->{
return item.getMemberPrice().compareTo(new BigDecimal("0")) == 1;
}).collect(Collectors.toList());
memberPriceService.saveBatch(collect);
}
}
③. 当我们启动如下的服务,进行测试


④. debug时,mysql默认的隔离级别为读已提交,为了能够在调试过程中,获取到数据库中的数据信息,可以调整隔离级别为读未提交
但是它对于当前的事务窗口生效,如果想要设置全局的,需要加上global字段。
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;




{
"msg": "success",
"code": 0,
"page": {
"totalCount": 0,
"pageSize": 10,
"totalPage": 0,
"currPage": 1,
"list": [{
"brandId": 0, //品牌id
"brandName": "品牌名字",
"catalogId": 0, //分类id
"catalogName": "分类名字",
"createTime": "2019-11-13T16:07:32.877Z", //创建时间
"id": 0, //商品id
"publishStatus": 0, //发布状态
"spuDescription": "string", //商品描述
"spuName": "string", //商品名字
"updateTime": "2019-11-13T16:07:32.877Z", //更新时间
"weight": 0 //重量
}]
}
}
@Override
public PageUtils queryPage(Map<String, Object> params) {
QueryWrapper<SpuInfoEntity> wrapper = new QueryWrapper<>();
String key=(String) params.get("key");
String status=(String) params.get("status");
String brandId=(String) params.get("brandId");
String catelogId=(String) params.get("catelogId");
if(!StringUtils.isEmpty(key)){
wrapper.and((w)->{
w.eq("id",key).or().like("spu_name",key);
});
}
if(!StringUtils.isEmpty(status)){
wrapper.eq("publish_status",status);
}
if(!StringUtils.isEmpty(brandId)&&!"0".equalsIgnoreCase(brandId)){
wrapper.eq("brand_id",brandId);
}
if(StringUtils.isEmpty(catelogId)&&!"0".equalsIgnoreCase(catelogId)){
wrapper.eq("catalog_id",catelogId);
}
IPage<SpuInfoEntity> page = this.page(
new Query<SpuInfoEntity>().getPage(params),
wrapper
);
return new PageUtils(page);
}
# DataSource Config
spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss



{
"msg": "success",
"code": 0,
"page": {
"totalCount": 26,
"pageSize": 10,
"totalPage": 3,
"currPage": 1,
"list": [{
"skuId": 1,
"spuId": 11,
"skuName": "华为 HUAWEI Mate 30 Pro 星河银 8GB+256GB",
"skuDesc": null,
"catalogId": 225,
"brandId": 9,
"skuDefaultImg": "https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-26/60e65a44-f943-4ed5-87c8-8cf90f403018_d511faab82abb34b.jpg",
"skuTitle": "华为 HUAWEI Mate 30 Pro 星河银 8GB+256GB麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四摄4G全网通手机",
"skuSubtitle": "【现货抢购!享白条12期免息!】麒麟990,OLED环幕屏双4000万徕卡电影四摄;Mate30系列享12期免息》",
"price": 6299.0000,
"saleCount": 0
}]
}
}
@Override
public PageUtils queryPage(Map<String, Object> params) {
QueryWrapper<SkuInfoEntity> wrapper = new QueryWrapper<>();
String key =(String) params.get("key");
String catelogId =(String) params.get("catelogId");
String brandId =(String) params.get("brandId");
String min =(String) params.get("min");
String max =(String) params.get("max");
if(!StringUtils.isEmpty(key)){
wrapper.and((w)->{
w.eq("sku_id",key).or().like("sku_name",key);
});
}
if(!StringUtils.isEmpty(catelogId)&&!"0".equalsIgnoreCase(catelogId)){
wrapper.eq("catalog_id",catelogId);
}
if(!StringUtils.isEmpty(brandId)&&!"0".equalsIgnoreCase(brandId)){
wrapper.eq("brand_id",brandId);
}
if(!StringUtils.isEmpty(min)){
wrapper.ge("price",min);
}
if(!StringUtils.isEmpty(max)){
try{
// 这里前端可能提交字母,如abc等,这里需要try-catch防止BigDecimal报错
BigDecimal bigDecimal = new BigDecimal(max);
if(bigDecimal.compareTo(new BigDecimal("0"))==1){
wrapper.le("price",max);
}
}catch (Exception e){
e.printStackTrace();
}
}
IPage<SkuInfoEntity> page = this.page(
new Query<SkuInfoEntity>().getPage(params),
wrapper
);
return new PageUtils(page);
}
CREATE TABLE `pms_spu_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '商品id',
`spu_name` varchar(200) DEFAULT NULL COMMENT '商品名称',
`spu_description` varchar(1000) DEFAULT NULL COMMENT '商品描述',
`catalog_id` bigint(20) DEFAULT NULL COMMENT '所属分类id',
`brand_id` bigint(20) DEFAULT NULL COMMENT '品牌id',
`weight` decimal(18,4) DEFAULT NULL,
`publish_status` tinyint(4) NOT NULL COMMENT '上架状态[0 - 下架,1 - 上架]',
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`,`publish_status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='spu信息';
CREATE TABLE `pms_spu_info_desc` (
`spu_id` bigint(20) NOT NULL COMMENT '商品id',
`decript` longtext COMMENT '商品介绍',
PRIMARY KEY (`spu_id`)
) ENGINE=InnoDB COMMENT='spu信息介绍';
CREATE TABLE `pms_spu_images` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`spu_id` bigint(20) DEFAULT NULL COMMENT 'spu_id',
`img_name` varchar(200) DEFAULT NULL COMMENT '图片名',
`img_url` varchar(255) DEFAULT NULL COMMENT '图片地址',
`img_sort` int(11) DEFAULT NULL COMMENT '顺序',
`default_img` tinyint(4) DEFAULT NULL COMMENT '是否默认图',
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT='spu图片';
========================================
CREATE TABLE `pms_sku_info` (
`sku_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'skuId',
`spu_id` bigint(20) DEFAULT NULL COMMENT 'spuId',
`sku_name` varchar(255) DEFAULT NULL COMMENT 'sku名称',
`sku_desc` varchar(2000) DEFAULT NULL COMMENT 'sku介绍描述',
`catalog_id` bigint(20) DEFAULT NULL COMMENT '所属分类id',
`brand_id` bigint(20) DEFAULT NULL COMMENT '品牌id',
`sku_default_img` varchar(255) DEFAULT NULL COMMENT '默认图片',
`sku_title` varchar(255) DEFAULT NULL COMMENT '标题',
`sku_subtitle` varchar(2000) DEFAULT NULL COMMENT '副标题',
`price` decimal(18,4) DEFAULT NULL COMMENT '价格',
`sale_count` bigint(20) DEFAULT NULL COMMENT '销量',
PRIMARY KEY (`sku_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='sku信息';
CREATE TABLE `pms_sku_images` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sku_id` bigint(20) DEFAULT NULL COMMENT 'sku_id',
`img_url` varchar(255) DEFAULT NULL COMMENT '图片地址',
`img_sort` int(11) DEFAULT NULL COMMENT '排序',
`default_img` int(11) DEFAULT NULL COMMENT '默认图[0 - 不是默认图,1 - 是默认图]',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COMMENT='sku图片';
CREATE TABLE `pms_sku_sale_attr_value` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sku_id` bigint(20) DEFAULT NULL COMMENT 'sku_id',
`attr_id` bigint(20) DEFAULT NULL COMMENT 'attr_id',
`attr_name` varchar(200) DEFAULT NULL COMMENT '销售属性名',
`attr_value` varchar(200) DEFAULT NULL COMMENT '销售属性值',
`attr_sort` int(11) DEFAULT NULL COMMENT '顺序',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT=' &值';
========================================
CREATE TABLE `sms_spu_bounds` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`spu_id` bigint(20) DEFAULT NULL,
`grow_bounds` decimal(18,4) DEFAULT NULL COMMENT '成长积分',
`buy_bounds` decimal(18,4) DEFAULT NULL COMMENT '购物积分',
`work` tinyint(1) DEFAULT NULL COMMENT '优惠生效情况[1111(四个状态位,从右到左);0 - 无优惠,成长积分是否赠送;1 - 无优惠,购物积分是否赠送;2 - 有优惠,成长积分是否赠送;3 - 有优惠,购物积分是否赠送【状态位0:不赠送,1:赠送】]',
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT='商品spu积分设置';
CREATE TABLE `sms_sku_ladder` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sku_id` bigint(20) DEFAULT NULL COMMENT 'spu_id',
`full_count` int(11) DEFAULT NULL COMMENT '满几件',
`discount` decimal(4,2) DEFAULT NULL COMMENT '打几折',
`price` decimal(18,4) DEFAULT NULL COMMENT '折后价',
`add_other` tinyint(1) DEFAULT NULL COMMENT '是否叠加其他优惠[0-不可叠加,1-可叠加]',
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT='商品阶梯价格';
CREATE TABLE `sms_sku_full_reduction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sku_id` bigint(20) DEFAULT NULL COMMENT 'spu_id',
`full_price` decimal(18,4) DEFAULT NULL COMMENT '满多少',
`reduce_price` decimal(18,4) DEFAULT NULL COMMENT '减多少',
`add_other` tinyint(1) DEFAULT NULL COMMENT '是否参与其他优惠',
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT='商品满减信息';
CREATE TABLE `sms_member_price` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sku_id` bigint(20) DEFAULT NULL COMMENT 'sku_id',
`member_level_id` bigint(20) DEFAULT NULL COMMENT '会员等级id',
`member_level_name` varchar(100) DEFAULT NULL COMMENT '会员等级名',
`member_price` decimal(18,4) DEFAULT NULL COMMENT '会员对应价格',
`add_other` tinyint(1) DEFAULT NULL COMMENT '可否叠加其他优惠[0-不可叠加优惠,1-可叠加]',
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT='商品会员价格';
@Component
@FeignClient(value = "gulimall-coupon")
public interface CouponFeignService {
/**
* 1、CouponFeignService.saveSpuBounds(spuBoundTo);
* 1)、@RequestBody将这个对象转为json。
* 2)、找到gulimall-coupon服务,给/coupon/spubounds/save发送请求。
* 将上一步转的json放在请求体位置,发送请求;
* 3)、对方服务收到请求。请求体里有json数据。
* (@RequestBody SpuBoundsEntity spuBounds);将请求体的json转为SpuBoundsEntity;
* 只要json数据模型是兼容的。双方服务无需使用同一个to
* @param spuBoundTo
* @return
*/
@PostMapping("/coupon/spubounds/save")
R saveSpuBounds(@RequestBody SpuBoundTO spuBoundTo);
@PostMapping("/coupon/skufullreduction/saveinfo")
R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}
③. 商品大保存流程图(很重要,代码写起来比较简单,最重要的是梳理流程图)

④. 前端传入后台JSON数据
{
"spuName":"【全新正品】华为Mate30e Pro ",
"spuDescription":"【全新正品】华为Mate30e Pro 描述",
"catalogId":225,
"brandId":2,
"weight":0.39,
"publishStatus":0,
"decript":[
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//10ceb2db-f200-45c3-8788-3e87902a6e88_73366cc235d68202.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//dd325ed8-d99a-4012-8828-ae9723cca362_528211b97272d88a.jpg"
],
"images":[
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//60c26486-43d0-4f71-8b18-c82565bd5b4f_0d40c24b264aa511.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//135b4aba-84b9-4563-81bc-9434500f786f_1f15cdbcf9e1273c.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//8f881c20-9cfb-49e8-80bf-8b2a47ed557a_23d9fbb256ea5d4a.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//0b831644-c54a-483c-801b-c231d61af5dc_b5c6b23d01dcdf81.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//01104fac-c422-4c1a-8a0e-c920c326fcec_a83bf5250e14caf2.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//726cf5de-9fe0-40eb-8270-f3f112cd3599_8bf441260bffa42f.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//7eab9d18-9b80-47ae-8831-2f6bc7732850_28f296629cca865e.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//fa6eacd1-2e39-4168-8360-bbe747ed6ae2_335b2c690e43a8f8.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//f3cc92ae-c96b-47dd-871d-7917e1ec6f71_73ab4d2e818d2211.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//233819b9-45e9-4f91-89a9-689578606950_919c850652e98031.jpg",
"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//1bd7ef27-fe34-4670-8eea-6678ee431fff_d511faab82abb34b.jpg"
],
"bounds":{
"buyBounds":500,
"growBounds":1000
},
"baseAttrs":[
{
"attrId":2,
"attrValues":"2022",
"showDesc":0
},
{
"attrId":5,
"attrValues":"LIO-AN00m",
"showDesc":0
},
{
"attrId":8,
"attrValues":"158.1",
"showDesc":1
},
{
"attrId":9,
"attrValues":"其他",
"showDesc":1
},
{
"attrId":10,
"attrValues":"海思(Hisilicon)",
"showDesc":1
},
{
"attrId":11,
"attrValues":"麒麟990",
"showDesc":1
}
],
"skus":[
{
"attr":[
{
"attrId":3,
"attrName":"颜色",
"attrValue":"亮黑色"
},
{
"attrId":12,
"attrName":"版本",
"attrValue":"8GB+256GB"
}
],
"skuName":"【全新正品】华为Mate30e Pro 亮黑色 8GB+256GB",
"price":"6799",
"skuTitle":"【全新正品】华为Mate30e Pro 亮黑色 8GB+256GB 麒麟990E 全网通手机",
"skuSubtitle":" 【全新正品】华为Mate30e Pro 5G手机华为麒麟990E 丹霞橙【Mate30E Pro】 8GB 256GB (12期免息版) 【全新正品、现货速发】送品牌无线充+蓝牙耳机+三合一数据线+钢化膜【推荐5G手机华为mate40e】亮黑色",
"images":[
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//726cf5de-9fe0-40eb-8270-f3f112cd3599_8bf441260bffa42f.jpg",
"defaultImg":1
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//7eab9d18-9b80-47ae-8831-2f6bc7732850_28f296629cca865e.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//fa6eacd1-2e39-4168-8360-bbe747ed6ae2_335b2c690e43a8f8.jpg",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
}
],
"descar":[
"亮黑色",
"8GB+256GB"
],
"fullCount":3,
"discount":0.98,
"countStatus":0,
"fullPrice":1000,
"reducePrice":100,
"priceStatus":0,
"memberPrice":[
{
"id":2,
"name":"铜牌会员",
"price":6699
},
{
"id":3,
"name":"银牌会员",
"price":6599
}
]
},
{
"attr":[
{
"attrId":3,
"attrName":"颜色",
"attrValue":"亮黑色"
},
{
"attrId":12,
"attrName":"版本",
"attrValue":"8GB+128GB"
}
],
"skuName":"【全新正品】华为Mate30e Pro 亮黑色 8GB+128GB",
"price":"5799",
"skuTitle":"【全新正品】华为Mate30e Pro 亮黑色 8GB+128GB 麒麟990E 全网通手机",
"skuSubtitle":" 【全新正品】华为Mate30e Pro 5G手机华为麒麟990E 丹霞橙【Mate30E Pro】 8GB 128GB (12期免息版) 【全新正品、现货速发】送品牌无线充+蓝牙耳机+三合一数据线+钢化膜【推荐5G手机华为mate40e】亮黑色",
"images":[
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//726cf5de-9fe0-40eb-8270-f3f112cd3599_8bf441260bffa42f.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//7eab9d18-9b80-47ae-8831-2f6bc7732850_28f296629cca865e.jpg",
"defaultImg":1
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//fa6eacd1-2e39-4168-8360-bbe747ed6ae2_335b2c690e43a8f8.jpg",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
}
],
"descar":[
"亮黑色",
"8GB+128GB"
],
"fullCount":0,
"discount":0,
"countStatus":0,
"fullPrice":0,
"reducePrice":0,
"priceStatus":0,
"memberPrice":[
{
"id":2,
"name":"铜牌会员",
"price":0
},
{
"id":3,
"name":"银牌会员",
"price":0
}
]
},
{
"attr":[
{
"attrId":3,
"attrName":"颜色",
"attrValue":"星河银"
},
{
"attrId":12,
"attrName":"版本",
"attrValue":"8GB+256GB"
}
],
"skuName":"【全新正品】华为Mate30e Pro 星河银 8GB+256GB",
"price":"6799",
"skuTitle":"【全新正品】华为Mate30e Pro 星河银 8GB+256GB 麒麟990E 全网通手机",
"skuSubtitle":" 【全新正品】华为Mate30e Pro 5G手机华为麒麟990E 丹霞橙【Mate30E Pro】 8GB 256GB (12期免息版) 【全新正品、现货速发】送品牌无线充+蓝牙耳机+三合一数据线+钢化膜【推荐5G手机华为mate40e】星河银",
"images":[
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//f3cc92ae-c96b-47dd-871d-7917e1ec6f71_73ab4d2e818d2211.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//233819b9-45e9-4f91-89a9-689578606950_919c850652e98031.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//1bd7ef27-fe34-4670-8eea-6678ee431fff_d511faab82abb34b.jpg",
"defaultImg":1
}
],
"descar":[
"星河银",
"8GB+256GB"
],
"fullCount":2,
"discount":0.8,
"countStatus":0,
"fullPrice":1000,
"reducePrice":200,
"priceStatus":0,
"memberPrice":[
{
"id":2,
"name":"铜牌会员",
"price":6799
},
{
"id":3,
"name":"银牌会员",
"price":6666
}
]
},
{
"attr":[
{
"attrId":3,
"attrName":"颜色",
"attrValue":"星河银"
},
{
"attrId":12,
"attrName":"版本",
"attrValue":"8GB+128GB"
}
],
"skuName":"【全新正品】华为Mate30e Pro 星河银 8GB+128GB",
"price":"5799",
"skuTitle":"【全新正品】华为Mate30e Pro 星河银 8GB+128GB 麒麟990E 全网通手机",
"skuSubtitle":" 【全新正品】华为Mate30e Pro 5G手机华为麒麟990E 丹霞橙【Mate30E Pro】 8GB 128GB (12期免息版) 【全新正品、现货速发】送品牌无线充+蓝牙耳机+三合一数据线+钢化膜【推荐5G手机华为mate40e】星河银",
"images":[
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//f3cc92ae-c96b-47dd-871d-7917e1ec6f71_73ab4d2e818d2211.jpg",
"defaultImg":1
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//233819b9-45e9-4f91-89a9-689578606950_919c850652e98031.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//1bd7ef27-fe34-4670-8eea-6678ee431fff_d511faab82abb34b.jpg",
"defaultImg":0
}
],
"descar":[
"星河银",
"8GB+128GB"
],
"fullCount":0,
"discount":0,
"countStatus":0,
"fullPrice":0,
"reducePrice":0,
"priceStatus":0,
"memberPrice":[
{
"id":2,
"name":"铜牌会员",
"price":0
},
{
"id":3,
"name":"银牌会员",
"price":0
}
]
},
{
"attr":[
{
"attrId":3,
"attrName":"颜色",
"attrValue":"翡冷翠"
},
{
"attrId":12,
"attrName":"版本",
"attrValue":"8GB+256GB"
}
],
"skuName":"【全新正品】华为Mate30e Pro 翡冷翠 8GB+256GB",
"price":"6799",
"skuTitle":"【全新正品】华为Mate30e Pro 翡冷翠 8GB+256GB 麒麟990E 全网通手机",
"skuSubtitle":" 【全新正品】华为Mate30e Pro 5G手机华为麒麟990E 丹霞橙【Mate30E Pro】 8GB 256GB (12期免息版) 【全新正品、现货速发】送品牌无线充+蓝牙耳机+三合一数据线+钢化膜【推荐5G手机华为mate40e】翡冷翠",
"images":[
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//8f881c20-9cfb-49e8-80bf-8b2a47ed557a_23d9fbb256ea5d4a.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//0b831644-c54a-483c-801b-c231d61af5dc_b5c6b23d01dcdf81.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//01104fac-c422-4c1a-8a0e-c920c326fcec_a83bf5250e14caf2.jpg",
"defaultImg":1
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
}
],
"descar":[
"翡冷翠",
"8GB+256GB"
],
"fullCount":0,
"discount":0,
"countStatus":0,
"fullPrice":0,
"reducePrice":0,
"priceStatus":0,
"memberPrice":[
{
"id":2,
"name":"铜牌会员",
"price":0
},
{
"id":3,
"name":"银牌会员",
"price":0
}
]
},
{
"attr":[
{
"attrId":3,
"attrName":"颜色",
"attrValue":"翡冷翠"
},
{
"attrId":12,
"attrName":"版本",
"attrValue":"8GB+128GB"
}
],
"skuName":"【全新正品】华为Mate30e Pro 翡冷翠 8GB+128GB",
"price":"5799",
"skuTitle":"【全新正品】华为Mate30e Pro 翡冷翠 8GB+128GB 麒麟990E 全网通手机",
"skuSubtitle":" 【全新正品】华为Mate30e Pro 5G手机华为麒麟990E 丹霞橙【Mate30E Pro】 8GB 128GB (12期免息版) 【全新正品、现货速发】送品牌无线充+蓝牙耳机+三合一数据线+钢化膜【推荐5G手机华为mate40e】翡冷翠",
"images":[
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//8f881c20-9cfb-49e8-80bf-8b2a47ed557a_23d9fbb256ea5d4a.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//0b831644-c54a-483c-801b-c231d61af5dc_b5c6b23d01dcdf81.jpg",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//01104fac-c422-4c1a-8a0e-c920c326fcec_a83bf5250e14caf2.jpg",
"defaultImg":1
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
}
],
"descar":[
"翡冷翠",
"8GB+128GB"
],
"fullCount":0,
"discount":0,
"countStatus":0,
"fullPrice":0,
"reducePrice":0,
"priceStatus":0,
"memberPrice":[
{
"id":2,
"name":"铜牌会员",
"price":0
},
{
"id":3,
"name":"银牌会员",
"price":0
}
]
},
{
"attr":[
{
"attrId":3,
"attrName":"颜色",
"attrValue":"罗兰紫"
},
{
"attrId":12,
"attrName":"版本",
"attrValue":"8GB+256GB"
}
],
"skuName":"【全新正品】华为Mate30e Pro 罗兰紫 8GB+256GB",
"price":"6799",
"skuTitle":"【全新正品】华为Mate30e Pro 罗兰紫 8GB+256GB 麒麟990E 全网通手机",
"skuSubtitle":" 【全新正品】华为Mate30e Pro 5G手机华为麒麟990E 丹霞橙【Mate30E Pro】 8GB 256GB (12期免息版) 【全新正品、现货速发】送品牌无线充+蓝牙耳机+三合一数据线+钢化膜【推荐5G手机华为mate40e】罗兰紫",
"images":[
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//60c26486-43d0-4f71-8b18-c82565bd5b4f_0d40c24b264aa511.jpg",
"defaultImg":1
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
}
],
"descar":[
"罗兰紫",
"8GB+256GB"
],
"fullCount":0,
"discount":0,
"countStatus":0,
"fullPrice":0,
"reducePrice":0,
"priceStatus":0,
"memberPrice":[
{
"id":2,
"name":"铜牌会员",
"price":0
},
{
"id":3,
"name":"银牌会员",
"price":0
}
]
},
{
"attr":[
{
"attrId":3,
"attrName":"颜色",
"attrValue":"罗兰紫"
},
{
"attrId":12,
"attrName":"版本",
"attrValue":"8GB+128GB"
}
],
"skuName":"【全新正品】华为Mate30e Pro 罗兰紫 8GB+128GB",
"price":"5799",
"skuTitle":"【全新正品】华为Mate30e Pro 罗兰紫 8GB+128GB 麒麟990E 全网通手机",
"skuSubtitle":" 【全新正品】华为Mate30e Pro 5G手机华为麒麟990E 丹霞橙【Mate30E Pro】 8GB 128GB (12期免息版) 【全新正品、现货速发】送品牌无线充+蓝牙耳机+三合一数据线+钢化膜【推荐5G手机华为mate40e】罗兰紫",
"images":[
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"https://gulimall2022-tangzhi.oss-cn-guangzhou.aliyuncs.com/2022-09-12//135b4aba-84b9-4563-81bc-9434500f786f_1f15cdbcf9e1273c.jpg",
"defaultImg":1
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
},
{
"imgUrl":"",
"defaultImg":0
}
],
"descar":[
"罗兰紫",
"8GB+128GB"
],
"fullCount":0,
"discount":0,
"countStatus":0,
"fullPrice":0,
"reducePrice":0,
"priceStatus":0,
"memberPrice":[
{
"id":2,
"name":"铜牌会员",
"price":0
},
{
"id":3,
"name":"银牌会员",
"price":0
}
]
}
]
}