feat(flow): 集成流程引擎控制巡检任务执行
- 在 GlobalException 中添加对原始异常的支持,实现错误链路追踪 - 为巡检任务和任务实例实体增加任务配置ID和检测任务ID字段 - 更新数据映射文件以同步数据库结构变更 - 在任务实例服务中注入流程控制服务并实现执行、暂停、停止和恢复功能 - 优化任务上下文管理器中的终端ID空值处理逻辑 - 移除终端ID非空校验并调整相关业务逻辑 - 重构任务执行VO类以支持流程引擎调用参数传递
This commit is contained in:
parent
8e4c122f9a
commit
68b2698614
@ -3,63 +3,55 @@ package com.cmvr.common.exception;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
/**
|
||||
* 全局异常
|
||||
*
|
||||
* @author cmvrIot
|
||||
* 全局自定义业务异常
|
||||
*/
|
||||
public class GlobalException extends RuntimeException
|
||||
{
|
||||
public class GlobalException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 错误提示
|
||||
*/
|
||||
/** 前端展示提示信息 */
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 错误明细,内部调试错误
|
||||
*
|
||||
* 和 {@link CommonResult#getDetailMessage()} 一致的设计
|
||||
*/
|
||||
/** 后端详细错误信息(数据库/原始异常详情) */
|
||||
private String detailMessage;
|
||||
|
||||
/**
|
||||
* 空构造方法,避免反序列化问题
|
||||
*/
|
||||
public GlobalException()
|
||||
{
|
||||
// 空构造,序列化使用
|
||||
public GlobalException() {
|
||||
}
|
||||
|
||||
public GlobalException(String message)
|
||||
{
|
||||
// 单纯提示信息
|
||||
public GlobalException(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
// 占位符格式化提示
|
||||
public GlobalException(String template, Object... params) {
|
||||
this.message = StrUtil.format(template, params);
|
||||
}
|
||||
|
||||
// 【重点:支持 提示+原始异常】对应 throw new GlobalException("任务执行失败", e);
|
||||
public GlobalException(String message, Throwable cause) {
|
||||
super(cause); // 绑定原始异常栈,日志可打全堆栈
|
||||
this.message = message;
|
||||
if (cause != null) {
|
||||
this.detailMessage = cause.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public String getDetailMessage()
|
||||
{
|
||||
public String getDetailMessage() {
|
||||
return detailMessage;
|
||||
}
|
||||
|
||||
public GlobalException setDetailMessage(String detailMessage)
|
||||
{
|
||||
public GlobalException setDetailMessage(String detailMessage) {
|
||||
this.detailMessage = detailMessage;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public GlobalException setMessage(String message)
|
||||
{
|
||||
public GlobalException setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -45,6 +45,6 @@ public class InspectionTask extends BaseEntity
|
||||
/** 任务id */
|
||||
@Excel(name = "任务id")
|
||||
@ApiModelProperty("任务id")
|
||||
private String teTaskConfigId;
|
||||
private String taskConfigId;
|
||||
|
||||
}
|
||||
|
||||
@ -52,4 +52,8 @@ public class InspectionTaskInstance extends BaseEntity
|
||||
@ApiModelProperty("结束时间")
|
||||
private Date endTime;
|
||||
|
||||
@Excel(name = "检测任务id")
|
||||
@ApiModelProperty("检测任务id")
|
||||
private String taskInsId;
|
||||
|
||||
}
|
||||
|
||||
@ -90,4 +90,8 @@ public class InspectionTaskInstanceVo extends BaseEntity
|
||||
@ApiModelProperty("修改人昵称")
|
||||
private String updateByName;
|
||||
|
||||
@Excel(name = "检测任务id")
|
||||
@ApiModelProperty("检测任务id")
|
||||
private String taskInsId;
|
||||
|
||||
}
|
||||
|
||||
@ -53,4 +53,9 @@ public class InspectionTaskVo extends BaseEntity
|
||||
@ApiModelProperty("修改人昵称")
|
||||
private String updateByName;
|
||||
|
||||
/** 任务id */
|
||||
@Excel(name = "任务id")
|
||||
@ApiModelProperty("任务id")
|
||||
private String taskConfigId;
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,9 @@ import com.cmvr.common.exception.ServiceException;
|
||||
import com.cmvr.common.utils.SecurityUtils;
|
||||
import com.cmvr.inspection.domain.vo.InspectionTaskInstanceVo;
|
||||
import com.cmvr.inspection.enums.TaskStatusEnum;
|
||||
import com.cmvr.test.flow.control.FlowControlService;
|
||||
import com.cmvr.test.flow.runtime.engine.FlowTaskRuntimeService;
|
||||
import com.cmvr.test.model.vo.TeTaskExecuteNormalVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.cmvr.common.utils.DateUtils;
|
||||
@ -27,6 +30,11 @@ public class InspectionTaskInstanceServiceImpl extends ServiceImpl<InspectionTas
|
||||
@Autowired
|
||||
private InspectionTaskInstanceMapper inspectionTaskInstanceMapper;
|
||||
|
||||
@Autowired
|
||||
private FlowTaskRuntimeService flowTaskRuntimeService;
|
||||
@Autowired
|
||||
private FlowControlService flowControlService;
|
||||
|
||||
/**
|
||||
* 查询巡检任务执行实例视图详情(包含关联信息)
|
||||
*
|
||||
@ -125,6 +133,8 @@ public class InspectionTaskInstanceServiceImpl extends ServiceImpl<InspectionTas
|
||||
update.setStartTime(DateUtils.getNowDate());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
// 调用真正的执行
|
||||
flowTaskRuntimeService.executeTask(TeTaskExecuteNormalVO.builder().taskId(instance.getTaskInsId()).build());
|
||||
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(update);
|
||||
}
|
||||
|
||||
@ -146,6 +156,7 @@ public class InspectionTaskInstanceServiceImpl extends ServiceImpl<InspectionTas
|
||||
update.setStatus(TaskStatusEnum.PAUSED.getCode());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowControlService.pause(instance.getTaskInsId());
|
||||
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(update);
|
||||
}
|
||||
|
||||
@ -168,6 +179,7 @@ public class InspectionTaskInstanceServiceImpl extends ServiceImpl<InspectionTas
|
||||
update.setEndTime(DateUtils.getNowDate());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowControlService.stop(instance.getTaskInsId());
|
||||
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(update);
|
||||
}
|
||||
|
||||
@ -189,6 +201,7 @@ public class InspectionTaskInstanceServiceImpl extends ServiceImpl<InspectionTas
|
||||
update.setStatus(TaskStatusEnum.RUNNING.getCode());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowControlService.resume(instance.getTaskInsId());
|
||||
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(update);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
|
||||
// 同步新增任务
|
||||
TeTaskConfigInfo teTaskConfigInfo = TeTaskConfigInfo.builder().taskName(inspectionTask.getTaskName()).build();
|
||||
teTaskConfigInfoService.insertTeTaskConfigInfo(teTaskConfigInfo);
|
||||
inspectionTask.setTeTaskConfigId(teTaskConfigInfo.getId());
|
||||
inspectionTask.setTaskConfigId(teTaskConfigInfo.getId());
|
||||
return inspectionTaskMapper.insertInspectionTask(inspectionTask);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
|
||||
{
|
||||
inspectionTask.setUpdateTime(DateUtils.getNowDate());
|
||||
inspectionTask.setUpdateBy(SecurityUtils.getUsername());
|
||||
TeTaskConfigInfo teTaskConfigInfo = teTaskConfigInfoService.selectTeTaskConfigInfoById(inspectionTask.getTeTaskConfigId());
|
||||
TeTaskConfigInfo teTaskConfigInfo = teTaskConfigInfoService.selectTeTaskConfigInfoById(inspectionTask.getTaskConfigId());
|
||||
teTaskConfigInfo.setTaskName(inspectionTask.getTaskName());
|
||||
teTaskConfigInfoService.updateTeTaskConfigInfo(teTaskConfigInfo);
|
||||
return inspectionTaskMapper.updateInspectionTask(inspectionTask);
|
||||
@ -121,7 +121,7 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
|
||||
// 批量查询巡检任务
|
||||
List<InspectionTask> inspectionTasks = this.baseMapper.selectBatchIds(Arrays.asList(ids));
|
||||
// 批量删除任务
|
||||
teTaskConfigInfoService.deleteTeTaskConfigInfoByIds(inspectionTasks.stream().map(InspectionTask::getTeTaskConfigId).toArray(String[]::new));
|
||||
teTaskConfigInfoService.deleteTeTaskConfigInfoByIds(inspectionTasks.stream().map(InspectionTask::getTaskConfigId).toArray(String[]::new));
|
||||
return inspectionTaskMapper.deleteInspectionTaskByIds(ids);
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
|
||||
// 查询点位
|
||||
List<InspectionWaypoint> waypoints = inspectionTaskWaypointMapper.selectWaypointsByTaskId(taskId);
|
||||
// 同步任务编排
|
||||
TeTaskOrchestraVO teTaskOrchestraVO = TeTaskOrchestraVO.builder().taskId(inspectionTask.getTeTaskConfigId()).itemIds(waypoints.stream().map(InspectionWaypoint::getDetectItemId).collect(Collectors.toList())).build();
|
||||
TeTaskOrchestraVO teTaskOrchestraVO = TeTaskOrchestraVO.builder().taskId(inspectionTask.getTaskConfigId()).itemIds(waypoints.stream().map(InspectionWaypoint::getDetectItemId).collect(Collectors.toList())).build();
|
||||
teTaskOrchestrationService.insertTeTaskOrchestration(teTaskOrchestraVO);
|
||||
return inspectionTaskWaypointMapper.batchInsertTaskWaypoint(list);
|
||||
}
|
||||
|
||||
@ -16,6 +16,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="status" column="status" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="taskInsId" column="task_ins_id" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.cmvr.inspection.domain.vo.InspectionTaskInstanceVo" id="InspectionTaskInstanceVoResult">
|
||||
@ -37,10 +40,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="taskInsId" column="task_ins_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInspectionTaskInstanceVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, task_id, robot_id, status, start_time, end_time from inspection_task_instance
|
||||
select id, create_by, create_time, update_by, update_time, remark, task_id, robot_id, status, start_time, end_time, task_ins_id from inspection_task_instance
|
||||
</sql>
|
||||
|
||||
<select id="selectInspectionTaskInstanceList" parameterType="InspectionTaskInstance" resultMap="InspectionTaskInstanceResult">
|
||||
@ -71,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null">status,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="taskInsId != null">task_ins_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@ -84,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="taskInsId != null">#{taskInsId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -100,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="taskInsId != null">task_ins_id = #{taskInsId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -120,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ti.task_id, t.task_name, t.task_code,
|
||||
ti.robot_id, r.robot_name,
|
||||
r.current_map_id as robot_current_map_id, m.map_name,
|
||||
ti.status, ti.start_time, ti.end_time,
|
||||
ti.status, ti.start_time, ti.end_time, ti.task_ins_id,
|
||||
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||
from inspection_task_instance ti
|
||||
left join inspection_task t on ti.task_id = t.id
|
||||
@ -141,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ti.task_id, t.task_name, t.task_code,
|
||||
ti.robot_id, r.robot_name,
|
||||
r.current_map_id as robot_current_map_id, m.map_name,
|
||||
ti.status, ti.start_time, ti.end_time
|
||||
ti.status, ti.start_time, ti.end_time, ti.task_ins_id
|
||||
from inspection_task_instance ti
|
||||
left join inspection_task t on ti.task_id = t.id
|
||||
left join inspection_robot r on ti.robot_id = r.id
|
||||
|
||||
@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="taskCode" column="task_code" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="taskConfigId" column="task_config_id" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.cmvr.inspection.domain.vo.InspectionTaskVo" id="InspectionTaskVoResult">
|
||||
@ -28,10 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="taskConfigId" column="task_config_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInspectionTaskVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, task_code, task_name, task_type from inspection_task
|
||||
select id, create_by, create_time, update_by, update_time, remark, task_code, task_name, task_type, task_config_id from inspection_task
|
||||
</sql>
|
||||
|
||||
<select id="selectInspectionTaskList" parameterType="InspectionTask" resultMap="InspectionTaskResult">
|
||||
@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="taskCode != null">task_code,</if>
|
||||
<if test="taskName != null">task_name,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="taskConfigId != null">task_config_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@ -71,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="taskCode != null">#{taskCode},</if>
|
||||
<if test="taskName != null">#{taskName},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="taskConfigId != null">#{taskConfigId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -85,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="taskCode != null">task_code = #{taskCode},</if>
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
<if test="taskType != null">task_type = #{taskType},</if>
|
||||
<if test="taskConfigId != null">task_config_id = #{taskConfigId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -102,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectInspectionTaskVoList" parameterType="InspectionTask" resultMap="InspectionTaskVoResult">
|
||||
select t.id, t.create_by, t.create_time, t.update_by, t.update_time, t.remark,
|
||||
t.task_code, t.task_name, t.task_type,
|
||||
t.task_code, t.task_name, t.task_type, t.task_config_id,
|
||||
u1.user_name as create_by_name, u2.user_name as update_by_name
|
||||
from inspection_task t
|
||||
left join sys_user u1 on t.create_by = u1.user_name <!-- 创建人关联用户 -->
|
||||
|
||||
@ -34,7 +34,9 @@ public class TaskContextManager {
|
||||
*/
|
||||
public void register(TaskContext context) {
|
||||
instContextMap.put(context.getInstId(), context);
|
||||
terminalInstMap.put(context.getTerminalId(), context.getInstId());
|
||||
if (context.getTerminalId() != null) {
|
||||
terminalInstMap.put(context.getTerminalId(), context.getInstId());
|
||||
}
|
||||
context.setTerminalStatus(TerminalStatusEnum.RUNNING);
|
||||
log.info("注册任务上下文:instId={}, terminalId={}", context.getInstId(), context.getTerminalId());
|
||||
}
|
||||
@ -47,7 +49,9 @@ public class TaskContextManager {
|
||||
if (ctx != null) {
|
||||
ctx.setTerminalStatus(TerminalStatusEnum.READY);
|
||||
ctx.setTerminalLocked(false);
|
||||
terminalInstMap.remove(ctx.getTerminalId());
|
||||
if (ctx.getTerminalId() != null) {
|
||||
terminalInstMap.remove(ctx.getTerminalId());
|
||||
}
|
||||
log.info("注销任务上下文:instId={}, terminalId={}", instId, ctx.getTerminalId());
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,9 +60,9 @@ public class FlowTaskRuntimeEntry implements FlowTaskRuntimeService {
|
||||
JSONObject runParams = taskExecuteTrailVO.getRunParams();
|
||||
String terminalId = taskExecuteTrailVO.getTerminalId();
|
||||
if (StrUtil.isEmpty(terminalId)) {
|
||||
throw new GlobalException("终端ID不能为空");
|
||||
// throw new GlobalException("终端ID不能为空");
|
||||
}
|
||||
if (taskInstHolder.isTerminalLocked(terminalId)) {
|
||||
if (terminalId != null && taskInstHolder.isTerminalLocked(terminalId)) {
|
||||
throw new GlobalException("当前终端正在执行其他任务,请稍后再试");
|
||||
}
|
||||
|
||||
|
||||
@ -28,6 +28,9 @@ public class FlowExceptionInterceptor implements FlowMsgPreInterceptor {
|
||||
try {
|
||||
return next.apply(message);
|
||||
} catch (Exception e) {
|
||||
log.error("节点执行异常:instId={}, nodeId={}, action={}",
|
||||
message.getInstId(), message.getNodeId(), message.getAction(), e);
|
||||
|
||||
if (ExceptionUtil.getRootCause(e) instanceof InterruptedException) {
|
||||
log.info("节点被中断退出: {}", message.getNodeId());
|
||||
return null;
|
||||
@ -43,9 +46,6 @@ public class FlowExceptionInterceptor implements FlowMsgPreInterceptor {
|
||||
"执行异常:" + StrUtil.sub(ExceptionUtil.getMessage(e), 0, 480),
|
||||
message.getIterations()
|
||||
);
|
||||
log.error("节点执行异常:instId={}, nodeId={}, action={}",
|
||||
message.getInstId(), message.getNodeId(), message.getAction(), e);
|
||||
|
||||
throw new GlobalException("任务执行失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,12 +3,18 @@ package com.cmvr.test.model.vo;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@Data
|
||||
@ApiModel("正常任务执行VO")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TeTaskExecuteNormalVO {
|
||||
@ApiModelProperty("任务ID")
|
||||
@NotEmpty(message = "任务ID不能为空")
|
||||
|
||||
@ -20,7 +20,7 @@ public class TeTaskExecuteTrailVO {
|
||||
private String flowData;
|
||||
|
||||
@ApiModelProperty("终端ID")
|
||||
@NotEmpty(message = "终端ID不能为空")
|
||||
// @NotEmpty(message = "终端ID不能为空")
|
||||
private String terminalId;
|
||||
|
||||
@ApiModelProperty(value = "运行时参数")
|
||||
|
||||
@ -55,6 +55,7 @@ CREATE TABLE `inspection_task` (
|
||||
`task_code` varchar(64) DEFAULT NULL COMMENT '任务编码',
|
||||
`task_name` varchar(100) NOT NULL COMMENT '任务名称',
|
||||
`task_type` char(1) DEFAULT '1' COMMENT '任务类型(1巡检任务 2讲解任务)',
|
||||
`task_config_id` varchar(64) DEFAULT NULL COMMENT '任务配置ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_task_code` (`task_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='巡检任务表';
|
||||
@ -101,6 +102,7 @@ CREATE TABLE `inspection_task_instance` (
|
||||
`status` char(1) DEFAULT '0' COMMENT '执行状态(0待执行 1执行中 2已完成 3已取消 4执行失败 5已暂停)',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`task_ins_id` varchar(64) DEFAULT NULL COMMENT '检测任务id',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_task_id` (`task_id`),
|
||||
KEY `idx_robot_id` (`robot_id`),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user