From 1845f3070630c7b41de14ce77d343349f83eabcb Mon Sep 17 00:00:00 2001 From: lius <Lius2225@163.com> Date: 星期一, 07 八月 2023 16:48:46 +0800 Subject: [PATCH] update --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentShiftStatisticalProcessJob.java | 3 ++- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/GenerateWeekDaysJob.java | 3 ++- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentStatisticalProcessJob.java | 3 ++- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentTraceProcessJob.java | 3 ++- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/util/ThrowableUtil.java | 25 +++++++++++++++++++++++++ 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/GenerateWeekDaysJob.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/GenerateWeekDaysJob.java index bfa06db..86c61b1 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/GenerateWeekDaysJob.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/GenerateWeekDaysJob.java @@ -3,6 +3,7 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.common.util.DateUtils; import org.jeecg.modules.mdc.service.IMdcVacationManagementService; +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; @@ -46,7 +47,7 @@ quartzLog.setIsSuccess(0); } catch (Exception e) { quartzLog.setIsSuccess(-1); - quartzLog.setExceptionDetail(e.toString()); + quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); } long endTime = System.currentTimeMillis(); quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); 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..4f57a4f 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,6 +3,7 @@ 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; @@ -55,7 +56,7 @@ quartzLog.setIsSuccess(0); } catch (Exception e) { quartzLog.setIsSuccess(-1); - quartzLog.setExceptionDetail(e.toString()); + quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); } long endTime = System.currentTimeMillis(); quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentStatisticalProcessJob.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentStatisticalProcessJob.java index 19dc333..1f2dd6a 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentStatisticalProcessJob.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentStatisticalProcessJob.java @@ -3,6 +3,7 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.common.util.DateUtils; import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalInfoService; +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; @@ -55,7 +56,7 @@ quartzLog.setIsSuccess(0); } catch (Exception e) { quartzLog.setIsSuccess(-1); - quartzLog.setExceptionDetail(e.toString()); + quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); } long endTime = System.currentTimeMillis(); quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentTraceProcessJob.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentTraceProcessJob.java index 1bf9f08..6ac4170 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentTraceProcessJob.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentTraceProcessJob.java @@ -3,6 +3,7 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.common.util.DateUtils; import org.jeecg.modules.mdc.service.IMdcEquipmentRunningSectionService; +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; @@ -45,7 +46,7 @@ quartzLog.setIsSuccess(0); } catch (Exception e) { quartzLog.setIsSuccess(-1); - quartzLog.setExceptionDetail(e.toString()); + quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); } long endTime = System.currentTimeMillis(); quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/util/ThrowableUtil.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/util/ThrowableUtil.java new file mode 100644 index 0000000..a6a9908 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/util/ThrowableUtil.java @@ -0,0 +1,25 @@ +package org.jeecg.modules.mdc.util; + +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * 寮傚父宸ュ叿 + * + * @author: LiuS + * @create: 2023-08-07 16:42 + */ +public class ThrowableUtil { + + /** + * 鑾峰彇鍫嗘爤淇℃伅 + */ + public static String getStackTrace(Throwable throwable) { + StringWriter sw = new StringWriter(); + try (PrintWriter pw = new PrintWriter(sw)) { + throwable.printStackTrace(pw); + return sw.toString(); + } + } + +} -- Gitblit v1.9.3