Commit 093cc9ca by guo_minglei@163.com

获取运行日志修改

parent a606b7a5
package com.byit.api;
import com.byit.model.RunRecording;
import com.byit.model.vo.RunRecordingVo;
import com.byit.service.ApiFlowService;
import com.byit.service.FlowService;
......@@ -116,8 +117,20 @@ public class ApiFlowController {
*/
@PostMapping("loadScheduleResult")
@ApiOperation("加载运行记录")
public List<RunRecordingVo> loadScheduleResult(String param){
List<RunRecordingVo> result = apiFlowService.loadScheduleResult(param);
public List<RunRecording> loadScheduleResult(String param){
List<RunRecording> result = apiFlowService.loadScheduleResult(param);
return result;
}
/**
*
* @param param
* @return
*/
@PostMapping("loadScheduleLog")
@ApiOperation("加载运行日志")
public RunRecordingVo loadScheduleLog(String param){
RunRecordingVo result = apiFlowService.loadScheduleLog(param);
return result;
}
......
package com.byit.service;
import com.byit.job.dto.plugin.PluginFlow;
import com.byit.model.RunRecording;
import com.byit.model.vo.RunRecordingVo;
import java.text.ParseException;
......@@ -58,7 +59,7 @@ public interface ApiFlowService {
* @param param
* @return
*/
List<RunRecordingVo> loadScheduleResult(String param);
List<RunRecording> loadScheduleResult(String param);
/**
* 补批
......@@ -78,4 +79,11 @@ public interface ApiFlowService {
* @return
*/
String getLogUrl(String param);
/**
* 加载运行日志
* @param param
* @return
*/
RunRecordingVo loadScheduleLog(String param);
}
......@@ -593,7 +593,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
@Override
public List<RunRecordingVo> loadScheduleResult(String param){
public List<RunRecording> loadScheduleResult(String param){
ValidationUtil.dataNotBank(param, "请求参数不允许为空!");
JSONObject jsonObject = JSON.parseObject(param);
String startTime = jsonObject.getString("startTime");
......@@ -634,20 +634,26 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
List<RunRecording> runRecordList = runRecordingMapper.findByStartAndEndTime(startDate.getTime(), endDate.getTime(), flowIds);
if (runRecordList != null && runRecordList.size() > 0){
List<RunRecordingVo> runRecordingVoList = new ArrayList<>();
runRecordList.forEach(runRecording -> {
return runRecordList;
}
@Override
public RunRecordingVo loadScheduleLog(String param) {
ValidationUtil.dataNotBank(param, "请求参数不允许为空!");
JSONObject jsonObject = JSON.parseObject(param);
String runId = jsonObject.getString("runId0");
ValidationUtil.dataNotBank(runId, "运行实例不允许为空!");
String flowName = jsonObject.getString("flowName");
ValidationUtil.dataNotBank(flowName, "工作流名称不允许为空!");
RunRecording runRecording = runRecordingMapper.findByRunIdAndFlowName(runId, flowName);
ValidationUtil.dataNotNull(runRecording, "运行实例不存在!");
RunRecordingVo runRecordingVo = new RunRecordingVo();
BeanUtils.copyProperties(runRecording, runRecordingVo);
List<JobTaskRunLog> jobTaskRunLogList = jobTaskRunLogMapper.findByRunIdAndFlowName(runRecording.getRunId(), runRecording.getFlowName());
List<JobTaskRunLog> jobTaskRunLogList = jobTaskRunLogMapper.findByRunIdAndFlowName(runRecording.getRunId(), flowName);
runRecordingVo.setJobTaskRunLogList(jobTaskRunLogList);
runRecordingVoList.add(runRecordingVo);
});
return runRecordingVoList;
}
return null;
return runRecordingVo;
}
/**
......
......@@ -119,4 +119,12 @@ public interface RunRecordingMapper {
List<RunRecording> findUnFinishByRunId(String runId);
List<RunRecording> findByStartAndEndTime(@Param("startDate")long startDate, @Param("endDate")long endDate, @Param("flowIds")List<Integer> flowIds);
/**
* 获取运行实例
* @param runId
* @param flowName
* @return
*/
RunRecording findByRunIdAndFlowName(@Param("runId")String runId, @Param("flowName")String flowName);
}
\ No newline at end of file
......@@ -97,6 +97,13 @@
</select>
<select id="findByRunIdAndFlowName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from run_recording
where run_id = #{runId,jdbcType=VARCHAR} and flow_name = #{flowName,jdbcType=VARCHAR}
</select>
<delete id="deleteById" parameterType="java.lang.Integer">
<!-- generated @mbg.generated date: 2019-12-25 -->
delete from run_recording
......
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