package com.hotent.runtime.manager; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; import com.fasterxml.jackson.databind.node.ObjectNode; import com.hotent.base.model.CommonResult; import com.hotent.base.query.PageList; import com.hotent.base.query.QueryFilter; import com.hotent.bpm.api.constant.EventType; import com.hotent.bpm.api.model.form.FormType; import com.hotent.bpm.api.model.identity.BpmIdentity; import com.hotent.bpm.api.model.process.def.BpmVariableDef; import com.hotent.bpm.api.model.process.inst.BpmProcessInstance; import com.hotent.bpm.api.model.process.nodedef.BpmNodeDef; import com.hotent.bpm.api.model.process.task.BpmTask; import com.hotent.bpm.engine.inst.DefaultProcessInstCmd; import com.hotent.bpm.persistence.model.*; import com.hotent.runtime.model.BpmTaskTransRecord; import com.hotent.runtime.params.*; import com.hotent.runtime.vo.FlowTypeVo; /** * 流程的相关接口 * * @company 广州宏天软件股份有限公司 * @author zhangxianwen * @email zhangxw@jee-soft.cn * @date 2018年6月28日 */ public interface IFlowManager { /** * 获取用户领导的待办事宜 * @param account * @param queryFilter * @return * @throws Exception */ PageList getLeaderTodoList(String account, QueryFilter queryFilter) throws Exception; /** * 获取用户待办事宜 * @param account * @param queryFilter * @return * @throws Exception */ CompletableFuture> getTodoList(String account, QueryFilter queryFilter) throws Exception; /** * 根据组织ID获取组织信息 * @param orgId * @return */ ObjectNode getOrgByIdOrCode(String orgId); /** * 获取待办列表查询条件 * @return * @throws Exception */ QueryFilter getTodoQueryFilter(QueryFilter filter) throws Exception; /** * 根据ID主键ID删除传阅任务 * @param id */ void delBpmTaskNoticeById(String id) throws Exception; /** * 获取我传阅的任务(知会任务) * @param account * @param queryFilter * @return * @throws Exception */ PageList getMyNoticeReadList(String account, QueryFilter queryFilter) throws Exception; /** * 获取我传阅的任务(知会任务)在各分类下的数量 * @param account * @param queryFilter * @return * @throws Exception */ List> getMyNoticeReadCount(String account, QueryFilter queryFilter) throws Exception; /** * 获取待阅任务(知会任务) * @return * @throws Exception */ BpmTaskNotice getNoticeTodoReadById(String id); /** * 获取待阅任务(知会任务) * @param account * @param queryFilter * @return * @throws Exception */ PageList getNoticeTodoReadList(String account, QueryFilter queryFilter) throws Exception; /** *获取待阅在各分类下的数量 * @return * @throws Exception */ List> getNoticeTodoReadCount(String account, QueryFilter filter) throws Exception; /** * 获取已阅任务(知会任务) * @param account * @param queryFilter * @return * @throws Exception */ PageList getNoticeDoneReadList(String account, QueryFilter queryFilter) throws Exception; /** * 获取已阅任务(知会任务)在各分类下的数量 * @param account * @param queryFilter * @return * @throws Exception */ List> getNoticeDoneReadCount(String account,QueryFilter queryFilter) throws Exception; /** * 获取用户的已办事宜 * @param account * @param queryFilter * @param status * @return * @throws Exception */ PageList> getDoneList(String account,String userId, QueryFilter queryFilter,String status) throws Exception; /** * 获取办结事宜。 * @param account * @param queryFilter * @return * @throws Exception */ PageList getCompletedList(String account, QueryFilter queryFilter) throws Exception; /** * 获取用户的办结事宜。 * @param account * @param queryFilter * @return * @throws Exception */ PageList getMyCompletedList(String account, QueryFilter queryFilter) throws Exception; /** * 我的请求 * @param account * @param queryFilter * @return * @throws Exception */ PageList getMyRequestList(String account, QueryFilter queryFilter) throws Exception; /** * 获取用户可发起的流程 * @param account * @param queryFilter * @param typeId * @return * @throws Exception */ PageList getMyFlowList(String account, QueryFilter queryFilter,String typeId) throws Exception; /** * 获取用户的草稿列表 * @param account * @param queryFilter * @return * @throws Exception */ PageList getMyDraftList(String account, QueryFilter queryFilter) throws Exception; /** * 根据流程定义ID或流程定义KEY获取流程变量 * * @param json {defId:"流程定义ID",defKey:"流程定义key"} * @return */ List getWorkflowVar(String json) throws Exception; /** * 获取用户的抄送转发事宜 * @param account * @param queryFilter * @param type * @return * @throws Exception */ PageList getReceiverCopyTo(String account, QueryFilter queryFilter,String type) throws Exception ; /** * 由我发出的抄送 * @param account * @param queryFilter * @return * @throws Exception */ PageList myCopyTo(String account, QueryFilter queryFilter) throws Exception ; /** * 获取用户转办代理事宜 * @param account * @param queryFilter * @return * @throws Exception */ PageList getDelegate(String account, QueryFilter queryFilter) throws Exception; List> getDelegateCount(String account, QueryFilter queryFilter) throws Exception; /** * 我的流转任务 * @param account * @param queryFilter * @return * @throws Exception */ PageList getMyTrans(String account, QueryFilter queryFilter) throws Exception; /** * 根据id删除草稿 * @param id * @return */ CommonResult removeDraftById(String runId) throws Exception; /** * 任务转办 * @param assignParamObject * @return * @throws Exception */ CommonResult delegate(AssignParamObject assignParamObject) throws Exception; /** * 任务沟通 * @param communicateParamObject * @return * @throws Exception */ CommonResult communicate(CommunicateParamObject communicateParamObject) throws Exception; /** * 流程任务加签,增加会签人员 * @param assignParamObject * @return * @throws Exception */ CommonResult taskSignUsers(AssignParamObject assignParamObject) throws Exception; /** * 添加签署人员 (根据加签代码修改) * @param assignParamObject * @return * @throws Exception */ CommonResult taskCustomSignUsers(AssignParamObject assignParamObject) throws Exception; /** * 根据实例id撤回流程(撤销) * @param instanceId * @return * @throws Exception */ CommonResult revokeInstance(RevokeParamObject revokeParamObject) throws Exception; // /** // * 根据流程定义key获取流程的所有节点信息 // * @param defKey // * @return // * @throws Exception // */ // List getNodesByDefKey(String defKey) throws Exception ; /** * 根据任务id获取下一环节处理人 * @param taskId * @return * @throws Exception */ Map> getNextTaskUsers(String taskId) throws Exception; /** * 修改任务执行人 * @param modifyExecutorsParamObject * @return * @throws Exception */ CommonResult setTaskExecutors(ModifyExecutorsParamObject modifyExecutorsParamObject) throws Exception; /** * 判断用户是否有添加会签权限 * @param json * @return * @throws Exception */ Boolean isAllowAddSign(IsAllowAddSignObject isAllowAddSignObject) throws Exception; /** * 保存流转信息(增加流转) * @param taskTransParamObject * @return * @throws Exception */ CommonResult taskToTrans(TaskTransParamObject taskTransParamObject) throws Exception; /** * 普通任务加签 * @param taskTransParamObject * @return * @throws Exception */ CommonResult userTaskToSign(TaskTransParamObject taskTransParamObject) throws Exception; /** * 保存并行审批信息 * @param taskApproveLineParam * @return * @throws Exception */ CommonResult taskToApproveLine(TaskApproveLineParam taskApproveLineParam) throws Exception; /** * 获取处理任务的 在线表单地址 * @param taskId * @param formType * @return * @throws Exception */ String getUrlFormByTaskId(String taskId, String formType) throws Exception; /** * 获取实例表单 * 如果nodeId 不为空,先获取节点配置的实例表单 * 否则获取全局的实例表单地址 * @param proInstId * @param nodeId * @param formType pc/mobile * @return * @throws Exception */ String getInstUrlForm(String proInstId, String nodeId, String formType) throws Exception; /** * 我的请求(包括人工终止和结束状态的实例) * @param account * @param queryFilter * @return * @throws Exception */ PageList getMyRequestListAll(String account, QueryFilter queryFilter) throws Exception; /** * 查询流程定义列表 * @param account * @param queryFilter * @return * @throws Exception */ PageList getBpmDefList(String account, QueryFilter queryFilter) throws Exception; /** * 新建流程列表 * @param account * @param queryFilter * @return * @throws Exception */ PageList newProcess(String account, QueryFilter queryFilter) throws Exception; /** * 流程分类下的数量 * @param queryFilter * @return * @throws Exception */ List> newProcessCount(QueryFilter queryFilter) throws Exception; /** * 我的请求列表 * @param account * @param queryFilter * @return * @throws Exception */ PageList myRequest(String account, QueryFilter queryFilter) throws Exception; List> myRequestCount(String account) throws Exception; /** * 查询流程实例列表 * @param account * @param queryFilter * @return * @throws Exception */ PageList getInstanceList(String account, QueryFilter queryFilter) throws Exception; /** * 获取流程实例的表单和数据 * @param proInstId * @param defKey * @return * @throws Exception */ InstFormAndBoVo getInstFormAndBO(String proInstId,String nodeId,String formId,FormType formType,Boolean includData,Boolean getStartForm,Boolean myApplication) throws Exception; /** * 流程启动时获取bo和表单。 * @param startCmdParam * @return * @throws Exception */ FormAndBoVo getFormAndBO(StartCmdParam startCmdParam,FormType formType) throws Exception; /** * 获取发起的cmd格式数据 * @param request * @param startCmdParam * @return * @throws Exception */ DefaultProcessInstCmd getStartCmd(StartCmdParam startCmdParam) throws Exception; /** * 获取可以选择的路径 * @param defId * @return * @throws Exception */ SelectDestinationVo selectDestination(String defId) throws Exception; /** * 节点图片 * @param proInstId * @param type * @param from * @param nodeId * @param defId * @return * @throws Exception */ FlowImageVo flowImage(String proInstId, String type, String from, String nodeId,String defId) throws Exception; /** * 流程图相关(移动端) * @param proInstId * @param type * @param from * @param nodeId * @param defId * @return * @throws Exception */ FlowImageMobileVo flowImageMobile(String proInstId, String type, String from, String nodeId, String defId) throws Exception; /** * 流程审批历史(页面数据) * @param instId * @param taskId * @return * @throws Exception */ List opinionHistory(String instId, String taskId) throws Exception; /** * 获取任务处理页面参数 * @param taskId * @return * @throws Exception */ CompletableFuture taskDoNext(String taskId) throws Exception; /** * 获取用户审批界面参数 * @param taskId * @return * @throws Exception */ TaskDoNextVo taskApprove(String taskId) throws Exception; /** * 获取任务流程图页面参数 * @param taskId * @return * @throws Exception */ TaskjImageVo taskImage(String taskId,String defId) throws Exception; /** * 获取流程实例中指定节点的审批意见 * @param instId * @param nodeId * @return * @throws Exception */ Object nodeOpinion(String defId,String instId,String nodeId ,boolean isDerive) throws Exception; /** * 获取任务的详情 * @param taskId * @return * @throws Exception */ CompletableFuture taskDetail(String taskId,String reqValue,FormType formType,String leaderId) throws Exception; CompletableFuture taskDetailMobile(String taskId,String reqValue,FormType formType) throws Exception; /** * 判断当前人是否有该任务处理权限 * @param taskId 任务ID * @param leaderId 领导用户ID * @return * @throws Exception */ Boolean isAuth(String taskId, String leaderId) throws Exception; /** * 判断当前用户是否为任务的执行人或者候选人 * @param taskId 任务ID * @return 判断结果 * @throws Exception */ Boolean checkTaskByAssignee(String taskId) throws Exception; /** * 获取任务上下文流程变量 * @param taskId * @param vars * @return * @throws Exception */ Map getTaskVars(String taskId,Map vars) throws Exception; /** * 处理任务 * @param doNextParamObject * @param reqValue * @param usersMap * @return * @throws Exception */ CompletableFuture> complete(DoNextParamObject doNextParamObject) throws Exception; /** * 保存草稿 * @param doNextParamObject * @return * @throws Exception */ CommonResult saveDraft(DoNextParamObject doNextParamObject) throws Exception; /** * 获取任务任务明细 * @param taskId * @param reqValue * @return * @throws Exception */ CompletableFuture getTaskById(String taskId,boolean requireLayout) throws Exception; /** * 任务办理(同意、反对、弃权) * @param taskId * @param actionName * @return * @throws Exception */ TaskToAgreeVo toAgree(String taskId, String actionName) throws Exception; /** * 驳回任务页面参数 * @param taskId * @param actionName * @return * @throws Exception */ TaskToRejectVo toReject(String taskId, String backModel) throws Exception; /** * 撤销我流转出去的任务 * @param withDrawParam * @return * @throws Exception */ CommonResult withDraw(WithDrawParam withDrawParam) throws Exception; List opinionHistory(String instId,String taskId,boolean isCommu) throws Exception; List filterByAuth(List opinionList,String inst, boolean isRequest) throws Exception; /** * 征询设置 * @param taskTransParamObject * @return * @throws Exception */ CommonResult taskToInqu(TaskTransParamObject taskTransParamObject) throws Exception; //添加阅读记录 void addReadRecord(Object obj) throws Exception; //知会任务待办转已办 void noticeTurnDode(String taskId); ObjectNode getAfterJumpNode(ObjectNode obj ) throws Exception; BpmNodeDef getCurNodeProperties(String orElse, String orElse2,String instId) throws Exception; /** * 获取指定节点属性 * @param defId * @param instId * @param nodeId * @return * @throws Exception */ BpmNodeDef getNodePropertiesByNodeId(String defId, String instId,String nodeId) throws Exception; /** * 获取流程字段信息 * @param account * @param queryFilter * @param status * @return * @throws Exception */ PageList> getFlowFieldList(QueryFilter queryFilter) throws Exception; /** * 获取已办 * @param current 用户账号 * @param queryFilter 过滤条件 * @param status 已办类型:null-我的已办;1-领导已办 * @return * @throws Exception */ CompletableFuture>> getDoneInstList(String current, QueryFilter queryFilter, String status) throws Exception; /** * 转移任务给(用户) * @param map * @return */ CommonResult divertDoneTask(Map map) throws Exception; List> getDoneInstCount(String current,QueryFilter queryFilter,String status) throws Exception; CommonResult taskToSignSequence( TaskTransParamObject taskTransParamObject) throws Exception; /** * 撤回流转出去的任务 * @param revokeParamObject * @return * @throws Exception */ CommonResult revokeTrans(RevokeTransParamObject revokeTransParamObject) throws Exception; void revokeSignSequence( RevokeTransParamObject revokeTransParamObject) throws Exception; CommonResult taskToSignLine( TaskTransParamObject taskTransParamObject) throws Exception; /** * 并行签署撤回 * @param revokeParamObject * @throws Exception */ void revokeSignLine(RevokeSignLineParamObject revokeParamObject) throws Exception; /** * 根据任务ID获取审批按钮 * @param taskId * @return */ TaskDetailVo getButtonsBytaskId(String taskId) throws Exception; /** * 获取顺签下一步执行人 * @param taskId * @return */ CommonResult nextExecutor(String taskId); /** * 判断当前用户是否有实例和任务的权限 * @param procDefKey * @param procInstId * @return */ boolean isInRightMap(String procDefKey,String procInstId); Map getInstanceByPks(List pks, String boDefAlias, String flowKey); /** * 获取表单列表流程相关按钮的权限 * @param instIds 流程实例ID集合 * @return 表单列表流程按钮权限 * */ List getDataTemplateButtonPermission(List instIds, String types) throws Exception; /** * 获取待办事宜(根据用户、组织、岗位、角色) * @param team * @param queryFilter * @return * @throws Exception */ PageList getTodoListByTeam(String team, QueryFilter queryFilter) throws Exception; Map> newProcessCard(String currentUserAccout, QueryFilter queryFilter, Integer size) throws Exception; Map getLeaderTodoCard(String currentUserAccout, QueryFilter queryFilter, Integer size); /** * 任务是否处于第一个节点 * *
	 * 当前如果是子流程实例中的任务,则直接返回false
	 * 
* * @param taskId * @return */ Boolean isTaskFirstNode(String taskId) throws Exception; /** * 删除流程实例 * @param id * @return */ Object instRemove(String id) throws Exception; /** * 执行对应的全局时间或者节点事件 * @param instanceId * @param tasks * @param eventType * @throws Exception */ void doPostAsync(String instanceId, List tasks, EventType eventType) throws Exception; /** * 根据流程实例id恢复实例数据 * @param idArr */ CommonResult doRestore(String[] idArr) throws Exception; /** * 查询常用流程 * @param queryFilter * @return * @throws Exception */ PageList getMyOftenFlow(QueryFilter queryFilter) throws Exception; /** * 获取我有权限的常用流程 * @param queryFilter * @return * @throws Exception */ PageList getMyOftenFlowKeyHasAuthority(QueryFilter queryFilter) throws Exception; /** * 根据父流程实例id和节点id。获取该节点上的外部子流程实例 * @param parentInstId * @param nodeId * @return */ List getSubInstanceList(String parentInstId, String nodeId); /** * 根据父流程定义id和节点id。获取该节点上的外部子流程定义id * @param parentDefId * @param parentInstId * @param nodeId * @return * @throws Exception */ String getSubDefId(String parentDefId, String parentInstId, String nodeId) throws Exception; /** * 获取当前用户有权限的流程分类信息 * @return * @throws Exception */ List getCurUserFlowType() throws Exception; }