From fdf82d2479dbfbd2a68cc8ebb8a409279edef3e7 Mon Sep 17 00:00:00 2001 From: zhengjie <201507802@qq.com> Date: Fri, 29 Jan 2021 15:04:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96](v2.6?= =?UTF-8?q?)=EF=BC=9A=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E9=82=AE=E7=AE=B1=E4=BC=98=E5=8C=96=EF=BC=8C=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E4=B8=BA=E7=A9=BA=E4=B8=8D=E8=B0=83=E7=94=A8=E5=8F=91?= =?UTF-8?q?=E9=80=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/zhengjie/modules/quartz/utils/ExecutionJob.java | 7 ++++--- pom.xml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java index 798f9c35..8e261850 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java @@ -42,7 +42,6 @@ import java.util.concurrent.*; * @date 2019-01-07 */ @Async -@SuppressWarnings({"unchecked","all"}) public class ExecutionJob extends QuartzJobBean { /** 该处仅供参考 */ @@ -108,8 +107,10 @@ public class ExecutionJob extends QuartzJobBean { if(quartzJob.getEmail() != null){ EmailService emailService = SpringContextHolder.getBean(EmailService.class); // 邮箱报警 - EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e)); - emailService.send(emailVo, emailService.find()); + if(StringUtils.isNoneBlank(quartzJob.getEmail())){ + EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e)); + emailService.send(emailVo, emailService.find()); + } } } finally { quartzLogRepository.save(log); diff --git a/pom.xml b/pom.xml index b8fe4a46..a69c5d0d 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 1.16 2.9.2 1.2.70 - 1.1.22 + 1.1.24 2.5.0 1.3.1.Final From 0b83ca0646f9c983a3958c88d1e79c527c644a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9A=86=E9=9D=9E?= <53246310+jiefei30@users.noreply.github.com> Date: Sun, 31 Jan 2021 14:15:21 +0800 Subject: [PATCH 2/4] fix findByDeptRoleId sql in UserRepository when delete dept cache (#572) --- .../zhengjie/modules/system/repository/UserRepository.java | 6 +++--- .../modules/system/service/impl/DeptServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java index 99ea5afc..c5c88a8d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java @@ -81,12 +81,12 @@ public interface UserRepository extends JpaRepository, JpaSpecificat /** * 根据角色中的部门查询 - * @param id / + * @param deptId / * @return / */ @Query(value = "SELECT u.* FROM sys_user u, sys_users_roles r, sys_roles_depts d WHERE " + - "u.user_id = r.user_id AND r.role_id = d.role_id AND r.role_id = ?1 group by u.user_id", nativeQuery = true) - List findByDeptRoleId(Long id); + "u.user_id = r.user_id AND r.role_id = d.role_id AND d.dept_id = ?1 group by u.user_id", nativeQuery = true) + List findByRoleDeptId(Long deptId); /** * 根据菜单查询 diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java index 12c13fed..8c7c331a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java @@ -273,7 +273,7 @@ public class DeptServiceImpl implements DeptService { * @param id / */ public void delCaches(Long id){ - List users = userRepository.findByDeptRoleId(id); + List users = userRepository.findByRoleDeptId(id); // 删除数据权限 redisUtils.delByKeys(CacheKey.DATA_USER, users.stream().map(User::getId).collect(Collectors.toSet())); redisUtils.del(CacheKey.DEPT_ID + id); From 5381ac38ce941cd8c8df9b9f0b4744a674bd255f Mon Sep 17 00:00:00 2001 From: sick-cat <31824316+sick-cat@users.noreply.github.com> Date: Sun, 31 Jan 2021 14:16:21 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=EF=BC=8C=E6=89=BE=E4=B8=8D=E5=88=B0=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=9A=84=E4=B8=B4=E6=97=B6=E6=96=87=E4=BB=B6=E3=80=82=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84=20(#580)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: yanzhao.jia --- eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java b/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java index 10ccd712..bf23eff9 100644 --- a/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java +++ b/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java @@ -95,7 +95,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil { File file = null; try { // 用uuid作为文件名,防止生成的临时文件重复 - file = File.createTempFile(IdUtil.simpleUUID(), prefix); + file = new File(SYS_TEM_DIR + IdUtil.simpleUUID() + prefix); // MultipartFile to File multipartFile.transferTo(file); } catch (IOException e) { From e4e318aa4e090199a97228cb1d9f3048550623a4 Mon Sep 17 00:00:00 2001 From: zhengjie <201507802@qq.com> Date: Mon, 1 Feb 2021 20:51:16 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96](v2.6?= =?UTF-8?q?)=EF=BC=9Adruid=20=E9=85=8D=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/config/application-dev.yml | 15 +++++++++++---- .../main/resources/config/application-prod.yml | 10 +++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/eladmin-system/src/main/resources/config/application-dev.yml b/eladmin-system/src/main/resources/config/application-dev.yml index 65d5aa71..c8bf11f1 100644 --- a/eladmin-system/src/main/resources/config/application-dev.yml +++ b/eladmin-system/src/main/resources/config/application-dev.yml @@ -10,19 +10,26 @@ spring: # 初始连接数 initial-size: 5 # 最小连接数 - min-idle: 10 + min-idle: 15 # 最大连接数 - max-active: 20 + max-active: 30 + # 是否自动回收超时连接 + remove-abandoned: true + # 超时时间(以秒数为单位) + remove-abandoned-timeout: 180 # 获取连接超时时间 - max-wait: 5000 + max-wait: 3000 # 连接有效性检测时间 time-between-eviction-runs-millis: 60000 # 连接在池中最小生存的时间 min-evictable-idle-time-millis: 300000 # 连接在池中最大生存的时间 max-evictable-idle-time-millis: 900000 + # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除 test-while-idle: true - test-on-borrow: false + # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个 + test-on-borrow: true + # 是否在归还到池中前进行检验 test-on-return: false # 检测连接是否有效 validation-query: select 1 diff --git a/eladmin-system/src/main/resources/config/application-prod.yml b/eladmin-system/src/main/resources/config/application-prod.yml index ced1f592..4b513e22 100644 --- a/eladmin-system/src/main/resources/config/application-prod.yml +++ b/eladmin-system/src/main/resources/config/application-prod.yml @@ -10,9 +10,9 @@ spring: # 初始连接数 initial-size: 5 # 最小连接数 - min-idle: 10 + min-idle: 15 # 最大连接数 - max-active: 20 + max-active: 30 # 获取连接超时时间 max-wait: 5000 # 连接有效性检测时间 @@ -21,8 +21,11 @@ spring: min-evictable-idle-time-millis: 300000 # 连接在池中最大生存的时间 max-evictable-idle-time-millis: 900000 + # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除 test-while-idle: true - test-on-borrow: false + # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个 + test-on-borrow: true + # 是否在归还到池中前进行检验 test-on-return: false # 检测连接是否有效 validation-query: select 1 @@ -31,6 +34,7 @@ spring: enabled: true stat-view-servlet: enabled: true + # 控制台管理用户名和密码 url-pattern: /druid/* reset-enable: false login-username: admin