/// <summary> /// 审批完成 /// </summary> private void SubmitFinish() { if (!string.IsNullOrEmpty(id)) { UseWelfareNote Ent = UseWelfareNote.Find(id); Ent.WorkFlowState = "End"; Ent.WorlFlowResult = RequestData.Get <string>("ApproveResult"); Ent.DoUpdate(); } }
/// <summary> /// 撤销通知 /// </summary> private void Undo() { string Id = RequestData.Get("Id") + ""; if (!String.IsNullOrEmpty(Id)) { UseWelfareNote Ent = UseWelfareNote.Find(Id); Ent.State = "2"; //2 撤销 Ent.DoUpdate(); } }
//创建流程 private void StartFlow(string SurveyId) { string state = RequestData.Get <string>("state"); string formtype = RequestData.Get("formtype") + ""; UseWelfareNote Ent = UseWelfareNote.Find(SurveyId); string FlowKey = "questionnaire_"; //工作流key string NextUsr = string.Empty; //下一个审批人 SysWFUserSet UsrEnt = SysWFUserSet.FindFirstByProperties("SurveyId", SurveyId); int lg = UsrEnt.UserId1.Split(',').Length; FlowKey = FlowKey + lg; NextUsr += UsrEnt.UserId1.Split(',')[0] + "|" + UsrEnt.UserName1.Split(',')[0]; //指定流程Key //if (!string.IsNullOrEmpty(Ent.WorkFlowCode)) //{ // FlowKey = Ent.WorkFlowCode; //} //else //{ // 根据人员 获取工作流key //SQL = @"select Code from WorkflowTemplate where TemplateName like '调查问卷%' "; //DataTable FlDt = DataHelper.QueryDataTable(SQL); //if (!string.IsNullOrEmpty(FlDt.Rows[0][0] + "")) //{ // FlowKey = (FlDt.Rows[0][0] + "").Substring(0, (FlDt.Rows[0][0] + "").Length - 1) + UserCount.Length; //} if (!string.IsNullOrEmpty(FlowKey)) { string formUrl = string.Empty; //if (formtype.Contains("onlyView")) //onlyView 表示固定问卷 //{ //formUrl = "/SurveyManage/InternetSurvey.aspx?flow=y&op=v&type=read&Id=" + SurveyId; //} //else //{ formUrl = "/EmpWelfare/UseWelfareNoteEdit.aspx?op=r&id=" + SurveyId; //} Guid guid = Aim.WorkFlow.WorkFlow.StartWorkFlow(SurveyId, formUrl, "福利申报通知", FlowKey, UserInfo.UserID, UserInfo.Name); Ent.WorkFlowState = "Start"; Ent.WorkFlowCode = guid.ToString(); //InstanceId Ent.DoUpdate(); this.PageState.Add("NextInfo", guid.ToString() + "$" + NextUsr); } }
/// <summary> /// 发起通知 /// </summary> private void DoPublish() { string Id = RequestData.Get("Id") + ""; if (!String.IsNullOrEmpty(Id)) { UseWelfareNote Ent = UseWelfareNote.Find(Id); Ent.State = "1"; //1 发起 if (!string.IsNullOrEmpty(Ent.DeptId)) { SendNotices(Ent); } Ent.DoUpdate(); } }
/// <summary> /// 默认查询 /// </summary> private void Doselect() { UseWelfareNote ent = null; if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { ent = UseWelfareNote.Find(id); } this.SetFormData(ent); } if (op == "c") { //生成编号 日期HR Random rd = new Random(); string DateFt = "HR_TZ" + DateTime.Now.ToString("yyyyMMdd") + rd.Next(0, 10); this.SetFormData(new { Code = DateFt }); } //审批意见 if (!string.IsNullOrEmpty(id)) { string sql = @"select * from Task where PatIndex('%{0}%',EFormName)>0 and Status='4' order by FinishTime asc"; sql = string.Format(sql, id); IList <EasyDictionary> taskDics = DataHelper.QueryDictList(sql); PageState.Add("Opinion", taskDics); string taskId = RequestData.Get <string>("TaskId");//取审批暂存时所填写的意见 if (!string.IsNullOrEmpty(taskId)) { Task tEnt = Task.Find(taskId); if (tEnt.Status != 4 && !string.IsNullOrEmpty(tEnt.Description)) { PageState.Add("UnSubmitOpinion", tEnt.Description); } } } //福利申报类型 //this.PageState.Add("ThingsType", SysEnumeration.GetEnumDict("EmpUsrWelfare")); ////获取系统枚举流程 //string WFSQL = "select Code,TemplateName from FL_Culture_AimPortal..WorkflowTemplate"; //this.PageState.Add("WFEnum", DataHelper.QueryDict(WFSQL)); }
private void GetNextUsers() { UseWelfareNote SEnt = UseWelfareNote.Find(id); string CurrentNode = RequestData.Get <string>("taskName"); string nextName = RequestData.Get <string>("nextName"); string nextUserId = ""; string nextUserName = ""; if (CurrentNode == "申请人") { string[] User = UserChoice()[0].Split('|'); if (User.Length > 0) { nextUserId = User[0]; nextUserName = User[1]; } } else if (CurrentNode == "第一步" && nextName == "不同意") { if (SEnt != null) { nextUserId = SEnt.CreateId; nextUserName = SEnt.CreateName; } } else if (CurrentNode == "第一步" && nextName != "不同意") { string[] User = UserChoice()[1].Split('|'); if (User.Length > 0) { nextUserId = User[0]; nextUserName = User[1]; } } else if (CurrentNode == "第二步" && nextName != "退回上一步") { string[] User = UserChoice()[2].Split('|'); if (User.Length > 0) { nextUserId = User[0]; nextUserName = User[1]; } } else if (CurrentNode == "第三步" && nextName != "退回上一步") { string[] User = UserChoice()[3].Split('|'); if (User.Length > 0) { nextUserId = User[0]; nextUserName = User[1]; } } else if (CurrentNode == "第四步" && nextName != "退回上一步") { string[] User = UserChoice()[4].Split('|'); if (User.Length > 0) { nextUserId = User[0]; nextUserName = User[1]; } } else if (CurrentNode == "第五步" && nextName != "退回上一步") { string[] User = UserChoice()[5].Split('|'); if (User.Length > 0) { nextUserId = User[0]; nextUserName = User[1]; } } PageState.Add("NextUsers", new { nextUserId = nextUserId, nextUserName = nextUserName }); }