Compare commits

...

2 Commits

Author SHA1 Message Date
丁磊
db575be748 // 移除占位符对应的值为空或null的占位符//日期格式化 2025-02-11 16:16:10 +08:00
曾文豪
f8d7e49290 publish 2.0.18
All checks were successful
/ local-deploy (push) Successful in 19s
2024-12-13 20:20:29 +08:00
12 changed files with 42 additions and 27 deletions

18
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>springboot-parent</name> <name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description> <description>杭州铁晟科技有限公司基础依赖</description>
@@ -58,49 +58,49 @@
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-database</artifactId> <artifactId>springboot-database</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-role</artifactId> <artifactId>springboot-role</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -6,11 +6,11 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-ademo</artifactId> <artifactId>springboot-ademo</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-database</artifactId> <artifactId>springboot-database</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-role</artifactId> <artifactId>springboot-role</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.17</version> <version>2.0.18</version>
</parent> </parent>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>

View File

@@ -1,6 +1,7 @@
package com.tiesheng.web.config.operation; package com.tiesheng.web.config.operation;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@@ -19,6 +20,7 @@ import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Date;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@@ -100,6 +102,18 @@ public class OperationAspect {
subject = (StrUtil.isEmpty(insertVal) ? "添加" : "编辑") + subject; subject = (StrUtil.isEmpty(insertVal) ? "添加" : "编辑") + subject;
} }
for (String key : allParams.keySet()) {
Object value = allParams.get(key);
if (value == null || StrUtil.isEmpty(value.toString())) {
// 移除占位符对应的值为空或null的占位符
String placeholder = "{" + key + "}";
subject = subject.replace(placeholder, "");
} else if (value instanceof Date) {
//日期格式化
allParams.put(key, DateUtil.format((Date) value,"yyyy-MM-dd HH:mm:ss"));
}
}
// 占位符处理 // 占位符处理
subject = StrUtil.format(subject, allParams); subject = StrUtil.format(subject, allParams);
} else { } else {

View File

@@ -68,19 +68,20 @@ public class CoreConfigService extends TsServiceBase<CoreConfigSystemMapper, Cor
* @param dto * @param dto
*/ */
public void updateConfigSystem(ConfigSystemDTO dto) { public void updateConfigSystem(ConfigSystemDTO dto) {
CoreConfigSystem configKey = getOneByColumn("config_key", dto.getConfigKey()); CoreConfigSystem coreConfigSystem = getOneByColumn("config_key", dto.getConfigKey());
if (configKey == null) { if (coreConfigSystem == null) {
throw new ApiException("该配置不存在,请检查"); throw new ApiException("该配置不存在,请检查");
} }
if (configKey.getReadOnly() == 1) { if (coreConfigSystem.getReadOnly() == 1) {
throw new ApiException("该配置只读,不可修改"); throw new ApiException("该配置只读,不可修改");
} }
configKey.setConfigVal(dto.getConfigVal()); coreConfigSystem.setConfigVal(dto.getConfigVal());
configKey.setRemark(dto.getRemark()); coreConfigSystem.setRemark(dto.getRemark());
configKey.setExtra(dto.getExtra()); coreConfigSystem.setExtra(dto.getExtra());
updateById(configKey); updateById(coreConfigSystem);
tsCacheService.putObj(CONFIG_SYSTEM_PREFIX + configKey, configKey, 10 * 60); tsCacheService.putObj(CONFIG_SYSTEM_PREFIX + coreConfigSystem.getConfigKey(),
coreConfigSystem, 10 * 60);
} }