Commit 6fd09734 by guo_minglei@163.com

查询运行实例接口改造

parent c3f7d54b
...@@ -661,7 +661,17 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -661,7 +661,17 @@ public class ApiFlowServiceImpl implements ApiFlowService {
} }
} }
List<RunRecording> runRecordList = runRecordingMapper.findByStartAndEndTime(startDate.getTime(), endDate.getTime(), flowIds); String scheduleStatus = jsonObject.getString("scheduleStatus");
List<String> scheduleStatusList = new ArrayList<>();
if(StringUtils.isNotEmpty(scheduleStatus)){
scheduleStatusList = Arrays.asList(scheduleStatus.split(","));
}
String executeStatus = jsonObject.getString("executeStatus");
List<String> executeStatusList = new ArrayList<>();
if(StringUtils.isNotEmpty(executeStatus)){
executeStatusList = Arrays.asList(executeStatus.split(","));
}
List<RunRecording> runRecordList = runRecordingMapper.findByStartAndEndTime(startDate.getTime(), endDate.getTime(), flowIds, scheduleStatusList, executeStatusList);
return runRecordList; return runRecordList;
} }
......
...@@ -16,7 +16,7 @@ spring: ...@@ -16,7 +16,7 @@ spring:
redis: redis:
database: 0 database: 0
host: 10.0.120.218 host: 10.0.120.208
port: 6379 port: 6379
password: password:
......
package com.byit.enums;
/**
* @Description
* @Author guo_m
* @Date 2020-03-31
*/
public enum ExecuteStatusEnum {
UN_START(1, "未运行"),
STARTING(2, "运行中"),
FINISH(3, "暂停"),
STOP(4, "完成"),
;
private Integer code;
private String msg;
private ExecuteStatusEnum(Integer code, String msg){
this.code = code;
this.msg = msg;
}
public Integer getCode(){
return this.code;
}
public String getMsg(){
return this.msg;
}
}
package com.byit.enums;
/**
* @Description 调度状态
* @Author guo_m
* @Date 2020-03-31
*/
public enum ScheduleStatusEnum {
SUCCESS(1, "成功"),
FAIL(2, "失败"),
REPAIR_SUCCESS(3, "补批成功"),
REPAIR_FAIL(4, "补批失败"),
KILL(5, "杀死")
;
private Integer code;
private String msg;
private ScheduleStatusEnum(Integer code, String msg){
this.code = code;
this.msg = msg;
}
public Integer getCode(){
return this.code;
}
public String getMsg(){
return this.msg;
}
}
...@@ -137,7 +137,11 @@ public interface RunRecordingMapper { ...@@ -137,7 +137,11 @@ public interface RunRecordingMapper {
*/ */
List<RunRecording> findUnFinishByRunId(String runId); List<RunRecording> findUnFinishByRunId(String runId);
List<RunRecording> findByStartAndEndTime(@Param("startDate")long startDate, @Param("endDate")long endDate, @Param("flowIds")List<Integer> flowIds); List<RunRecording> findByStartAndEndTime(@Param("startDate")long startDate,
@Param("endDate")long endDate,
@Param("flowIds")List<Integer> flowIds,
@Param("scheduleStatusList")List<String> scheduleStatusList,
@Param("executeStatusList")List<String> executeStatusList);
/** /**
* 获取运行实例 * 获取运行实例
......
...@@ -113,10 +113,24 @@ ...@@ -113,10 +113,24 @@
<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=",">
flowId #{flowId}
</foreach> </foreach>
) )
</if> </if>
<if test="scheduleStatusList != null">
and flow_status in (
<foreach collection="scheduleStatusList" item="scheduleStatus" separator=",">
${scheduleStatus}
</foreach>
)
</if>
<if test="executeStatusList != null">
and flow_run_result in (
<foreach collection="executeStatusList" item="executeStatus" separator=",">
${executeStatus}
</foreach>
)
</if>
order by start_time desc order by start_time desc
</select> </select>
......
...@@ -312,12 +312,14 @@ public class JobUtils { ...@@ -312,12 +312,14 @@ public class JobUtils {
* @param flowName 工作流名称 * @param flowName 工作流名称
* @return * @return
*/ */
public static ResponseResult loadScheduleResult(String startTime, String endTime, String workspaceName, String flowName){ public static ResponseResult loadScheduleResult(String startTime, String endTime, String workspaceName, String flowName, String scheduleStatus, String executeStatus){
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("startTime", startTime); param.put("startTime", startTime);
param.put("endTime", endTime); param.put("endTime", endTime);
param.put("workspaceName", workspaceName); param.put("workspaceName", workspaceName);
param.put("flowName", flowName); param.put("flowName", flowName);
param.put("scheduleStatus", scheduleStatus);
param.put("executeStatus", executeStatus);
String response = createHttpRequest(REQUEST_LOADSCHEDULE, "param=" + JSON.toJSONString(param)); String response = createHttpRequest(REQUEST_LOADSCHEDULE, "param=" + JSON.toJSONString(param));
log.info("--------------------获取运行实例接口调用成功,结果为:{}------------------------",response); log.info("--------------------获取运行实例接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
......
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