package com.jwipc.order.convert;

import com.jwipc.order.dto.DeliveryOrderDetailBaseDTO;
import com.jwipc.order.dto.DeliveryOrderDetailListDTO;
import com.jwipc.order.dto.DeliveryOrderDetailPrintDTO;
import com.jwipc.order.dto.ImportCreateDeliveryOrderDetailDTO;
import com.jwipc.order.entity.DeliveryOrderDetail;
import com.jwipc.order.entity.PurchaseOrderDetail;
import com.jwipc.order.model.po.DeliveryOrderDetailPO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

import java.util.List;


@Mapper(componentModel = "spring")
public interface DeliveryOrderDetailConvert {
    List<DeliveryOrderDetail> dtos2Entities(List<DeliveryOrderDetailBaseDTO> item);

    List<DeliveryOrderDetailListDTO> pos2Dtos(List<DeliveryOrderDetailPO> list);

    List<DeliveryOrderDetailBaseDTO> entities2Dtos(List<DeliveryOrderDetail> deliveryOrderDetails);

    DeliveryOrderDetailPrintDTO convert1(DeliveryOrderDetail orderDetail);
    @Mapping(source = "requireDate", target = "requireDate",ignore = true)
    @Mapping(source = "supplierErpCode", target = "supplierCode")
    @Mapping(source = "createName", target = "buyer")
    ImportCreateDeliveryOrderDetailDTO fillData(PurchaseOrderDetail one,@MappingTarget ImportCreateDeliveryOrderDetailDTO baseDTO);
}
