提交代码

master
姜玉琦 2024-03-10 00:57:26 +08:00
parent 22054bf3ee
commit 7faf93f596
7 changed files with 33 additions and 58 deletions

View File

@ -10,11 +10,11 @@ chestnut:
# 演示模式开关 # 演示模式开关
demoMode: false demoMode: false
# 文件路径 示例( Windows配置D:/chestnut/uploadPathLinux配置 /home/chestnut/uploadPath # 文件路径 示例( Windows配置D:/chestnut/uploadPathLinux配置 /home/chestnut/uploadPath
uploadPath: 'E:/dev/workspace_chestnut/uploadPath' uploadPath: 'D:/dev/workspace_chestnut/uploadPath'
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
captchaType: math captchaType: math
member: member:
uploadPath: 'E:/dev/workspace_chestnut/_xy_member/' uploadPath: 'D:/dev/workspace_chestnut/_xy_member/'
# 开发环境配置 # 开发环境配置
server: server:
@ -73,13 +73,13 @@ spring:
data: data:
redis: redis:
# 地址 # 地址
host: 140.143.157.1 host: 127.0.0.1
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 15 database: 15
# 密码 # 密码
password: x7Zhj3twzSdDwx2A password: 123456
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:

View File

@ -9,8 +9,8 @@ chestnut:
system: system:
# 演示模式开关 # 演示模式开关
demoMode: true demoMode: true
# 文件路径 示例( Windows配置D:/chestnut/uploadPathLinux配置 /home/app/uploadPath # 文件路径 示例( Windows配置D:/chestnut/uploadPathLinux配置 /home/app/data
uploadPath: /home/app/uploadPath uploadPath: /home/app/data
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
captchaType: math captchaType: math
freemarker: freemarker:
@ -23,7 +23,7 @@ chestnut:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8090 # 服务器的HTTP端口默认为8090
port: 8090 port: 8081
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /
@ -72,13 +72,13 @@ spring:
data: data:
redis: redis:
# 地址 # 地址
host: 140.143.157.1 host: 127.0.0.1
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 15 database: 15
# 密码 # 密码
password: x7Zhj3twzSdDwx2A password: 123456
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -236,7 +236,7 @@ xxl:
### 执行器端口号 [选填]小于等于0则自动获取默认端口为9999单机部署多个执行器时注意要配置不同执行器端口 ### 执行器端口号 [选填]小于等于0则自动获取默认端口为9999单机部署多个执行器时注意要配置不同执行器端口
port: 9968 port: 9968
### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径; ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
logpath: E:/dev/workspace_chestnut/ChestnutCMS/chestnut-modules/chestnut-xxljob/jobhandler logpath: /home/app/logs/chestnut-modules/chestnut-xxljob/jobhandler
### 执行器日志文件保存天数 [选填] 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能默认30 ### 执行器日志文件保存天数 [选填] 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能默认30
logretentiondays: 30 logretentiondays: 30

View File

@ -1,28 +0,0 @@
package com.chestnut.member;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import com.chestnut.member.domain.Member;
import com.chestnut.member.service.IMemberExpConfigService;
import com.chestnut.member.service.IMemberService;
@SpringBootTest
public class MemberTest {
@Autowired
private IMemberService memberService;
@Autowired
private IMemberExpConfigService expConfigService;
@Test
void testMemberSignIn() {
Member member = this.memberService.getById(398339741712453L);
expConfigService.list().forEach(expConfig -> {
expConfigService.triggerExpOperation(expConfig.getOpType(), member.getMemberId());
});
}
}

View File

@ -100,9 +100,12 @@ public abstract class AsyncTask implements Runnable {
} else { } else {
this.setStatus(TaskStatus.FAILED); this.setStatus(TaskStatus.FAILED);
String err = e.getMessage(); String err = e.getMessage();
if (e instanceof GlobalException ge && ge.getErrorCode() != null) { if (e instanceof GlobalException) {
GlobalException ge = (GlobalException)e;
if(ge!=null && ge.getErrArgs()!=null){
err = I18nUtils.get(ge.getErrorCode().value(), LocaleContextHolder.getLocale(), ge.getErrArgs()); err = I18nUtils.get(ge.getErrorCode().value(), LocaleContextHolder.getLocale(), ge.getErrArgs());
} }
}
this.addErrorMessage(err); this.addErrorMessage(err);
} }
this.setPercent(100); this.setPercent(100);

View File

@ -21,7 +21,9 @@ public class AsyncTaskExceptionHandler implements AsyncUncaughtExceptionHandler
@Override @Override
public void handleUncaughtException(Throwable ex, Method method, Object... params) { public void handleUncaughtException(Throwable ex, Method method, Object... params) {
if (ArrayUtils.isNotEmpty(params) && params[0] instanceof AsyncTask task) { if (ArrayUtils.isNotEmpty(params) && params[0] instanceof AsyncTask) {
AsyncTask task = (AsyncTask)params[0];
if(task!=null){
task.setStatus(TaskStatus.FAILED); task.setStatus(TaskStatus.FAILED);
task.setEndTime(LocalDateTime.now()); task.setEndTime(LocalDateTime.now());
task.addErrorMessage(ex.getMessage()); task.addErrorMessage(ex.getMessage());
@ -29,4 +31,5 @@ public class AsyncTaskExceptionHandler implements AsyncUncaughtExceptionHandler
log.error("Async task failed{}", ex.getMessage()); log.error("Async task failed{}", ex.getMessage());
} }
} }
}
} }

View File

@ -71,13 +71,13 @@ public class ConvertUtils {
* @return * @return
*/ */
public static Boolean toBoolean(String str, boolean defaultV) { public static Boolean toBoolean(String str, boolean defaultV) {
return switch(str) { switch(str) {
case "true" -> Boolean.TRUE; case "true" : return Boolean.TRUE;
case "false" -> Boolean.FALSE; case "false" : return Boolean.FALSE;
case "1" -> Boolean.TRUE; case "1" : return Boolean.TRUE;
case "0" -> Boolean.FALSE; case "0" : return Boolean.FALSE;
default -> defaultV; default : return defaultV;
}; }
} }
public static Boolean toBoolean(Object obj, boolean defaultV) { public static Boolean toBoolean(Object obj, boolean defaultV) {

View File

@ -26,10 +26,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -170,7 +167,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
i18nDict.setLangKey("MENU.NAME." + menu.getMenuId()); i18nDict.setLangKey("MENU.NAME." + menu.getMenuId());
i18nDict.setLangTag(LocaleContextHolder.getLocale().toLanguageTag()); i18nDict.setLangTag(LocaleContextHolder.getLocale().toLanguageTag());
i18nDict.setLangValue(menu.getMenuName()); i18nDict.setLangValue(menu.getMenuName());
i18nDictService.batchSaveI18nDicts(List.of(i18nDict)); i18nDictService.batchSaveI18nDicts(Arrays.asList(i18nDict));
} }
private boolean checkMenuUnique(String menuName, Long parentId, Long menuId) { private boolean checkMenuUnique(String menuName, Long parentId, Long menuId) {