converter package

OrderMaster2OrderDTO.java //在orderservice--findlist方法中有使用

package com.tkft.sell.converter;

import com.tkft.sell.dataobject.OrderMaster;
import com.tkft.sell.dto.OrderDTO;
import org.springframework.beans.BeanUtils;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Auther xinyuan
 * @Date 11/19/18 1:41 PM
 **/
public class OrderMaster2OrderDTO {
    public static OrderDTO convert(OrderMaster orderMaster){
        OrderDTO orderDTO = new OrderDTO();
        BeanUtils.copyProperties(orderMaster, orderDTO);
        return orderDTO;
    }

    public static List convert(List orderMasterList){
        return orderMasterList.stream().map(e -> convert(e)).collect(Collectors.toList());
    }
}

你可能感兴趣的:(converter package)