public string QueryCompletedList() { RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask(); RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow(); RoadFlow.Platform.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary(); string text = base.Request.Form["title"]; string flowid = base.Request.Form["flowid"]; string sender = base.Request.Form["sender"]; string date = base.Request.Form["date1"]; string date2 = base.Request.Form["date2"]; string text2 = base.Request.Form["sidx"]; string text3 = base.Request.Form["sord"]; string text4 = ""; int pageSize = RoadFlow.Utility.Tools.GetPageSize(); int pageNumber = RoadFlow.Utility.Tools.GetPageNumber(); string order = (MyExtensions.IsNullOrEmpty(text2) ? "CompletedTime1" : text2) + " " + (MyExtensions.IsNullOrEmpty(text3) ? "asc" : text3); long count; List <RoadFlow.Data.Model.WorkFlowTask> tasks = workFlowTask.GetTasks(MyController.CurrentUserID, out count, pageSize, pageNumber, MyExtensions.Trim1(text), flowid, sender, date, date2, 1, order); JsonData jsonData = new JsonData(); foreach (RoadFlow.Data.Model.WorkFlowTask item in tasks) { bool isHasten = false; RoadFlow.Data.Model.AppLibrary byCode = appLibrary.GetByCode(item.FlowID.ToString()); int num = 0; int num2 = 1000; int num3 = 500; if (byCode != null) { num = byCode.OpenMode; num2 = (byCode.Width.HasValue ? byCode.Width.Value : 1000); num3 = (byCode.Height.HasValue ? byCode.Height.Value : 500); } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("<a class=\"viewlink\" href=\"javascript:void(0);\" onclick=\"detail('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">查看</a>"); if (item.Status == 2 && workFlowTask.HasWithdraw(item.ID, out isHasten)) { stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/back.gif") + ") no-repeat left center; padding-left:18px;margin-left:5px;\" href=\"javascript:void(0);\" onclick=\"withdraw('" + item.ID + "');\">收回</a>"); } if (isHasten) { stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/comment_reply.png") + ") no-repeat left center; padding-left:18px;margin-left:5px;\" href=\"javascript:void(0);\" onclick=\"hasten('" + item.ID + "');\">催办</a>"); } JsonData jsonData2 = new JsonData(); jsonData2["id"] = item.ID.ToString(); jsonData2["FlowName"] = workFlow.GetFlowName(item.FlowID); jsonData2["Note"] = item.Note; jsonData2["ReceiveTime"] = MyExtensions.ToDateTimeString(item.ReceiveTime); jsonData2["CompletedTime"] = (item.CompletedTime1.HasValue ? MyExtensions.ToDateTimeString(item.CompletedTime1.Value) : ""); jsonData2["SenderName"] = item.SenderName; jsonData2["StepName"] = item.StepName; jsonData2["Title"] = "<a href=\"javascript:void(0);\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}&display=1" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + MyExtensions.HtmlEncode(item.Title) + "</a>"; jsonData2["Opation"] = stringBuilder.ToString(); jsonData.Add(jsonData2); } return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}"); }
public string Query() { RoadFlow.Platform.WorkFlowDelegation workFlowDelegation1 = new RoadFlow.Platform.WorkFlowDelegation(); RoadFlow.Platform.Organize organize = new RoadFlow.Platform.Organize(); RoadFlow.Platform.Users users = new RoadFlow.Platform.Users(); RoadFlow.Platform.WorkFlow workFlow1 = new RoadFlow.Platform.WorkFlow(); string startTime = this.Request.Form["S_StartTime"]; string endTime = this.Request.Form["S_EndTime"]; string id1 = this.Request.Form["S_UserID"]; string str1 = this.Request.Form["sidx"]; string str2 = this.Request.Form["sord"]; string str3 = this.Request.Form["typeid"]; int pageSize = Tools.GetPageSize(); int pageNumber = Tools.GetPageNumber(); string order = (str1.IsNullOrEmpty() ? "SenderTime" : str1) + " " + (str2.IsNullOrEmpty() ? "asc" : str2); long count; IEnumerable <RoadFlow.Data.Model.WorkFlowDelegation> workFlowDelegations = !("1" == this.Request.QueryString["isoneself"]) ? (IEnumerable <RoadFlow.Data.Model.WorkFlowDelegation>)workFlowDelegation1.GetPagerData(out count, pageSize, pageNumber, RoadFlow.Platform.Users.RemovePrefix(id1), startTime, endTime, order) : (IEnumerable <RoadFlow.Data.Model.WorkFlowDelegation>)workFlowDelegation1.GetPagerData(out count, pageSize, pageNumber, MyController.CurrentUserID.ToString(), startTime, endTime, order); JsonData jsonData1 = new JsonData(); foreach (RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation2 in workFlowDelegations) { string str4 = "委托中"; if (workFlowDelegation2.StartTime > DateTimeNew.Now) { str4 = "未开始"; } else if (workFlowDelegation2.EndTime < DateTimeNew.Now) { str4 = "已失效"; } JsonData jsonData2 = new JsonData(); JsonData jsonData3 = jsonData2; string index1 = "id"; Guid id2 = workFlowDelegation2.ID; JsonData jsonData4 = (JsonData)id2.ToString(); jsonData3[index1] = jsonData4; jsonData2["UserID"] = (JsonData)users.GetName(workFlowDelegation2.UserID); jsonData2["ToUserID"] = (JsonData)users.GetName(workFlowDelegation2.ToUserID); JsonData jsonData5 = jsonData2; string index2 = "FlowID"; Guid? flowId = workFlowDelegation2.FlowID; string str5; if (!flowId.HasValue) { str5 = ""; } else { RoadFlow.Platform.WorkFlow workFlow2 = workFlow1; flowId = workFlowDelegation2.FlowID; Guid flowID = flowId.Value; str5 = workFlow2.GetFlowName(flowID); } JsonData jsonData6 = (JsonData)str5; jsonData5[index2] = jsonData6; jsonData2["StartTime"] = (JsonData)workFlowDelegation2.StartTime.ToDateTimeString(); jsonData2["EndTime"] = (JsonData)workFlowDelegation2.EndTime.ToDateTimeString(); jsonData2["Note"] = (JsonData)workFlowDelegation2.Note; jsonData2["Status"] = (JsonData)str4; JsonData jsonData7 = jsonData2; string index3 = "Edit"; string str6 = "<a class=\"editlink\" href=\"javascript:edit('"; id2 = workFlowDelegation2.ID; string str7 = id2.ToString(); string str8 = "');\">编辑</a>"; JsonData jsonData8 = (JsonData)(str6 + str7 + str8); jsonData7[index3] = jsonData8; jsonData1.Add((object)jsonData2); } return("{\"userdata\":{\"total\":" + (object)count + ",\"pagesize\":" + (object)pageSize + ",\"pagenumber\":" + (object)pageNumber + "},\"rows\":" + jsonData1.ToJson(true) + "}"); }
public string QueryWaitList() { RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask(); RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow(); RoadFlow.Platform.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary(); string text = base.Request.Form["title"]; string flowid = base.Request.Form["flowid"]; string sender = base.Request.Form["sender"]; string date = base.Request.Form["date1"]; string date2 = base.Request.Form["date2"]; string text2 = base.Request.Form["sidx"]; string text3 = base.Request.Form["sord"]; string text4 = ""; int pageSize = RoadFlow.Utility.Tools.GetPageSize(); int pageNumber = RoadFlow.Utility.Tools.GetPageNumber(); long count; List <RoadFlow.Data.Model.WorkFlowTask> obj = workFlowTask.GetTasks(order: (MyExtensions.IsNullOrEmpty(text2) ? "ReceiveTime" : text2) + " " + (MyExtensions.IsNullOrEmpty(text3) ? "asc" : text3), userID: MyController.CurrentUserID, count: out count, size: pageSize, number: pageNumber, title: MyExtensions.Trim1(text), flowid: flowid, sender: sender, date1: date, date2: date2); JsonData jsonData = new JsonData(); Guid currentUserID = MyController.CurrentUserID; foreach (RoadFlow.Data.Model.WorkFlowTask item in obj) { RoadFlow.Data.Model.AppLibrary byCode = appLibrary.GetByCode(item.FlowID.ToString()); int num = 0; int num2 = 1000; int num3 = 500; if (byCode != null) { num = byCode.OpenMode; num2 = (byCode.Width.HasValue ? byCode.Width.Value : 1000); num3 = (byCode.Height.HasValue ? byCode.Height.Value : 500); } WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(item.FlowID); JsonData jsonData2 = new JsonData(); jsonData2["id"] = item.ID.ToString(); jsonData2["FlowName"] = workFlow.GetFlowName(item.FlowID); jsonData2["StepName"] = item.StepName; jsonData2["Note"] = item.Note; jsonData2["ReceiveTime"] = MyExtensions.ToDateTimeString(item.ReceiveTime); jsonData2["SenderName"] = item.SenderName; if (item.CompletedTime.HasValue) { if (item.CompletedTime.Value < DateTimeNew.get_Now()) { jsonData2["StatusTitle"] = "<i title=\"已过期\" class=\"fa fa-bell\" style=\"color:red;font-weight:bold;\"><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">已过期</span></i>"; } else if ((item.CompletedTime.Value - DateTimeNew.get_Now()).Days <= 3) { jsonData2["StatusTitle"] = "<i title=\"即将过期\" class=\"fa fa-bell\" style=\"color:#fd8a02;font-weight:bold;\"><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">即将到期</span></i>"; } else { jsonData2["StatusTitle"] = "<i title=\"正常\" class=\"fa fa-bell\" style=\"color:#666;font-weight:bold;\"></i><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">正常</span></i>"; } } else { jsonData2["StatusTitle"] = "<i title=\"正常\" class=\"fa fa-bell\" style=\"color:#666;font-weight:bold;\"></i><span title=\"要求完成时间:无时间要求\">正常</span></i>"; } jsonData2["Title"] = "<a href=\"javascript:void(0);\" class=\"blue\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + MyExtensions.HtmlEncode(item.Title) + "</a>"; string text5 = "<a href=\"javascript:void(0);\" class=\"editlink\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">处理</a> <a class=\"viewlink\" href=\"javascript:void(0);\" onclick=\"detail('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">查看</a>"; if (workFlowRunModel != null && workFlowRunModel.FirstStepID == item.StepID && item.SenderID == currentUserID) { text5 = text5 + " <a class=\"deletelink\" href=\"javascript:void(0);\" onclick=\"delTask('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">作废</a>"; } jsonData2["Opation"] = text5; jsonData.Add(jsonData2); } return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}"); }