• 商城项目14_商品新增vo抽取、修改vo、新增逻辑、代码的具体落地、SPU检测、SKU检测、流程图


    写在最前面, 商品新增最重要的需要把前端的流程看懂,需要把对应的逻辑搞清楚!!!
    在这里插入图片描述

    ①. 商品新增vo抽取

    • ①. 在商品新增vo抽取前,进行renren后台系统、提前展示下所有的流程
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述

    在这里插入图片描述

    {"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}]}]}
    
    • 1

    ②. 修改新增的vo

    • ①. 数据库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;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    @Data
    public class Bounds {
        private BigDecimal buyBounds;
        private BigDecimal growBounds;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    @Data
    public class BaseAttrs {
        private Long attrId;//属性的ID
        private String attrValues;//属性的值
        private int showDesc;//是否快速展示
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    @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;//会员信息
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    @Data
    public class Attr {
        private Long attrId;//属性id
        private String attrName;//属性名称
        private String attrValue;//属性值
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    @Data
    public class MemberPrice {
        private Long id;//会员id
        private String name;//会员名称
        private BigDecimal price;//这个商品会员的价钱是多少
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    ③. 新增商品的逻辑

    • ①. 保存spu的基本信息 psm_spu_info
      在这里插入图片描述
    @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;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    在这里插入图片描述

    • ②. 保存spu的描述信息 psm_spu_info_desc
      在这里插入图片描述

    在这里插入图片描述
    在这里插入图片描述

    • ③. 保存spu的的图片集 psm_spu_images

    在这里插入图片描述

    在这里插入图片描述在这里插入图片描述

    • ④. 保存spu的规格参数 pms_product_attr_value
      在这里插入图片描述

    在这里插入图片描述

    @Data
    public class BaseAttrs {
        private Long attrId;//属性的ID
        private String attrValues;//属性的值
        private int showDesc;//是否快速展示
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • ⑤. 保存spu的积分信息 gulimall_sms – sms_spu_bounds
      在这里插入图片描述

    在这里插入图片描述

    @Data
    public class Bounds {
        private BigDecimal buyBounds;
        private BigDecimal growBounds;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • ⑥. psm_sku_info 基本信息
      在这里插入图片描述

    在这里插入图片描述

    @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;//会员信息
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • ⑦. sku的图片信息

    在这里插入图片描述

    在这里插入图片描述

    @Data
    public class Images {
        private String imgUrl;
        private int defaultImg;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • ⑧. sku的销售属性值 psm_sku_sale_attr_value

    在这里插入图片描述

    在这里插入图片描述

    @Data
    public class Attr {
        private Long attrId;//属性id
        private String attrName;//属性名称
        private String attrValue;//属性值
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • ⑨. sku的优惠满减等信息 gulimall_sms->sms_sku_ladder --sms_sku_full_reduction – sms_ member_price – sms_spu_bounds

    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    在这里插入图片描述

    @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;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    @Data
    public class MemberPrice {
        private Long id;
        private String name;
        private BigDecimal price;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    ④. 保存商品核心代码

    • ①. 需要在product服务中编写如下核心代码
        /**
         * //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优惠信息失败");
                        }
                    }
                });
            }
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    //编写远程调用接口
    @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);
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • ②. 商品服务要去调用优惠卷服务,可以采用公共的vo进行传参和接收处理
    @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;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    @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();
        }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    @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);
        }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • ③. 当我们启动如下的服务,进行测试
      在这里插入图片描述
      在这里插入图片描述

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

    SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
    
    • 1
    • ⑤. debug商品新增的时候,报错,这个时候需要将表的id改为输入的方式
      在这里插入图片描述
      在这里插入图片描述

    ⑤. 商品管理 - SPU检测

    • ①. 查询的是pms_spu_info表,查询条件有分类id、品牌id、状态、检测
      在这里插入图片描述

    在这里插入图片描述

    {
    	"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 //重量
    
    		}]
    	}
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • ②. 核心代码展示
        @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);
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • ③. 问题:在SPU中,写出的日期数据都不符合规则:
      想要符合规则,可以设置写出数据的规则:
    # DataSource Config
    spring:
      jackson:
        date-format: yyyy-MM-dd HH:mm:ss
    
    • 1
    • 2
    • 3
    • 4

    在这里插入图片描述

    ⑥. 商品管理 - SKU检测

    • ①. 查询的是pms_sku_info表,查询条件有分类id、品牌id、价格、检索。这里需要特别注意价格后台用的bigDecial类型存储的,在后台判断的时候需要try-catch处理

    在这里插入图片描述在这里插入图片描述

    {
    	"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
    		}]
    	}
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • ②. 核心代码展示
        @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);
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40

    ⑦. 商品保持流程图 - 超级重要

    • ①. 商品大保存所需要用到的表结构如下
    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='商品会员价格';
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • ②. 在服务A调用服务B的时候,是用Feign远程调用时候,使用的是TO对象进行传输
    @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);
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • ③. 商品大保存流程图(很重要,代码写起来比较简单,最重要的是梳理流程图)
      在这里插入图片描述

    • ④. 前端传入后台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
                    }
                ]
            }
        ]
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350
    • 351
    • 352
    • 353
    • 354
    • 355
    • 356
    • 357
    • 358
    • 359
    • 360
    • 361
    • 362
    • 363
    • 364
    • 365
    • 366
    • 367
    • 368
    • 369
    • 370
    • 371
    • 372
    • 373
    • 374
    • 375
    • 376
    • 377
    • 378
    • 379
    • 380
    • 381
    • 382
    • 383
    • 384
    • 385
    • 386
    • 387
    • 388
    • 389
    • 390
    • 391
    • 392
    • 393
    • 394
    • 395
    • 396
    • 397
    • 398
    • 399
    • 400
    • 401
    • 402
    • 403
    • 404
    • 405
    • 406
    • 407
    • 408
    • 409
    • 410
    • 411
    • 412
    • 413
    • 414
    • 415
    • 416
    • 417
    • 418
    • 419
    • 420
    • 421
    • 422
    • 423
    • 424
    • 425
    • 426
    • 427
    • 428
    • 429
    • 430
    • 431
    • 432
    • 433
    • 434
    • 435
    • 436
    • 437
    • 438
    • 439
    • 440
    • 441
    • 442
    • 443
    • 444
    • 445
    • 446
    • 447
    • 448
    • 449
    • 450
    • 451
    • 452
    • 453
    • 454
    • 455
    • 456
    • 457
    • 458
    • 459
    • 460
    • 461
    • 462
    • 463
    • 464
    • 465
    • 466
    • 467
    • 468
    • 469
    • 470
    • 471
    • 472
    • 473
    • 474
    • 475
    • 476
    • 477
    • 478
    • 479
    • 480
    • 481
    • 482
    • 483
    • 484
    • 485
    • 486
    • 487
    • 488
    • 489
    • 490
    • 491
    • 492
    • 493
    • 494
    • 495
    • 496
    • 497
    • 498
    • 499
    • 500
    • 501
    • 502
    • 503
    • 504
    • 505
    • 506
    • 507
    • 508
    • 509
    • 510
    • 511
    • 512
    • 513
    • 514
    • 515
    • 516
    • 517
    • 518
    • 519
    • 520
    • 521
    • 522
    • 523
    • 524
    • 525
    • 526
    • 527
    • 528
    • 529
    • 530
    • 531
    • 532
    • 533
    • 534
    • 535
    • 536
    • 537
    • 538
    • 539
    • 540
    • 541
    • 542
    • 543
    • 544
    • 545
    • 546
    • 547
    • 548
    • 549
    • 550
    • 551
    • 552
    • 553
    • 554
    • 555
    • 556
    • 557
    • 558
    • 559
    • 560
    • 561
    • 562
    • 563
    • 564
    • 565
    • 566
    • 567
    • 568
    • 569
    • 570
    • 571
    • 572
    • 573
    • 574
    • 575
    • 576
    • 577
    • 578
    • 579
    • 580
    • 581
    • 582
    • 583
    • 584
    • 585
    • 586
    • 587
    • 588
    • 589
    • 590
    • 591
    • 592
    • 593
    • 594
    • 595
    • 596
    • 597
    • 598
    • 599
    • 600
    • 601
    • 602
    • 603
    • 604
    • 605
    • 606
    • 607
    • 608
    • 609
    • 610
    • 611
    • 612
    • 613
    • 614
    • 615
    • 616
    • 617
    • 618
    • 619
    • 620
    • 621
    • 622
    • 623
    • 624
    • 625
    • 626
    • 627
    • 628
    • 629
    • 630
    • 631
    • 632
    • 633
    • 634
    • 635
    • 636
    • 637
    • 638
    • 639
    • 640
    • 641
    • 642
    • 643
    • 644
    • 645
    • 646
    • 647
    • 648
    • 649
    • 650
    • 651
    • 652
    • 653
    • 654
    • 655
    • 656
    • 657
    • 658
    • 659
    • 660
    • 661
    • 662
    • 663
    • 664
    • 665
    • 666
    • 667
    • 668
    • 669
    • 670
    • 671
    • 672
    • 673
    • 674
    • 675
    • 676
    • 677
    • 678
    • 679
    • 680
    • 681
    • 682
    • 683
    • 684
    • 685
    • 686
    • 687
    • 688
    • 689
    • 690
    • 691
    • 692
    • 693
    • 694
    • 695
    • 696
    • 697
    • 698
    • 699
    • 700
    • 701
    • 702
    • 703
    • 704
    • 705
    • 706
    • 707
    • 708
    • 709
    • 710
    • 711
    • 712
    • 713
    • 714
    • 715
    • 716
    • 717
    • 718
    • 719
    • 720
    • 721
    • 722
    • 723
    • 724
    • 725
    • 726
    • 727
    • 728
    • 729
    • 730
    • 731
    • 732
    • 733
    • 734
    • 735
    • 736
    • 737
    • 738
    • 739
    • 740
    • 741
    • 742
    • 743
    • 744
    • 745
    • 746
    • 747
    • 748
    • 749
    • 750
    • 751
  • 相关阅读:
    牛客刷题<八>使用generate...for语句简化语句
    【学海】中位数(Median)的介绍以及如何在不同条件下计算中位数
    无法启动此程序,因为计算机中丢失MSVCR71.dll的详细解决修复方法
    JavaWeb文件上传/下载(Servlet)
    计算机网络常见面试题
    Java如何实现pdf转base64以及怎么反转?
    java python php线上课程教学辅助系统 作业考试nodejs+vue+elementui
    Arduino驱动ML8511紫外线传感器(光照传感器篇)
    TechEmpower 21轮Web框架 性能评测 -- C# 的性能 和 Rust、C++并驾齐驱
    java面试题整理《基础篇》八
  • 原文地址:https://blog.csdn.net/TZ845195485/article/details/126823942