利用反射获取对象值
import org.apache.commons.beanutils.BeanUtils;
private String getValueByField(Object object, String field) { String retValue = null; if (CommonUtils.isEmpty(object)) { return null; } try { retValue = BeanUtils.getProperty(object, field); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { logger.error("VerticalPriceCycleFrontDataService getValueByField", e); } return retValue; }

浙公网安备 33010602011771号