/// <summary> /// 创建运行分析流程 /// </summary> /// <param name="recordID">记录ID</param> /// <param name="recordIkind">运行分析记录种类</param> /// <param name="userID">用户ID</param> /// <returns>流程创建结果</returns> public static string RunNewYXFXRecord(string recordID, string recordIkind, string userID) { DataTable dt = null; string command = "", workFlowId = "", workTaskId = "", flowCaption = "", workFlowInstanceId = "", workTaskInstanceId = ""; //if (MainHelper.UserOrg.OrgName.IndexOf("供电所") > -1) //{ // if (recordIkind == "供电所定期分析") // { // dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "供电所定期分析"); // } // else if (recordIkind == "供电所专题分析") // { // dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "供电所专题分析"); // } //} ////else if (MainHelper.UserOrg.OrgName.IndexOf("局") > -1) //else //{ // if (recordIkind == "局定期分析") // { // dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "局定期分析"); // } // else if (recordIkind == "局专题分析") // { // dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "局专题分析"); // } //} if (recordIkind == "供电所定期分析") { dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "供电所定期分析"); } else if (recordIkind == "供电所专题分析") { dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "供电所专题分析"); } else if (recordIkind == "局定期分析") { dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "局定期分析"); } else if (recordIkind == "局专题分析") { dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "局专题分析"); } workFlowId = dt.Rows[0]["WorkFlowId"].ToString(); workTaskId = dt.Rows[0]["workTaskId"].ToString(); flowCaption = dt.Rows[0]["FlowCaption"].ToString(); workFlowInstanceId = Guid.NewGuid().ToString(); workTaskInstanceId = Guid.NewGuid().ToString(); DataTable taskCommand = WorkFlowTask.GetTaskCommands(workFlowId, workTaskId); if (taskCommand.Rows.Count > 0) { command = taskCommand.Rows[0]["CommandName"].ToString(); } else { command = "提交"; } string strmes = CreatWorkFlow(userID, workFlowId, workTaskId, workFlowInstanceId, workTaskInstanceId, flowCaption, command); WFP_RecordWorkTaskIns wpfrecord = new WFP_RecordWorkTaskIns(); wpfrecord.RecordID = recordID; wpfrecord.WorkFlowId = workFlowId; wpfrecord.WorkFlowInsId = workFlowInstanceId; wpfrecord.WorkTaskId = workTaskId; wpfrecord.WorkTaskInsId = workTaskInstanceId; if (strmes.IndexOf("未提交至任何人") == -1) MainHelper.PlatformSqlMap.Create<WFP_RecordWorkTaskIns>(wpfrecord); return strmes; }
/// <summary> /// 创建工作票流程 /// </summary> /// <param name="recordID">记录ID</param> /// <param name="kind">工作票种类(01操作票、02一种工作票、03二种工作票、04抢修单)</param> /// <param name="userID">用户ID</param> /// <param name="IsRun">流程是否流转</param> /// <returns>流程创建信息二维数组,[0]流程创建结果 [1]运行后流程的任务节点名称</returns> public static string[] RunNewGZPRecord(string recordID, string kind, string userID, bool IsRun) { DataTable dt = null; string command = "", workFlowId = "", workTaskId = "", flowCaption = "", workFlowInstanceId = "", workTaskInstanceId = ""; string strtemp = ""; if (kind == "dzczp") dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "电力线路倒闸操作票"); else if (kind == "yzgzp") dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "电力线路第一种工作票"); else if (kind == "ezgzp") dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "电力线路第二种工作票"); else if (kind == "xlqxp") dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, "电力线路事故应急抢修单"); else dt = WorkFlowTemplate.GetSelectedNameWorkFlows(userID, kind); workFlowId = dt.Rows[0]["WorkFlowId"].ToString(); workTaskId = dt.Rows[0]["workTaskId"].ToString(); flowCaption = dt.Rows[0]["FlowCaption"].ToString(); workFlowInstanceId = Guid.NewGuid().ToString(); workTaskInstanceId = Guid.NewGuid().ToString(); DataTable taskCommand = WorkFlowTask.GetTaskCommands(workFlowId, workTaskId); if (taskCommand.Rows.Count > 0) { command = taskCommand.Rows[0]["CommandName"].ToString(); } else { command = "提交"; } string[] strmes = new string[2]; strmes[0] = CreatWorkFlow(userID, workFlowId, workTaskId, workFlowInstanceId, workTaskInstanceId, flowCaption, command, IsRun); WFP_RecordWorkTaskIns wpfrecord = new WFP_RecordWorkTaskIns(); wpfrecord.RecordID = recordID; wpfrecord.WorkFlowId = workFlowId; wpfrecord.WorkFlowInsId = workFlowInstanceId; wpfrecord.WorkTaskId = workTaskId; wpfrecord.WorkTaskInsId = workTaskInstanceId; if (strmes[0].IndexOf("未提交至任何人") == -1) MainHelper.PlatformSqlMap.Create<WFP_RecordWorkTaskIns>(wpfrecord); strtemp = RecordWorkTask.GetWorkFlowTaskCaption(workTaskInstanceId); if (strtemp == "结束节点1") { strmes[1] = "存档"; } else { strmes[1] = strtemp; } return strmes; }