Java DO到DTO转换利用spring 的BeanUtils.copyProperties()
public static <T> List<T> copy(Object sourceList, Class<?> beanClass) throws Exception {List<Object> sList = (List<Object>) sourceList;List<Object> tList = new ArrayList<Object>();for (Object t : sList) {Object dto = beanClass.newInstance();BeanUtils.copyProperties(t, dto);tList.add(dto);}return (List<T>) tList;}List<DTO> dtoList = copy(doList,DTO.class);