/// <summary> /// 驳回 /// </summary> /// <param name="vallist"></param> /// <param name="todoID"></param> /// <param name="operationUserCode"></param> /// <param name="operationType"></param> /// <param name="common"></param> /// <param name="flowcontent"></param> /// <param name="node"></param> /// <param name="toNodeKey"></param> private void Reject(Dictionary <string, string> vallist, int todoID, string operationUserCode, Operation operationType, string common, FlowContent flowcontent, FlowNode node, string toNodeKey) { ToDoHandle.DealTodo((int)operationType, operationUserCode, todoID); FlowVar var = new FlowVar(flowcontent.TmpKey, flowcontent.CurrentInstanceID); var.UpdateVal(vallist, this.CurrenUserCode); List <WF_ToDo> undolist = todobll.getList(flowcontent.CurrentInstanceID, node.NodeKey, (int)TodoState.UnDo); if (undolist != null && undolist.Count > 0) { foreach (WF_ToDo item in undolist) { ToDoHandle.DeleteTodo((int)operationType, operationUserCode, item.ID); } } WF_TemplateNode tmpnode = nodebll.getByNodeKey(flowcontent.TmpKey, node.NodeKey); if (tmpnode.IsGoBack == 0) { throw new Exception("改节点禁止退回"); } if (tmpnode.GoBackType == "every") { if (string.IsNullOrWhiteSpace(toNodeKey)) { throw new Exception("请选择需要退回到哪一个节点"); } } else { toNodeKey = tmpnode.GoBackType; } FlowNode toNode = NodeFactory.getFlowNode(flowcontent.TmpKey, toNodeKey, this.endFlow); NodeReturn ret = toNode.Run(flowcontent); //获取当前待办人的编号 List <string> newtodis = new List <string>(); List <string> newnodekey = new List <string>(); if (!ret.isOver) { List <string> userCodeList = ret.ToDoUserList; //循环遍历插入待办 if (userCodeList != null && userCodeList.Count > 0) { foreach (string user in userCodeList) { int todoid = ToDoHandle.InsertTodo(user.Trim(), flowcontent.CurrentInstanceID, (int)TodoIsShow.Show, -1, flowcontent.TaskName, (int)TodoType.Normal, toNode, toNode.NodeKey, CurrenUserCode); newtodis.Add(todoid.ToString()); } } flowcontent.CurrentTodoID = string.Join(", ", newtodis); flowcontent.CurrentNodeKey = toNodeKey; } operationbll.Insert(flowcontent.CurrentInstanceID, todoID, CurrenUserCode, (int)operationType, common); }
/// <summary> /// 跳转 /// </summary> /// <param name="vallist"></param> /// <param name="todoID"></param> /// <param name="operationUserCode"></param> /// <param name="operationType"></param> /// <param name="common"></param> /// <param name="flowcontent"></param> /// <param name="node"></param> private void GoTo(Dictionary <string, string> vallist, int todoID, string operationUserCode, Operation operationType, string common, FlowContent flowcontent, FlowNode node, string toNodeKey) { ToDoHandle.DealTodo((int)operationType, operationUserCode, todoID); FlowVar var = new FlowVar(flowcontent.TmpKey, flowcontent.CurrentInstanceID); var.UpdateVal(vallist, this.CurrenUserCode); List <WF_ToDo> undolist = todobll.getList(flowcontent.CurrentInstanceID, node.NodeKey, (int)TodoState.UnDo); if (undolist != null && undolist.Count > 0) { foreach (WF_ToDo item in undolist) { ToDoHandle.DeleteTodo((int)operationType, operationUserCode, item.ID); } } FlowNode toNode = NodeFactory.getFlowNode(flowcontent.TmpKey, toNodeKey, this.endFlow); NodeReturn ret = toNode.Run(flowcontent); //获取当前待办人的编号 List <string> newtodis = new List <string>(); List <string> newnodekey = new List <string>(); if (!ret.isOver) { List <string> userCodeList = ret.ToDoUserList; //循环遍历插入待办 if (userCodeList != null && userCodeList.Count > 0) { foreach (string user in userCodeList) { int todoid = ToDoHandle.InsertTodo(user.Trim(), flowcontent.CurrentInstanceID, (int)TodoIsShow.Show, -1, flowcontent.TaskName, (int)TodoType.Normal, toNode, toNode.NodeKey, CurrenUserCode); newtodis.Add(todoid.ToString()); } } flowcontent.CurrentTodoID = string.Join(", ", newtodis); flowcontent.CurrentNodeKey = toNodeKey; } operationbll.Insert(flowcontent.CurrentInstanceID, todoID, CurrenUserCode, (int)operationType, common); }