diff --git a/deploy.bat b/deploy.bat index 35b4a09..6d63d8b 100644 --- a/deploy.bat +++ b/deploy.bat @@ -1 +1 @@ -cmd /k mvn clean deploy -D skipTest \ No newline at end of file +cmd /k mvn clean deploy -Dmaven.test.skip=true -Dgpg.passphrase=jeecg123456 \ No newline at end of file diff --git a/easypoi-annotation/pom.xml b/easypoi-annotation/pom.xml index b6bdcb2..4b3681c 100644 --- a/easypoi-annotation/pom.xml +++ b/easypoi-annotation/pom.xml @@ -4,7 +4,7 @@ org.jeecg easypoi - 2.1.2 + 2.1.3-SNAPSHOT easypoi-annotation 基础注解类,解耦合 diff --git a/easypoi-annotation/src/main/java/org/jeecgframework/poi/excel/annotation/Excel.java b/easypoi-annotation/src/main/java/org/jeecgframework/poi/excel/annotation/Excel.java index 8093de7..80fee12 100644 --- a/easypoi-annotation/src/main/java/org/jeecgframework/poi/excel/annotation/Excel.java +++ b/easypoi-annotation/src/main/java/org/jeecgframework/poi/excel/annotation/Excel.java @@ -107,7 +107,7 @@ public @interface Excel { public String savePath() default "upload"; /** - * 导出类型 1 是文本 2 是图片,3是函数 默认是文本 ,4 String-Long型 + * 导出类型 1 是文本 2 是图片,3是函数 默认是文本 */ public int type() default 1; diff --git a/easypoi-base/pom.xml b/easypoi-base/pom.xml index e4981e5..0138ce8 100644 --- a/easypoi-base/pom.xml +++ b/easypoi-base/pom.xml @@ -4,7 +4,7 @@ org.jeecg easypoi - 2.1.2 + 2.1.3-SNAPSHOT easypoi-base diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/html/ExcelToHtmlServer.java b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/html/ExcelToHtmlServer.java index ee08039..657221c 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/html/ExcelToHtmlServer.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/html/ExcelToHtmlServer.java @@ -31,7 +31,7 @@ public class ExcelToHtmlServer { private int firstColumn; private int endColumn; private static final String COL_HEAD_CLASS = "colHeader"; - private static final String ROW_HEAD_CLASS = "rowHeader"; + //private static final String ROW_HEAD_CLASS = "rowHeader"; private static final String DEFAULTS_CLASS = "excelDefaults"; diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/imports/CellValueServer.java b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/imports/CellValueServer.java index 9b80a3d..9c85a69 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/imports/CellValueServer.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/imports/CellValueServer.java @@ -33,6 +33,7 @@ import org.jeecgframework.poi.excel.entity.sax.SaxReadCellEntity; import org.jeecgframework.poi.exception.excel.ExcelImportException; import org.jeecgframework.poi.exception.excel.enums.ExcelImportEnum; import org.jeecgframework.poi.handler.inter.IExcelDataHandler; +import org.jeecgframework.poi.util.PoiPublicUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -208,9 +209,9 @@ public class CellValueServer { if (result instanceof String) { return result; } - // 想要的结果是long - if (entity.getType() == 4 && result instanceof Double) { - result = String.valueOf(((Double) result).longValue()); + // double类型防止科学计数法 + if (result instanceof Double) { + return PoiPublicUtil.doubleToString((Double) result); } return String.valueOf(result); } diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/util/PoiPublicUtil.java b/easypoi-base/src/main/java/org/jeecgframework/poi/util/PoiPublicUtil.java index e750d67..ab7229f 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/util/PoiPublicUtil.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/util/PoiPublicUtil.java @@ -20,6 +20,7 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.math.BigDecimal; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; @@ -460,4 +461,18 @@ public final class PoiPublicUtil { object, paramsArr, ++index); } + /** + * double to String 防止科学计数法 + * @param value + * @return + */ + public static String doubleToString(Double value) { + String temp = value.toString(); + if (temp.contains("E")) { + BigDecimal bigDecimal = new BigDecimal(temp); + temp = bigDecimal.toPlainString(); + } + return temp; + } + } diff --git a/easypoi-web/pom.xml b/easypoi-web/pom.xml index 4b8b17a..9b23d61 100644 --- a/easypoi-web/pom.xml +++ b/easypoi-web/pom.xml @@ -4,7 +4,7 @@ org.jeecg easypoi - 2.1.2 + 2.1.3-SNAPSHOT easypoi-web diff --git a/pom.xml b/pom.xml index 7c964ca..e98245f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.jeecg easypoi - 2.1.2 + 2.1.3-SNAPSHOT pom easypoi @@ -38,7 +38,7 @@ - 2.1.2 + 2.1.3-SNAPSHOT 3.9 2.9.1 16.0.1