Commit 7593c888 by huangfusuper

日志保存结果规范化

parent 47a3f51f
package com.byit.task; package com.byit.task;
import com.byit.conf.MythJobAutoConfigure; import com.byit.conf.MythJobAutoConfigure;
import com.byit.enums.EmailEnum;
import com.byit.enums.NodePropertyEnum; import com.byit.enums.NodePropertyEnum;
import com.byit.enums.NodeRunStatusPropertyEnum;
import com.byit.job.dto.DispatchResponseDto; import com.byit.job.dto.DispatchResponseDto;
import com.byit.job.dto.ScriptDto; import com.byit.job.dto.ScriptDto;
import com.byit.job.enums.JobResultEnum; import com.byit.job.enums.JobResultEnum;
...@@ -59,8 +61,8 @@ public class ScriptExecutorJobTask implements TimerTask { ...@@ -59,8 +61,8 @@ public class ScriptExecutorJobTask implements TimerTask {
/** /**
* 校验工作流是否被杀死 * 校验工作流是否被杀死
* @param flowId * @param flowId 工作流ID
* @param runId * @param runId 运行标识
* @return * @return
*/ */
private boolean checkFlowStatusIsKill(Integer flowId,String runId){ private boolean checkFlowStatusIsKill(Integer flowId,String runId){
...@@ -74,7 +76,7 @@ public class ScriptExecutorJobTask implements TimerTask { ...@@ -74,7 +76,7 @@ public class ScriptExecutorJobTask implements TimerTask {
/** /**
* 运行任务 * 运行任务
* @param mythJobTaskSchedule * @param mythJobTaskSchedule 运行的排期表
*/ */
private void runJob(JobTaskSchedule mythJobTaskSchedule) { private void runJob(JobTaskSchedule mythJobTaskSchedule) {
RunScriptService runScriptService = SpringUtil.getBean(RunScriptService.class); RunScriptService runScriptService = SpringUtil.getBean(RunScriptService.class);
...@@ -121,7 +123,7 @@ public class ScriptExecutorJobTask implements TimerTask { ...@@ -121,7 +123,7 @@ public class ScriptExecutorJobTask implements TimerTask {
jobTaskRunLog.setLogId(mythJobTaskSchedule.getLogId()); jobTaskRunLog.setLogId(mythJobTaskSchedule.getLogId());
jobTaskRunLog.setVersionName(mythJobTaskSchedule.getVersionName()); jobTaskRunLog.setVersionName(mythJobTaskSchedule.getVersionName());
jobTaskRunLog.setRunType("2"); jobTaskRunLog.setRunType("1");
jobTaskRunLog.setJobType(mythJobTaskSchedule.getJobType()); jobTaskRunLog.setJobType(mythJobTaskSchedule.getJobType());
jobTaskRunLog.setHandlerName(mythJobTaskSchedule.getHandlerName()); jobTaskRunLog.setHandlerName(mythJobTaskSchedule.getHandlerName());
jobTaskRunLog.setTriggerTime(new Date()); jobTaskRunLog.setTriggerTime(new Date());
...@@ -131,8 +133,8 @@ public class ScriptExecutorJobTask implements TimerTask { ...@@ -131,8 +133,8 @@ public class ScriptExecutorJobTask implements TimerTask {
Date thisTime = new Date(); Date thisTime = new Date();
jobTaskRunLog.setStartTime(thisTime); jobTaskRunLog.setStartTime(thisTime);
jobTaskRunLog.setEndTime(thisTime); jobTaskRunLog.setEndTime(thisTime);
jobTaskRunLog.setRunCode("2"); jobTaskRunLog.setRunCode(NodeRunStatusPropertyEnum.RUN_FAILURE.getCode());
jobTaskRunLog.setAlertEnd("1"); jobTaskRunLog.setAlertEnd(EmailEnum.IS_ALARM_NO.getCode());
if (jobTaskRunLogById.getRunCount()>1) { if (jobTaskRunLogById.getRunCount()>1) {
//上一次的执行日志 //上一次的执行日志
String runMsg = jobTaskRunLogById.getRunMsg(); String runMsg = jobTaskRunLogById.getRunMsg();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment