public void getExcelField(String targetId, Field field, ExcelImportEntity excelEntity, Excel excel, Class<?> pojoClass) throws Exception { excelEntity.setName(getExcelName(excel.name(), targetId)); String fieldname = field.getName(); excelEntity.setMethod(PoiPublicUtil.getMethod(fieldname, pojoClass, field.getType())); if (StringUtils.isNotEmpty(excel.importFormat())) { excelEntity.setFormat(excel.importFormat()); } else { excelEntity.setFormat(excel.format()); } }
public void getExcelField(String targetId, Field field, ExcelImportEntity excelEntity, Excel excel, Class<?> pojoClass) throws Exception { excelEntity.setName(getExcelName(excel.name(), targetId)); String fieldname = field.getName(); excelEntity.setMethod(PoiPublicUtil.getMethod(fieldname, pojoClass, field.getType())); if (StringUtils.isNotEmpty(excel.importFormat())) { excelEntity.setFormat(excel.importFormat()); } else { excelEntity.setFormat(excel.format()); } }
public void getExcelField(String targetId, Field field, ExcelImportEntity excelEntity, Excel excel, Class<?> pojoClass) throws Exception { excelEntity.setName(PoiPublicUtil.getValueByTargetId(excel.name(), targetId, null)); String fieldname = field.getName(); excelEntity.setMethod(PoiReflectorUtil.fromCache(pojoClass).getSetMethod(fieldname)); if (StringUtils.isNotEmpty(excel.importFormat())) { excelEntity.setFormat(excel.importFormat()); } else { excelEntity.setFormat(excel.format()); } }