package com.jwipc.contract.logic;

import com.jwipc.api.constant.ContractSendSign;
import com.jwipc.api.dto.ApiResult;
import com.jwipc.constant.SignProcessType;
import com.jwipc.contract.dto.*;
import com.jwipc.contract.entity.Contract;
import com.jwipc.contract.entity.ContractDetail;
import com.jwipc.contract.model.po.DigitalSealConfigDTO;
import com.jwipc.contract.model.query.*;
import com.jwipc.page.PageView;
import com.jwipc.supplier.clent.dto.SupplierBankDTO;
import com.jwipc.sys.dto.FinancialShareApiResultDTO;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 功能描述:
 *
 * @Author: zx
 * @Date: 2024/3/7 0007 16:28
 */
public interface ContractLogic {

    PageView listPage(ContractMangeQuery query);
    PageView reportPage(ContractMangeQuery query);
    List<ContractReportDTO> listAll(ContractMangeQuery query);

    PageView choseContractList(ContractMangeQuery query);

    ContractDTO formDeatil(String id);

    ContractPayDTO formPayDeatil(String id);

    PageView choseSupplierList(ChoseSupplierListQuery choseSupplierListQuery);

    Long selectOnlyCode(String code,Long conId);

    void insertOrUpdate(Contract bean);

    void saveContractDeatils(Contract bean,String dlist,String rowsTableTblist,String mros);

    void removeContract(String id);

    void saveSignFile(MultipartFile[] files , String[] fileIds , String conId);

    PageView selectPayListPage(ChoseSupplierListQuery choseSupplierListQuery);

    PageView contractPayListPage(ContractMangeQuery query);

    PageView choseContractHistoryList(ChoseSupplierListQuery choseSupplierListQuery);

    List<SupplierBankDTO> supplierBankDate(String conId);
    String  getTotalPayAmount(String contractCode);

    PageView detailLists(ContractPayDetailsQuery payDetailsQuery);

    PageView detailOrderLists(ContractPayDetailsQuery payDetailsQuery);

    PageView detailTypeLists(ContractPayDetailsQuery payDetailsQuery);
    List<ContractPayTypeDTO> detailTypeListByContractId(Long contractId);

    Long selectOnlyPayCode(String code,Long payId);

    void insertOrUpdateByPay(ContractPayDTO bean);

    void saveContractPayDeatils(ContractPayDTO bean, String dlist,String orderlist,String typelist);

    void removeContractPay(String id);

    ContractDetailDTO formDetail(String detailId);

    ContractMroDTO formDetailMro(String detailId);

    PageView selectContractDetailListPage(ChoseSupplierListQuery choseSupplierListQuery);


    PageView selectMroContractDetailListPage(ChoseSupplierListQuery choseSupplierListQuery);

    PageView selectContractMroListPage(ChoseSupplierListQuery choseSupplierListQuery);

    ContractPayStageDTO getFromPayDetail(Long payId);

    List<ContractCategoryDTO> getContractCategory(Integer mroFlag);

    Map<Long, BigDecimal> amountSum(String payStageId,String contractIds, String payId);

    ApiResult getBillByKm(String conId, String oaApplyId);

    ApiResult getPayBillByKm(String payId,String oaApplyId);

    PageView getOaProcessList(ProcessListQuery processListQuery);

    void sendSign(String conId);

    String uploadSignFile(MultipartFile file, String fileId);

    ContractSendSignResultDTO sendSignClient(ContractSendSignDTO contractSendSignDTO, SignProcessType signProcessType);

    DigitalSealConfigDTO selectESignDetailClient(String companyCode, String sealType);

    List<Map<String,String>> detailImport(MultipartFile file,Integer isSap);

    void updateTime(List<String> idList, String deliveryDate, String invoiceTime);

    List<ContractDetailDTO> getDetailListByPurchaseCodeAndeItem(String billCode, String itemCode);

    PageView selectReceiptContractDetailListPage(ChoseSupplierListQuery choseSupplierListQuery);

    List<ContractDetail> selectReceiptContractDetailList(ChoseSupplierListQuery choseSupplierListQuery);

    void cancelContract(String id);

    FinancialShareApiResultDTO submitContractToGx(String conId, String gxApplyId, String isTerminated);

    List<String> submitStampFileToGx(String conId, String gxApplyId,String type);

    List<ContractPrintDTO> getPrintData(String contractId);

    List<Map<String,String>> detailMroImport(MultipartFile file);

    List<ContractDetailDTO> selectContractDetailExportData(String queryStr);

    void contractTerminateCheck(String contractId);

    /**
     * 资产合同保存接口
     * @param saveDTO 保存参数
     */
    String formSave(ContractMroSaveDTO saveDTO);
}
