package com.jwipc.inquiry.logic;

import com.jwipc.inquiry.dto.*;
import com.jwipc.inquiry.model.po.InquiryDetailByIdDetailPO;
import com.jwipc.inquiry.model.po.InquiryDetailByIdPO;
import com.jwipc.inquiry.model.query.InquiryConvertContractQuery;
import com.jwipc.inquiry.model.query.InquiryQuery;
import com.jwipc.page.PageView;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author shenyang.ou
 * @date 2024/2/18 14:59
 * @desc 询价
 */
public interface InquiryLogic {
    PageView findByPage(InquiryQuery query);

    InquiryDTO getById(Long id);

    void saveOrUpdate(InquiryParamDTO param);

    /**
     * 发布
     * @param id 询价id
     */
    void publish(Long id);

    /**
     * 截止
     * @param id 询价id
     */
    void end(Long id);

    /**
     * 不定价关闭
     * @param id
     */
    void close(Long id);

    List<InquiryMaterialQuoteDTO> materialQuoteList(Long inquiryId);

    /**
     * 作废
     * @param id 询价id
     * @param cancelRemark 作废原因
     */
    void cancel(Long id, String cancelRemark);

    /**
     * 删除
     * @param id 询价id
     */
    void remove(Long id);

    /**
     * 更新询价物料和供应商数据
     * @param inquiryMaterialId 询价物料id
     * @param inquiryMaterialSupplierId 询价物料供应商id
     * @param materialCode 物料编码
     * @param quoteFromDate 有效期起始日
     * @param quoteEndDate 有效期结束日
     */
    void updateMaterialAndSupplierData(Long inquiryMaterialId, Long inquiryMaterialSupplierId, String materialCode, String quoteFromDate, String quoteEndDate,Integer confirmDeliveryDate,Long mpq,Long moq,String supplierCode);

    List<InquiryEditSupplierDTO> supplierListByInquiryId(Long inquiryId);
    List<InquiryEditSupplierDTO> supplierCopyListByInquiryId(Long inquiryId);

    /**
     * 导入物料信息
     * @param file
     */
    List<InquiryMaterialImportDTO> importMaterialData(MultipartFile file);

    /**
     * 导入供应商信息
     * @param file
     */
    List<InquirySupplierImportDTO> importSupplierData(MultipartFile file, String companyCode);

    /**
     * 根据物料编码和工厂编码获取配额供应商
     * @param materialCode 物料编码
     * @param factoryCode 工厂编码
     */
    List<InquirySupplierImportDTO> getSupplierByMaterialCodeAndFactoryCode(String materialCode, String factoryCode,String companyCode);

    List<InquiryDetailByIdPO> xjlistFindByList(Long xjId, Integer type);

    List<InquiryDetailByIdDetailClientDTO> formMaterialDeatilById(Long xjId, String supplierId);

    List<InquiryDTO> inquiryContractList(InquiryConvertContractQuery query);

    List<InquiryDetailByIdDetailClientDTO> formDetailByMaterialSupplierId(List<String> inquiryIdList, String supplierId);

    void updateConStateByNos(String dataSourcesNos,String supplierCode, Integer state);

    List<InquiryCostContractDTO> getInquiryCostContractList(InquiryConvertContractQuery query);
}
