From b50a43845b2b05198c93b573a2e1bdc0c80a6b8c Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期五, 03 一月 2025 11:29:47 +0800
Subject: [PATCH] 增加压缩空气月指标执行任务

---
 shasteel-biz/src/main/java/com/iailab/module/shasteel/job/utils/ScheduleUtils.java |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/utils/ScheduleUtils.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/utils/ScheduleUtils.java
index 4f1c9f0..0433c16 100644
--- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/utils/ScheduleUtils.java
+++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/utils/ScheduleUtils.java
@@ -2,7 +2,6 @@
 
 import com.iailab.framework.common.constant.Constant;
 import com.iailab.framework.common.enums.ErrorCode;
-import com.iailab.framework.common.exception.ServerException;
 import com.iailab.module.shasteel.job.entity.ScheduleJobEntity;
 import org.quartz.*;
 
@@ -39,7 +38,7 @@
         try {
             return (CronTrigger) scheduler.getTrigger(getTriggerKey(jobId));
         } catch (SchedulerException e) {
-            throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage());
+            throw new RuntimeException("获取表达式触发器异常", e);
         }
     }
 
@@ -68,7 +67,7 @@
             	pauseJob(scheduler, scheduleJob.getId());
             }
         } catch (SchedulerException e) {
-            throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage());
+            throw new RuntimeException("创建定时任务异常", e);
         }
     }
     
@@ -99,7 +98,7 @@
             }
             
         } catch (SchedulerException e) {
-            throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage());
+            throw new RuntimeException("更新定时任务异常", e);
         }
     }
 
@@ -114,7 +113,7 @@
         	
             scheduler.triggerJob(getJobKey(scheduleJob.getId()), dataMap);
         } catch (SchedulerException e) {
-            throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage());
+            throw new RuntimeException("立即执行任务异常", e);
         }
     }
 
@@ -125,7 +124,7 @@
         try {
             scheduler.pauseJob(getJobKey(jobId));
         } catch (SchedulerException e) {
-            throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage());
+            throw new RuntimeException("暂停任务异常", e);
         }
     }
 
@@ -136,7 +135,7 @@
         try {
             scheduler.resumeJob(getJobKey(jobId));
         } catch (SchedulerException e) {
-            throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage());
+            throw new RuntimeException("恢复任务异常", e);
         }
     }
 
@@ -147,7 +146,7 @@
         try {
             scheduler.deleteJob(getJobKey(jobId));
         } catch (SchedulerException e) {
-            throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage());
+            throw new RuntimeException("删除定时任务异常", e);
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3