package cn.ysk.cashier.service.product;

import cn.ysk.cashier.dto.product.TbProductFrmLossDto;
import cn.ysk.cashier.dto.product.TbProductStockCountQueryCriteria;
import cn.ysk.cashier.dto.product.TbProductStockDetailDto;
import cn.ysk.cashier.dto.product.TbProductStockDetailQueryCriteria;
import cn.ysk.cashier.pojo.product.TbProductStockDetail;
import cn.ysk.cashier.vo.TbProductStockCountVo;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface TbProductStockDetailService {

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

    Map<String,Object> queryPage(TbProductStockDetailQueryCriteria criteria) throws ParseException;
    TbProductStockCountVo stockCount(TbProductStockCountQueryCriteria criteria) throws ParseException;
    Map<String,Object> stockList(TbProductStockCountQueryCriteria criteria) throws ParseException;

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

    /**
     * 根据ID查询
     * @param id ID
     * @return TbProductStockDetailDto
     */
    TbProductStockDetailDto findById(Long id);

    void frmLoss(TbProductFrmLossDto resources);
    /**
    * 创建
    * @param resources /
    * @return TbProductStockDetailDto
    */
    TbProductStockDetailDto create(TbProductStockDetail resources);

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

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

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

    void addSaleRecord(Integer orderId);

}
