|
@@ -23,13 +23,13 @@ public class SysConfigService {
|
|
|
return sysConfigRepo.findAll(JpaUtils.toSpecification(pageQuery, SysConfig.class), JpaUtils.toPageRequest(pageQuery));
|
|
return sysConfigRepo.findAll(JpaUtils.toSpecification(pageQuery, SysConfig.class), JpaUtils.toPageRequest(pageQuery));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Cacheable("SysConfigServiceGetBigDecimal")
|
|
|
|
|
|
|
+// @Cacheable("SysConfigServiceGetBigDecimal")
|
|
|
public BigDecimal getBigDecimal(String name) {
|
|
public BigDecimal getBigDecimal(String name) {
|
|
|
return sysConfigRepo.findByName(name).map(sysConfig -> new BigDecimal(sysConfig.getValue()))
|
|
return sysConfigRepo.findByName(name).map(sysConfig -> new BigDecimal(sysConfig.getValue()))
|
|
|
.orElse(BigDecimal.ZERO);
|
|
.orElse(BigDecimal.ZERO);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Cacheable("SysConfigServiceGetTime")
|
|
|
|
|
|
|
+// @Cacheable("SysConfigServiceGetTime")
|
|
|
public LocalTime getTime(String name) {
|
|
public LocalTime getTime(String name) {
|
|
|
String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
|
|
String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
|
|
|
.orElseThrow(new BusinessException("配置不存在"));
|
|
.orElseThrow(new BusinessException("配置不存在"));
|
|
@@ -37,14 +37,14 @@ public class SysConfigService {
|
|
|
return LocalTime.from(dateTimeFormatter.parse(str));
|
|
return LocalTime.from(dateTimeFormatter.parse(str));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Cacheable("SysConfigServiceGetBoolean")
|
|
|
|
|
|
|
+// @Cacheable("SysConfigServiceGetBoolean")
|
|
|
public boolean getBoolean(String name) {
|
|
public boolean getBoolean(String name) {
|
|
|
String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
|
|
String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
|
|
|
.orElseThrow(new BusinessException("配置不存在"));
|
|
.orElseThrow(new BusinessException("配置不存在"));
|
|
|
return str.equals("1");
|
|
return str.equals("1");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Cacheable("SysConfigServiceGetInt")
|
|
|
|
|
|
|
+// @Cacheable("SysConfigServiceGetInt")
|
|
|
public int getInt(String name) {
|
|
public int getInt(String name) {
|
|
|
String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
|
|
String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
|
|
|
.orElseThrow(new BusinessException("配置不存在"));
|
|
.orElseThrow(new BusinessException("配置不存在"));
|