From 334be32dd50dfd3d4b72166a81c05876992f9721 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Mon, 22 Jul 2024 10:32:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AE=A1=E6=8E=A7=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E9=94=99=E8=AF=AF=20=E5=8F=96=E6=B6=88=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=AE=9A=E6=97=B6=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/zc/business/controller/DcMYSQLJob.java | 6 +++--- .../com/zc/business/interfaces/OperationLogAspect.java | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcMYSQLJob.java b/zc-business/src/main/java/com/zc/business/controller/DcMYSQLJob.java index e0e576fc..ae129197 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcMYSQLJob.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcMYSQLJob.java @@ -35,7 +35,7 @@ public class DcMYSQLJob { // this.environment = environment; //} - @Scheduled(cron = "0 0 22 * * ?") + //@Scheduled(cron = "0 0 22 * * ?") //@Scheduled(cron = "0 10 * * * ?") public void backupAthena() throws IOException { //String url = "jdbc:mysql://10.0.111.11:3306/athena?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true"; @@ -43,7 +43,7 @@ public class DcMYSQLJob { extracted(UniversalEnum.ATHENA.getValue(), "athena"); } - @Scheduled(cron = "0 30 22 * * ?") + //@Scheduled(cron = "0 30 22 * * ?") //@Scheduled(cron = "0 20 * * * ?") public void backupJiHeDC() throws IOException { // 数据库配置信息 @@ -52,7 +52,7 @@ public class DcMYSQLJob { extracted(UniversalEnum.JIHE_DC.getValue(), "jihe-dc"); } - @Scheduled(cron = "0 0 23 * * ?") + //@Scheduled(cron = "0 0 23 * * ?") //@Scheduled(cron = "0 30 * * * ?") public void backupJiHeDCPro() throws IOException { // 数据库配置信息 diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index 0ccd7215..ef315c2e 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -469,9 +469,10 @@ public class OperationLogAspect { if (loginUser != null) { SysDept sysDept = deptService.selectDeptById(loginUser.getDeptId()); - + if (sysDept != null) { + operLog.setDeptName(sysDept.getDeptName()); + } operLog.setOperName(loginUser.getUsername()); - operLog.setDeptName(sysDept.getDeptName()); operLog.setOperLocation(loginUser.getLoginLocation()); operLog.setOperType(UniversalEnum.TWO.getValue()); } else { @@ -592,8 +593,10 @@ public class OperationLogAspect { if (loginUser != null) { SysDept sysDept = deptService.selectDeptById(loginUser.getDeptId()); + if (sysDept != null) { + operLog.setDeptName(sysDept.getDeptName()); + } operLog.setOperName(loginUser.getUsername()); - operLog.setDeptName(sysDept.getDeptName()); operLog.setOperLocation(loginUser.getLoginLocation()); operLog.setOperType(UniversalEnum.ZERO.getValue()); } else {