old mode 100644
new mode 100755
| | |
| | | package com.java110.utils.util; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.apache.commons.beanutils.BeanUtils; |
| | | import org.apache.commons.beanutils.ConvertUtils; |
| | | import org.apache.commons.beanutils.Converter; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.apache.commons.lang3.reflect.FieldUtils; |
| | | import org.springframework.cglib.beans.BeanCopier; |
| | | import org.springframework.cglib.beans.BeanMap; |
| | | |
| | |
| | | } |
| | | |
| | | private static void objectFieldsPutMap(Object dstBean, BeanMap beanMap, Map orgMap) { |
| | | Field[] fields = dstBean.getClass().getDeclaredFields(); |
| | | //Field[] fields = dstBean.getClass().getDeclaredFields(); |
| | | Field[] fields = FieldUtils.getAllFields(dstBean.getClass()); |
| | | for (Field field : fields) { |
| | | if (!orgMap.containsKey(field.getName())) { |
| | | continue; |
| | |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * bean转换为map对象 |
| | | * |
| | | * @param orgBean 原始bean |
| | | * @return map对象 |
| | | */ |
| | | public static JSONObject beanCovertJson(Object orgBean) { |
| | | |
| | | return JSONObject.parseObject(JSONObject.toJSONString(orgBean)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * bean集合转换为map对象集合 |