From b8a3bb8257cd2a5de0dc23994580892506a1b7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E4=BB=AA?= Date: Thu, 13 May 2021 16:17:28 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E7=94=A8string=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E6=95=B0=E5=AD=97=20=E5=8F=AF=E8=83=BD=E5=9B=9B=E8=88=8D?= =?UTF-8?q?=E4=BA=94=E5=85=A5=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../handlers/AbstractCellValueTagHandler.java | 2 +- .../easyexcel/test/temp/Lock2Test.java | 2 +- src/test/resources/dataformat/dataformat.xls | Bin 28672 -> 28672 bytes src/test/resources/dataformat/dataformat.xlsx | Bin 12192 -> 12460 bytes update.md | 3 +++ 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index d411ade1..9f1a4c72 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.alibaba easyexcel - 2.2.9 + 2.2.10 jar easyexcel diff --git a/src/main/java/com/alibaba/excel/analysis/v07/handlers/AbstractCellValueTagHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/handlers/AbstractCellValueTagHandler.java index f10fa5a4..580e6704 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/handlers/AbstractCellValueTagHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/handlers/AbstractCellValueTagHandler.java @@ -43,7 +43,7 @@ public abstract class AbstractCellValueTagHandler extends AbstractXlsxTagHandler break; } tempCellData.setType(CellDataTypeEnum.NUMBER); - tempCellData.setNumberValue(new BigDecimal(tempData.toString())); + tempCellData.setNumberValue(BigDecimal.valueOf(Double.parseDouble(tempDataString))); break; default: throw new IllegalStateException("Cannot set values now"); diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java index c3f7ea1b..92202642 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java @@ -34,7 +34,7 @@ public class Lock2Test { @Test public void test() throws Exception { // File file = TestFileUtil.readUserHomeFile("test/test6.xls"); - File file = new File("/Users/zhuangjiaju/Downloads/签到金模板-0507-v3.xlsx"); + File file = new File("/Users/zhuangjiaju/test/签到金模板-0507-v5.xlsx"); List list = EasyExcel.read(file).sheet(0).headRowNumber(0).doReadSync(); LOGGER.info("数据:{}", list.size()); diff --git a/src/test/resources/dataformat/dataformat.xls b/src/test/resources/dataformat/dataformat.xls index 5d0d7ff767dc57baa5fc429aed16570fc5751aa2..c8afd6461f3398c3405321a0358d024cf55f2719 100644 GIT binary patch delta 458 zcmZp8z}WDBaYGIZ8-oeFaMJ#Ph%CVb&u{>jED)Ha^h^LK7#*jgR;SK`>0|&zd zMj*w|#=ye3Ew5*in9jubWwLRK;^d$dnaKqy`h0>whcN)P2?8N2>*Td5!HmZ@Go~JAWa^LEd@n+p kak6Y$`{bOAyOXk9I2kIZJDzjD&d5BuFvECrLskPT075or9{>OV delta 304 zcmZp8z}WDBaYGIZ+lEgM-+p(VT*T7GloPZ07t1qtrWbyjAMvy?ZEoR@-75Mij{ zU_b&H3?ck05p} z<}jd)(dHmeRp!YPeAtX0+AuKi0EN7485l}|^lBh|4M_9bF)&y$GBCsd>2@G}3rMpv zF)*CA-+aPnE)UxqUj_!fh|P`Z(u|wiqIww_B{qx1xU+3;O-f;6JT>`MisEF!RI$nO zsce(gQ}y|T7=U^i7#W0skcnxsPI@qtKon5-BF4$l=_*V&qJivsrpX4G+b3nYa5nhn T0K?=uBlBd%OykWBSq-cJmMc{- diff --git a/src/test/resources/dataformat/dataformat.xlsx b/src/test/resources/dataformat/dataformat.xlsx index c207011836ae3b20c30ea1fc5912c0eaec0c564a..f77dd9fd35d736e487afb71af78b23c6877a9320 100644 GIT binary patch delta 5013 zcmY*dWn2?{)Eyu#Jvs#@qXtL_(k-JwP+A(KJ7kOoWz+^pqXHt*AT83}B_*{{lG5pT zeV+Hj^S=MD_niCXf6wopd)`}>Syu@W!y)KUgAQB(Ad&z8pa1{>fv!RU9^NiC9v&`` zKsVPyBMaR{VIVC3>)p$%R!JR{0jGfq?+l-tp*VpI=d2gAvW;WC^5O&RO~uqF{OeAR zSASAo`-P02Rr>_j^O2r{5oxAH8Ep6r#65lwXE=Li+xl|l)P9JhRV(qQpzEsOm#)9h zhJG1j$7cSZAOfUndmWgkQQ8DSpbkmCAfU?TLh5kGv_M=r;$`MYw5PpdC&zXQQX~2? z(VHNOn7lC%J=e&t0k{E2&uR%CfLbaCxM^HpowlxyQa?9V z5pJR5hmhEi@sOt~rIb~W(Wl!DSC24q3*8QqQ}n?l)4i;Oaa9+H<`FA&_fInl{Whi< z?_mbErT2zuUq``kAKSqfZDo#_Ct3}Ea-Sajs?mJib)Y&eb(pB0`<|Ul8uo-KptlQ! z36zv$%)56a8Yj{kb;K&rfL8I}>mGgRjC@tQ_%zM**@UXnj&XlA&j3*p z&m0QGizfK|5gn$WL{vfBa2_$vIn8-w;;;D{&Hvk>S0~5y+x&>Jv{bh!Ci4QmEOWQF zIYLa9pbTf>iBc7uTCUN;QtNfD3w6{`d?_#tsgG#opo({j8%#G+o#sj@0gHWx zvvE$x%d;jyERKdX%>${Y;B%nYDC_MKJ-2XvO{k( zKxJbMVGx@?az{tbUb~+YW#Br*U=Otc{}dz3aTvA7(*Z>hIqpuFLknYq^Sk5j-}92_ z)zJmlVZ8=-Lg8i$ak7nc3%alm;M;NES054Wo$LEO15>;o!Qc$i4kXX*%gU3Ej0FmI zbGXoqz}6Zt^bjWDaN9eO-&RUs^zM0^oN)rj{@v*_agxhv`YV>(lh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y*h~T1j799t{Ob5 z&X_IJu68#?S$EDpd!!M1S(@rIh%vD}VXiiCv?wxcR&ioGc}G1$4K9)qM>$(sTJ97( zAjATETQDhr*U!@uoQgT8UPNTt{2IU#xGGuX;jR8WBY`Y2hi+%a3wLAX5%UdDp?#3> z`hs0{D5IcU3Pf)Rd8`KUdSV-{&a?IiZIpb;(-As=)w zr}L}BV>U4;@rU-w*y%$By`Z6E5Brny)#Fc_QXJc_z?i3w##|X*^DAP{3H?4}JZC55 z8tRE}2X?(8C6EmOWFv=`WG~Vsl0Ai5zEpvnOZ?+A6m5+|`cZma|=L*FAFXX~XxYVCuz>c}t zY5v1D0D$sO^8N2nQo&GMWH5DZGMfLJ#Xo!p{7>xJc diff --git a/update.md b/update.md index ef085dab..f2d889a4 100644 --- a/update.md +++ b/update.md @@ -1,3 +1,6 @@ +# 2.2.10 +* 修复读取的时候用string接收数字 可能四舍五入不一致的bug + # 2.2.9 * 修复读取的时候用string接收数字 可能四舍五入不一致的bug