public static <T> Map<String, Object> toMap(T bean) {
        Map<String, Object> map = null;
        try {
            map = PropertyUtils.describe(bean);
            map.remove("class");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return map;
    }
public static < T > Map < String , Object > toMap ( T bean ) { Map < String , Object > map = null ; try { map = PropertyUtils . describe ( bean ) ; map . remove ( "class" ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } return map ; }
将一个JavaBean对象的所有属性封装在Map中并返回，
注意只能将拥有Getter方法的属性才能取出并封装到Map中

@param bean 需要转换的Bean对象
@return 返回一个Map , 失败返回null