package com.inkasso.factoring.settlement.service;

import com.inkasso.factoring.common.entity.GridPage;
import com.inkasso.factoring.common.entity.ResponseJson;
import com.inkasso.factoring.file.entity.FileStorageDO;
import com.inkasso.factoring.settlement.entity.*;
import com.inkasso.factoring.settlement.model.request.BillSignRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

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

public interface SettlementManagementService {
    /**
     * 添加结算单
     *
     * @param settlementBasicInfo
     * @param request
     */
    void add(SettlementBasicInfo settlementBasicInfo, HttpServletRequest request) throws Exception;

    /**
     * 查看详情
     *
     * @param businessKey
     * @return
     */
    SettlementBasicInfo getDetail(Long businessKey);

    /**
     * 获取结算货物信息
     *
     * @param settlementBasicInfoId
     * @return
     */
    List<SettlementGoodsInfo> getGoodsInfoList(Long settlementBasicInfoId) throws ParseException;

    /**
     * 计算对账日期
     *
     * @param settlementBasicInfo
     * @return
     */
    Object getExpectedSettlementDate(SettlementBasicInfo settlementBasicInfo);

    /**
     * 一件计算质保金
     *
     * @param settlementBasicInfo
     * @return
     */
    Object calculation(SettlementBasicInfo settlementBasicInfo);

    ResponseEntity<Object> downloadReport(Long id, HttpServletResponse res);

    ResponseEntity<Object> downloadPdfSign(Long settlementBasicInfoId, HttpServletResponse res);

    List<FileStorageDO> showPdfSign(Long settlementBasicInfoId);

    Object downloadPdf(SettlementBasicInfo settlementBasicInfo, HttpServletResponse response);

    Object findAllList(SearchBusiness search);

    /**
     * 自动签署
     *
     * @param businessKey
     * @param taskId
     * @return
     */
    SettlementElectronicInfo autoSign(Long businessKey, String taskId);

    Object importGoodsInfo(MultipartFile file);

    void downloadFile(HttpServletResponse response);

    void billUnitPriceAdjust(SettlementBasicInfo settlementBasicInfo);

    List<SettlementGoodsInfo> findGoodsInfoList(String businessNumber);

    Object billSign(BillSignRequest billSignRequest);

    Object getCanBeBillGoodsInformation(ConditionVo conditionVo);

    Object findOperatorByBusinessNumber(String businessNumber);

    void updateBill(SettlementBasicInfo settlementBasicInfo);

    Object getSignTppe(String electronicInfoId, String taskId, String basicId);
    void doSignCallBackByQuery(String contractId, String[] fdds);

    Object doBusinessHistoryView(Long businessKey, String businessType);
}
