This commit is contained in:
2025-11-28 15:10:27 +08:00
parent 44159715ac
commit de4f305044
6 changed files with 18 additions and 6 deletions

View File

@@ -64,9 +64,9 @@ public class TableController {
*/
@GetMapping("getKitchenFood")
// @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();
List<KitchenFoodVO> kitchenFood = kitchenDetailMapper.getKitchenFood(shopId, productName);
List<KitchenFoodVO> kitchenFood = kitchenDetailMapper.getKitchenFood(shopId, productName, categoryId);
return CzgResult.success(kitchenFood);
}
}

View File

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

View File

@@ -24,7 +24,7 @@ public class KitchenFoodVO {
record KitchenFoodItemVO(
//员工名称
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
Long num, String subStatus,
//下单时间 起菜时间 出菜时间 上菜时间

View File

@@ -20,6 +20,7 @@
`table`.id as table_id,
`table`.`name` as table_name,
`table`.`max_capacity` as table_user_num,
`table`.`status` as table_status,
`order`.call_phone,
`order`.call_username,
`order`.booking_phone,
@@ -56,6 +57,7 @@
<id property="tableId" column="table_id"/>
<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">

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,8 +12,10 @@
detail.sku_name AS skuName,
`order`.id AS orderId,
detail.id AS orderDetailId,
COALESCE(`table`.`name`, '无台桌') AS tableName,
CASE WHEN `table`.id IS NULL THEN '吧台' ELSE COALESCE(`area`.`name`, '') END AS areaName,
`category`.id AS categoryId,
`category`.name AS categoryName,
COALESCE(`table`.`name`, '无台桌') AS tableName,
CASE WHEN `table`.id IS NULL THEN '吧台' ELSE COALESCE(`area`.`name`, '') END AS areaName,
`staff`.`name` AS staffName,
sum(detail.num - detail.return_num) AS num,
detail.sub_status AS subStatus,
@@ -24,10 +26,15 @@
FROM `tb_order_detail` detail
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 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_area` `area` ON `table`.area_id = `area`.id
WHERE detail.shop_id = #{shopId}
AND detail.`status` = 'wait-pay'
<if test="categoryId != null">
AND `category`.id = #{categoryId}
</if>
<if test="productName != null and productName != ''">
AND detail.product_name like concat('%',#{productName},'%')
</if>
@@ -108,6 +115,8 @@
<arg column="tableName" javaType="java.lang.String"/>
<arg column="areaName" javaType="java.lang.String"/>
<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="subStatus" javaType="java.lang.String"/>
<arg column="orderTime" javaType="java.lang.String"/>