diff --git a/CHANGELOG.md b/CHANGELOG.md index 2015b7800..a1dfb24f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ * 【extra 】 增加ValidationUtil(pr#207@Gitee) * 【core 】 反射调用支持传递参数的值为null(pr#1205@Github) * 【core 】 HexUtil增加format方法(issue#I245NF@Gitee) +* 【poi 】 ExcelWriter增加setCurrentRowToEnd方法(issue#I24A2R@Gitee) +* 【core 】 ExcelWriter增加setCurrentRowToEnd方法(issue#I24A2R@Gitee) ### Bug修复 * 【core 】 修复DateUtil.current使用System.nanoTime的问题(issue#1198@Github) diff --git a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java b/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java index 8f61aeb5d..c1bbdea85 100644 --- a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java @@ -782,7 +782,7 @@ public class URLUtil { * @since 5.3.11 */ public static String getDataUriBase64(String mimeType, String data) { - return getDataUri(mimeType, null, "BASE64", data); + return getDataUri(mimeType, null, "base64", data); } /** diff --git a/hutool-core/src/test/java/cn/hutool/core/text/csv/CsvReaderTest.java b/hutool-core/src/test/java/cn/hutool/core/text/csv/CsvReaderTest.java index 0db3d8142..4de1f22c3 100644 --- a/hutool-core/src/test/java/cn/hutool/core/text/csv/CsvReaderTest.java +++ b/hutool-core/src/test/java/cn/hutool/core/text/csv/CsvReaderTest.java @@ -16,7 +16,9 @@ public class CsvReaderTest { public void readTest() { CsvReader reader = new CsvReader(); CsvData data = reader.read(ResourceUtil.getReader("test.csv", CharsetUtil.CHARSET_UTF_8)); - Assert.assertEquals("关注\"对象\"", data.getRow(0).get(2)); + Assert.assertEquals("sss,sss", data.getRow(0).get(0)); + Assert.assertEquals("性别", data.getRow(0).get(2)); + Assert.assertEquals("关注\"对象\"", data.getRow(0).get(3)); } @Test diff --git a/hutool-core/src/test/resources/test.csv b/hutool-core/src/test/resources/test.csv index 597f1ebbc..a22b8335f 100644 --- a/hutool-core/src/test/resources/test.csv +++ b/hutool-core/src/test/resources/test.csv @@ -1 +1 @@ -姓名,"性别",关注"对象",年龄 \ No newline at end of file +"sss,sss",姓名,"性别",关注"对象",年龄 \ No newline at end of file diff --git a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java b/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java index b484bfa69..46dda3f2c 100644 --- a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java +++ b/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java @@ -392,6 +392,15 @@ public class ExcelWriter extends ExcelBase { return this; } + /** + * 定位到最后一行的后边,用于追加数据 + * @return this + * @since 5.5.0 + */ + public ExcelWriter setCurrentRowToEnd(){ + return setCurrentRow(getRowCount()); + } + /** * 跳过当前行 *