Class clazz = bean.getClass();
Field[] fields = clazz.getDeclaredFields();
String sign = "";
for (Field field : fields) {
//设置可以获取私有字段
field.setAccessible(true);
String key = field.toString().substring(field.toString().lastIndexOf(".") + 1);
String value = (String) field.get(bean);
if (value == null) {
value = "";
}
//逻辑
}