Compare commits

...

3 Commits

Author SHA1 Message Date
MicyToy 69e226de74
Pre Merge pull request !1128 from MicyToy/enhance/profile 2026-01-06 05:53:18 +00:00
RuoYi 1f2f11f80f 修复Excel自定义格式样式污染问题 2026-01-06 13:53:11 +08:00
MicyToy 0a2db84392
优化配置文件
使用include的方式引入druid,仍然可以通过active覆盖。
修改logback和profile的配置,解决各平台配置方式不统一。

Signed-off-by: MicyToy <jhkonka@live.cn>
2025-12-22 08:02:20 +00:00
3 changed files with 19 additions and 4 deletions

View File

@ -7,7 +7,7 @@ ruoyi:
# 版权年份
copyrightYear: 2026
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
profile: ${user.home}/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
@ -52,7 +52,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
include: druid
# 文件上传
servlet:
multipart:

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" />
<property name="log.path" value="${user.home}/ruoyi/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />

View File

@ -1153,7 +1153,7 @@ public class ExcelUtil<T>
String dictType = attr.dictType();
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
{
cell.getCellStyle().setDataFormat(this.wb.getCreationHelper().createDataFormat().getFormat(dateFormat));
cell.setCellStyle(createCellStyle(cell.getCellStyle(), dateFormat));
cell.setCellValue(parseDateToStr(dateFormat, value));
}
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
@ -1192,6 +1192,21 @@ public class ExcelUtil<T>
return cell;
}
/**
* 使
*
* @param cellStyle
* @param format
* @return CellStyle
*/
private CellStyle createCellStyle(CellStyle cellStyle, String format)
{
CellStyle style = wb.createCellStyle();
style.cloneStyleFrom(cellStyle);
style.setDataFormat(wb.getCreationHelper().createDataFormat().getFormat(format));
return style;
}
/**
* POI XSSFSheet
*