mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-28 16:58:43 +08:00 
			
		
		
		
	商城:product:完善 ProductSpuDO 表
This commit is contained in:
		
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							| @@ -20,7 +20,7 @@ | ||||
| <!--        <module>yudao-module-bpm</module>--> | ||||
| <!--        <module>yudao-module-report</module>--> | ||||
| <!--        <module>yudao-module-mp</module>--> | ||||
| <!--        <module>yudao-module-mall</module>--> | ||||
|         <module>yudao-module-mall</module> | ||||
|         <!-- 示例项目 --> | ||||
|         <module>yudao-example</module> | ||||
|     </modules> | ||||
|   | ||||
| @@ -13,6 +13,7 @@ import java.util.Arrays; | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| @Deprecated | ||||
| public enum ProductSpuSpecTypeEnum implements IntArrayValuable { | ||||
|  | ||||
|     RECYCLE(1, "统一规格"), | ||||
|   | ||||
| @@ -1,43 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.product.dal.dataobject.group; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; | ||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| /** | ||||
|  * 商品分组的绑定 DO | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName("product_group_bind") | ||||
| @KeySequence("product_group_bind_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class ProductGroupBindDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 编号,自增 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 商品分组编号 | ||||
|      * | ||||
|      * 关联 {@link ProductGroupDO#getId()} | ||||
|      */ | ||||
|     private Long groupId; | ||||
|     /** | ||||
|      * 商品 SPU 编号 | ||||
|      * | ||||
|      * 关联 {@link ProductSpuDO#getId()} | ||||
|      */ | ||||
|     private Long spuId; | ||||
|  | ||||
| } | ||||
| @@ -1,63 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.product.dal.dataobject.group; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.product.enums.group.ProductGroupStyleEnum; | ||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| /** | ||||
|  * 商品分组 DO | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName("product_group") | ||||
| @KeySequence("product_group_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class ProductGroupDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 商品分组编号,自增 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 分组名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|     /** | ||||
|      * 商品数量 | ||||
|      */ | ||||
|     private Integer count; | ||||
|     /** | ||||
|      * 排序 | ||||
|      */ | ||||
|     private Integer sort; | ||||
|     /** | ||||
|      * 风格,用于 APP 首页展示商品的样式 | ||||
|      * | ||||
|      * 枚举 {@link ProductGroupStyleEnum} | ||||
|      */ | ||||
|     private Integer style; | ||||
|     /** | ||||
|      * 是否默认 | ||||
|      * | ||||
|      * true - 系统默认,不允许删除 | ||||
|      * false - 自定义,允许删除 | ||||
|      */ | ||||
|     private Boolean defaulted; | ||||
|  | ||||
| } | ||||
| @@ -1,38 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.product.dal.dataobject.search; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| /** | ||||
|  * 商品热搜关键字 DO | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName("product_hot_search") | ||||
| @KeySequence("product_hot_search_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class ProductHotSearchDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 编号,主键自增 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 关键字 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 内容 | ||||
|      */ | ||||
|     private String content; | ||||
|  | ||||
| } | ||||
| @@ -1,26 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.product.dal.dataobject.shop; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| // TODO 芋艿:待设计 | ||||
| /** | ||||
|  * 店铺 DO | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName("shop") | ||||
| @KeySequence("shop_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class ShopDO extends BaseDO { | ||||
|  | ||||
|     private Long id; | ||||
|  | ||||
| } | ||||
| @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.product.dal.dataobject.spu; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO; | ||||
| import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO; | ||||
| import cn.iocoder.yudao.module.product.dal.dataobject.delivery.DeliveryTemplateDO; | ||||
| import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; | ||||
| import cn.iocoder.yudao.module.product.enums.spu.ProductSpuSpecTypeEnum; | ||||
| import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum; | ||||
| @@ -43,17 +44,22 @@ public class ProductSpuDO extends BaseDO { | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 商品编码 | ||||
|      * 关键字 | ||||
|      */ | ||||
|     private String code; | ||||
|     private String keyword; | ||||
|     /** | ||||
|      * 促销语 | ||||
|      * 商品简介 | ||||
|      */ | ||||
|     private String sellPoint; | ||||
|     private String introduction; | ||||
|     /** | ||||
|      * 商品详情 | ||||
|      */ | ||||
|     private String description; | ||||
|     /** | ||||
|      * 商品条码(一维码) | ||||
|      */ | ||||
|     private String barCode; | ||||
|  | ||||
|     /** | ||||
|      * 商品分类编号 | ||||
|      * | ||||
| @@ -67,19 +73,23 @@ public class ProductSpuDO extends BaseDO { | ||||
|      */ | ||||
|     private Long brandId; | ||||
|     /** | ||||
|      * 商品图片的数组 | ||||
|      * | ||||
|      * 1. 第一张图片将作为商品主图,支持同时上传多张图; | ||||
|      * 2. 建议使用尺寸 800x800 像素以上、大小不超过 1M 的正方形图片; | ||||
|      * 3. 至少 1 张,最多上传 10 张 | ||||
|      * 商品封面图 | ||||
|      */ | ||||
|     private String picUrl; | ||||
|     /** | ||||
|      * 商品轮播图 | ||||
|      */ | ||||
|     @TableField(typeHandler = JacksonTypeHandler.class) | ||||
|     private List<String> picUrls; | ||||
|     private List<String> sliderPicUrls; | ||||
|     /** | ||||
|      * 商品视频 | ||||
|      */ | ||||
|     private String videoUrl; | ||||
|  | ||||
|     /** | ||||
|      * 单位名 | ||||
|      */ | ||||
|     private String unitName; | ||||
|     /** | ||||
|      * 排序字段 | ||||
|      */ | ||||
| @@ -96,37 +106,86 @@ public class ProductSpuDO extends BaseDO { | ||||
|     /** | ||||
|      * 规格类型 | ||||
|      * | ||||
|      * 枚举 {@link ProductSpuSpecTypeEnum} | ||||
|      * false - 单规格 | ||||
|      * true - 多规格 | ||||
|      */ | ||||
|     private Integer specType; | ||||
|     private Boolean specType; | ||||
|     /** | ||||
|      * 最小价格,单位使用:分 | ||||
|      * 商品价格,单位使用:分 | ||||
|      * | ||||
|      * 基于其对应的 {@link ProductSkuDO#getPrice()} 最小值 | ||||
|      */ | ||||
|     private Integer minPrice; | ||||
|     /** | ||||
|      * 最大价格,单位使用:分 | ||||
|      * | ||||
|      * 基于其对应的 {@link ProductSkuDO#getPrice()} 最大值 | ||||
|      */ | ||||
|     private Integer maxPrice; | ||||
|     private Integer price; | ||||
|     /** | ||||
|      * 市场价,单位使用:分 | ||||
|      * | ||||
|      * 基于其对应的 {@link ProductSkuDO#getMarketPrice()} 最大值 | ||||
|      * 基于其对应的 {@link ProductSkuDO#getMarketPrice()} 最大值 TODO 芋艿:待确定最大还是最小 | ||||
|      */ | ||||
|     private Integer marketPrice; | ||||
|     /** | ||||
|      * 总库存 | ||||
|      * 成本价,单位使用:分 | ||||
|      * | ||||
|      * 基于其对应的 {@link ProductSkuDO#getCostPrice()} 最大值 TODO 芋艿:待确定最大还是最小 | ||||
|      */ | ||||
|     private Integer costPrice; | ||||
|     /** | ||||
|      * 库存 | ||||
|      * | ||||
|      * 基于其对应的 {@link ProductSkuDO#getStock()} 求和 | ||||
|      */ | ||||
|     private Integer totalStock; | ||||
|     private Integer stock; | ||||
|  | ||||
|     // ========== 物流相关字段 ========= | ||||
|  | ||||
|     /** | ||||
|      * 是否展示库存 | ||||
|      * 物流配置模板编号 | ||||
|      * | ||||
|      * 关联 {@link DeliveryTemplateDO#getId()} | ||||
|      */ | ||||
|     private Boolean showStock; | ||||
|     private Long deliveryTemplateId; | ||||
|  | ||||
|     // ========== 营销相关字段 ========= | ||||
|     /** | ||||
|      * 是否热卖推荐 | ||||
|      */ | ||||
|     private Boolean recommendHot; | ||||
|     /** | ||||
|      * 是否优惠推荐 | ||||
|      */ | ||||
|     private Boolean recommendBenefit; | ||||
|     /** | ||||
|      * 是否精品推荐 | ||||
|      */ | ||||
|     private Boolean recommendBest; | ||||
|     /** | ||||
|      * 是否新品推荐 | ||||
|      */ | ||||
|     private Boolean recommendNew; | ||||
|     /** | ||||
|      * 是否优品推荐 | ||||
|      */ | ||||
|     private Boolean recommendGood; | ||||
|  | ||||
|     /** | ||||
|      * 赠送积分 | ||||
|      */ | ||||
|     private Integer giveIntegral; | ||||
|  | ||||
|     /** | ||||
|      * 分销类型 | ||||
|      * | ||||
|      * false - 默认 | ||||
|      * true - 自行设置 | ||||
|      */ | ||||
|     private Boolean subCommissionType; | ||||
|  | ||||
|     /** | ||||
|      * 活动展示顺序 | ||||
|      * | ||||
|      * 对应 PromotionTypeEnum 枚举 | ||||
|      */ | ||||
|     @TableField(typeHandler = JacksonTypeHandler.class) | ||||
|     private List<Integer> activityOrders; | ||||
|  | ||||
|     // ========== 统计相关字段 ========= | ||||
|  | ||||
| @@ -139,74 +198,8 @@ public class ProductSpuDO extends BaseDO { | ||||
|      */ | ||||
|     private Integer virtualSalesCount; | ||||
|     /** | ||||
|      * 商品点击量 | ||||
|      * 浏览量 | ||||
|      */ | ||||
|     private Integer clickCount; | ||||
|  | ||||
|     // ========== 物流相关字段 ========= | ||||
|  | ||||
|     // TODO 芋艿:稍后完善物流的字段 | ||||
| //    /** | ||||
| //     * 配送方式 | ||||
| //     * | ||||
| //     * 枚举 {@link DeliveryModeEnum} | ||||
| //     */ | ||||
| //    private Integer deliveryMode; | ||||
| //    /** | ||||
| //     * 配置模板编号 | ||||
| //     * | ||||
| //     * 关联 {@link DeliveryTemplateDO#getId()} | ||||
| //     */ | ||||
| //    private Long deliveryTemplateId; | ||||
|  | ||||
|     // TODO ========== 待定字段:yv ========= | ||||
|     // TODO vip_price 会员价格 | ||||
|     // TODO postage 邮费 | ||||
|     // TODO is_postage 是否包邮 | ||||
|     // TODO unit_name 单位 | ||||
|     // TODO is_new 商户是否代理 | ||||
|     // TODO give_integral 获得积分 | ||||
|     // TODO is_integral 是开启积分兑换 | ||||
|     // TODO integral 所需积分 | ||||
|     // TODO is_seckill 秒杀状态 | ||||
|     // TODO is_bargain 砍价状态 | ||||
|     // TODO code_path 产品二维码地址 | ||||
|     // TODO is_sub 是否分佣 | ||||
|  | ||||
|     // TODO ↓↓ 芋艿 ↓↓ 看起来走分组更合适? | ||||
|     // TODO is_hot 是否热卖 | ||||
|     // TODO is_benefit 是否优惠 | ||||
|     // TODO is_best 是否精品 | ||||
|     // TODO is_new 是否新品 | ||||
|     // TODO is_good 是否优品推荐 | ||||
|  | ||||
|     // TODO ========== 待定字段:cf ========= | ||||
|     // TODO source_link 淘宝京东1688类型 | ||||
|     // TODO activity 活动显示排序 0=默认 1=秒 2=砍价 3=拼团 | ||||
|  | ||||
|     // TODO ========== 待定字段:lf ========= | ||||
|  | ||||
|     // TODO free_shipping_type:运费类型:1-包邮;2-统一运费;3-运费模板 | ||||
|     // TODO free_shipping:统一运费金额 | ||||
|     // TODO free_shipping_template_id:运费模板 | ||||
|     // TODO is_commission:分销佣金:1-开启;0-不开启;first_ratio second_ratio three_ratio | ||||
|     // TODO is_share_bouns:区域股东分红:1-开启;0-不开启;region_ratio;shareholder_ratio | ||||
|  | ||||
|     // TODO is_new:新品推荐:1-是;0-否 | ||||
|     // TODO is_best:好物优选:1-是;0-否 | ||||
|     // TODO is_like:猜你喜欢:1-是;0-否 | ||||
|  | ||||
|     // TODO is_team:是否开启拼团[0=否, 1=是] | ||||
|     // TODO is_integral:积分抵扣:1-开启;0-不开启 | ||||
|     // TODO is_member:会员价:1-开启;0-不开启 | ||||
|     // TODO give_integral_type:赠送积分类型:0-不赠送;1-赠送固定积分;2-按比例赠送积分 | ||||
|     // TODO give_integral:赠送积分; | ||||
|  | ||||
|     // TODO poster:商品自定义海报 | ||||
|  | ||||
|     // TODO ========== 待定字段:laoji ========= | ||||
|     // TODO productType 1 - 普通商品 2 - 预售商品;可能和 type 合并不错 | ||||
|     // TODO productUnit 商品单位 | ||||
|     // TODO extJson 扩展信息;例如说,预售商品的信息 | ||||
|     private Integer browseCount; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -203,7 +203,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||||
|             o.setClickCount(100); | ||||
|             o.setCode(code); | ||||
|             o.setDescription("测试商品"); | ||||
|             o.setPicUrls(new ArrayList<>()); | ||||
|             o.setSliderPicUrls(new ArrayList<>()); | ||||
|             o.setName("测试"); | ||||
|             o.setSalesCount(100); | ||||
|             o.setSellPoint("超级加倍"); | ||||
| @@ -251,7 +251,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||||
|             o.setClickCount(1); | ||||
|             o.setCode(generateNo()); | ||||
|             o.setDescription("测试商品"); | ||||
|             o.setPicUrls(new ArrayList<>()); | ||||
|             o.setSliderPicUrls(new ArrayList<>()); | ||||
|             o.setName("测试"); | ||||
|             o.setSalesCount(1); | ||||
|             o.setSellPoint("卖点"); | ||||
|   | ||||
| @@ -54,11 +54,11 @@ | ||||
| <!--            <version>${revision}</version>--> | ||||
| <!--        </dependency>--> | ||||
|         <!-- 支付服务 --> | ||||
| <!--        <dependency>--> | ||||
| <!--            <groupId>cn.iocoder.boot</groupId>--> | ||||
| <!--            <artifactId>yudao-module-pay-biz</artifactId>--> | ||||
| <!--            <version>${revision}</version>--> | ||||
| <!--        </dependency>--> | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.boot</groupId> | ||||
|             <artifactId>yudao-module-pay-biz</artifactId> | ||||
|             <version>${revision}</version> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- 微信公众号模块。默认注释,保证编译速度 --> | ||||
| <!--        <dependency>--> | ||||
| @@ -68,21 +68,21 @@ | ||||
| <!--        </dependency>--> | ||||
|  | ||||
|         <!-- 商城相关模块。默认注释,保证编译速度 --> | ||||
| <!--        <dependency>--> | ||||
| <!--            <groupId>cn.iocoder.boot</groupId>--> | ||||
| <!--            <artifactId>yudao-module-promotion-biz</artifactId>--> | ||||
| <!--            <version>${revision}</version>--> | ||||
| <!--        </dependency>--> | ||||
| <!--        <dependency>--> | ||||
| <!--            <groupId>cn.iocoder.boot</groupId>--> | ||||
| <!--            <artifactId>yudao-module-product-biz</artifactId>--> | ||||
| <!--            <version>${revision}</version>--> | ||||
| <!--        </dependency>--> | ||||
| <!--        <dependency>--> | ||||
| <!--            <groupId>cn.iocoder.boot</groupId>--> | ||||
| <!--            <artifactId>yudao-module-trade-biz</artifactId>--> | ||||
| <!--            <version>${revision}</version>--> | ||||
| <!--        </dependency>--> | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.boot</groupId> | ||||
|             <artifactId>yudao-module-promotion-biz</artifactId> | ||||
|             <version>${revision}</version> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.boot</groupId> | ||||
|             <artifactId>yudao-module-product-biz</artifactId> | ||||
|             <version>${revision}</version> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.boot</groupId> | ||||
|             <artifactId>yudao-module-trade-biz</artifactId> | ||||
|             <version>${revision}</version> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- spring boot 配置所需依赖 --> | ||||
|         <dependency> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV