@@ -0,0 +1,27 @@ | |||||
package com.ruoyi.business.domain.bo; | |||||
import lombok.Data; | |||||
/** | |||||
* 查询运行日志 | |||||
* | |||||
* @author boyi | |||||
* @since 2022/8/26 10:16 | |||||
*/ | |||||
@Data | |||||
public class JobQueryLogBO { | |||||
/** | |||||
* 计划uuid | |||||
*/ | |||||
private String scheduleUuid; | |||||
/** | |||||
* 翻页方向 | |||||
*/ | |||||
private String cursorDirection; | |||||
/** | |||||
* 每页数量 | |||||
*/ | |||||
private Integer size; | |||||
} | |||||
@@ -0,0 +1,65 @@ | |||||
package com.ruoyi.business.domain.vo; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import lombok.Data; | |||||
import java.util.Date; | |||||
import java.util.List; | |||||
/** | |||||
* 查询job响应 | |||||
* | |||||
* @author boyi | |||||
* @since 2022/8/26 10:17 | |||||
*/ | |||||
@Data | |||||
public class JobQueryLogVO { | |||||
/** | |||||
* 用于判断继续翻页时是否有数据,可用作翻页按钮置灰操作比如当往下翻页到20页时,第21页没有数据,则在20页时hasData为false,表示不能继续往下翻页,只能往上翻页 | |||||
*/ | |||||
private Boolean hasData; | |||||
/** | |||||
* 往下翻页时,可作为 cursorId 使用,表示从这个id开始往下翻页 | |||||
*/ | |||||
private Long nextId; | |||||
/** | |||||
* 往上翻页时,可作为 cursorId 使用,表示从这个id开始往上翻页 | |||||
*/ | |||||
private Long preId; | |||||
/** | |||||
* 当前的翻页方向 next表示当前往下翻页 pre表示当前往上翻页 | |||||
*/ | |||||
private String cursorDirection; | |||||
/** | |||||
* 日志 | |||||
*/ | |||||
private List<DataList> dataList; | |||||
/** | |||||
* 任务结束运行的时 | |||||
/** | |||||
* 应用运行参数 | |||||
*/ | |||||
@Data | |||||
public static class DataList { | |||||
private String id; | |||||
private String jobUuid; | |||||
private String status; | |||||
private String taskName; | |||||
private String robotUuid; | |||||
private String robotName; | |||||
private String triggerTime; | |||||
private String robotClientUuid; | |||||
// remark | |||||
private String remark; | |||||
} | |||||
} |
@@ -19,19 +19,23 @@ public interface IApplyPlanService extends IService<ApplyPlan> { | |||||
/** | /** | ||||
* 更新计划应用执行结果 | * 更新计划应用执行结果 | ||||
* | |||||
* @param | * @param | ||||
* @return | * @return | ||||
*/ | */ | ||||
void queryAppStartResult() throws IllegalAccessException; | void queryAppStartResult() throws IllegalAccessException; | ||||
/** | /** | ||||
* 获取应用执行结果 | * 获取应用执行结果 | ||||
* | |||||
* @return | * @return | ||||
*/ | */ | ||||
boolean execPlan(ApplyStartBO applyStartBO) throws IllegalAccessException; | boolean execPlan(ApplyStartBO applyStartBO) throws IllegalAccessException; | ||||
/** | /** | ||||
* 定时查询指定时间执行的数据 | * 定时查询指定时间执行的数据 | ||||
* | |||||
* @return | * @return | ||||
*/ | */ | ||||
boolean runAppBySetTime() throws IllegalAccessException; | boolean runAppBySetTime() throws IllegalAccessException; | ||||
@@ -43,6 +47,7 @@ public interface IApplyPlanService extends IService<ApplyPlan> { | |||||
/** | /** | ||||
* 创建计划 | * 创建计划 | ||||
* | |||||
* @param addApplyPlanBO | * @param addApplyPlanBO | ||||
* @return | * @return | ||||
*/ | */ | ||||
@@ -50,10 +55,12 @@ public interface IApplyPlanService extends IService<ApplyPlan> { | |||||
/** | /** | ||||
* 修改计划 | * 修改计划 | ||||
* | |||||
* @param addApplyPlanBO | * @param addApplyPlanBO | ||||
* @return | * @return | ||||
*/ | */ | ||||
boolean update(AddApplyPlanBO addApplyPlanBO); | boolean update(AddApplyPlanBO addApplyPlanBO); | ||||
/** | /** | ||||
* 查询应用执行计划管理列表 | * 查询应用执行计划管理列表 | ||||
* | * | ||||
@@ -12,6 +12,7 @@ import com.ruoyi.business.domain.Apply; | |||||
import com.ruoyi.business.domain.Rebot; | import com.ruoyi.business.domain.Rebot; | ||||
import com.ruoyi.business.domain.ResourceLibrary; | import com.ruoyi.business.domain.ResourceLibrary; | ||||
import com.ruoyi.business.domain.bo.*; | import com.ruoyi.business.domain.bo.*; | ||||
import com.ruoyi.business.domain.vo.JobQueryLogVO; | |||||
import com.ruoyi.business.domain.vo.JobQueryVO; | import com.ruoyi.business.domain.vo.JobQueryVO; | ||||
import com.ruoyi.business.domain.vo.JobStartVO; | import com.ruoyi.business.domain.vo.JobStartVO; | ||||
import com.ruoyi.business.domain.vo.ListRebotVO; | import com.ruoyi.business.domain.vo.ListRebotVO; | ||||
@@ -307,7 +308,7 @@ public class ApplyPlanServiceImpl extends ServiceImpl<ApplyPlanMapper, ApplyPlan | |||||
updateApplyPlan.setOutParam(robotParam.getValue()); | updateApplyPlan.setOutParam(robotParam.getValue()); | ||||
} | } | ||||
} | } | ||||
updateApplyPlan.setRemark(jobQueryVO.getRemark()); | |||||
this.updateById(updateApplyPlan); | this.updateById(updateApplyPlan); | ||||
} | } | ||||
// 如果是终态改变机器人状态 | // 如果是终态改变机器人状态 | ||||
@@ -2,14 +2,8 @@ package com.ruoyi.business.util; | |||||
import cn.hutool.json.JSONUtil; | import cn.hutool.json.JSONUtil; | ||||
import com.alibaba.fastjson2.JSON; | import com.alibaba.fastjson2.JSON; | ||||
import com.ruoyi.business.domain.bo.ApplyStartBO; | |||||
import com.ruoyi.business.domain.bo.JobQueryBO; | |||||
import com.ruoyi.business.domain.bo.ListApplyBO; | |||||
import com.ruoyi.business.domain.bo.ListRebotBO; | |||||
import com.ruoyi.business.domain.vo.JobQueryVO; | |||||
import com.ruoyi.business.domain.vo.JobStartVO; | |||||
import com.ruoyi.business.domain.vo.ListApplyVO; | |||||
import com.ruoyi.business.domain.vo.ListRebotVO; | |||||
import com.ruoyi.business.domain.bo.*; | |||||
import com.ruoyi.business.domain.vo.*; | |||||
import com.ruoyi.business.yddoman.BaseDTO; | import com.ruoyi.business.yddoman.BaseDTO; | ||||
import com.ruoyi.business.yddoman.CreateTokenDTO; | import com.ruoyi.business.yddoman.CreateTokenDTO; | ||||
import com.ruoyi.common.exception.ServiceException; | import com.ruoyi.common.exception.ServiceException; | ||||
@@ -44,6 +38,8 @@ public class YinDaoHttpUtils { | |||||
private static final String APP_START = REQUEST_PREFIX + "/dispatch/v2/job/start"; | private static final String APP_START = REQUEST_PREFIX + "/dispatch/v2/job/start"; | ||||
// 查询应用运行结果 | // 查询应用运行结果 | ||||
private static final String QUERY_APP_START_RESULT = REQUEST_PREFIX + "/dispatch/v2/job/query"; | private static final String QUERY_APP_START_RESULT = REQUEST_PREFIX + "/dispatch/v2/job/query"; | ||||
// 查询应用运行日志(异常时可以查询原因) | |||||
private static final String QUERY_APP_START_RESULT_LOG = REQUEST_PREFIX + "/dispatch/v2/job/list"; | |||||
/** | /** | ||||
@@ -66,6 +62,16 @@ public class YinDaoHttpUtils { | |||||
return JSON.parseObject(baseDTO.getData().toString(), JobQueryVO.class); | return JSON.parseObject(baseDTO.getData().toString(), JobQueryVO.class); | ||||
} | } | ||||
/** | |||||
* 查询应用运行结果 | |||||
*/ | |||||
public static JobQueryLogVO queryAppStartResultLog(JobQueryLogBO jobQueryLogBO) throws IllegalAccessException { | |||||
// 实体类转map | |||||
Map<String, Object> data = BeanToMapUtil.convertEntityToMap(jobQueryLogBO); | |||||
BaseDTO baseDTO = sendPost(QUERY_APP_START_RESULT_LOG, data); | |||||
return JSON.parseObject(baseDTO.getData().toString(), JobQueryLogVO.class); | |||||
} | |||||
/** | /** | ||||
* 查询应用列表 | * 查询应用列表 | ||||
*/ | */ | ||||
@@ -71,8 +71,4 @@ public class RyTask { | |||||
} | } |