/// <summary> /// 程序文件 交办动作处理 /// </summary> /// <param name="p_strActionName"></param> /// <param name="entity"></param> protected ReturnInfo FormSubmitForProFile(Boolean bIsSave, String strActionName, String strParentTbID, String strStepStatus, EntityBase entity) { User l_objUser = null; ReturnInfo l_objReturnInfo = FormSave.SaveEntity(entity, this, bIsSave, this.SubAction, this.TemplateName); if (!l_objReturnInfo.IsSucess) { this.ShowMsgBox(this.Page, MsgType.VbExclamation, "表单保存出错,后续操作不能进行!" + l_objReturnInfo.ErrMessage); return(l_objReturnInfo); } if (!bIsSave) { //处理交办人相关信息 if (String.IsNullOrEmpty(strParentTbID)) { DataTable dt = B_PF.GetNextWorkItemIdForAssign(base.ProcessID);//当前ProcessID 父流程ID EntityBase entitybase = base.EntityData != null ? base.EntityData : new EntityBase(); entitybase.AgentUserID = String.Empty; entitybase.AgentUserName = String.Empty; EntityBase entitybase2 = EntityFactory.CreateEntity2(base.TemplateName);; base.EntityData.Clone(entitybase2); entitybase2.AgentUserID = String.Empty; entitybase2.AgentUserName = String.Empty; entitybase2.ProcessID = dt.Rows[0]["PROC_INST_ID"].ToString(); entitybase.ProcessID = dt.Rows[0]["PROC_INST_ID"].ToString(); entitybase2.WorkItemID = dt.Rows[0]["WORK_ITEM_ID"].ToString(); entitybase.WorkItemID = dt.Rows[0]["WORK_ITEM_ID"].ToString(); entitybase2.D_StepStatus = dt.Rows[0]["STATUS"].ToString(); entitybase.D_StepStatus = dt.Rows[0]["STATUS"].ToString(); entitybase2.ReceiveUserID = dt.Rows[0]["USER_ID"].ToString(); entitybase.ReceiveUserID = dt.Rows[0]["USER_ID"].ToString(); entitybase2.StepName = dt.Rows[0]["NAME"].ToString(); entitybase.StepName = dt.Rows[0]["NAME"].ToString(); entitybase2.SubmitAction = strActionName; entitybase.SubmitAction = strActionName; //接收人姓名 l_objUser = OAUser.GetUser(entitybase.ReceiveUserID); if (l_objUser != null) { entitybase2.ReceiveUserName = l_objUser.Name; entitybase.ReceiveUserName = l_objUser.Name; } entitybase2.FormsData = XmlUtility.SerializeXml(entitybase); if (!entitybase2.Save()) { l_objReturnInfo.IsSucess = false; l_objReturnInfo.ErrMessage = SysString.GetErrorMsgs(entitybase2.ErrMsgs); ILogger log = LoggerFactory.GetLogger(LogType.TxtFile, @"Log", "程序文件"); log.WriteLog("保存实体出错:" + l_objReturnInfo.ErrMessage); return(l_objReturnInfo); } }//新增协助会签节点数据 else { B_PF pfEntity = new B_PF(); pfEntity.ID = int.Parse(strParentTbID); pfEntity = XmlUtility.DeSerializeXml <B_PF>(pfEntity.FormsData); pfEntity.ID = int.Parse(strParentTbID); //清空子流程ProcessID,用于标识当部门领导自己提交表单撤销子流程(如果不为空,则需要注销子流程) pfEntity.ChildProcessID = String.Empty; pfEntity.AssistContent = (entity as B_PF).AssistContent; pfEntity.FormsData = XmlUtility.SerializeXml(pfEntity);//.Replace("<ID>" + pfEntity.ID + "</ID>", "<ID>" + int.MinValue.ToString() + "</ID>"); if (!pfEntity.Save()) { throw new Exception(pfEntity.ErrMsgs.ToString()); } WorkFlowBase.CompleteWorkItem(base.WorkItemID, null); }//更新交办会签节点数据 } l_objReturnInfo.IsSucess = true; return(l_objReturnInfo); }
/// <summary> /// /// </summary> /// <param name="p_blnIsSaveDraft"></param> /// <param name="p_strActionName"></param> /// <param name="p_htAttributes"></param> /// <param name="p_entEntityData"></param> protected void FormSubmit(Boolean p_blnIsSaveDraft, String p_strActionName, Hashtable p_htAttributes, EntityBase p_entEntityData) { String l_strMessage = String.Empty; User l_objUser = null; Boolean l_blnIsProcessCreated = true; try { ////M_20100406 ////huangqi ////修改说明:流程与附件模板名称是否匹配 ////Begin //if (p_entEntityData.FileList.Count > 0 && p_entEntityData.FileList[0].ProcessType != base.TemplateName) //{ // this.ShowMsgBox(this.Page, MsgType.VbInformation, "流程与附件模板名称不比配,请注销后重新处理该文件。", base.EntryAction); // return; //} ////End if (String.IsNullOrEmpty(base.WorkItemID)) { l_blnIsProcessCreated = false; } //保存实体数据 ReturnInfo l_objReturnInfo = FormSave.SaveEntity(p_entEntityData, this, p_blnIsSaveDraft, p_strActionName, base.TemplateName); if (!l_objReturnInfo.IsSucess) { //this.ShowMsgBox(this.Page, MsgType.VbExclamation, "表单保存出错,后续操作不能进行!" + l_objReturnInfo.ErrMessage); JScript.Alert("表单保存出错,后续操作不能进行!" + l_objReturnInfo.ErrMessage, TemplateName == ProcessConstString.TemplateName.PROGRAM_FILE); return; } if (p_blnIsSaveDraft) { if (l_blnIsProcessCreated) { //this.ShowMsgBox(this.Page, MsgType.VbInformation, "保存草稿成功!"); bool isUseUp = false; if (TemplateName == ProcessConstString.TemplateName.PROGRAM_FILE) { isUseUp = true; } else if (TemplateName == ProcessConstString.TemplateName.FinanceCCBX_APPLY) { isUseUp = true; } else { isUseUp = false; } JScript.Alert("保存草稿成功!", isUseUp); } else { this.ShowMsgBox(this.Page, MsgType.VbInformation, "保存草稿成功,可从草稿箱查看已保存文件!", "7"); } return; } //流程操作 DoWorkItem(p_htAttributes, l_blnIsProcessCreated); //获取下一个节点 getnext : DataTable l_dtbDataTable = B_FormsData.GetNextWorkItem(this.ProcessID, this.WorkItemID); if (l_dtbDataTable.Rows.Count == 0) { //有时候反应慢 数据还没产生 System.Threading.Thread.Sleep(500); l_dtbDataTable = B_FormsData.GetNextWorkItem(this.ProcessID, this.WorkItemID); } //防止协办与交办的冲突 if (base.TemplateName == ProcessConstString.TemplateName.LETTER_RECEIVE && base.SubAction != ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_TJCB) { if (l_dtbDataTable != null && l_dtbDataTable.Rows.Count > 0) { int i = 0; foreach (DataRow l_dtrDataRow in l_dtbDataTable.Rows) { if (l_dtrDataRow["NAME"].ToString() != ProcessConstString.StepName.LetterReceiveStepName.STEP_HELP_DIRECTOR) { i = 1; break; } else if (base.SubAction == ProcessConstString.SubmitAction.ACTION_SUBMIT && base.StepName == ProcessConstString.StepName.LetterReceiveStepName.STEP_LETTER_ADMIN) { i = 1; break; } } if (i == 0) { goto getnext; } } } l_strMessage = p_strActionName + " "; String l_strStepName = String.Empty; foreach (DataRow l_dtrDataRow in l_dtbDataTable.Rows) { EntityBase l_entEntityData = EntityFactory.CreateEntity2(base.TemplateName); EntityBase l_entEntityBaseData = base.EntityData; l_entEntityBaseData.Clone(l_entEntityData); //流程实例ID l_entEntityData.ProcessID = this.ProcessID; l_entEntityBaseData.ProcessID = this.ProcessID; //步骤节点ID l_entEntityData.WorkItemID = l_dtrDataRow["WORK_ITEM_ID"].ToString(); l_entEntityBaseData.WorkItemID = l_dtrDataRow["WORK_ITEM_ID"].ToString(); //步骤名称 l_entEntityData.StepName = l_dtrDataRow["NAME"].ToString(); l_entEntityBaseData.StepName = l_dtrDataRow["NAME"].ToString(); //步骤状态 l_entEntityData.D_StepStatus = l_dtrDataRow["STATUS"].ToString(); l_entEntityBaseData.D_StepStatus = l_dtrDataRow["STATUS"].ToString(); //接收时间 l_entEntityData.ReceiveDateTime = Convert.ToDateTime(l_dtrDataRow["CREATED_DATE"]); l_entEntityBaseData.ReceiveDateTime = Convert.ToDateTime(l_dtrDataRow["CREATED_DATE"]); //接收人账号 l_entEntityData.ReceiveUserID = l_dtrDataRow["USER_ID"].ToString(); l_entEntityBaseData.ReceiveUserID = l_dtrDataRow["USER_ID"].ToString(); //接收人姓名 l_objUser = OAUser.GetUser(l_entEntityData.ReceiveUserID); if (l_objUser != null) { l_entEntityData.ReceiveUserName = l_objUser.Name; l_entEntityBaseData.ReceiveUserName = l_objUser.Name; } //公办ID l_entEntityData.CommonID = l_dtrDataRow["POOL_ID"].ToString(); l_entEntityBaseData.CommonID = l_dtrDataRow["POOL_ID"].ToString(); //提交动作 l_entEntityData.SubmitAction = null; l_entEntityBaseData.SubmitAction = null; //代理人信息 l_entEntityData.AgentUserID = String.Empty; l_entEntityData.AgentUserName = String.Empty; l_entEntityBaseData.AgentUserID = String.Empty; l_entEntityBaseData.AgentUserName = String.Empty; l_entEntityData.IsFormSave = false; l_entEntityBaseData.IsFormSave = false; if (base.TemplateName == ProcessConstString.TemplateName.PROGRAM_FILE || base.TemplateName == ProcessConstString.TemplateName.LETTER_RECEIVE) { l_entEntityData.CommentList.Clear(); l_entEntityBaseData.CommentList.Clear(); } l_entEntityData.FormsData = XmlUtility.SerializeXml(l_entEntityBaseData); if (l_strStepName != l_entEntityData.StepName) { l_strStepName = l_entEntityData.StepName; if (l_strMessage != p_strActionName + " ") { l_strMessage += "待处理!"; } l_strMessage += "\\n[" + l_strStepName + "]:"; } if (!String.IsNullOrEmpty(l_entEntityData.ReceiveUserName)) { l_strMessage += l_entEntityData.ReceiveUserName + " "; } else { l_strMessage += l_entEntityData.ReceiveUserID + " "; } if ((B_FormsData.AscertainSameRecord(base.ProcessID, l_entEntityData.WorkItemID, base.TemplateName))) { continue; } if (!l_entEntityData.Save()) { String l_strErrorMessage = SysString.GetErrorMsgs(l_entEntityData.ErrMsgs); ILogger log = LoggerFactory.GetLogger(LogType.TxtFile, @"Log", this.TemplateName); log.WriteLog("保存待办节点出错:" + l_strErrorMessage); } } if (l_strMessage == p_strActionName + " ") { l_strMessage = "完成!"; } else { l_strMessage += "待处理!"; } this.ShowMsgBox(this.Page, MsgType.VbInformation, l_strMessage, base.EntryAction); } catch (Exception ex) { this.WriteLog(ex.Message); l_strMessage = ex.Message; this.ShowMsgBox(this.Page, MsgType.VbInformation, l_strMessage, base.EntryAction); } }