From 62eec4df5194b0eb566a2746f1570c6f8112c2f9 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Fri, 09 Sep 2022 10:26:55 +0800
Subject: [PATCH] 删除多余的style重复赋值
---
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
index 3c6fc3e..681f6cd 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
@@ -681,7 +681,6 @@
if (!headerStyles.containsKey(key))
{
CellStyle style = wb.createCellStyle();
- style = wb.createCellStyle();
style.cloneStyleFrom(styles.get("data"));
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
@@ -715,7 +714,6 @@
if (!styles.containsKey(key))
{
CellStyle style = wb.createCellStyle();
- style = wb.createCellStyle();
style.setAlignment(excel.align());
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setBorderRight(BorderStyle.THIN);
@@ -866,7 +864,7 @@
{
// 创建cell
cell = row.createCell(column);
- if (isSubListValue(vo) && attr.needMerge())
+ if (isSubListValue(vo) && getListCellValue(vo).size() > 1 && attr.needMerge())
{
CellRangeAddress cellAddress = new CellRangeAddress(subMergedFirstRowNum, subMergedLastRowNum, column, column);
sheet.addMergedRegion(cellAddress);
@@ -888,7 +886,7 @@
}
else if (value instanceof BigDecimal && -1 != attr.scale())
{
- cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).toString());
+ cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).doubleValue());
}
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
{
--
Gitblit v1.9.3