package com.jwipc.order.logic;

import cn.hutool.core.lang.Pair;
import com.jwipc.order.clent.dto.UpdateOrderDTO;
import com.jwipc.order.dto.*;
import com.jwipc.order.entity.DeliveryOrder;
import com.jwipc.order.model.query.DeliveryOrderQuery;
import com.jwipc.page.PageView;
import org.springframework.web.multipart.MultipartFile;

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

/**
 * <p> </p>
 *
 * @author BOGON
 * @version 1.0
 * @since JDK 1.8
 */
public interface DeliveryOrderLogic {
    DeliveryOrderLookupDTO getDefaultDetail(DeliveryOrderLookupDTO deliveryOrderBaseDTO, Long id);
    DeliveryOrder getDeliveryOrderByCode(String no);


    Pair<String, Set<String>> saveOrUpdate(DeliveryOrderSaveDTO deliveryOrderSaveDTO);

    PageView getList(DeliveryOrderQuery query);

    List<DeliveryOrderBaseDTO> getListAll(DeliveryOrderQuery deliveryOrderQuery);

    DeliveryPrintDTO getPrintData(String ids);

    void saveAttachment(List<DeliveryOrderFileDTO> fileDTOS);

    /**
     * 完成收货
     * @param devOrderCodes 送货单编号
     */
    void complateDelivery(Set<String> devOrderCodes);

    void update(DeliveryOrderSaveDTO deliveryOrderSaveDTO);

    PageView getAttachmentList(Long id);

    void removeAttachment(String id, String remark);

    void submitRemark(String id, String remark);

    List<ImportCreateDeliveryOrderDetailDTO> getImportData(List<Map<String, String>> dataList);
    List<ImportCreateDeliveryOrderDetailDTO> overseasImport(MultipartFile file,String factoryCode);

    /**
     * 通过送货单查找关联的对账单
     * @param id 送货单id
     * @return 关联的对账单号列表
     */
    List<String> findAccountStatementByOrderCode(Long id);

    void setEntrustNo(Long id, String entrustNo);

    /**
     * 根据委托单号获取送货单号
     *
     * @param entrustNo 委托单号
     * @return 送货单号
     */
    List<String> getDevOrderCodesByEntrustNo(String entrustNo);

    /**
     * 根据委托单号获取工厂编号
     *
     * @param entrustNo 委托单号
     * @return 工厂编号
     */
    String getFactoryCodesByEntrustNo(String entrustNo);

    void pushDeliveryToSap(String ids);
    void updateReturnConfirmStatus(String ids);

    void updateDeliveryReturnConfirmStatus(List<UpdateOrderDTO> updateOrderDTOS);

    void getFtp(String startDate, String endDate);
}