import org.apache.commons.beanutils.PropertyUtils;
public <T> List<Map<String, Object>> listConvert(List<T> list) { List<Map<String, Object>> list_map = new ArrayList<Map<String, Object>>(); // 定义List<Map<String, Object>>数组
// list为外部传进来的list集合 if (CollectionUtils.isNotEmpty(list)) { list.forEach(item ->{
// PropertyUtils.describe(Object)转换 Map<String, Object> map = (Map<String, Object>) PropertyUtils.describe(item); list_map.add(map ); }); } return list_map; }