Commit 984611e0 by huangfusuper

Merge remote-tracking branch 'origin/developer' into developer

parents 818a7e1e 2abfbe8b
...@@ -7,7 +7,7 @@ import com.byit.dto.plugin.*; ...@@ -7,7 +7,7 @@ import com.byit.dto.plugin.*;
import com.byit.enums.DagCheckEnum; import com.byit.enums.DagCheckEnum;
import com.byit.enums.FlowPropertyEnum; import com.byit.enums.FlowPropertyEnum;
import com.byit.enums.NodePropertyEnum; import com.byit.enums.NodePropertyEnum;
import com.byit.enums.ScheduleEnum; import com.byit.enums.ScheduleTypeEnum;
import com.byit.enums.plugin.PluginNodeTypeEnum; import com.byit.enums.plugin.PluginNodeTypeEnum;
import com.byit.job.utils.CronExpression; import com.byit.job.utils.CronExpression;
import com.byit.job.utils.CurrentUserUtils; import com.byit.job.utils.CurrentUserUtils;
...@@ -44,7 +44,6 @@ import static com.alibaba.fastjson.serializer.SerializerFeature.WriteClassName; ...@@ -44,7 +44,6 @@ import static com.alibaba.fastjson.serializer.SerializerFeature.WriteClassName;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class ApiFlowServiceImpl implements ApiFlowService { public class ApiFlowServiceImpl implements ApiFlowService {
private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
private final static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Resource @Resource
private FlowMapper flowMapper; private FlowMapper flowMapper;
...@@ -479,15 +478,14 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -479,15 +478,14 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//获取当前时间 //获取当前时间
String reRunId = UUID.randomUUID().toString().replace("-",""); String reRunId = UUID.randomUUID().toString().replace("-","");
Long triggerTime = System.currentTimeMillis(); Long triggerTime = System.currentTimeMillis();
List<JobTask> jobTaskList = new ArrayList<>();
JobTask jobTask = new JobTask(); JobTask jobTask = new JobTask();
BeanUtils.copyProperties(node, jobTask); BeanUtils.copyProperties(jobTaskRunLog, jobTask);
jobTask.setTriggerTime(triggerTime); jobTask.setTriggerTime(triggerTime);
jobTask.setTriggerStatus("1"); jobTask.setTriggerStatus("1");
jobTask.setRunId(reRunId); jobTask.setRunId(reRunId);
jobTask.setReRunId(jobTaskRunLog.getRunId()); jobTask.setReRunId(jobTaskRunLog.getRunId());
//设置为重跑 //设置为重跑
jobTask.setScheduleType(ScheduleEnum.REPEAT.getCode()); jobTask.setScheduleType(ScheduleTypeEnum.REPEAT.getCode());
jobTask.setOperator(userName); jobTask.setOperator(userName);
//查询当前节点的依赖节点 //查询当前节点的依赖节点
...@@ -496,6 +494,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -496,6 +494,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
jobTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList)); jobTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList));
} }
List<JobTask> jobTaskList = new ArrayList<>();
jobTaskList.add(jobTask); jobTaskList.add(jobTask);
//校验通过,开始设置重跑 //校验通过,开始设置重跑
...@@ -509,7 +508,6 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -509,7 +508,6 @@ public class ApiFlowServiceImpl implements ApiFlowService {
} }
jobTaskMapper.saveJobTasks(jobTaskList); jobTaskMapper.saveJobTasks(jobTaskList);
} }
...@@ -536,28 +534,30 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -536,28 +534,30 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if (FlowPropertyEnum.IS_INNER.getCode().equals(flow.getIsInner())){//是内嵌工作流 if (FlowPropertyEnum.IS_INNER.getCode().equals(flow.getIsInner())){//是内嵌工作流
Node node = nodeMapper.getByMapFlowId(flow.getFlowId()); Node node = nodeMapper.getByMapFlowId(flow.getFlowId());
RunInfo nodeRun = RunInfo.builder().workspaceName(runInfo.getWorkspaceName()).flowName(runInfo.getFlowName()) RunInfo nodeRun = RunInfo.builder().workspaceName(runInfo.getWorkspaceName()).flowName(runInfo.getFlowName())
.nodeName(runInfo.getNodeName()).runId(runInfo.getRunId()).runState("1").build(); .nodeName(node.getNodeName()).runId(runInfo.getRunId()).runState("1").build();
reRunJob(JSON.toJSONString(nodeRun, WriteClassName)); reRunJob(JSON.toJSONString(nodeRun, WriteClassName));
}else { }else {
//不是内嵌工作流 //不是内嵌工作流
Long triggerTime = System.currentTimeMillis(); Long triggerTime = System.currentTimeMillis();
String reRunId = UUID.randomUUID().toString().replace("-",""); String reRunId = UUID.randomUUID().toString().replace("-","");
List<JobTask> jobTaskList = new ArrayList<>(); List<JobTask> jobTaskList = new ArrayList<>();
List<Node> nodeList = nodeMapper.findOnforkByFlowId(flow.getFlowId()); List<JobTaskRunLogWithBLOBs> jobTaskRunLogList = jobTaskRunLogMapper.findJobTaskRunLogWithBLOBsByFlowIdAndRunId(flow.getFlowId(), runInfo.getRunId());
ValidationUtil.dataNotNull(nodeList, "该工作流没有在调度上的任务"); ValidationUtil.dataNotNull(jobTaskRunLogList, "该工作流没有在调度上的任务");
String userName = currentUserUtils.account(); String userName = currentUserUtils.account();
nodeList.forEach(node -> {
jobTaskRunLogList.forEach(jobTaskRunLog -> {
JobTask jobTask = new JobTask(); JobTask jobTask = new JobTask();
BeanUtils.copyProperties(node, jobTask); BeanUtils.copyProperties(jobTaskRunLog, jobTask);
jobTask.setTriggerTime(triggerTime); jobTask.setTriggerTime(triggerTime);
jobTask.setTriggerStatus("1"); jobTask.setTriggerStatus("1");
jobTask.setRunId(reRunId); jobTask.setRunId(reRunId);
jobTask.setReRunId(runInfo.getRunId()); jobTask.setReRunId(runInfo.getRunId());
//设置为重跑 //设置为重跑
jobTask.setScheduleType(ScheduleEnum.REPEAT.getCode()); jobTask.setScheduleType(ScheduleTypeEnum.REPEAT.getCode());
jobTask.setOperator(userName); jobTask.setOperator(userName);
//查询当前节点的依赖节点 //查询当前节点的依赖节点
List<Integer> dependNodeIdList = nodeDependencyMapper.findDependIdByNodeId(node.getNodeId()); List<Integer> dependNodeIdList = nodeDependencyMapper.findDependIdByNodeId(jobTaskRunLog.getNodeId());
if (dependNodeIdList != null && dependNodeIdList.size() > 0){ if (dependNodeIdList != null && dependNodeIdList.size() > 0){
jobTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList)); jobTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList));
} }
...@@ -569,19 +569,19 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -569,19 +569,19 @@ public class ApiFlowServiceImpl implements ApiFlowService {
private void addDependNode(String reRunId, String runId, Long triggerTime, List<JobTask> jobTaskList, List<Integer> subNodeIdList, String userName) { private void addDependNode(String reRunId, String runId, Long triggerTime, List<JobTask> jobTaskList, List<Integer> subNodeIdList, String userName) {
subNodeIdList.forEach(childNodeId -> { subNodeIdList.forEach(childNodeId -> {
Node subNode = nodeMapper.getById(childNodeId); JobTaskRunLog jobTaskRunLog = jobTaskRunLogMapper.findByRunIdAndNodeId(runId, childNodeId);
JobTask jobTask = new JobTask(); JobTask jobTask = new JobTask();
BeanUtils.copyProperties(subNode, jobTask); BeanUtils.copyProperties(jobTaskRunLog, jobTask);
jobTask.setTriggerTime(triggerTime); jobTask.setTriggerTime(triggerTime);
jobTask.setTriggerStatus("1"); jobTask.setTriggerStatus("1");
jobTask.setRunId(reRunId); jobTask.setRunId(reRunId);
jobTask.setReRunId(runId); jobTask.setReRunId(runId);
//设置为重跑 //设置为重跑
jobTask.setScheduleType(ScheduleEnum.REPEAT.getCode()); jobTask.setScheduleType(ScheduleTypeEnum.REPEAT.getCode());
jobTask.setOperator(userName); jobTask.setOperator(userName);
//查询当前节点的依赖节点 //查询当前节点的依赖节点
List<Integer> dependNodeIdList = nodeDependencyMapper.findDependIdByNodeId(subNode.getNodeId()); List<Integer> dependNodeIdList = nodeDependencyMapper.findDependIdByNodeId(jobTaskRunLog.getNodeId());
if (dependNodeIdList != null && dependNodeIdList.size() > 0){ if (dependNodeIdList != null && dependNodeIdList.size() > 0){
jobTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList)); jobTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList));
} }
...@@ -668,9 +668,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -668,9 +668,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if(StringUtils.isNotEmpty(executeStatus)){ if(StringUtils.isNotEmpty(executeStatus)){
executeStatusList = Arrays.asList(executeStatus.split(",")); executeStatusList = Arrays.asList(executeStatus.split(","));
} }
String startDate = dateTimeFormat.format(new Date(startTime)); List<RunRecording> runRecordList = runRecordingMapper.findByStartAndEndTime(new Date(startTime), new Date(endTime), flowIds, scheduleStatusList, executeStatusList);
String endDate = dateTimeFormat.format(new Date(endTime));
List<RunRecording> runRecordList = runRecordingMapper.findByStartAndEndTime(startDate, endDate, flowIds, scheduleStatusList, executeStatusList);
return runRecordList; return runRecordList;
} }
...@@ -725,7 +723,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -725,7 +723,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if (null != unstartflowStatisticData){ if (null != unstartflowStatisticData){
flowStatisticData.setUnstart(flowStatisticData.getUnstart() + unstartflowStatisticData.getUnstart()); flowStatisticData.setUnstart(flowStatisticData.getUnstart() + unstartflowStatisticData.getUnstart());
} }
StatisticData nodeStatisticData = jobTaskRunLogMapper.findStatusByStartAndEndTime(startTime, endTime, flowIdList); StatisticData nodeStatisticData = jobTaskRunLogMapper.findStatusByStartAndEndTime(new Date(startTime), new Date(endTime), flowIdList);
StatisticData unstartNodeStatisticData = waitingTaskMapper.findStatusByStartAndEndTime(flowIdList); StatisticData unstartNodeStatisticData = waitingTaskMapper.findStatusByStartAndEndTime(flowIdList);
if (null != unstartNodeStatisticData){ if (null != unstartNodeStatisticData){
nodeStatisticData.setUnstart(nodeStatisticData.getUnstart() + unstartNodeStatisticData.getUnstart()); nodeStatisticData.setUnstart(nodeStatisticData.getUnstart() + unstartNodeStatisticData.getUnstart());
...@@ -823,7 +821,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -823,7 +821,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
} }
} }
StatisticData nodeStatisticData = jobTaskRunLogMapper.findStatusByStartAndEndTime(startTime, endTime, flowIdList); StatisticData nodeStatisticData = jobTaskRunLogMapper.findStatusByStartAndEndTime(new Date(startTime), new Date(endTime), flowIdList);
StatisticData unstartNodeStatisticData = waitingTaskMapper.findStatusByStartAndEndTime(flowIdList); StatisticData unstartNodeStatisticData = waitingTaskMapper.findStatusByStartAndEndTime(flowIdList);
if (null != unstartNodeStatisticData){ if (null != unstartNodeStatisticData){
nodeStatisticData.setUnstart(nodeStatisticData.getUnstart() + unstartNodeStatisticData.getUnstart()); nodeStatisticData.setUnstart(nodeStatisticData.getUnstart() + unstartNodeStatisticData.getUnstart());
...@@ -938,7 +936,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -938,7 +936,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
waitingRecord.setRunId(runId); waitingRecord.setRunId(runId);
waitingRecord.setFlowNodeCount(nodeList.size()); waitingRecord.setFlowNodeCount(nodeList.size());
waitingRecord.setOperator(userName); waitingRecord.setOperator(userName);
waitingRecord.setScheduleType(ScheduleEnum.REPAIR.getCode()); waitingRecord.setScheduleType(ScheduleTypeEnum.REPAIR.getCode());
waitingRecord.setWaitOrder(++order); waitingRecord.setWaitOrder(++order);
//设置实例 //设置实例
BeanUtils.copyProperties(waitingRecord, runRecording); BeanUtils.copyProperties(waitingRecord, runRecording);
...@@ -976,7 +974,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -976,7 +974,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
waitingTask.setNodeDepend(Joiner.on(",").join(dependNodeNameList)); waitingTask.setNodeDepend(Joiner.on(",").join(dependNodeNameList));
} }
waitingTask.setOperator(usernName); waitingTask.setOperator(usernName);
waitingTask.setScheduleType(ScheduleEnum.REPAIR.getCode()); waitingTask.setScheduleType(ScheduleTypeEnum.REPAIR.getCode());
waitingTaskList.add(waitingTask); waitingTaskList.add(waitingTask);
}); });
......
...@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.byit.dto.plugin.RunLog; import com.byit.dto.plugin.RunLog;
import com.byit.dto.plugin.RunNode; import com.byit.dto.plugin.RunNode;
import com.byit.enums.NodePropertyEnum; import com.byit.enums.NodePropertyEnum;
import com.byit.enums.ScheduleEnum; import com.byit.enums.ScheduleTypeEnum;
import com.byit.job.WorkRoulette; import com.byit.job.WorkRoulette;
import com.byit.job.utils.PlaceholderUtils; import com.byit.job.utils.PlaceholderUtils;
import com.byit.mapper.JobTaskRunLogMapper; import com.byit.mapper.JobTaskRunLogMapper;
...@@ -63,7 +63,7 @@ public class ApiNodeServiceImpl implements ApiNodeService { ...@@ -63,7 +63,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
schedule.setScriptUrls(runNode.getScriptUrl()); schedule.setScriptUrls(runNode.getScriptUrl());
schedule.setJobType(runNode.getJobType()); schedule.setJobType(runNode.getJobType());
schedule.setTriggerTime(triggerTime); schedule.setTriggerTime(triggerTime);
schedule.setScheduleType(ScheduleEnum.REAL.getCode()); schedule.setScheduleType(ScheduleTypeEnum.REAL.getCode());
schedule.setRunParam(PlaceholderUtils.formatParam(schedule.getRunParam())); schedule.setRunParam(PlaceholderUtils.formatParam(schedule.getRunParam()));
......
...@@ -5,7 +5,7 @@ package com.byit.enums; ...@@ -5,7 +5,7 @@ package com.byit.enums;
* @author: gml * @author: gml
* @create: 2020/3/9 * @create: 2020/3/9
*/ */
public enum ScheduleEnum { public enum ScheduleTypeEnum {
NORMAL(1, "正常跑批"), NORMAL(1, "正常跑批"),
REPEAT(2, "重跑"), REPEAT(2, "重跑"),
...@@ -16,7 +16,7 @@ public enum ScheduleEnum { ...@@ -16,7 +16,7 @@ public enum ScheduleEnum {
private Integer code; private Integer code;
private String msg; private String msg;
private ScheduleEnum(Integer code, String msg){ private ScheduleTypeEnum(Integer code, String msg){
this.code = code; this.code = code;
this.msg = msg; this.msg = msg;
} }
......
...@@ -6,6 +6,7 @@ import com.byit.model.JobTaskRunLogWithBLOBs; ...@@ -6,6 +6,7 @@ import com.byit.model.JobTaskRunLogWithBLOBs;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -119,8 +120,8 @@ public interface JobTaskRunLogMapper { ...@@ -119,8 +120,8 @@ public interface JobTaskRunLogMapper {
* @param flowIdList * @param flowIdList
* @return * @return
*/ */
StatisticData findStatusByStartAndEndTime(@Param("startTime")Long startTime, StatisticData findStatusByStartAndEndTime(@Param("startTime")Date startTime,
@Param("endTime")Long endTime, @Param("endTime")Date endTime,
@Param("flowIdList")List<Integer> flowIdList); @Param("flowIdList")List<Integer> flowIdList);
StatisticData findStatisticDataByRunIdAndFlowId(@Param("runId")String runId, @Param("flowId")Integer flowId); StatisticData findStatisticDataByRunIdAndFlowId(@Param("runId")String runId, @Param("flowId")Integer flowId);
......
...@@ -139,8 +139,8 @@ public interface RunRecordingMapper { ...@@ -139,8 +139,8 @@ public interface RunRecordingMapper {
*/ */
List<RunRecording> findUnFinishByRunId(String runId); List<RunRecording> findUnFinishByRunId(String runId);
List<RunRecording> findByStartAndEndTime(@Param("startDate")String startDate, List<RunRecording> findByStartAndEndTime(@Param("startDate")Date startDate,
@Param("endDate")String endDate, @Param("endDate")Date endDate,
@Param("flowIds")List<Integer> flowIds, @Param("flowIds")List<Integer> flowIds,
@Param("scheduleStatusList")List<String> scheduleStatusList, @Param("scheduleStatusList")List<String> scheduleStatusList,
@Param("executeStatusList")List<String> executeStatusList); @Param("executeStatusList")List<String> executeStatusList);
......
...@@ -150,6 +150,11 @@ public class RunRecording implements Serializable { ...@@ -150,6 +150,11 @@ public class RunRecording implements Serializable {
@ApiModelProperty("重跑和补批的操作人") @ApiModelProperty("重跑和补批的操作人")
private String operator; private String operator;
/**
* 重跑的运行标识
*/
@ApiModelProperty("重跑的运行标识")
private String reRunId;
/** /**
*/ */
......
...@@ -202,8 +202,8 @@ ...@@ -202,8 +202,8 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from flow_status_snapshoot from flow_status_snapshoot
where snapshoot_time &gt;= ${startDate} where snapshoot_time &gt;= #{startDate}
and snapshoot_time &lt;= ${endDate} and snapshoot_time &lt;= #{endDate}
</select> </select>
<delete id="deleteOutSnapShoot" parameterType="java.lang.Long"> <delete id="deleteOutSnapShoot" parameterType="java.lang.Long">
delete from flow_status_snapshoot delete from flow_status_snapshoot
......
...@@ -179,6 +179,9 @@ ...@@ -179,6 +179,9 @@
<if test="operator != null"> <if test="operator != null">
operator, operator,
</if> </if>
<if test="scheduleType != null">
schedule_type,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -283,6 +286,9 @@ ...@@ -283,6 +286,9 @@
<if test="operator != null"> <if test="operator != null">
#{operator,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR},
</if> </if>
<if test="scheduleType != null">
#{scheduleType,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
...@@ -292,7 +298,7 @@ ...@@ -292,7 +298,7 @@
job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual, job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual,
plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param, plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name, run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name,
run_command,run_source,flow_name,super_success_run, re_run_id ,log_id, node_depend, operator run_command,run_source,flow_name,super_success_run, re_run_id ,log_id, node_depend, operator, schedule_type
) values ) values
<foreach collection="jobTasks" item="jobTask" separator =","> <foreach collection="jobTasks" item="jobTask" separator =",">
( (
...@@ -305,7 +311,7 @@ ...@@ -305,7 +311,7 @@
#{jobTask.sourcePrincipal,jdbcType=VARCHAR},#{jobTask.triggerTime,jdbcType=BIGINT},#{jobTask.triggerStatus,jdbcType=CHAR}, #{jobTask.sourcePrincipal,jdbcType=VARCHAR},#{jobTask.triggerTime,jdbcType=BIGINT},#{jobTask.triggerStatus,jdbcType=CHAR},
#{jobTask.versionName,jdbcType=VARCHAR},#{jobTask.runCommand,jdbcType=VARCHAR},#{jobTask.runSource,jdbcType=LONGVARCHAR}, #{jobTask.versionName,jdbcType=VARCHAR},#{jobTask.runCommand,jdbcType=VARCHAR},#{jobTask.runSource,jdbcType=LONGVARCHAR},
#{jobTask.flowName,jdbcType=VARCHAR},#{jobTask.superSuccessRun,jdbcType=CHAR},#{jobTask.reRunId,jdbcType=VARCHAR}, #{jobTask.flowName,jdbcType=VARCHAR},#{jobTask.superSuccessRun,jdbcType=CHAR},#{jobTask.reRunId,jdbcType=VARCHAR},
#{jobTask.logId,jdbcType=INTEGER},#{jobTask.nodeDepend,jdbcType=VARCHAR},#{jobTask.operator,jdbcType=VARCHAR} #{jobTask.logId,jdbcType=INTEGER},#{jobTask.nodeDepend,jdbcType=VARCHAR},#{jobTask.operator,jdbcType=VARCHAR}, #{scheduleType,jdbcType=INTEGER},
) )
</foreach> </foreach>
...@@ -414,6 +420,9 @@ ...@@ -414,6 +420,9 @@
<if test="operator != null"> <if test="operator != null">
operator = #{operator,jdbcType=VARCHAR}, operator = #{operator,jdbcType=VARCHAR},
</if> </if>
<if test="scheduleType != null">
schedule_type = #{scheduleType,jdbcType=INTEGER},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<result column="log_remotely_path" jdbcType="VARCHAR" property="logRemotelyPath"/> <result column="log_remotely_path" jdbcType="VARCHAR" property="logRemotelyPath"/>
<result column="node_depend" jdbcType="VARCHAR" property="nodeDepend"/> <result column="node_depend" jdbcType="VARCHAR" property="nodeDepend"/>
<result column="operator" jdbcType="VARCHAR" property="operator"/> <result column="operator" jdbcType="VARCHAR" property="operator"/>
<result column="schedule_type" jdbcType="INTEGER" property="scheduleType"/>
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTaskRunLogWithBLOBs"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTaskRunLogWithBLOBs">
<result column="run_msg" jdbcType="LONGVARCHAR" property="runMsg" /> <result column="run_msg" jdbcType="LONGVARCHAR" property="runMsg" />
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
log_id, failed_remaining_count, version_name, flow_id, flow_name, job_group_id, handler_name, log_id, failed_remaining_count, version_name, flow_id, flow_name, job_group_id, handler_name,
node_name, is_virtual, run_code, run_params, start_time, run_type, trigger_code, node_name, is_virtual, run_code, run_params, start_time, run_type, trigger_code,
trigger_time, job_group_ip, map_flow_id, run_command, end_time, node_id,job_type,alert_end,run_id,re_run_id trigger_time, job_group_ip, map_flow_id, run_command, end_time, node_id,job_type,alert_end,run_id,re_run_id
,log_file_name, super_success_run, run_count, log_remotely_path, node_depend, operator ,log_file_name, super_success_run, run_count, log_remotely_path, node_depend, operator, schedule_type
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
run_msg, trigger_msg run_msg, trigger_msg
...@@ -127,8 +128,8 @@ ...@@ -127,8 +128,8 @@
sum(case when run_code = '2' or run_code = '4' or run_code = '6' then 1 else 0 end) as fail, sum(case when run_code = '2' or run_code = '4' or run_code = '6' then 1 else 0 end) as fail,
sum(case when run_code = '5' then 1 else 0 end) as 'kill' sum(case when run_code = '5' then 1 else 0 end) as 'kill'
from job_task_run_log from job_task_run_log
where start_time &gt;= ${startDate} where start_time &gt;= #{startDate}
and end_time &lt;= ${endDate} and end_time &lt;= #{endDate}
<if test="flowIdList != null"> <if test="flowIdList != null">
and flow_id in ( and flow_id in (
<foreach collection="flowIdList" item="flowId" separator=","> <foreach collection="flowIdList" item="flowId" separator=",">
...@@ -251,6 +252,9 @@ ...@@ -251,6 +252,9 @@
<if test="operator != null"> <if test="operator != null">
operator, operator,
</if> </if>
<if test="scheduleType != null">
schedule_type,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="logId != null"> <if test="logId != null">
...@@ -349,6 +353,9 @@ ...@@ -349,6 +353,9 @@
<if test="operator != null"> <if test="operator != null">
#{operator,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR},
</if> </if>
<if test="scheduleType != null">
#{scheduleType,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateJobTaskRunLogWithBLOBs" parameterType="com.byit.model.JobTaskRunLogWithBLOBs"> <update id="updateJobTaskRunLogWithBLOBs" parameterType="com.byit.model.JobTaskRunLogWithBLOBs">
...@@ -447,6 +454,9 @@ ...@@ -447,6 +454,9 @@
<if test="operator != null"> <if test="operator != null">
operator = #{operator,jdbcType=VARCHAR}, operator = #{operator,jdbcType=VARCHAR},
</if> </if>
<if test="scheduleType != null">
schedule_type = #{scheduleType,jdbcType=INTEGER},
</if>
</set> </set>
where log_id = #{logId,jdbcType=INTEGER} where log_id = #{logId,jdbcType=INTEGER}
</update> </update>
...@@ -540,6 +550,9 @@ ...@@ -540,6 +550,9 @@
<if test="operator != null"> <if test="operator != null">
operator = #{operator,jdbcType=VARCHAR}, operator = #{operator,jdbcType=VARCHAR},
</if> </if>
<if test="scheduleType != null">
schedule_type = #{scheduleType,jdbcType=INTEGER},
</if>
</set> </set>
where log_id = #{logId,jdbcType=INTEGER} where log_id = #{logId,jdbcType=INTEGER}
</update> </update>
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<result column="re_run_id" jdbcType="VARCHAR" property="reRunId"/> <result column="re_run_id" jdbcType="VARCHAR" property="reRunId"/>
<result column="node_depend" jdbcType="VARCHAR" property="nodeDepend"/> <result column="node_depend" jdbcType="VARCHAR" property="nodeDepend"/>
<result column="operator" jdbcType="VARCHAR" property="operator"/> <result column="operator" jdbcType="VARCHAR" property="operator"/>
<result column="schedule_type" jdbcType="INTEGER" property="scheduleType"/>
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTaskSchedule"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTaskSchedule">
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual, job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual,
plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param, plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name, run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name,
log_id, run_command,flow_name, super_success_run, re_run_id, node_depend, operator log_id, run_command,flow_name, super_success_run, re_run_id, node_depend, operator, schedule_type
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
run_source run_source
...@@ -182,6 +183,9 @@ ...@@ -182,6 +183,9 @@
<if test="operator != null"> <if test="operator != null">
operator, operator,
</if> </if>
<if test="scheduleType != null">
schedule_type,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -286,6 +290,9 @@ ...@@ -286,6 +290,9 @@
<if test="operator != null"> <if test="operator != null">
#{operator,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR},
</if> </if>
<if test="scheduleType != null">
#{scheduleType,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
...@@ -300,7 +307,7 @@ ...@@ -300,7 +307,7 @@
script_urls, source_principal, trigger_time, script_urls, source_principal, trigger_time,
trigger_status, version_name, log_id, trigger_status, version_name, log_id,
run_command, run_source,flow_name, super_success_run, re_run_id, run_command, run_source,flow_name, super_success_run, re_run_id,
node_depend, operator node_depend, operator, schedule_type
) )
values values
<foreach collection="jobTaskSchedules" item="jobTaskSchedule" separator=","> <foreach collection="jobTaskSchedules" item="jobTaskSchedule" separator=",">
...@@ -326,7 +333,7 @@ ...@@ -326,7 +333,7 @@
#{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR}, #{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR},
#{jobTaskSchedule.flowName,jdbcType=VARCHAR}, #{jobTaskSchedule.superSuccessRun,jdbcType=CHAR}, #{jobTaskSchedule.flowName,jdbcType=VARCHAR}, #{jobTaskSchedule.superSuccessRun,jdbcType=CHAR},
#{jobTaskSchedule.reRunId,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeDepend,jdbcType=VARCHAR}, #{jobTaskSchedule.reRunId,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeDepend,jdbcType=VARCHAR},
#{jobTaskSchedule.operator,jdbcType=VARCHAR} #{jobTaskSchedule.operator,jdbcType=VARCHAR}, #{scheduleType,jdbcType=INTEGER},
) )
</foreach> </foreach>
</insert> </insert>
...@@ -434,6 +441,9 @@ ...@@ -434,6 +441,9 @@
<if test="operator != null"> <if test="operator != null">
operator = #{operator,jdbcType=VARCHAR}, operator = #{operator,jdbcType=VARCHAR},
</if> </if>
<if test="scheduleType != null">
schedule_type = #{scheduleType,jdbcType=INTEGER},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
...@@ -108,8 +108,8 @@ ...@@ -108,8 +108,8 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from run_recording from run_recording
where start_time &gt;= ${startDate} where start_time &gt;= #{startDate}
and end_time &lt;= ${endDate} and end_time &lt;= #{endDate}
<if test="flowIds != null"> <if test="flowIds != null">
and flow_id in ( and flow_id in (
<foreach collection="flowIds" item="flowId" separator=","> <foreach collection="flowIds" item="flowId" separator=",">
...@@ -120,14 +120,14 @@ ...@@ -120,14 +120,14 @@
<if test="scheduleStatusList != null"> <if test="scheduleStatusList != null">
and flow_status in ( and flow_status in (
<foreach collection="scheduleStatusList" item="scheduleStatus" separator=","> <foreach collection="scheduleStatusList" item="scheduleStatus" separator=",">
${scheduleStatus} #{scheduleStatus}
</foreach> </foreach>
) )
</if> </if>
<if test="executeStatusList != null"> <if test="executeStatusList != null">
and flow_run_result in ( and flow_run_result in (
<foreach collection="executeStatusList" item="executeStatus" separator=","> <foreach collection="executeStatusList" item="executeStatus" separator=",">
${executeStatus} #{executeStatus}
</foreach> </foreach>
) )
</if> </if>
...@@ -156,8 +156,8 @@ ...@@ -156,8 +156,8 @@
sum(case when flow_status='4' and (flow_run_result = '2' or flow_run_result = '4') then 1 else 0 end ) fail, sum(case when flow_status='4' and (flow_run_result = '2' or flow_run_result = '4') then 1 else 0 end ) fail,
sum(case when flow_run_result='5' then 1 else 0 end ) 'kill' sum(case when flow_run_result='5' then 1 else 0 end ) 'kill'
from run_recording from run_recording
where start_time &gt;= ${startDate} where start_time &gt;= #{startDate}
and end_time &lt;= ${endDate} and end_time &lt;= #{endDate}
<if test="flowIdList != null"> <if test="flowIdList != null">
and flow_id in ( and flow_id in (
<foreach collection="flowIdList" item="flowId" separator=","> <foreach collection="flowIdList" item="flowId" separator=",">
...@@ -488,7 +488,7 @@ ...@@ -488,7 +488,7 @@
<update id="killInnerFlow" > <update id="killInnerFlow" >
update run_recording set flow_status = '4',flow_run_result = '5' update run_recording set flow_status = '4',flow_run_result = '5'
where run_id = #{runId,jdbcType=VARCHAR} where run_id = #{runId,jdbcType=VARCHAR}
and flow_name = ${flowName,jdbcType=VARCHAR} and flow_name = #{flowName,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest;
@Component @Component
public class CurrentUserUtils { public class CurrentUserUtils {
@Value("{authentication.user.pub-key}") @Value("${authentication.user.pub-key}")
private String pubKey; private String pubKey;
public JwtUserInfo getCurrentUser() { public JwtUserInfo getCurrentUser() {
......
package com.byit.dto.plugin; package com.byit.dto.plugin;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* @Description 重跑信息 * @Description 重跑信息
...@@ -10,6 +12,8 @@ import lombok.Data; ...@@ -10,6 +12,8 @@ import lombok.Data;
*/ */
@Data @Data
@Builder @Builder
@AllArgsConstructor
@NoArgsConstructor
public class RunInfo { public class RunInfo {
/** /**
* 运行实例id 必填 * 运行实例id 必填
......
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