package cn.superdesk.uniorder.service.invoice.supplier;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.invoice.supplier.InvoiceApplySupplierXGoods;
import cn.superdesk.uniorder.dto.param.invoice.supplier.InvoiceApplySupplierOpDetailInnerGoodsListQueryCriteria;
import cn.superdesk.uniorder.dto.param.invoice.supplier.InvoiceApplySupplierXGoodsQueryCriteria;
import cn.superdesk.uniorder.dto.vo.invoice.supplier.InvoiceApplySupplierDetailDimGoodsItemVo;
import cn.superdesk.uniorder.dto.vo.invoice.supplier.InvoiceApplySupplierXUnifiedOrderGoodsEdVo;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

/**
 * @Description: 供应商 开票申请 X 商品 extends BaseService<InvoiceApplySupplierXGoods>
 * @Author: linjinyu
 * @CreateDate: 2020/11/4 下午2:42
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020/11/4 下午2:42
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public interface InvoiceApplySupplierXGoodsService {

    /****************************************** extends BaseService 部分 start ******************************************/

    @Deprecated
    void addObj(InvoiceApplySupplierXGoods entity);

    @Deprecated
    void updateObj(InvoiceApplySupplierXGoods entity);

    @Deprecated
    void deleteObj(Long id);

    @Deprecated
    InvoiceApplySupplierXGoods findById(Long id);

    @Deprecated
    PageInfo<InvoiceApplySupplierXGoods> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize);

    @Deprecated
    List<InvoiceApplySupplierXGoods> findAll(Map<String, Object> queryMap);

    /****************************************** extends BaseService 部分   end ******************************************/


    void addInvoiceApplySupplierXGoods(InvoiceApplySupplierXGoods entity);

    void updateInvoiceApplySupplierXGoods(InvoiceApplySupplierXGoods entity);

    void deleteInvoiceApplySupplierXGoods(Long id);

    InvoiceApplySupplierXGoods findInvoiceApplySupplierXGoodsById(Long id);

    R<List<InvoiceApplySupplierXGoods>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize);

    R<List<InvoiceApplySupplierXGoods>> pageQueryGenericParam(InvoiceApplySupplierXGoodsQueryCriteria criteria);


    /****************************************** 重构前存在 start ******************************************/


    List<InvoiceApplySupplierDetailDimGoodsItemVo> getInvoiceApplySupplierDetailInnerGoodsList(InvoiceApplySupplierOpDetailInnerGoodsListQueryCriteria queryCriteria);


    /****************************************** 工具方法 start ******************************************/

    /**
     * 用于 发票申请 排除已开票的商品
     * * 装的是 基于 某对账单Sn 查出这个对账单 商品 已申请开票
     *
     * @param accountingOrderSn
     * @return
     */
    List<InvoiceApplySupplierXUnifiedOrderGoodsEdVo> getInvoiceApplyXUnifiedOrderGoodsEd(String accountingOrderSn);

    /**
     * 根据发票申请Id 获取 关联 积分流水 ids 集合
     *
     * @param invoiceApplyId
     * @return
     */
    List<Long> findGoodsSetByInvoicApplyId(Long invoiceApplyId);

    List<Long> findGoodsSetByInvoicApplySn(String invoiceApplySn);

    /**
     * 根据开票申请Id 获取 关联 对账单 ids 集合
     * <p>
     * 由于 这个 开票申请 X 对账单 X 订单 X 商品 表是没有记录 invoiceApplyId and accountingOrderid
     * <p>
     * 所以不实际
     *
     * @param invoiceApplyIds
     * @return
     */
    List<Long> getAffectedAccountingOrderIdsByInvoiceApplyIds(List<Long> invoiceApplyIds);

    List<String> getAffectedAccountingOrderSnsByInvoiceApplySn(String invoiceApplySn);

    List<String> getAffectedAccountingOrderSnsByInvoiceApplySns(List<String> invoiceApplySns);

    /****************************************** 工具方法   end ******************************************/

    /****************************************** 基于对账单Id检测开票状态 start ******************************************/

    @Deprecated
    Integer checkInvoiceApplyStatusByAccountingOrderIdFocusSupplier(Long accountingOrderId);

    Integer checkInvoiceApplyStatusByAccountingOrderSnFocusSupplier(String accountingOrderSn);

    /****************************************** 基于对账单Id检测开票状态   end ******************************************/

    /****************************************** 基于对账单Sn检测开票状态 并 更新 对账单 开票状态 start ******************************************/

    @Deprecated
    void checkInvoiceApplyStatusByAccountingOrderIdAndUpdateAccountingEntityFocusSupplier(Long accountingOrderId);

    void checkInvoiceApplyStatusByAccountingOrderSnAndUpdateAccountingEntityFocusSupplier(String accountingOrderSn);

    void deleteInvoiceApplySupplierXGoodsBatchByAccountingOrderSn(String accountingOrderSn);

    /****************************************** 基于对账单Sn检测开票状态 并 更新 对账单 开票状态   end ******************************************/
}
