protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { string taskid = Request.QueryString["taskid"]; Guid taskID; if (taskid.IsGuid(out taskID)) { string user = Request.Form["user"]; string openerid = Request.QueryString["openerid"]; FoWoSoft.Platform.WorkFlowTask btask = new FoWoSoft.Platform.WorkFlowTask(); var users = new FoWoSoft.Platform.Organize().GetAllUsers(user); System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (var user1 in users) { btask.DesignateTask(taskID, user1); FoWoSoft.Platform.Log.Add("管理员指派了流程任务", "将任务" + taskID + "指派给了:" + user1.Name + user1.ID, FoWoSoft.Platform.Log.Types.流程相关); sb.Append(user1.Name); sb.Append(","); } string userNames = sb.ToString().TrimEnd(','); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('已成功指派给:" + userNames + "!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true); } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string flowid = context.Request.QueryString["flowid1"]; string groupid = context.Request.QueryString["groupid"]; Guid fid, gid; if (flowid.IsGuid(out fid) && groupid.IsGuid(out gid)) { System.Text.StringBuilder delxml = new System.Text.StringBuilder(); var tasks = new FoWoSoft.Platform.WorkFlowTask().GetTaskList(fid, gid); foreach (var task in tasks) { delxml.Append(task.Serialize()); } new FoWoSoft.Platform.WorkFlowTask().DeleteInstance(fid, gid); FoWoSoft.Platform.Log.Add("管理员删除了流程实例", delxml.ToString(), FoWoSoft.Platform.Log.Types.流程相关); context.Response.Write("删除成功!"); } else { context.Response.Write("参数错误!"); } }
protected void Page_Load(object sender, EventArgs e) { string taskid = Request.QueryString["taskid"]; Guid tid; if (!taskid.IsGuid(out tid)) { Response.Write("参数错误!"); Response.End(); } else if (new FoWoSoft.Platform.WorkFlowTask().HasWithdraw(tid)) { bool success = new FoWoSoft.Platform.WorkFlowTask().WithdrawTask(tid); if (success) { FoWoSoft.Platform.Log.Add("收回了任务", "任务ID:" + taskid, FoWoSoft.Platform.Log.Types.流程相关); Response.Write("收回成功!"); Response.End(); } else { Response.Write("收回失败!"); Response.End(); } } else { Response.Write("该任务不能收回!"); Response.End(); } }
private void TaskCount(HttpContext context) { var userID = Guid.Parse(context.Request["userID"]); string pager; var taskList = new FoWoSoft.Platform.WorkFlowTask().GetTasks(userID, out pager); var result = taskList.Count > 0 ? "有" + taskList.Count.ToString() + "条待办":""; context.Response.Write(result); }
private static void DelTask(HttpContext context, string taskgid) { FoWoSoft.Platform.WorkFlowTask btask = new FoWoSoft.Platform.WorkFlowTask(); var task = btask.Get(Guid.Parse(taskgid)); if (task != null) { btask.Delete(task.ID); new WebForm.Common.Meet().Roomis(task.InstanceID, WebForm.Common.RoomisOperation.put_reject); } }
public object Roomis(FoWoSoft.Data.Model.WorkFlowExecute.Execute execute) { var meetInfo = new FoWoSoft.Platform.MeetInfo().GetByTemp3(execute.InstanceID); if (meetInfo == null) { return(null); } string roomisId = meetInfo.temp1;//会议id; // var meetMsg = $" 您申请的会议名称:{meetInfo.temp2};会议地址:{meetInfo.MeetName},"; if (WebForm.Common.Tools.CheckBack(execute.ExecuteType, execute.StepID)) { put_reject(roomisId, execute.Sender.Account); // 申请失败:您申请的会议名称:***;会议地址:****,审核结果:没有通过:审核人:****;审核意见:**** var msg = string.Format(DuanxinService.DuanxinSendMsg3, meetInfo.temp2, meetInfo.MeetName, execute.Sender.Name, execute.Comment); //$" 申请失败:{meetMsg}审核结果:没有通过:审核人:{execute.Sender.Name},审核意见:{execute.Comment}"; //20180110短信发送 // duanxinService.smsSend(execute.Sender.Account, msg); //发给审请人 duanxinService.Sendapplication(execute.InstanceID, msg); } else if (execute.ExecuteType == FoWoSoft.Data.Model.WorkFlowExecute.EnumType.ExecuteType.Completed) { var tasks = new FoWoSoft.Platform.WorkFlowTask().GetAll(); var installTasks = tasks.Where(s => s.InstanceID.ToString().Equals(execute.InstanceID, StringComparison.OrdinalIgnoreCase) && s.Status == 0); string remarks = execute.Comment; put_approve(roomisId, execute.Sender.Account, remarks); //申请成功:您申请的会议名称:***;会议地址:****,已审核完毕,可以使用。 var msg = string.Format(DuanxinService.DuanxinSendMsg2, meetInfo.temp2, meetInfo.MeetName); //var msg = $"申请成功:{meetMsg}已审核完毕,可以使用。" ; //20180110短信发送 //anxinService.smsSend(execute.Sender.Account, msg+ "请查看"); //发给审请人 duanxinService.Sendapplication(execute.InstanceID, msg); } else { SendStep(roomisId, execute.InstanceID, meetInfo); } return(1); }
public void backEnd(FoWoSoft.Data.Model.WorkFlowExecute.Execute execute) { if (WebForm.Common.Tools.CheckBack(execute.ExecuteType, execute.StepID)) { var taskall = new FoWoSoft.Platform.WorkFlowTask().GetAll(); var installTasks = taskall.Where(s => s.InstanceID.ToString().Equals(execute.InstanceID, StringComparison.OrdinalIgnoreCase)); foreach (var item in installTasks) { if (item.Status < 2) { new FoWoSoft.Platform.WorkFlowTask().Completed(item.ID); } } Response.Write("<script type=\"text/javascript\">top.getTaskCount();top.mainTab.closeTab();</script>"); Response.End(); } }
private static void GetStatus(HttpContext context, string taskgid) { FoWoSoft.Platform.WorkFlowTask btask = new FoWoSoft.Platform.WorkFlowTask(); var task = btask.Get(Guid.Parse(taskgid)); if (task != null) { if (task.Status.In(2, 3, 4, 5)) { context.Response.Write("1"); } else { context.Response.Write("0"); } } }
/// <summary> /// 每一步的会议审核 /// </summary> /// <param name="eventId"></param> /// <param name="apperot"></param> /// <returns></returns> public static string SendStep(string eventId, string install) { var tasks = new FoWoSoft.Platform.WorkFlowTask().GetAll(); var installTasks = tasks.Where(s => s.InstanceID.ToString().Equals(install, StringComparison.OrdinalIgnoreCase)).OrderByDescending(s => s.Sort).Take(2); string[] remarks = new string[] { "待处理", "打开", "中间完成", "退回", "他人已处理", "他人已退回" }; foreach (var item in installTasks) { var approver = new FoWoSoft.Platform.Users().Get(item.ReceiveID).Account; var remark = (item.Status > -1 && item.Status < 6) ? remarks[item.Status] : ""; string data = JsonConvert.SerializeObject(new { approver = approver, status = "PENDING", remarks = remark }); string address = "api/booking/events/{0}/approval"; Put_Roomis(eventId, address, data); } return("1"); }
/// <summary> /// 每一步的会议审核 /// </summary> /// <param name="eventId"></param> /// <param name="apperot"></param> /// <returns></returns> public string SendStep(string eventId, string instanceid, FoWoSoft.Data.Model.MeetInfo meetInfo) { var meetMsg = $" 您申请的会议名称:{meetInfo.temp2};会议地址:{meetInfo.MeetName},"; var userInfoEdu = new EduWebService().GetUser(meetInfo.ApplicatId); if (userInfoEdu == null) { return(null); } var tasks = new FoWoSoft.Platform.WorkFlowTask().GetAll(); var installTasks = tasks.Where(s => s.InstanceID.ToString().Equals(instanceid, StringComparison.OrdinalIgnoreCase) && s.Status == 0); string[] remarks = new string[] { "请审核", "打开", "中间完成", "退回", "他人已处理", "他人已退回" }; var n = 0; foreach (var item in installTasks) { var task = tasks.FirstOrDefault(s => s.ID == item.PrevID); if (n == 0)//发给审请人 { if (task != null) { //申请过程:您申请的会议名称:***;会议地址:****,****(部门)申请通过。 duanxinService.Sendapplication(instanceid, string.Format(DuanxinService.DuanxinSendMsg1, meetInfo.temp2, meetInfo.MeetName, task.StepName)); } } n++; var approver = new FoWoSoft.Platform.Users().Get(item.ReceiveID).Account; var remark = (item.Status > -1 && item.Status < 6) ? remarks[item.Status] : ""; string data = JsonConvert.SerializeObject(new { approver = approver, status = "PENDING", remarks = remark }); string address = "api/booking/events/{0}/approval"; //由*** 部门,***(人名),申请的会议名称为:****会议申请,需要您审核。 FoWoSoft.Platform.Log.Add1(string.Format("各部门({0})", item.StepName + userInfoEdu.BMMC + userInfoEdu.XM + meetInfo.temp2), data, FoWoSoft.Platform.Log.Types.其它分类); //20180110短信发送 if (item.StepName == "信息办") { //由*** 部门,***(人名),申请的会议名称为:****会议申请已通过,请确认并提供相关支持。 duanxinService.Sendapplication(instanceid, string.Format(DuanxinService.DuanxinSendMsg6, userInfoEdu.BMMC, userInfoEdu.XM, meetInfo.MeetName, meetInfo.temp2, meetInfo.MeetTimes)); } else if (item.StepName.Contains("各部门")) { var prevName = tasks.FirstOrDefault(s => s.ID == item.PrevID).StepName; duanxinService.smsSend(approver, string.Format(DuanxinService.DuanxinSendMsg5, userInfoEdu.BMMC, userInfoEdu.XM, meetInfo.MeetName, meetInfo.temp2, meetInfo.MeetTimes, prevName)); } else { duanxinService.smsSend(approver, string.Format(DuanxinService.DuanxinSendMsg4, userInfoEdu.BMMC, userInfoEdu.XM, meetInfo.MeetName, meetInfo.temp2, meetInfo.MeetTimes)); } Put_Roomis(eventId, address, data); } return("1"); }