qmj 1 месяц назад
Родитель
Сommit
d9fa13493b

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/order/UserOrderController.java

@@ -97,7 +97,7 @@ public class UserOrderController extends BaseController {
         orderParent.setCreateTime(new Date());
 //        orderParent.setUpdateTime(new Date());
         orderParent.setDdId(input.getDdId().toString());
-        orderParent.setTableNum(input.getTableNum());
+        orderParent.setTableId(input.getTableId());
         orderParent.setShdzId(input.getShdzId());
         orderParent.setShAddress(shdz);
         orderParent.setType(input.getType());
@@ -153,7 +153,7 @@ public class UserOrderController extends BaseController {
             // 设置支付相关信息(从父订单继承)
             posOrder.setPayType(input.getPaymentMethod());
             //设置桌号(从父订单继承)
-            posOrder.setTableNum(input.getTableNum());
+            posOrder.setTableId(input.getTableId());
             posOrder.setLogo(item.getLogo());
             posOrder.setPosName(item.getPosName());
             posOrder.setJvli(item.getJvli());

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreateInput.java

@@ -35,8 +35,8 @@ public class OrderCreateInput {
 
     private String paymentMethod;
 
-    /** 桌号 */
-    private String tableNum;
+    /** 餐桌码ID,关联 table_qrcode.id */
+    private Long tableId;
     /** 整单备注 */
     private String remarks;
 

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/domain/OrderParent.java

@@ -69,8 +69,8 @@ public class OrderParent
     private Date updateTime;
 
     private String ddId;
-    /** 桌号 */
-    private String tableNum;
+    /** 餐桌码ID,关联 table_qrcode.id */
+    private Long tableId;
 
     /**
      * 收货地址id

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/domain/PosOrder.java

@@ -285,9 +285,9 @@ public class PosOrder {
      */
     private String orderCategory;
     /**
-     * 桌号
+     * 餐桌码ID,关联 table_qrcode.id
      */
-    private String tableNum;
+    private Long tableId;
     /**
      * 店铺 logo
      */

+ 6 - 6
ruoyi-system/src/main/resources/mapper/system/OrderParentMapper.xml

@@ -16,14 +16,14 @@
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="ddId"    column="dd_id"    />
-        <result property="tableNum"    column="table_num"    />
+        <result property="tableId"    column="table_id"    />
         <result property="shdzId"    column="shdz_id"    />
         <result property="shAddress"    column="sh_address"    />
         <result property="remarks"    column="remarks"    />
     </resultMap>
 
     <sql id="selectOrderParentVo">
-        select id, user_id, order_status, total_amount, total_discount, actual_pay_amount, payment_method, payment_time, create_time, update_time, dd_id, table_num, shdz_id, sh_address, remarks from order_parent
+        select id, user_id, order_status, total_amount, total_discount, actual_pay_amount, payment_method, payment_time, create_time, update_time, dd_id, table_id, shdz_id, sh_address, remarks from order_parent
     </sql>
 
     <select id="selectOrderParentList" parameterType="OrderParent" resultMap="OrderParentResult">
@@ -37,7 +37,7 @@
             <if test="paymentMethod != null  and paymentMethod != ''"> and payment_method = #{paymentMethod}</if>
             <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
             <if test="ddId != null  and ddId != ''"> and dd_id = #{ddId}</if>
-            <if test="tableNum != null  and tableNum != ''"> and table_num = #{tableNum}</if>
+            <if test="tableId != null"> and table_id = #{tableId}</if>
             <if test="shdzId != null"> and shdz_id = #{shdzId}</if>
             <if test="shAddress != null  and shAddress != ''"> and sh_address = #{shAddress}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
@@ -63,7 +63,7 @@
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="ddId != null">dd_id,</if>
-            <if test="tableNum != null and tableNum != ''">table_num,</if>
+            <if test="tableId != null">table_id,</if>
             <if test="shdzId != null">shdz_id,</if>
             <if test="shAddress != null and shAddress != ''">sh_address,</if>
             <if test="remarks != null and remarks != ''">remarks,</if>
@@ -80,7 +80,7 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="ddId != null">#{ddId},</if>
-            <if test="tableNum != null and tableNum != ''">#{tableNum},</if>
+            <if test="tableId != null">#{tableId},</if>
             <if test="shdzId != null">#{shdzId},</if>
             <if test="shAddress != null and shAddress != ''">#{shAddress},</if>
             <if test="remarks != null and remarks != ''">#{remarks},</if>
@@ -100,7 +100,7 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="ddId != null">dd_id = #{ddId},</if>
-            <if test="tableNum != null and tableNum != ''">table_num = #{tableNum},</if>
+            <if test="tableId != null">table_id = #{tableId},</if>
             <if test="shdzId != null">shdz_id = #{shdzId},</if>
             <if test="shAddress != null and shAddress != ''">sh_address = #{shAddress},</if>
             <if test="remarks != null and remarks != ''">remarks = #{remarks},</if>

+ 7 - 7
ruoyi-system/src/main/resources/mapper/system/PosOrderMapper.xml

@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="payType" column="pay_type" />
         <result property="parentDdId" column="parent_dd_id" />
         <result property="orderCategory" column="order_category" />
-        <result property="tableNum" column="table_num" />
+        <result property="tableId" column="table_id" />
         <result property="logo" column="logo" />
         <result property="posName" column="pos_name" />
         <result property="foodAmount" column="food_amount" />
@@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectPosOrderVo">
-        select id, dd_id, sh_id, md_id, cretim, shdz_id, user_id,sh_address, amount, remarks, state, type, delry_time,food,yh_id,yh_name,md_yh_id,md_yh_name,md_discount_amount,jvli,freight,dining_status,qs_id,pay_url,collect_payment,activity,md_activity,kefu_state,kefu_content,kefu_repeat,repeat_dd_id,sales_name,md_sales_name,sales_reduction,md_sales_reduction,points,points_reduction,sd_time,pay_type,parent_dd_id,order_category,table_num,logo,pos_name,food_amount,pick_up_num,is_accepted,is_display,display_time from pos_order
+        select id, dd_id, sh_id, md_id, cretim, shdz_id, user_id,sh_address, amount, remarks, state, type, delry_time,food,yh_id,yh_name,md_yh_id,md_yh_name,md_discount_amount,jvli,freight,dining_status,qs_id,pay_url,collect_payment,activity,md_activity,kefu_state,kefu_content,kefu_repeat,repeat_dd_id,sales_name,md_sales_name,sales_reduction,md_sales_reduction,points,points_reduction,sd_time,pay_type,parent_dd_id,order_category,table_id,logo,pos_name,food_amount,pick_up_num,is_accepted,is_display,display_time from pos_order
     </sql>
 
     <select id="selectPosOrderList" parameterType="PosOrder" resultMap="PosOrderResult">
@@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null"> and pay_type =#{payType}</if>
             <if test="parentDdId != null and parentDdId != ''"> and parent_dd_id = #{parentDdId}</if>
             <if test="orderCategory != null and orderCategory != ''"> and order_category = #{orderCategory}</if>
-            <if test="tableNum != null and tableNum != ''"> and table_num = #{tableNum}</if>
+            <if test="tableId != null"> and table_id = #{tableId}</if>
             <if test="logo != null and logo != ''"> and logo = #{logo}</if>
             <if test="posName != null and posName != ''"> and pos_name = #{posName}</if>
             and not (state=0 and collect_payment=0)
@@ -130,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null"> and pay_type =#{payType}</if>
             <if test="parentDdId != null and parentDdId != ''"> and parent_dd_id = #{parentDdId}</if>
             <if test="orderCategory != null and orderCategory != ''"> and order_category = #{orderCategory}</if>
-            <if test="tableNum != null and tableNum != ''"> and table_num = #{tableNum}</if>
+            <if test="tableId != null"> and table_id = #{tableId}</if>
             <if test="logo != null and logo != ''"> and logo = #{logo}</if>
             <if test="posName != null and posName != ''"> and pos_name = #{posName}</if>
         </where>
@@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null">pay_type,</if>
             <if test="parentDdId != null and parentDdId != ''">parent_dd_id,</if>
             <if test="orderCategory != null and orderCategory != ''">order_category,</if>
-            <if test="tableNum != null and tableNum != ''">table_num,</if>
+            <if test="tableId != null">table_id,</if>
             <if test="logo != null and logo != ''">logo,</if>
             <if test="posName != null and posName != ''">pos_name,</if>
             <if test="foodAmount != null">food_amount,</if>
@@ -209,7 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null">#{payType},</if>
             <if test="parentDdId != null and parentDdId != ''">#{parentDdId},</if>
             <if test="orderCategory != null and orderCategory != ''">#{orderCategory},</if>
-            <if test="tableNum != null and tableNum != ''">#{tableNum},</if>
+            <if test="tableId != null">#{tableId},</if>
             <if test="logo != null and logo != ''">#{logo},</if>
             <if test="posName != null and posName != ''">#{posName},</if>
             <if test="foodAmount != null">#{foodAmount},</if>
@@ -252,7 +252,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null">pay_type = #{payType},</if>
             <if test="parentDdId != null and parentDdId != ''">parent_dd_id = #{parentDdId},</if>
             <if test="orderCategory != null and orderCategory != ''">order_category = #{orderCategory},</if>
-            <if test="tableNum != null and tableNum != ''">table_num = #{tableNum},</if>
+            <if test="tableId != null">table_id = #{tableId},</if>
             <if test="logo != null and logo != ''">logo = #{logo},</if>
             <if test="posName != null and posName != ''">pos_name = #{posName},</if>
             <if test="foodAmount != null">food_amount = #{foodAmount},</if>