/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package cn.ysk.cashier.service.shop;

import cn.ysk.cashier.dto.shoptable.*;
import cn.ysk.cashier.pojo.order.TbCashierCart;
import cn.ysk.cashier.pojo.shop.TbShopTable;
import cn.ysk.cashier.dto.shop.TbShopTableDto;
import cn.ysk.cashier.dto.shop.TbShopTableQueryCriteria;
import com.alibaba.fastjson.JSONObject;
import org.springframework.data.domain.Pageable;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
* @website https://eladmin.vip
* @description 服务接口
* @author lyf
* @date 2024-01-18
**/
public interface TbShopTableService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(TbShopTableQueryCriteria criteria, Pageable pageable);

    Map<String,Object> queryAllPage(TbShopTableQueryCriteria criteria);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<TbShopTableDto>
    */
    List<TbShopTableDto> queryAll(TbShopTableQueryCriteria criteria);

    /**
     * 根据shopId查询台桌列表
     * @param shopId 店铺id
     * @return 台桌列表
     */
    List<TbShopTable> queryListByShopId(Integer shopId);

    /**
     * 根据ID查询
     * @param id ID
     * @return TbShopTableDto
     */
    TbShopTableDto findById(Integer id);


    void binding(TbShopTable resources);
    /**
     * 创建
     *
     * @param resources /
     * @return TbShopTableDto
     */
    TbShopTable create(TbShopTable resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(TbShopTable resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Integer[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<TbShopTableDto> all, HttpServletResponse response) throws IOException;

    TbCashierCart addCartForUser(AddCartDTO addCartDTO);

    /**
     * 添加临时菜
     * @param temporaryDishesDTO 临时菜信息
     */
    TbCashierCart addTemporaryDishes(AddTemporaryDishesDTO temporaryDishesDTO);


    void removeCart(RemoveCartDTO removeCartDTO);

    void returnCart(ReturnCartDTO returnCartDTO);

    void clearCart(ClearCartDTO clearCartDTO);

    Map<String, Object> getCart(String tableId, Integer page, Integer size, Integer shopId, String masterId, String useType);

    TbCashierCart updateCart(UpdateCartDTO updateCartDTO);

    void pack(PackCartDTO packCartDTO);

    Object createOrder(CreateOrderDTO createOrderDTO, boolean addMasterId);

    JSONObject getMasterId(Integer shopId, String tableId, String useType, Integer orderId);

    Object pending(PendingDTO pendingDTO);

    Object getCar(Integer shopId, String tableId, String useType);

    Object getPayType(Integer shopId);

    Object pay(PayDTO payDTO);

    Object deleteOrder(DeleteOrderDTO deleteOrderDTO);

    Object updateVip(UpdateVipDTO updateVipDTO);

    Object choseTable(ChoseTableDTO choseTableDTO);

    Object choseCount(ChoseCountDTO choseCountDTO);

    Object printOrder(BaseTableDTO baseTableDTO);

    Object generate(TableGenerateDTO generateDTO);

    Object printDishes(BaseTableDTO baseTableDTO);

    Object choseModel(ChoseModelDTO choseModelDTO);

    Object returnOrder(ReturnOrderDTO returnOrderDTO);

    /**
     * 获取台桌状态
     * @param shopId 电偶id
     * @param tableId qrcode
     * @return
     */
    Object getShopState(Integer shopId, String tableId);

    Object bindQrcode(BindTableQrCodeDTO bindTableQrCodeDTO);

    /**
     * 修改购物车价格
     * @param updatePriceDTO 价格信息
     */
    TbCashierCart updatePrice(UpdatePriceDTO updatePriceDTO);

}
