ソースを参照

添加实体类字段

lutong 2 週間 前
コミット
43ea366731

+ 14 - 0
alien-dining/src/main/resources/db/generic_ordering_alter.sql

@@ -0,0 +1,14 @@
+-- 通用价目点餐扩展(执行前请自行在测试环境验证)
+-- 1. 订单:菜单类型(1=美食 2=通用价目,默认 1 兼容旧数据)
+ALTER TABLE store_order ADD COLUMN menu_type TINYINT NOT NULL DEFAULT 1 COMMENT '1=美食(store_cuisine) 2=通用价目(store_price)' AFTER table_number;
+
+-- 2. 订单明细:行类型(1=cuisine_id→store_cuisine 2=cuisine_id→store_price)
+ALTER TABLE store_order_detail ADD COLUMN line_type TINYINT NOT NULL DEFAULT 1 COMMENT '1=美食 2=通用价目' AFTER order_no;
+
+-- 3. 购物车:与美食购物车分行存储(默认 1)
+ALTER TABLE store_cart ADD COLUMN menu_type TINYINT NOT NULL DEFAULT 1 COMMENT '1=美食 2=通用价目' AFTER store_id;
+
+-- 4. 优惠规则:区分 product_id 指向美食还是通用价目(默认 1;历史 NULL 视作美食)
+ALTER TABLE store_product_discount_rule ADD COLUMN rule_product_type TINYINT NULL DEFAULT 1 COMMENT '1=store_cuisine 2=store_price' AFTER product_id;
+
+CREATE INDEX idx_store_cart_table_menu ON store_cart (table_id, menu_type, delete_flag);

+ 4 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreCart.java

@@ -34,6 +34,10 @@ public class StoreCart {
     @TableField("store_id")
     private Integer storeId;
 
+    @ApiModelProperty(value = "菜单类型:1=美食 2=通用价目,默认1")
+    @TableField("menu_type")
+    private Integer menuType;
+
     @ApiModelProperty(value = "菜品ID")
     @TableField("cuisine_id")
     private Integer cuisineId;

+ 4 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreOrder.java

@@ -46,6 +46,10 @@ public class StoreOrder {
     @TableField("table_number")
     private String tableNumber;
 
+    @ApiModelProperty(value = "菜单类型:1=美食(store_cuisine) 2=通用价目(store_price),默认1")
+    @TableField("menu_type")
+    private Integer menuType;
+
     @ApiModelProperty(value = "就餐人数")
     @TableField("diner_count")
     private Integer dinerCount;

+ 4 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreOrderDetail.java

@@ -34,6 +34,10 @@ public class StoreOrderDetail {
     @TableField("order_no")
     private String orderNo;
 
+    @ApiModelProperty(value = "行类型:1=美食 store_cuisine.id 2=通用价目 store_price.id(存在 cuisine_id)")
+    @TableField("line_type")
+    private Integer lineType;
+
     @ApiModelProperty(value = "菜品ID")
     @TableField("cuisine_id")
     private Integer cuisineId;

+ 4 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreProductDiscountRule.java

@@ -26,6 +26,10 @@ public class StoreProductDiscountRule {
 	@TableField("product_id")
 	private Integer productId;
 
+	@ApiModelProperty("1=美食(store_cuisine) 2=通用价目(store_price),默认1")
+	@TableField("rule_product_type")
+	private Integer ruleProductType;
+
 	@ApiModelProperty("规则名称")
 	@TableField("rule_name")
 	private String ruleName;