@@ -26,6 +26,10 @@ Spring Boot 支持 https://gitee.com/lemur/easypoi-spring-boot-starter | |||||
- pdf全部改为模板导出方式 | - pdf全部改为模板导出方式 | ||||
- word模板和excel功能同步 | - word模板和excel功能同步 | ||||
[企业版技术支持] | |||||
由Tidelift(https://tidelift.com/)提供统一服务 | |||||
[用户征集](https://gitee.com/lemur/easypoi/issues/IFDX7) | [用户征集](https://gitee.com/lemur/easypoi/issues/IFDX7) | ||||
@@ -28,6 +28,11 @@ Next steps | |||||
[User feedback](https://gitee.com/lemur/easypoi/issues/IFDX7) | [User feedback](https://gitee.com/lemur/easypoi/issues/IFDX7) | ||||
## cn.afterturn:easypoi for enterprise | |||||
Available as part of the Tidelift Subscription | |||||
The maintainers of cn.afterturn:easypoi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/maven-cn-afterturn-easypoi?utm_source=maven-cn-afterturn-easypoi&utm_medium=referral&utm_campaign=readme) | |||||
Display in order of registration. If you are using Easypoi, please register on https://gitee.com/lemur/easypoi/issues/IFDX7 which is only as a reference for the open source, no other purposes. | Display in order of registration. If you are using Easypoi, please register on https://gitee.com/lemur/easypoi/issues/IFDX7 which is only as a reference for the open source, no other purposes. | ||||
@@ -31,7 +31,7 @@ public final class CsvExportUtil { | |||||
*/ | */ | ||||
public static void exportCsv(CsvExportParams params, Class<?> pojoClass, Collection<?> dataSet, OutputStream outputStream) { | public static void exportCsv(CsvExportParams params, Class<?> pojoClass, Collection<?> dataSet, OutputStream outputStream) { | ||||
IWriter writer = new CsvExportService(outputStream, params, pojoClass); | IWriter writer = new CsvExportService(outputStream, params, pojoClass); | ||||
writer.writer(dataSet); | |||||
writer.write(dataSet); | |||||
writer.close(); | writer.close(); | ||||
} | } | ||||
@@ -50,7 +50,7 @@ public final class CsvExportUtil { | |||||
Collection dataSet; | Collection dataSet; | ||||
while ((dataSet = server.selectListForExcelExport(queryParams, page)) != null && dataSet.size() > 0) { | while ((dataSet = server.selectListForExcelExport(queryParams, page)) != null && dataSet.size() > 0) { | ||||
page++; | page++; | ||||
writer.writer(dataSet); | |||||
writer.write(dataSet); | |||||
} | } | ||||
writer.close(); | writer.close(); | ||||
} | } | ||||
@@ -156,7 +156,7 @@ public class CsvExportService extends BaseExportService implements IWriter<Void> | |||||
@Override | @Override | ||||
public IWriter writer(Collection data) { | |||||
public IWriter write(Collection data) { | |||||
try { | try { | ||||
Iterator<?> iterator = data.iterator(); | Iterator<?> iterator = data.iterator(); | ||||
String line = null; | String line = null; | ||||
@@ -137,7 +137,7 @@ public class ExcelBatchExportService extends ExcelExportService implements IWrit | |||||
List<Object> list = server | List<Object> list = server | ||||
.selectListForExcelExport(queryParams, page++); | .selectListForExcelExport(queryParams, page++); | ||||
while (list != null && list.size() > 0) { | while (list != null && list.size() > 0) { | ||||
writer(list); | |||||
write(list); | |||||
list = server.selectListForExcelExport(queryParams, page++); | list = server.selectListForExcelExport(queryParams, page++); | ||||
} | } | ||||
return close(); | return close(); | ||||
@@ -149,7 +149,7 @@ public class ExcelBatchExportService extends ExcelExportService implements IWrit | |||||
} | } | ||||
@Override | @Override | ||||
public IWriter<Workbook> writer(Collection data) { | |||||
public IWriter<Workbook> write(Collection data) { | |||||
if (sheet.getLastRowNum() + data.size() > entity.getMaxNum()) { | if (sheet.getLastRowNum() + data.size() > entity.getMaxNum()) { | ||||
sheet = workbook.createSheet(); | sheet = workbook.createSheet(); | ||||
index = 0; | index = 0; | ||||
@@ -289,7 +289,7 @@ public class ExcelToHtmlService { | |||||
FileOutputStream fos = null; | FileOutputStream fos = null; | ||||
try { | try { | ||||
fos = new FileOutputStream(savefile); | fos = new FileOutputStream(savefile); | ||||
fos.writer(data); | |||||
fos.write(data); | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
LOGGER.error(e.getMessage(), e); | LOGGER.error(e.getMessage(), e); | ||||
} finally { | } finally { | ||||
@@ -184,7 +184,7 @@ public class StyleHelper { | |||||
* Outputs the appropriate CSS style for the given cell style. | * Outputs the appropriate CSS style for the given cell style. | ||||
* | * | ||||
* @param style The cell style. | * @param style The cell style. | ||||
* @param out The place to writer the output. | |||||
* @param out The place to write the output. | |||||
*/ | */ | ||||
void colorStyles(CellStyle style, Formatter out); | void colorStyles(CellStyle style, Formatter out); | ||||
@@ -23,7 +23,7 @@ public interface IWriter<T> { | |||||
* @param data | * @param data | ||||
* @return | * @return | ||||
*/ | */ | ||||
public IWriter<T> writer(Collection data); | |||||
public IWriter<T> write(Collection data); | |||||
/** | /** | ||||
* 关闭流,完成业务 | * 关闭流,完成业务 | ||||