package com.sunxung.factoring.service.underlying;

import com.sunxung.factoring.entity.GridPage;
import com.sunxung.factoring.entity.acceptance.AcceptanceBasicInfo;
import com.sunxung.factoring.entity.acceptance.BaseGoods;
import com.sunxung.factoring.entity.underlying.UnderlyingAccountsReceivableInfo;
import com.sunxung.factoring.entity.underlying.UnderlyingBasicInfo;
import com.sunxung.factoring.entity.underlying.UnderlyingGoodsInfo;
import com.sunxung.factoring.entity.underlying.vo.GoodsSearch1;
import com.sunxung.factoring.entity.underlying.vo.UnderlyingCalculateVo;
import com.sunxung.factoring.entity.underlying.vo.UnderlyingInfoVo;

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

/**
 * @author liutao
 * @date 2021.10.11
 */
public interface UnderlyingService {

    /**
     * 新建底层信息
     *
     * @param underlyingInfoVo
     * @param request
     * @return
     */
    void add(UnderlyingInfoVo underlyingInfoVo, HttpServletRequest request);

    /**
     * 修改底层信息
     *
     * @param underlyingInfoVo
     * @param taskId
     * @param request
     */
    void edit(UnderlyingInfoVo underlyingInfoVo, String taskId, HttpServletRequest request);

    /**
     * 从验收单查询可以做底层的货物
     *
     * @param goodsSearch1 货物查询条件
     * @return
     */
    GridPage<AcceptanceBasicInfo> findGoodsByAcceptance(GoodsSearch1 goodsSearch1);

    /**
     * 从结算单查询可以做底层的货物
     *
     * @param goodsSearch
     * @return
     */
//    GridPage<SettlementBasicInfo> findGoodsBySettlement(GoodsSearch1 goodsSearch);

    /**
     * 根据货物销售单价、数量等信息计算销售总价、采购总价等
     *
     * @param underlyingCalculateVo
     * @return
     */
    List<BaseGoods> calculate(UnderlyingCalculateVo underlyingCalculateVo);

    /**
     * 根据货物信息生成底层信息
     *
     * @param underlyingInfoVo
     * @return
     */
    List<UnderlyingAccountsReceivableInfo> generateAccountsReceivable(UnderlyingInfoVo underlyingInfoVo);

    /**
     * 获取底层详情信息
     *
     * @param businessKey
     * @return
     */
    UnderlyingInfoVo getDetail(Long businessKey);

    /**
     * 获取货物信息
     *
     * @param underlyingBasicInfoId
     * @return
     */
    List<UnderlyingGoodsInfo> getGoodsInfoList(Long underlyingBasicInfoId);

    /**
     * 根据业务编号获取应收账款信息
     *
     * @param businessNumber
     * @return
     */
    UnderlyingBasicInfo findAccountsReceivableByBusinessNumber(String businessNumber, Long supplierId);

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