Commit 540541a6 by huangfusuper

完善界面的接口及部分BUG修改

parent 15a2087a
package com.byit.view; package com.byit.view;
import com.byit.dto.FlowConditionDto;
import com.byit.model.vo.FlowImportantAllVo; import com.byit.model.vo.FlowImportantAllVo;
import com.byit.model.vo.FlowVersionDetailedVo; import com.byit.model.vo.FlowVersionDetailedVo;
import com.byit.model.vo.FlowVersionVo; import com.byit.model.vo.FlowVersionVo;
import com.byit.service.FlowVersionService; import com.byit.service.FlowVersionService;
import com.byit.model.vo.FlowVersionVoDep; import com.byit.model.vo.FlowVersionVoDep;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -30,8 +32,8 @@ public class FlowVersionViewController { ...@@ -30,8 +32,8 @@ public class FlowVersionViewController {
} }
@PostMapping("findAllVersion") @PostMapping("findAllVersion")
public List<FlowVersionVo> findAllVersion(){ public List<FlowVersionVo> findAllVersion(@RequestBody FlowConditionDto flowConditionDto){
return flowVersionService.findAllVersion(); return flowVersionService.findAllVersion(flowConditionDto);
} }
@RequestMapping("findAllByFlowId") @RequestMapping("findAllByFlowId")
public List<FlowVersionDetailedVo> findAllByFlowId(Integer flowId) { public List<FlowVersionDetailedVo> findAllByFlowId(Integer flowId) {
......
package com.byit.view; package com.byit.view;
import com.byit.dto.FlowConditionDto;
import com.byit.model.Flow; import com.byit.model.Flow;
import com.byit.model.vo.FlowImportantAllVo; import com.byit.model.vo.FlowImportantAllVo;
import com.byit.model.vo.FlowViewVo; import com.byit.model.vo.FlowViewVo;
import com.byit.service.FlowService; import com.byit.service.FlowService;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -24,13 +26,13 @@ public class FlowViewController { ...@@ -24,13 +26,13 @@ public class FlowViewController {
} }
@PostMapping("findAllThisVersionFlow") @PostMapping("findAllThisVersionFlow")
public List<Flow> findAllThisVersionFlow(){ public List<Flow> findAllThisVersionFlow(@RequestBody FlowConditionDto flowConditionDto){
return flowService.findAllFlow(); return flowService.findAllFlow(flowConditionDto);
} }
@PostMapping("findAllFlowViewVo") @PostMapping("findAllFlowViewVo")
public List<FlowViewVo> findAllFlowViewVo(){ public List<FlowViewVo> findAllFlowViewVo(@RequestBody FlowConditionDto flowConditionDto){
return flowService.findAllFlowViewVo(); return flowService.findAllFlowViewVo(flowConditionDto);
} }
/** /**
...@@ -38,7 +40,7 @@ public class FlowViewController { ...@@ -38,7 +40,7 @@ public class FlowViewController {
* @return * @return
*/ */
@PostMapping("findAllFlowImportant") @PostMapping("findAllFlowImportant")
public List<FlowImportantAllVo> findAllFlowImportant() { public List<FlowImportantAllVo> findAllFlowImportant(@RequestBody FlowConditionDto flowConditionDto) {
return flowService.findAllFlowImportant(); return flowService.findAllFlowImportant(flowConditionDto);
} }
} }
package com.byit.view;
import com.byit.dto.plugin.JavaTask;
import com.byit.model.vo.JavaTaskLogImportantVo;
import com.byit.service.JavaTaskService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author huangfu
*/
@RestController
@RequestMapping("view/java")
public class JavaTaskViewController {
private final JavaTaskService javaTaskService;
public JavaTaskViewController(JavaTaskService javaTaskService) {
this.javaTaskService = javaTaskService;
}
@RequestMapping("findAll")
public List<JavaTask> findAll(String jobName){
return javaTaskService.findAll(jobName);
}
@RequestMapping("findAllJavaTaskLogImportantVo")
public List<JavaTaskLogImportantVo> findAllJavaTaskLogImportantVo(String jobName) {
return javaTaskService.findAllJavaTaskLogImportantVo(jobName);
}
}
package com.byit.view; package com.byit.view;
import com.byit.model.JobTaskRunLog;
import com.byit.model.vo.RunLogVo; import com.byit.model.vo.RunLogVo;
import com.byit.service.JobTaskRunLogService; import com.byit.service.JobTaskRunLogService;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -25,4 +26,14 @@ public class RunLogViewController { ...@@ -25,4 +26,14 @@ public class RunLogViewController {
public List<RunLogVo> findAllRunLogIdByFlowIdAndRunId(@Param("flowId") Integer flowId, @Param("runId") String runId){ public List<RunLogVo> findAllRunLogIdByFlowIdAndRunId(@Param("flowId") Integer flowId, @Param("runId") String runId){
return jobTaskRunLogService.findAllRunLogIdByFlowIdAndRunId(flowId,runId); return jobTaskRunLogService.findAllRunLogIdByFlowIdAndRunId(flowId,runId);
} }
@RequestMapping("findNodeLogByHandlerName")
public List<RunLogVo> findNodeLogByHandlerName(String handlerName){
return jobTaskRunLogService.findNodeLogByHandlerName(handlerName);
}
@RequestMapping("findImmediatelyNode")
public List<JobTaskRunLog> findImmediatelyNode(String nodeName) {
return jobTaskRunLogService.findImmediatelyNode(nodeName);
}
} }
package com.byit.view; package com.byit.view;
import com.byit.dto.FlowConditionDto;
import com.byit.model.RunRecording; import com.byit.model.RunRecording;
import com.byit.model.vo.RunRecordingViewVo; import com.byit.model.vo.RunRecordingViewVo;
import com.byit.service.RunRecordingService; import com.byit.service.RunRecordingService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -22,19 +24,19 @@ public class RunRecordingViewController { ...@@ -22,19 +24,19 @@ public class RunRecordingViewController {
} }
@RequestMapping("findAll") @RequestMapping("findAll")
public List<RunRecording> findAll(){ public List<RunRecording> findAll(@RequestBody FlowConditionDto flowConditionDto){
return runRecordingService.findAll(); return runRecordingService.findAll(flowConditionDto);
} }
@RequestMapping("findAllRunIng") @RequestMapping("findAllRunIng")
public List<RunRecording> findAllRunIng() { public List<RunRecording> findAllRunIng(@RequestBody FlowConditionDto flowConditionDto) {
return runRecordingService.findAllRunIng(); return runRecordingService.findAllRunIng(flowConditionDto);
} }
@RequestMapping("findAllRunRecordingViewVo") @RequestMapping("findAllRunRecordingViewVo")
public List<RunRecordingViewVo> findAllRunRecordingViewVo(){ public List<RunRecordingViewVo> findAllRunRecordingViewVo(@RequestBody FlowConditionDto flowConditionDto){
return runRecordingService.findAllRunRecordingViewVo(); return runRecordingService.findAllRunRecordingViewVo(flowConditionDto);
} }
@RequestMapping("findAllError") @RequestMapping("findAllError")
public List<RunRecordingViewVo> findAllError(){ public List<RunRecordingViewVo> findAllError(@RequestBody FlowConditionDto flowConditionDto){
return runRecordingService.findAllError(); return runRecordingService.findAllError(flowConditionDto);
} }
} }
package com.byit.view;
import com.byit.model.Workspace;
import com.byit.service.WorkspaceService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author huangfu
*/
@RestController
@RequestMapping("view/workspace")
public class WorkspaceViewController {
private final WorkspaceService workspaceService;
public WorkspaceViewController(WorkspaceService workspaceService) {
this.workspaceService = workspaceService;
}
@RequestMapping("findAllWorkspace")
public List<Workspace> findAllWorkspace(){
return workspaceService.findAll();
}
}
package com.byit.dto;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
/**
* @author huangfu
*/
@Data
@ToString
public class FlowConditionDto implements Serializable {
private Integer workspaceId;
private String flowName;
}
...@@ -9,6 +9,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -9,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date;
/** /**
* 工作流的事件监听操作 * 工作流的事件监听操作
* @author huangfu * @author huangfu
...@@ -16,7 +18,6 @@ import org.springframework.stereotype.Component; ...@@ -16,7 +18,6 @@ import org.springframework.stereotype.Component;
@Component @Component
@Slf4j @Slf4j
public class FlowEventListener { public class FlowEventListener {
private final FlowService flowService; private final FlowService flowService;
public FlowEventListener(FlowService flowService) { public FlowEventListener(FlowService flowService) {
......
package com.byit.mapper; package com.byit.mapper;
import com.byit.dto.FlowConditionDto;
import com.byit.model.Flow; import com.byit.model.Flow;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -59,4 +60,6 @@ public interface FlowMapper { ...@@ -59,4 +60,6 @@ public interface FlowMapper {
*/ */
List<Flow> findAll(); List<Flow> findAll();
List<Flow> findAllByCondition(FlowConditionDto flowConditionDto);
} }
\ No newline at end of file
package com.byit.mapper; package com.byit.mapper;
import com.byit.dto.FlowConditionDto;
import com.byit.model.FlowVersion; import com.byit.model.FlowVersion;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -13,6 +14,7 @@ public interface FlowVersionMapper { ...@@ -13,6 +14,7 @@ public interface FlowVersionMapper {
* @return * @return
*/ */
List<FlowVersion> findAllFlow(); List<FlowVersion> findAllFlow();
List<FlowVersion> findAllFlowCondition(FlowConditionDto flowConditionDto);
int deleteById(Integer flowVersionId); int deleteById(Integer flowVersionId);
......
...@@ -8,6 +8,7 @@ import java.util.List; ...@@ -8,6 +8,7 @@ import java.util.List;
@Repository @Repository
public interface JavaTaskMapper { public interface JavaTaskMapper {
List<JavaTask> findAll(String jobName);
int deleteById(Integer id); int deleteById(Integer id);
int insertSelective(JavaTask record); int insertSelective(JavaTask record);
......
...@@ -15,6 +15,8 @@ import java.util.List; ...@@ -15,6 +15,8 @@ import java.util.List;
*/ */
@Repository @Repository
public interface JobTaskRunLogMapper { public interface JobTaskRunLogMapper {
List<JobTaskRunLog> findImmediatelyNode(String nodeName);
/** /**
* 查询没有结束的节点 * 查询没有结束的节点
* @param nodeIds * @param nodeIds
...@@ -23,11 +25,13 @@ public interface JobTaskRunLogMapper { ...@@ -23,11 +25,13 @@ public interface JobTaskRunLogMapper {
*/ */
List<JobTaskRunLog> findJobTaskRunLogNotEndNodeByRunCodeCount(@Param("nodeIds") List<Integer> nodeIds, @Param("runId") String runId); List<JobTaskRunLog> findJobTaskRunLogNotEndNodeByRunCodeCount(@Param("nodeIds") List<Integer> nodeIds, @Param("runId") String runId);
List<JobTaskRunLogWithBLOBs> findNodeLogByHandlerName(String handlerName);
/** /**
* 查询失败且重试次数大于0的节点 * 查询失败且重试次数大于0的节点
* @return * @return
*/ */
List<JobTaskRunLog> findErrorNode(); List<JobTaskRunLogWithBLOBs> findErrorNode();
/** /**
* 查根据flowId和RunId查询一批节点 * 查根据flowId和RunId查询一批节点
......
package com.byit.mapper; package com.byit.mapper;
import com.byit.dto.FlowConditionDto;
import com.byit.dto.plugin.StatisticData; import com.byit.dto.plugin.StatisticData;
import com.byit.model.RunRecording; import com.byit.model.RunRecording;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -18,19 +19,19 @@ public interface RunRecordingMapper { ...@@ -18,19 +19,19 @@ public interface RunRecordingMapper {
* 查询全部的数据 * 查询全部的数据
* @return * @return
*/ */
List<RunRecording> findAll(); List<RunRecording> findAll(FlowConditionDto flowConditionDto);
/** /**
* 查询全部错误的节点 * 查询全部错误的节点
* @return * @return
*/ */
List<RunRecording> findAllError(); List<RunRecording> findAllError(FlowConditionDto flowConditionDto);
/** /**
* 查询运行中的数据 * 查询运行中的数据
* @return * @return
*/ */
List<RunRecording> findAllRunIng(); List<RunRecording> findAllRunIng(FlowConditionDto flowConditionDto);
/** /**
* 查询已经完结的,并且没有告警的任务流 * 查询已经完结的,并且没有告警的任务流
* @return * @return
......
package com.byit.mapper; package com.byit.mapper;
import com.byit.model.Workspace; import com.byit.model.Workspace;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface WorkspaceMapper { public interface WorkspaceMapper {
List<Workspace> findAll();
int deleteById(Integer workspaceId); int deleteById(Integer workspaceId);
int insertSelective(Workspace record); int insertSelective(Workspace record);
......
...@@ -156,6 +156,9 @@ public class RunRecording implements Serializable { ...@@ -156,6 +156,9 @@ public class RunRecording implements Serializable {
@ApiModelProperty("重跑的运行标识") @ApiModelProperty("重跑的运行标识")
private String reRunId; private String reRunId;
@ApiModelProperty("工作空间id")
private Integer workspaceId;
/** /**
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.byit.model.vo;
import com.byit.dto.plugin.JavaTask;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Administrator
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class JavaTaskLogImportantVo extends JavaTask {
private String rowKey;
private boolean hasChildren;
}
...@@ -13,6 +13,7 @@ public class RunLogVo { ...@@ -13,6 +13,7 @@ public class RunLogVo {
private String nodeName; private String nodeName;
private String jobType; private String jobType;
private Integer failedRemainingCount; private Integer failedRemainingCount;
private String handlerName;
private String isVirtual; private String isVirtual;
private Integer mapFlowId; private Integer mapFlowId;
private String triggerCode; private String triggerCode;
......
package com.byit.service; package com.byit.service;
import com.byit.dto.FlowConditionDto;
import com.byit.model.Flow; import com.byit.model.Flow;
import com.byit.model.vo.FlowImportantAllVo; import com.byit.model.vo.FlowImportantAllVo;
import com.byit.model.vo.FlowViewVo; import com.byit.model.vo.FlowViewVo;
import com.byit.model.vo.FlowVo; import com.byit.model.vo.FlowVo;
import com.byit.model.vo.NodeVo; import com.byit.model.vo.NodeVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import java.util.List;
...@@ -20,14 +22,14 @@ public interface FlowService { ...@@ -20,14 +22,14 @@ public interface FlowService {
* 查询全部的任务流数据 * 查询全部的任务流数据
* @return * @return
*/ */
List<FlowViewVo> findAllFlowViewVo(); List<FlowViewVo> findAllFlowViewVo(FlowConditionDto flowConditionDto);
List<FlowImportantAllVo> findAllFlowImportant(); List<FlowImportantAllVo> findAllFlowImportant(FlowConditionDto flowConditionDto);
/** /**
* 查询全部的任务流数据 * 查询全部的任务流数据
* @return * @return
*/ */
List<Flow> findAllFlow(); List<Flow> findAllFlow(FlowConditionDto flowConditionDto);
/** /**
* 根据ID查询 * 根据ID查询
* @param id * @param id
......
package com.byit.service; package com.byit.service;
import com.byit.dto.FlowConditionDto;
import com.byit.model.FlowVersion; import com.byit.model.FlowVersion;
import com.byit.model.vo.FlowImportantAllVo; import com.byit.model.vo.FlowImportantAllVo;
import com.byit.model.vo.FlowVersionDetailedVo; import com.byit.model.vo.FlowVersionDetailedVo;
...@@ -22,7 +23,7 @@ public interface FlowVersionService { ...@@ -22,7 +23,7 @@ public interface FlowVersionService {
* 查询全部的工作流 * 查询全部的工作流
* @return * @return
*/ */
List<FlowVersionVo> findAllVersion(); List<FlowVersionVo> findAllVersion(FlowConditionDto flowConditionDto);
List<FlowVersionDetailedVo> findAllByFlowId(Integer flowId); List<FlowVersionDetailedVo> findAllByFlowId(Integer flowId);
} }
package com.byit.service; package com.byit.service;
import com.byit.dto.plugin.JavaTask; import com.byit.dto.plugin.JavaTask;
import com.byit.model.vo.JavaTaskLogImportantVo;
import java.util.List; import java.util.List;
...@@ -10,6 +11,17 @@ import java.util.List; ...@@ -10,6 +11,17 @@ import java.util.List;
*/ */
public interface JavaTaskService { public interface JavaTaskService {
/** /**
* 查询全部的task任务
* @return
*/
List<JavaTask> findAll(String javaTaskName);
/**
* javaTask主要信息
* @return
*/
List<JavaTaskLogImportantVo> findAllJavaTaskLogImportantVo(String jobName);
/**
* 查询当前时间+若干秒内该执行的任务节点 * 查询当前时间+若干秒内该执行的任务节点
* @param triggerTime * @param triggerTime
* @return * @return
......
...@@ -14,7 +14,9 @@ import java.util.List; ...@@ -14,7 +14,9 @@ import java.util.List;
**/ **/
public interface JobTaskRunLogService { public interface JobTaskRunLogService {
List<JobTaskRunLog> findImmediatelyNode(String nodeName);
List<RunLogVo> findNodeLogByHandlerName(String handlerName);
/** /**
* 查询没有结束的节点 * 查询没有结束的节点
...@@ -28,7 +30,7 @@ public interface JobTaskRunLogService { ...@@ -28,7 +30,7 @@ public interface JobTaskRunLogService {
* 查询失败且重试次数大于0的节点 * 查询失败且重试次数大于0的节点
* @return * @return
*/ */
List<JobTaskRunLog> findErrorNode(); List<JobTaskRunLogWithBLOBs> findErrorNode();
/** /**
* 查根据flowId和RunId查询一批节点 * 查根据flowId和RunId查询一批节点
* @param flowId * @param flowId
......
package com.byit.service; package com.byit.service;
import com.byit.dto.FlowConditionDto;
import com.byit.model.RunRecording; import com.byit.model.RunRecording;
import com.byit.model.vo.RunRecordingViewVo; import com.byit.model.vo.RunRecordingViewVo;
...@@ -14,24 +15,24 @@ public interface RunRecordingService { ...@@ -14,24 +15,24 @@ public interface RunRecordingService {
* 查询全部数据 映射成VO * 查询全部数据 映射成VO
* @return * @return
*/ */
List<RunRecordingViewVo> findAllRunRecordingViewVo(); List<RunRecordingViewVo> findAllRunRecordingViewVo(FlowConditionDto flowConditionDt);
/** /**
* 查询全部的数据 * 查询全部的数据
* @return * @return
*/ */
List<RunRecording> findAll(); List<RunRecording> findAll(FlowConditionDto flowConditionDto);
/** /**
* 查询全部错误的节点 * 查询全部错误的节点
* @return * @return
*/ */
List<RunRecordingViewVo> findAllError(); List<RunRecordingViewVo> findAllError(FlowConditionDto flowConditionDto);
/** /**
* 查询运行中的数据 * 查询运行中的数据
* @return * @return
*/ */
List<RunRecording> findAllRunIng(); List<RunRecording> findAllRunIng(FlowConditionDto flowConditionDto);
/** /**
* 查询已经完结的,并且没有告警的任务流 * 查询已经完结的,并且没有告警的任务流
* @return * @return
......
package com.byit.service;
import com.byit.model.Workspace;
import java.util.List;
/**
* @author huangfu
*/
public interface WorkspaceService {
/**
* 查询全部工作空间
* @return 返回全部工作空间
*/
List<Workspace> findAll();
}
...@@ -3,6 +3,7 @@ package com.byit.service.impl; ...@@ -3,6 +3,7 @@ package com.byit.service.impl;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.byit.dto.FlowConditionDto;
import com.byit.dto.web.ResponseResult; import com.byit.dto.web.ResponseResult;
import com.byit.enums.ExecuteStatusEnum; import com.byit.enums.ExecuteStatusEnum;
import com.byit.enums.FlowPropertyEnum; import com.byit.enums.FlowPropertyEnum;
...@@ -22,6 +23,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -22,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
...@@ -54,8 +56,8 @@ public class FlowServiceImpl implements FlowService { ...@@ -54,8 +56,8 @@ public class FlowServiceImpl implements FlowService {
@Override @Override
public List<FlowViewVo> findAllFlowViewVo() { public List<FlowViewVo> findAllFlowViewVo(FlowConditionDto flowConditionDto) {
List<Flow> allFlow = findAllFlow(); List<Flow> allFlow = findAllFlow(flowConditionDto);
return allFlow.stream().map(flow -> { return allFlow.stream().map(flow -> {
FlowViewVo flowViewVo = new FlowViewVo(); FlowViewVo flowViewVo = new FlowViewVo();
flowViewVo.setFlowId(flow.getFlowId()); flowViewVo.setFlowId(flow.getFlowId());
...@@ -68,8 +70,8 @@ public class FlowServiceImpl implements FlowService { ...@@ -68,8 +70,8 @@ public class FlowServiceImpl implements FlowService {
} }
@Override @Override
public List<FlowImportantAllVo> findAllFlowImportant() { public List<FlowImportantAllVo> findAllFlowImportant(FlowConditionDto flowConditionDto) {
List<Flow> all = flowMapper.findAll(); List<Flow> all = flowMapper.findAllByCondition(flowConditionDto);
return all.stream().map(flow -> { return all.stream().map(flow -> {
FlowImportantAllVo flowImportantAllVo = new FlowImportantAllVo(); FlowImportantAllVo flowImportantAllVo = new FlowImportantAllVo();
flowImportantAllVo.setRowKey(UUID.randomUUID().toString().replace("-","")); flowImportantAllVo.setRowKey(UUID.randomUUID().toString().replace("-",""));
...@@ -81,8 +83,8 @@ public class FlowServiceImpl implements FlowService { ...@@ -81,8 +83,8 @@ public class FlowServiceImpl implements FlowService {
} }
@Override @Override
public List<Flow> findAllFlow() { public List<Flow> findAllFlow(FlowConditionDto flowConditionDto) {
return flowMapper.findAll(); return flowMapper.findAllByCondition(flowConditionDto);
} }
@Override @Override
......
package com.byit.service.impl; package com.byit.service.impl;
import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.IdcardUtil;
import com.byit.dto.FlowConditionDto;
import com.byit.mapper.FlowVersionMapper; import com.byit.mapper.FlowVersionMapper;
import com.byit.model.FlowVersion; import com.byit.model.FlowVersion;
import com.byit.model.vo.FlowImportantAllVo; import com.byit.model.vo.FlowImportantAllVo;
...@@ -44,8 +45,8 @@ public class FlowVersionServiceImpl implements FlowVersionService { ...@@ -44,8 +45,8 @@ public class FlowVersionServiceImpl implements FlowVersionService {
@Override @Override
public List<FlowVersionVo> findAllVersion() { public List<FlowVersionVo> findAllVersion(FlowConditionDto flowConditionDto) {
List<FlowVersion> allFlow = flowVersionMapper.findAllFlow(); List<FlowVersion> allFlow = flowVersionMapper.findAllFlowCondition(flowConditionDto);
return allFlow.stream().map(flowVersion -> { return allFlow.stream().map(flowVersion -> {
FlowVersionVo flowVersionVo = new FlowVersionVo(); FlowVersionVo flowVersionVo = new FlowVersionVo();
flowVersionVo.setNodeId(UUID.randomUUID().toString().replace("-","")); flowVersionVo.setNodeId(UUID.randomUUID().toString().replace("-",""));
......
...@@ -2,10 +2,14 @@ package com.byit.service.impl; ...@@ -2,10 +2,14 @@ package com.byit.service.impl;
import com.byit.dto.plugin.JavaTask; import com.byit.dto.plugin.JavaTask;
import com.byit.mapper.JavaTaskMapper; import com.byit.mapper.JavaTaskMapper;
import com.byit.model.vo.JavaTaskLogImportantVo;
import com.byit.service.JavaTaskService; import com.byit.service.JavaTaskService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/** /**
* @author huangfu * @author huangfu
...@@ -19,6 +23,23 @@ public class JavaTaskServiceImpl implements JavaTaskService { ...@@ -19,6 +23,23 @@ public class JavaTaskServiceImpl implements JavaTaskService {
} }
@Override @Override
public List<JavaTask> findAll(String jobName) {
return javaTaskMapper.findAll(jobName);
}
@Override
public List<JavaTaskLogImportantVo> findAllJavaTaskLogImportantVo(String jobName) {
List<JavaTask> javaTasks = this.findAll(jobName);
return javaTasks.stream().map(javaTask -> {
JavaTaskLogImportantVo javaTaskLogImportantVo = new JavaTaskLogImportantVo();
javaTaskLogImportantVo.setRowKey(UUID.randomUUID().toString().replace("-",""));
javaTaskLogImportantVo.setHasChildren(true);
BeanUtils.copyProperties(javaTask,javaTaskLogImportantVo);
return javaTaskLogImportantVo;
}).collect(Collectors.toList());
}
@Override
public List<JavaTask> findAllByTriggerTimeLessThanEqual(Long triggerTime) { public List<JavaTask> findAllByTriggerTimeLessThanEqual(Long triggerTime) {
return javaTaskMapper.findAllByTriggerTimeLessThanEqual(triggerTime); return javaTaskMapper.findAllByTriggerTimeLessThanEqual(triggerTime);
} }
......
...@@ -41,12 +41,29 @@ public class JobTaskRunLogServiceImpl implements JobTaskRunLogService { ...@@ -41,12 +41,29 @@ public class JobTaskRunLogServiceImpl implements JobTaskRunLogService {
} }
@Override @Override
public List<JobTaskRunLog> findImmediatelyNode(String nodeName) {
return jobTaskRunLogMapper.findImmediatelyNode(nodeName);
}
@Override
public List<RunLogVo> findNodeLogByHandlerName(String handlerName) {
List<JobTaskRunLogWithBLOBs> nodeLogByHandlerName = jobTaskRunLogMapper.findNodeLogByHandlerName(handlerName);
return nodeLogByHandlerName.stream().map(nodeLog ->{
RunLogVo runLogVo = new RunLogVo();
runLogVo.setRowKey(UUID.randomUUID().toString().replace("-",""));
runLogVo.setHasTrigger(true);
BeanUtils.copyProperties(nodeLog,runLogVo);
return runLogVo;
}).collect(Collectors.toList());
}
@Override
public List<JobTaskRunLog> findJobTaskRunLogNotEndNodeByRunCodeCount(List<Integer> nodIds, String runId) { public List<JobTaskRunLog> findJobTaskRunLogNotEndNodeByRunCodeCount(List<Integer> nodIds, String runId) {
return jobTaskRunLogMapper.findJobTaskRunLogNotEndNodeByRunCodeCount(nodIds, runId); return jobTaskRunLogMapper.findJobTaskRunLogNotEndNodeByRunCodeCount(nodIds, runId);
} }
@Override @Override
public List<JobTaskRunLog> findErrorNode() { public List<JobTaskRunLogWithBLOBs> findErrorNode() {
return jobTaskRunLogMapper.findErrorNode(); return jobTaskRunLogMapper.findErrorNode();
} }
......
package com.byit.service.impl; package com.byit.service.impl;
import com.byit.dto.FlowConditionDto;
import com.byit.enums.RunRecordingEnum; import com.byit.enums.RunRecordingEnum;
import com.byit.mapper.RunRecordingMapper; import com.byit.mapper.RunRecordingMapper;
import com.byit.model.RunRecording; import com.byit.model.RunRecording;
...@@ -29,8 +30,8 @@ public class RunRecordingServiceImpl implements RunRecordingService { ...@@ -29,8 +30,8 @@ public class RunRecordingServiceImpl implements RunRecordingService {
} }
@Override @Override
public List<RunRecordingViewVo> findAllRunRecordingViewVo() { public List<RunRecordingViewVo> findAllRunRecordingViewVo(FlowConditionDto flowConditionDt) {
List<RunRecording> runRecordings = findAll(); List<RunRecording> runRecordings = findAll(flowConditionDt);
return runRecordings.stream().map(runRecording -> { return runRecordings.stream().map(runRecording -> {
RunRecordingViewVo runRecordingViewVo = new RunRecordingViewVo(); RunRecordingViewVo runRecordingViewVo = new RunRecordingViewVo();
runRecordingViewVo.setHasChildren(true); runRecordingViewVo.setHasChildren(true);
...@@ -41,13 +42,13 @@ public class RunRecordingServiceImpl implements RunRecordingService { ...@@ -41,13 +42,13 @@ public class RunRecordingServiceImpl implements RunRecordingService {
} }
@Override @Override
public List<RunRecording> findAll() { public List<RunRecording> findAll(FlowConditionDto flowConditionDto) {
return runRecordingMapper.findAll(); return runRecordingMapper.findAll(flowConditionDto);
} }
@Override @Override
public List<RunRecordingViewVo> findAllError() { public List<RunRecordingViewVo> findAllError(FlowConditionDto flowConditionDto) {
List<RunRecording> allError = runRecordingMapper.findAllError(); List<RunRecording> allError = runRecordingMapper.findAllError(flowConditionDto);
return allError.stream().map(runRecording -> { return allError.stream().map(runRecording -> {
RunRecordingViewVo runRecordingViewVo = new RunRecordingViewVo(); RunRecordingViewVo runRecordingViewVo = new RunRecordingViewVo();
runRecordingViewVo.setHasChildren(true); runRecordingViewVo.setHasChildren(true);
...@@ -58,8 +59,8 @@ public class RunRecordingServiceImpl implements RunRecordingService { ...@@ -58,8 +59,8 @@ public class RunRecordingServiceImpl implements RunRecordingService {
} }
@Override @Override
public List<RunRecording> findAllRunIng() { public List<RunRecording> findAllRunIng(FlowConditionDto flowConditionDto) {
return runRecordingMapper.findAllRunIng(); return runRecordingMapper.findAllRunIng(flowConditionDto);
} }
@Override @Override
......
package com.byit.service.impl;
import com.byit.mapper.WorkspaceMapper;
import com.byit.model.Workspace;
import com.byit.service.WorkspaceService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author huangfu
*/
@Service
public class WorkspaceServiceImpl implements WorkspaceService {
private final WorkspaceMapper workspaceMapper;
public WorkspaceServiceImpl(WorkspaceMapper workspaceMapper) {
this.workspaceMapper = workspaceMapper;
}
@Override
public List<Workspace> findAll() {
return workspaceMapper.findAll();
}
}
...@@ -62,13 +62,13 @@ public class JavaTaskJobTask implements TimerTask { ...@@ -62,13 +62,13 @@ public class JavaTaskJobTask implements TimerTask {
log.setTriggerCode(RunResultEnum.TRIGGER_ERROR.getCode()); log.setTriggerCode(RunResultEnum.TRIGGER_ERROR.getCode());
} }
log.setTriggerMsg(pluginRpcResponsePacket.getMsg()); log.setTriggerMsg(pluginRpcResponsePacket.getMsg());
log.setJobGroupIp(pluginRpcResponsePacket.getRunIp());
}catch (Exception e){ }catch (Exception e){
log.setTriggerCode(RunResultEnum.TRIGGER_ERROR.getCode()); log.setTriggerCode(RunResultEnum.TRIGGER_ERROR.getCode());
log.setRunCode(RunResultEnum.RUN_ERROR.getCode()); log.setRunCode(RunResultEnum.RUN_ERROR.getCode());
log.setRunMsg(javaTask.getTaskName()+":"+e.getMessage()); log.setRunMsg(javaTask.getTaskName()+":"+e.getMessage());
log.setTriggerMsg(javaTask.getTaskName()+":"+e.getMessage()); log.setTriggerMsg(javaTask.getTaskName()+":"+e.getMessage());
} }
JobTaskRunLogServiceImpl jobTaskRunLogService = SpringUtil.getBean(JobTaskRunLogServiceImpl.class); JobTaskRunLogServiceImpl jobTaskRunLogService = SpringUtil.getBean(JobTaskRunLogServiceImpl.class);
jobTaskRunLogService.updateJobTaskRunLogWithBLOBs(log); jobTaskRunLogService.updateJobTaskRunLogWithBLOBs(log);
} }
......
...@@ -7,6 +7,7 @@ import com.byit.packet.response.PluginRpcResponsePacket; ...@@ -7,6 +7,7 @@ import com.byit.packet.response.PluginRpcResponsePacket;
import com.byit.service.impl.JobTaskRunLogServiceImpl; import com.byit.service.impl.JobTaskRunLogServiceImpl;
import com.byit.util.SpringUtil; import com.byit.util.SpringUtil;
import java.util.Date;
import java.util.Map; import java.util.Map;
/** /**
...@@ -34,6 +35,7 @@ public class JavaTaskCallbackThread implements Runnable { ...@@ -34,6 +35,7 @@ public class JavaTaskCallbackThread implements Runnable {
jobTaskRunLog.setRunMsg(result.get("msg")); jobTaskRunLog.setRunMsg(result.get("msg"));
jobTaskRunLog.setRunCode(code); jobTaskRunLog.setRunCode(code);
jobTaskRunLog.setLogId(logId); jobTaskRunLog.setLogId(logId);
jobTaskRunLog.setEndTime(new Date());
mythJobTaskRunLogService.updateJobTaskRunLogWithBLOBs(jobTaskRunLog); mythJobTaskRunLogService.updateJobTaskRunLogWithBLOBs(jobTaskRunLog);
} }
......
...@@ -2,6 +2,8 @@ package com.byit.thread; ...@@ -2,6 +2,8 @@ package com.byit.thread;
import com.byit.dto.executor.JobRunResultDto; import com.byit.dto.executor.JobRunResultDto;
import com.byit.enums.EmailEnum; import com.byit.enums.EmailEnum;
import com.byit.enums.JobResultEnum;
import com.byit.enums.task.RunResultEnum;
import com.byit.model.JobTaskRunLogWithBLOBs; import com.byit.model.JobTaskRunLogWithBLOBs;
import com.byit.service.impl.JobTaskRunLogServiceImpl; import com.byit.service.impl.JobTaskRunLogServiceImpl;
import com.byit.util.SpringUtil; import com.byit.util.SpringUtil;
...@@ -41,7 +43,12 @@ public class LogCallbackThread implements Runnable { ...@@ -41,7 +43,12 @@ public class LogCallbackThread implements Runnable {
jobTaskRunLog.setLogId(jobRunResultDto.getLogId()); jobTaskRunLog.setLogId(jobRunResultDto.getLogId());
jobTaskRunLog.setStartTime(jobRunResultDto.getStartTime()); jobTaskRunLog.setStartTime(jobRunResultDto.getStartTime());
jobTaskRunLog.setEndTime(jobRunResultDto.getEndTime()); jobTaskRunLog.setEndTime(jobRunResultDto.getEndTime());
jobTaskRunLog.setRunCode(jobRunResultDto.getReturnResult().getCode()); String code = RunResultEnum.RUN_ERROR.getCode();
if (JobResultEnum.SUCCESS.getCode().equals(jobRunResultDto.getReturnResult().getCode())){
code = RunResultEnum.RUN_SUCCESS.getCode();
}
jobTaskRunLog.setRunCode(code);
jobTaskRunLog.setAlertEnd(EmailEnum.IS_ALARM_NO.getCode()); jobTaskRunLog.setAlertEnd(EmailEnum.IS_ALARM_NO.getCode());
mythJobTaskRunLogService.updateJobTaskRunLogWithBLOBs(jobTaskRunLog); mythJobTaskRunLogService.updateJobTaskRunLogWithBLOBs(jobTaskRunLog);
......
...@@ -2,6 +2,7 @@ package com.byit.thread.helper; ...@@ -2,6 +2,7 @@ package com.byit.thread.helper;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.byit.model.JobTaskRunLog; import com.byit.model.JobTaskRunLog;
import com.byit.model.JobTaskRunLogWithBLOBs;
import com.byit.service.mapservice.JobTaskRunLogAndJobTaskService; import com.byit.service.mapservice.JobTaskRunLogAndJobTaskService;
import com.byit.service.JobTaskRunLogService; import com.byit.service.JobTaskRunLogService;
import com.byit.thread.BaseThreadRunHelper; import com.byit.thread.BaseThreadRunHelper;
...@@ -35,7 +36,7 @@ public class FailedRetryThreadRunHelper extends BaseThreadRunHelper { ...@@ -35,7 +36,7 @@ public class FailedRetryThreadRunHelper extends BaseThreadRunHelper {
@Override @Override
public Long start() { public Long start() {
//查询又重试次数的失败节点 //查询又重试次数的失败节点
List<JobTaskRunLog> errorNodes = jobTaskRunLogService.findErrorNode(); List<JobTaskRunLogWithBLOBs> errorNodes = jobTaskRunLogService.findErrorNode();
if(CollectionUtil.isNotEmpty(errorNodes)){ if(CollectionUtil.isNotEmpty(errorNodes)){
errorNodes.forEach(errorNode ->{ errorNodes.forEach(errorNode ->{
log.debug("-----------------【操作失败节点{}】-----------------",errorNode); log.debug("-----------------【操作失败节点{}】-----------------",errorNode);
......
...@@ -39,7 +39,7 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper { ...@@ -39,7 +39,7 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper {
@Override @Override
public Long start() { public Long start() {
Long preTestTime = System.currentTimeMillis()+ TimeUnit.HOURS.toMillis(PRE_TIME); Long preTestTime = System.currentTimeMillis()+ TimeUnit.MINUTES.toMillis(PRE_TIME);
//这个查询时有一个条件是 剩余次数不等于0也就是说 等于0的就查询不出来 //这个查询时有一个条件是 剩余次数不等于0也就是说 等于0的就查询不出来
List<Flow> halfAnHourFlow = flowService.findHalfAnHourFlow(preTestTime); List<Flow> halfAnHourFlow = flowService.findHalfAnHourFlow(preTestTime);
if (CollectionUtil.isNotEmpty(halfAnHourFlow)) { if (CollectionUtil.isNotEmpty(halfAnHourFlow)) {
......
...@@ -92,6 +92,21 @@ ...@@ -92,6 +92,21 @@
from flow from flow
</select> </select>
<select id="findAllByCondition" parameterType="com.byit.dto.FlowConditionDto" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from flow
<trim prefix="where" prefixOverrides="and">
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=INTEGER}
</if>
<if test="flowName != null and flowName != ''">
and flow_name like concat(concat('%',#{flowName,jdbcType=VARCHAR}),'%')
</if>
</trim>
</select>
<delete id="deleteById" parameterType="java.lang.Integer"> <delete id="deleteById" parameterType="java.lang.Integer">
<!-- generated @mbg.generated date: 2019-12-31 --> <!-- generated @mbg.generated date: 2019-12-31 -->
delete from flow delete from flow
......
...@@ -41,6 +41,18 @@ ...@@ -41,6 +41,18 @@
from flow_version where remove_mark = '1' from flow_version where remove_mark = '1'
</select> </select>
<select id="findAllFlowCondition" parameterType="com.byit.dto.FlowConditionDto" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from flow_version where remove_mark = '1'
<if test="workspaceId != null">
and workspace_id = #{workspaceId,jdbcType=INTEGER}
</if>
<if test="flowName != null and flowName != ''">
and flow_name = #{flowName,jdbcType=INTEGER}
</if>
</select>
<select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!-- generated @mbg.generated date: 2019-12-31 --> <!-- generated @mbg.generated date: 2019-12-31 -->
select select
......
...@@ -21,6 +21,18 @@ ...@@ -21,6 +21,18 @@
id, job_name, task_name, repeat_count, param, trigger_time, cron, remaining_count, id, job_name, task_name, repeat_count, param, trigger_time, cron, remaining_count,
create_time, update_time, alarml_action, alarm_email create_time, update_time, alarml_action, alarm_email
</sql> </sql>
<select id="findAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from java_task
<where>
<if test="jobName != null and jobName != ''">
job_name like concat(concat('%',#{jobName,jdbcType=VARCHAR}),'%')
</if>
</where>
</select>
<select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!-- generated @mbg.generated date: 2020-04-14 --> <!-- generated @mbg.generated date: 2020-04-14 -->
select select
......
...@@ -62,8 +62,30 @@ ...@@ -62,8 +62,30 @@
</foreach> </foreach>
</select> </select>
<select id="findErrorNode" resultMap="BaseResultMap"> <select id="findImmediatelyNode" resultMap="ResultMapWithBLOBs">
select <include refid="Base_Column_List" /> select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from job_task_run_log where schedule_type = 4
<if test="nodeName != null and nodeName != ''">
AND node_name = #{nodeName,jdbcType=VARCHAR}
</if>
</select>
<select id="findNodeLogByHandlerName" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from job_task_run_log where handler_name = #{handlerName,jdbcType=VARCHAR}
</select>
<select id="findErrorNode" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from job_task_run_log from job_task_run_log
where (run_code = '2' || run_code = '4') and failed_remaining_count > 0 where (run_code = '2' || run_code = '4') and failed_remaining_count > 0
and is_virtual = '1' and is_virtual = '1'
......
...@@ -25,32 +25,55 @@ ...@@ -25,32 +25,55 @@
<result column="schedule_type" jdbcType="INTEGER" property="scheduleType" /> <result column="schedule_type" jdbcType="INTEGER" property="scheduleType" />
<result column="operator" jdbcType="VARCHAR" property="operator" /> <result column="operator" jdbcType="VARCHAR" property="operator" />
<result column="re_run_id" jdbcType="VARCHAR" property="reRunId" /> <result column="re_run_id" jdbcType="VARCHAR" property="reRunId" />
<result column="workspace_id" jdbcType="INTEGER" property="workspaceId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
recording_id, run_id, alarm_email, dispatch_ip, flow_name, flow_run_result, flow_status, recording_id, run_id, alarm_email, dispatch_ip, flow_name, flow_run_result, flow_status,
flow_timeout, flow_version_name, alarml_action, priority, trigger_time, principal, flow_timeout, flow_version_name, alarml_action, priority, trigger_time, principal,
flow_id, start_time, end_time, is_alarm,is_inner,fail_fast, flow_node_count, schedule_type, operator, re_run_id flow_id, start_time, end_time, is_alarm,is_inner,fail_fast, flow_node_count, schedule_type, operator, re_run_id
,workspace_id
</sql> </sql>
<select id="findAll" resultMap="BaseResultMap"> <select id="findAll" parameterType="com.byit.dto.FlowConditionDto" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from run_recording from run_recording
<trim prefix="WHERE" prefixOverrides="AND |OR">
<if test="workspaceId != null">
and workspace_id = #{workspaceId,jdbcType=INTEGER}
</if>
<if test="flowName != null and flowName != ''">
and flow_name = #{flowName,jdbcType=VARCHAR}
</if>
</trim>
</select> </select>
<select id="findAllError" resultMap="BaseResultMap"> <select id="findAllError" parameterType="com.byit.dto.FlowConditionDto" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from run_recording from run_recording
where flow_run_result = '2' or flow_run_result = '4' where (flow_run_result = '2' or flow_run_result = '4'
or flow_run_result = '5' or flow_run_result = '5')
<if test="workspaceId != null">
and workspace_id = #{workspaceId,jdbcType=INTEGER}
</if>
<if test="flowName != null and flowName != ''">
and flow_name = #{flowName,jdbcType=VARCHAR}
</if>
</select> </select>
<select id="findAllRunIng" resultMap="BaseResultMap"> <select id="findAllRunIng" parameterType="com.byit.dto.FlowConditionDto" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from run_recording from run_recording
where flow_status = '2' or flow_status = '3' where (flow_status = '2' or flow_status = '3')
<if test="workspaceId != null">
AND workspace_id = #{workspaceId,jdbcType=INTEGER}
</if>
<if test="flowName != null and flowName != ''">
AND flow_name = #{flowName,jdbcType=VARCHAR}
</if>
</select> </select>
<!--查询已完结 没有告警的--> <!--查询已完结 没有告警的-->
...@@ -311,6 +334,9 @@ ...@@ -311,6 +334,9 @@
<if test="reRunId != null"> <if test="reRunId != null">
re_run_id, re_run_id,
</if> </if>
<if test="workspaceId != null">
workspace_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordingId != null"> <if test="recordingId != null">
...@@ -382,6 +408,9 @@ ...@@ -382,6 +408,9 @@
<if test="reRunId != null"> <if test="reRunId != null">
#{reRunId,jdbcType=VARCHAR}, #{reRunId,jdbcType=VARCHAR},
</if> </if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateRunRecordingById" parameterType="com.byit.model.RunRecording"> <update id="updateRunRecordingById" parameterType="com.byit.model.RunRecording">
...@@ -453,6 +482,9 @@ ...@@ -453,6 +482,9 @@
<if test="reRunId != null"> <if test="reRunId != null">
re_run_id = #{reRunId,jdbcType=VARCHAR}, re_run_id = #{reRunId,jdbcType=VARCHAR},
</if> </if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=INTEGER},
</if>
</set> </set>
where recording_id = #{recordingId,jdbcType=INTEGER} where recording_id = #{recordingId,jdbcType=INTEGER}
</update> </update>
...@@ -526,6 +558,9 @@ ...@@ -526,6 +558,9 @@
<if test="reRunId != null"> <if test="reRunId != null">
re_run_id = #{reRunId,jdbcType=VARCHAR}, re_run_id = #{reRunId,jdbcType=VARCHAR},
</if> </if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=INTEGER},
</if>
</set> </set>
where flow_id = #{flowId,jdbcType=INTEGER} and run_id = #{runId,jdbcType=VARCHAR} where flow_id = #{flowId,jdbcType=INTEGER} and run_id = #{runId,jdbcType=VARCHAR}
</update> </update>
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
workspace_id, workspace_name, author, add_time, remove_mark workspace_id, workspace_name, author, add_time, remove_mark
</sql> </sql>
<select id="findAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from workspace
</select>
<select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!-- generated @mbg.generated date: 2019-12-31 --> <!-- generated @mbg.generated date: 2019-12-31 -->
select select
......
...@@ -27,6 +27,7 @@ public class PluginRpcResponsePacket extends BasePacketModel { ...@@ -27,6 +27,7 @@ public class PluginRpcResponsePacket extends BasePacketModel {
private String type; private String type;
private long runTime; private long runTime;
private boolean status = false; private boolean status = false;
private String runIp;
@Override @Override
public Command getCommand() { public Command getCommand() {
return Command.RUN_REMOTELY_JOB_NODE_RESPONSE; return Command.RUN_REMOTELY_JOB_NODE_RESPONSE;
......
...@@ -5,6 +5,7 @@ import com.byit.client.PluginClient; ...@@ -5,6 +5,7 @@ import com.byit.client.PluginClient;
import com.byit.factory.PluginClientFactory; import com.byit.factory.PluginClientFactory;
import com.byit.future.PluginFutureResponse; import com.byit.future.PluginFutureResponse;
import com.byit.packet.request.PluginRpcRequestPacket; import com.byit.packet.request.PluginRpcRequestPacket;
import com.byit.packet.response.PluginRpcResponsePacket;
import com.byit.registry.PluginServiceRegistry; import com.byit.registry.PluginServiceRegistry;
import com.byit.rpc.remoting.invoker.route.LoadBalance; import com.byit.rpc.remoting.invoker.route.LoadBalance;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -87,7 +88,9 @@ public class PluginClientInitialization { ...@@ -87,7 +88,9 @@ public class PluginClientInitialization {
//发送请求 //发送请求
pluginClient.send(address,pluginRpcRequestPacket); pluginClient.send(address,pluginRpcRequestPacket);
//获取结果 //获取结果
return pluginFutureResponse.get(); PluginRpcResponsePacket pluginRpcResponsePacket = pluginFutureResponse.get();
pluginRpcResponsePacket.setRunIp(address);
return pluginRpcResponsePacket;
}catch (Exception e){ }catch (Exception e){
throw new RuntimeException(e); throw new RuntimeException(e);
}finally { }finally {
......
...@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component; ...@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
* @author huangfu * @author huangfu
*/ */
@Component @Component
@TaskHandler(expand = "{sadasdadasdasdasd}",cron = "0 0/2 * * * ?",taskName = "sentEmailServer",autoPublish = false,publishUrl = "http://127.0.0.1:8081/myth-job-admin/api/node/autoAddJavaTask") @TaskHandler(expand = "{sadasdadasdasdasd}",cron = "0 0/2 * * * ?",taskName = "sentEmailServer",autoPublish = true,publishUrl = "http://127.0.0.1:8081/myth-job-admin/api/node/autoAddJavaTask")
@Slf4j @Slf4j
public class SentEmailServer extends BaseJobHandler { public class SentEmailServer extends BaseJobHandler {
@Override @Override
......
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