package com.gyee.frame.service.ticket;

import com.gyee.frame.model.ticket.Wfinstance;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenmh
 * @since 2020-07-21
 */
public interface WfinstanceService extends IService<Wfinstance> {

    int selectMaxId();

    /**
     * 根据 ticketid 获取流程状态 ---- 启用 or 结束
     * workticket 表的id = wfinstance 表的 ownerid
     *
     * @param ownerId
     * @return
     */
    Map<String, Object> flowInstance(double ownerId);

    /**
     * 查询工作票对应的状态
     *
     * @param ownerId
     * @return
     */
    Wfinstance instance(double ownerId);

    /**
     * 流程启动时插入一条信息
     *
     * @param ownerId
     * @param wfName
     * @param ticketNum
     * @param principal
     * @param stater
     * @param labors
     * @param role
     * @param online  在线人员
     * @return
     */
    boolean initInstance(double ownerId, String wfName, String ticketNum, String principal, String stater, List<String> labors, String role, String online);

    /**
     * 更新 cuenodeid 字段及状态
     *
     * @param id
     * @param nodeId
     * @param active
     * @return
     */
    boolean updateInstance(double id, double nodeId, String active);
}
