mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-03-11 03:06:53 +08:00
Compare commits
4 Commits
c5cd75fe17
...
c600cb7ac1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c600cb7ac1 | ||
|
|
6a074c8832 | ||
|
|
fefad4e147 | ||
|
|
316117524d |
2
pom.xml
2
pom.xml
@@ -28,7 +28,7 @@
|
||||
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||
<commons.io.version>2.21.0</commons.io.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<fastjson.version>2.0.60</fastjson.version>
|
||||
<fastjson.version>2.0.61</fastjson.version>
|
||||
<jjwt.version>0.9.1</jjwt.version>
|
||||
<minio.version>8.2.2</minio.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
|
||||
@@ -53,7 +53,7 @@ public class SecurityContextHolder
|
||||
|
||||
public static Long getUserId()
|
||||
{
|
||||
return Convert.toLong(get(SecurityConstants.DETAILS_USER_ID), 0L);
|
||||
return Convert.toLong(get(SecurityConstants.DETAILS_USER_ID), null);
|
||||
}
|
||||
|
||||
public static void setUserId(String account)
|
||||
|
||||
@@ -79,6 +79,11 @@ public class ExcelUtil<T>
|
||||
|
||||
public static final String[] FORMULA_STR = { "=", "-", "+", "@" };
|
||||
|
||||
/**
|
||||
* 单元格样式缓存
|
||||
*/
|
||||
private Map<String, CellStyle> cellStyleCache = new HashMap<String, CellStyle>();
|
||||
|
||||
/**
|
||||
* Excel sheet最大行数,默认65536
|
||||
*/
|
||||
@@ -976,7 +981,7 @@ public class ExcelUtil<T>
|
||||
* 添加单元格
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public Cell addCell(Excel attr, Row row, T vo, Field field, int column)
|
||||
public Cell addCell(Excel attr, Row row, T vo, Field field, int column)
|
||||
{
|
||||
Cell cell = null;
|
||||
try
|
||||
@@ -1043,9 +1048,16 @@ public class ExcelUtil<T>
|
||||
*/
|
||||
private CellStyle createCellStyle(CellStyle cellStyle, String format)
|
||||
{
|
||||
String key = cellStyle.getIndex() + "|" + format;
|
||||
CellStyle cached = cellStyleCache.get(key);
|
||||
if (cached != null)
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
CellStyle style = wb.createCellStyle();
|
||||
style.cloneStyleFrom(cellStyle);
|
||||
style.setDataFormat(wb.getCreationHelper().createDataFormat().getFormat(format));
|
||||
cellStyleCache.put(key, style);
|
||||
return style;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user