package com.inkasso.factoring.invoicemanage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.inkasso.factoring.common.entity.GridPage;
import com.inkasso.factoring.file.entity.FileStorage;
import com.inkasso.factoring.file.entity.FileStorageDO;
import com.inkasso.factoring.invoicemanage.entity.InvoiceBasicInfo;
import com.inkasso.factoring.invoicemanage.model.request.SearchBusiness;
import com.inkasso.factoring.invoicemanage.model.request.SearchGoodsVo;
import com.inkasso.factoring.settlement.entity.SettlementGoodsInfo;
import com.inkasso.factoring.settlement.model.dto.BusinessProcessingTaskDTO;
import org.springframework.ui.Model;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author : liutao
 * @Date: 2022-3-22
 */
public interface InvoiceBasicInfoService extends IService<InvoiceBasicInfo> {

    /**
     * 获取列表页信息
     *
     * @param id
     * @return
     */
    InvoiceBasicInfo get(Long id);


    /**
     * 添加销售发票
     *
     * @param invoiceBasicInfo
     * @return
     */
    void add(InvoiceBasicInfo invoiceBasicInfo) throws IOException;

    /**
     * 获取销售发票添加页面详细信息
     *
     * @param businessKey 销售发票信息ID
     * @return
     */
    InvoiceBasicInfo getDetail(Long businessKey);

    /**
     * 修改销售发票
     *
     * @param invoiceBasicInfo
     * @param request
     */
    void doUpdate(InvoiceBasicInfo invoiceBasicInfo,HttpServletRequest request) throws IOException;

    /**
     * 获取销售发票添加页面详细信息
     *
     * @param businessKey 销售发票信息ID
     * @return
     */
    InvoiceBasicInfo getUpdateDetail(Long businessKey);

    /**
     * 初始化信息
     *
     * @param businessBasicId
     * @param model
     */
    void init(Long businessBasicId, Model model);

    /**
     * 一键下载
     * @param id
     * @param response
     */
    void downloadAllInvoiceFile(Long id, HttpServletResponse response);

    List<FileStorage> showSaleInvoice(Long id);

    void downLoadSaleInvoice(Long id,HttpServletResponse response);

    GridPage<BusinessProcessingTaskDTO> findList(SearchBusiness searchBusiness);

    GridPage saleSelectGoodsOfPayment(SearchGoodsVo searchGoodsVo);

    GridPage<SettlementGoodsInfo> saleSelectGoodsOfDiscount(SearchGoodsVo searchGoodsVo);

    Object findByCustomer(Long customerId, Long businessBasicInfoId);
}
