package com.jwipc.order.client.impl;

import com.jwipc.order.clent.dto.UpdateOrderDTO;
import com.jwipc.order.client.DeliverOrderClient;
import com.jwipc.order.logic.DeliveryOrderLogic;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

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

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Service
@RequiredArgsConstructor
public class DeliverOrderClientImpl implements DeliverOrderClient {
    private final DeliveryOrderLogic deliveryOrderLogic;
    @Override
    public void complateDelivery(Set<String> devOrderCodes) {
        deliveryOrderLogic.complateDelivery(devOrderCodes);
    }

    @Override
    public void updateDeliveryReturnConfirmStatus(List<UpdateOrderDTO> updateOrderDTOS) {
        deliveryOrderLogic.updateDeliveryReturnConfirmStatus(updateOrderDTOS);
    }

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

    /**
     * 根据委托单号获取工厂编号
     *
     * @param entrustNo 委托单号
     * @return 工厂编号
     */
    @Override
    public String getFactoryCodesByEntrustNo(String entrustNo) {
        return deliveryOrderLogic.getFactoryCodesByEntrustNo(entrustNo);
    }

}
