From ed48aa9f30a87c528f071d06bf6b59d7d15428e9 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期一, 26 五月 2025 16:12:55 +0800 Subject: [PATCH] 点检报表后端 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentShiftStatisticalProcessJob.java | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentShiftStatisticalProcessJob.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentShiftStatisticalProcessJob.java index 78b6562..3203329 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentShiftStatisticalProcessJob.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentShiftStatisticalProcessJob.java @@ -3,13 +3,16 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.common.util.DateUtils; import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalShiftInfoService; +import org.jeecg.modules.mdc.util.ThrowableUtil; import org.jeecg.modules.quartz.entity.QuartzJob; import org.jeecg.modules.quartz.entity.SysQuartzLog; import org.jeecg.modules.quartz.service.IQuartzJobService; import org.jeecg.modules.quartz.service.ISysQuartzLogService; +import org.jeecg.modules.system.service.ISysAnnouncementService; import org.quartz.*; import javax.annotation.Resource; +import java.util.Date; import java.util.List; /** @@ -17,8 +20,6 @@ * @author: LiuS * @create: 2023-07-24 10:26 */ -@PersistJobDataAfterExecution -@DisallowConcurrentExecution @Slf4j public class RunningAllEquipmentShiftStatisticalProcessJob implements Job { @@ -40,9 +41,13 @@ @Resource private IQuartzJobService quartzJobService; + @Resource + private ISysAnnouncementService sysAnnouncementService; + @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { SysQuartzLog quartzLog = new SysQuartzLog(); + quartzLog.setCreateTime(new Date()); List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); if (byJobClassName != null && !byJobClassName.isEmpty()) { quartzLog.setJobId(byJobClassName.get(0).getId()); @@ -55,7 +60,9 @@ quartzLog.setIsSuccess(0); } catch (Exception e) { quartzLog.setIsSuccess(-1); - quartzLog.setExceptionDetail(e.toString()); + quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); + // 鍙戦�佹秷鎭�氱煡 + sysAnnouncementService.jobSendMessage("瀹氭椂缁熻鍗曟棩鐝鏁版嵁浠诲姟", quartzLog.getExceptionDetail()); } long endTime = System.currentTimeMillis(); quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); -- Gitblit v1.9.3