Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松
2025-11-28 16:46:33 +08:00
6 changed files with 24 additions and 9 deletions

View File

@@ -64,9 +64,9 @@ public class TableController {
*/ */
@GetMapping("getKitchenFood") @GetMapping("getKitchenFood")
// @SaAdminCheckPermission(value = "kitchen:table", name = "后厨-按台桌查看") // @SaAdminCheckPermission(value = "kitchen:table", name = "后厨-按台桌查看")
public CzgResult<List<KitchenFoodVO>> getKitchenFood(@RequestParam(required = false) String productName) { public CzgResult<List<KitchenFoodVO>> getKitchenFood(@RequestParam(required = false) String productName, @RequestParam(required = false) Long categoryId) {
Long shopId = StpKit.USER.getShopId(); Long shopId = StpKit.USER.getShopId();
List<KitchenFoodVO> kitchenFood = kitchenDetailMapper.getKitchenFood(shopId, productName); List<KitchenFoodVO> kitchenFood = kitchenDetailMapper.getKitchenFood(shopId, productName, categoryId);
return CzgResult.success(kitchenFood); return CzgResult.success(kitchenFood);
} }
} }

View File

@@ -18,6 +18,8 @@ public class BkTableVO {
public static class TableVO { public static class TableVO {
private Long tableId; private Long tableId;
private String tableName; private String tableName;
private String tableStatus;
private Integer tableUserNum;
private List<BkOrder> bkOrders; private List<BkOrder> bkOrders;
} }

View File

@@ -24,7 +24,7 @@ public class KitchenFoodVO {
record KitchenFoodItemVO( record KitchenFoodItemVO(
//员工名称 //员工名称
Long orderId, String staffName, Long orderId, String staffName,
String tableName,String areaName,Long orderDetailId, String tableName,String areaName,Long orderDetailId,Long categoryId,String categoryName,
//下单数 //菜品状态 待起菜 PENDING_PREP 待出菜 READY_TO_SERVE 已出菜 SENT_OUT 已上菜 DELIVERED //下单数 //菜品状态 待起菜 PENDING_PREP 待出菜 READY_TO_SERVE 已出菜 SENT_OUT 已上菜 DELIVERED
Long num, String subStatus, Long num, String subStatus,
//下单时间 起菜时间 出菜时间 上菜时间 //下单时间 起菜时间 出菜时间 上菜时间

View File

@@ -19,6 +19,8 @@
`area`.`name` as area_name, `area`.`name` as area_name,
`table`.id as table_id, `table`.id as table_id,
`table`.`name` as table_name, `table`.`name` as table_name,
`table`.`max_capacity` as table_user_num,
`table`.`status` as table_status,
`order`.call_phone, `order`.call_phone,
`order`.call_username, `order`.call_username,
`order`.booking_phone, `order`.booking_phone,
@@ -54,6 +56,8 @@
<!-- 桌台级别映射 --> <!-- 桌台级别映射 -->
<id property="tableId" column="table_id"/> <id property="tableId" column="table_id"/>
<result property="tableName" column="table_name"/> <result property="tableName" column="table_name"/>
<result property="tableUserNum" column="table_user_num"/>
<result property="tableStatus" column="table_status"/>
<!-- 嵌套集合:订单列表 --> <!-- 嵌套集合:订单列表 -->
<collection property="bkOrders" ofType="com.czg.account.vo.BkTableVO$BkOrder"> <collection property="bkOrders" ofType="com.czg.account.vo.BkTableVO$BkOrder">

View File

@@ -28,5 +28,5 @@ public interface KitchenDetailMapper {
/** /**
* 按台桌查看商品列表 * 按台桌查看商品列表
*/ */
List<KitchenFoodVO> getKitchenFood(Long shopId, String productName); List<KitchenFoodVO> getKitchenFood(Long shopId, String productName, Long categoryId);
} }

View File

@@ -12,6 +12,8 @@
detail.sku_name AS skuName, detail.sku_name AS skuName,
`order`.id AS orderId, `order`.id AS orderId,
detail.id AS orderDetailId, detail.id AS orderDetailId,
`category`.id AS categoryId,
`category`.name AS categoryName,
COALESCE(`table`.`name`, '无台桌') AS tableName, COALESCE(`table`.`name`, '无台桌') AS tableName,
CASE WHEN `table`.id IS NULL THEN '吧台' ELSE COALESCE(`area`.`name`, '') END AS areaName, CASE WHEN `table`.id IS NULL THEN '吧台' ELSE COALESCE(`area`.`name`, '') END AS areaName,
`staff`.`name` AS staffName, `staff`.`name` AS staffName,
@@ -23,11 +25,16 @@
detail.food_serve_time AS foodServeTime detail.food_serve_time AS foodServeTime
FROM `tb_order_detail` detail FROM `tb_order_detail` detail
INNER JOIN `tb_order_info` `order` ON detail.order_id = `order`.id AND `order`.`status` = 'unpaid' INNER JOIN `tb_order_info` `order` ON detail.order_id = `order`.id AND `order`.`status` = 'unpaid'
LEFT JOIN `tb_shop_staff` `staff` ON staff.id = `order`.staff_id LEFT JOIN `tb_shop_staff` `staff` ON staff.id = `order`.staff_id and staff.shop_id = #{shopId}
LEFT JOIN `tb_product` `product` ON `product`.id = `detail`.product_id and product.shop_id = #{shopId}
INNER JOIN `tb_shop_prod_category` `category` ON category.id = `product`.category_id and category.shop_id = #{shopId}
LEFT JOIN `tb_shop_table` `table` ON `order`.table_code = `table`.table_code LEFT JOIN `tb_shop_table` `table` ON `order`.table_code = `table`.table_code
LEFT JOIN `tb_shop_table_area` `area` ON `table`.area_id = `area`.id LEFT JOIN `tb_shop_table_area` `area` ON `table`.area_id = `area`.id
WHERE detail.shop_id = #{shopId} WHERE detail.shop_id = #{shopId}
AND detail.`status` = 'wait-pay' AND detail.`status` = 'wait-pay'
<if test="categoryId != null">
AND `category`.id = #{categoryId}
</if>
<if test="productName != null and productName != ''"> <if test="productName != null and productName != ''">
AND detail.product_name like concat('%',#{productName},'%') AND detail.product_name like concat('%',#{productName},'%')
</if> </if>
@@ -49,7 +56,7 @@
FROM FROM
`tb_order_detail` detail `tb_order_detail` detail
INNER JOIN `tb_order_info` `order` ON detail.order_id = `order`.id AND `order`.`status` = 'unpaid' INNER JOIN `tb_order_info` `order` ON detail.order_id = `order`.id AND `order`.`status` = 'unpaid'
LEFT JOIN `tb_shop_staff` `staff` ON staff.id = `order`.staff_id LEFT JOIN `tb_shop_staff` `staff` ON staff.id = `order`.staff_id and staff.shop_id = #{shopId}
LEFT JOIN `tb_shop_table` `table` ON `order`.table_code = `table`.table_code LEFT JOIN `tb_shop_table` `table` ON `order`.table_code = `table`.table_code
LEFT JOIN `tb_shop_table_area` `area` ON `table`.area_id = `area`.id LEFT JOIN `tb_shop_table_area` `area` ON `table`.area_id = `area`.id
WHERE WHERE
@@ -81,7 +88,7 @@
FROM `tb_order_detail` detail FROM `tb_order_detail` detail
INNER JOIN `tb_order_info` `order` ON detail.order_id = `order`.id AND `order`.`status` = 'unpaid' INNER JOIN `tb_order_info` `order` ON detail.order_id = `order`.id AND `order`.`status` = 'unpaid'
LEFT JOIN `tb_shop_table` `table` ON `order`.table_code = `table`.table_code LEFT JOIN `tb_shop_table` `table` ON `order`.table_code = `table`.table_code
LEFT JOIN `tb_shop_staff` `staff` ON staff.id = `order`.staff_id LEFT JOIN `tb_shop_staff` `staff` ON staff.id = `order`.staff_id and staff.shop_id = #{shopId}
WHERE detail.shop_id = #{shopId} WHERE detail.shop_id = #{shopId}
AND detail.`status` = 'wait-pay' AND detail.`status` = 'wait-pay'
<if test="orderId != null"> <if test="orderId != null">
@@ -108,6 +115,8 @@
<arg column="tableName" javaType="java.lang.String"/> <arg column="tableName" javaType="java.lang.String"/>
<arg column="areaName" javaType="java.lang.String"/> <arg column="areaName" javaType="java.lang.String"/>
<arg column="orderDetailId" javaType="java.lang.Long"/> <arg column="orderDetailId" javaType="java.lang.Long"/>
<arg column="categoryId" javaType="java.lang.Long"/>
<arg column="categoryName" javaType="java.lang.String"/>
<arg column="num" javaType="java.lang.Long"/> <arg column="num" javaType="java.lang.Long"/>
<arg column="subStatus" javaType="java.lang.String"/> <arg column="subStatus" javaType="java.lang.String"/>
<arg column="orderTime" javaType="java.lang.String"/> <arg column="orderTime" javaType="java.lang.String"/>