/// <summary> /// 取消送审 /// </summary> /// <returns></returns> public string UnChecked() { long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键 var Findresult = ExpenseMstService.Find <System.Int64>(id); SavedResult <Int64> savedresult = new SavedResult <Int64>(); Findresult.Data.FApprovestatus = "1"; Findresult.Data.FApprover = 0; Findresult.Data.FApprovedate = new Nullable <DateTime>(); Findresult.Data.PersistentState = PersistentState.Modified; savedresult = ExpenseMstService.Save <Int64>(Findresult.Data, ""); return(DataConverterHelper.SerializeObject(savedresult)); }
public string GetExpenseMstInfo([FromUri] long id) { ExpenseAllModel ExpenseAll = new ExpenseAllModel(); ExpenseAll.ExpenseMst = ExpenseMstService.Find(id).Data; ExpenseAll.ExpenseDtls = ExpenseMstService.FindExpenseDtlByForeignKey(id).Data.ToList(); ExpenseAll.ExpenseHxs = ExpenseMstService.FindExpenseHxByForeignKey(id).Data.ToList(); //用款计划对应的附件 var qtAttachments = this.QtAttachmentService.Find(t => t.RelPhid == id && t.BTable == "YS3_EXPENSEMST").Data; if (qtAttachments != null && qtAttachments.Count > 0) { ExpenseAll.QtAttachments = qtAttachments.ToList(); } return(DataConverterHelper.SerializeObject(ExpenseAll)); }
/// <summary> /// 根据主键获取数据 /// </summary> /// <returns>返回Json串</returns> public string GetExpenseMstInfo() { long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键 string tabtype = System.Web.HttpContext.Current.Request.Params["tabtype"]; //Tab类型 switch (tabtype) { case "expensemst": var findedresultexpensemst = ExpenseMstService.Find(id); return(DataConverterHelper.ResponseResultToJson(findedresultexpensemst)); case "expensedtl": var findedresultexpensedtl = ExpenseMstService.FindExpenseDtlByForeignKey(id); return(DataConverterHelper.EntityListToJson(findedresultexpensedtl.Data, findedresultexpensedtl.Data.Count)); case "expensehx": var findedresultexpensehx = ExpenseMstService.FindExpenseHxByForeignKey(id); return(DataConverterHelper.EntityListToJson(findedresultexpensehx.Data, findedresultexpensehx.Data.Count)); default: FindedResult findedresultother = new FindedResult(); return(DataConverterHelper.ResponseResultToJson(findedresultother)); } }
public string GetExpenseMstList([FromUri] ExpenseListRequestModel param) { //string clientJsonQuery = System.Web.HttpContext.Current.Request.Params["queryfilter"];//查询条件 //Dictionary<string, object> dicWhere = DataConverterHelper.ConvertToDic(clientJsonQuery);//查询条件转Dictionary //var userId = System.Web.HttpContext.Current.Request.Params["userId"]; Dictionary <string, object> dicWhere = new Dictionary <string, object>(); /*var dicWhereDept = new Dictionary<string, object>(); * new CreateCriteria(dicWhereDept) * .Add(ORMRestrictions<string>.Eq("Dwdm", param.UserCode)).Add(ORMRestrictions<string>.Eq("Dylx", "97")); //闭区间 * var deptList = CorrespondenceSettingsService.Find(dicWhereDept); * List<string> deptL = new List<string>(); * for (var i = 0; i < deptList.Data.Count; i++) * { * deptL.Add(deptList.Data[i].Dydm); * } * new CreateCriteria(dicWhere) * .Add(ORMRestrictions<IList<String>>.In("FBudgetDept", deptL));*/ new CreateCriteria(dicWhere) .Add(ORMRestrictions <string> .Eq("FDeclarationDept", param.FDeclarationDept)); if (param.FApprovestatus.Count > 0) { new CreateCriteria(dicWhere) .Add(ORMRestrictions <List <string> > .In("FApprovestatus", param.FApprovestatus)); } if (param.FStartdate != null) { new CreateCriteria(dicWhere) .Add(ORMRestrictions <System.DateTime?> .Ge("FDateofdeclaration", param.FStartdate)); } if (param.FEnddate != null) { new CreateCriteria(dicWhere) .Add(ORMRestrictions <System.DateTime?> .Le("FDateofdeclaration", param.FEnddate)); } if (param.MinAmount != 0) { new CreateCriteria(dicWhere) .Add(ORMRestrictions <System.Decimal> .Ge("FSurplusamount", param.MinAmount)); } if (param.MaxAmount != 0) { new CreateCriteria(dicWhere) .Add(ORMRestrictions <System.Decimal> .Le("FSurplusamount", param.MaxAmount)); } if (!string.IsNullOrEmpty(param.searchValue)) { var dic1 = new Dictionary <string, object>(); var dic2 = new Dictionary <string, object>(); new CreateCriteria(dic1) .Add(ORMRestrictions <String> .Like("FPerformevaltype", param.searchValue)); new CreateCriteria(dic2) .Add(ORMRestrictions <String> .Like("FProjname", param.searchValue)); new CreateCriteria(dicWhere) .Add(ORMRestrictions.Or(dic1, dic2)); } //根据单据号进行排序 var result = ExpenseMstService.LoadWithPage(param.PageIndex, param.PageSize, dicWhere, new string[] { "FPerformevaltype Desc" }); if (param.ProcPhid != 0) { var expenseList = ExpenseMstService.Find(dicWhere, new string[] { "FPerformevaltype Desc" }).Data; if (expenseList != null && expenseList.Count > 0) { List <string> orgList = expenseList.ToList().Select(t => t.FBudgetDept).Distinct().ToList(); if (orgList != null && orgList.Count > 0) { var procList = this.GAppvalProcService.Find(t => orgList.Contains(t.OrgCode)).Data; if (procList != null && procList.Count > 0) { //可以选取相同审批流的打上标记 foreach (var res in expenseList) { if (res.FApprovestatus == "1" && procList.ToList().Find(t => t.OrgCode == res.FBudgetDept && t.PhId == param.ProcPhid) != null) { res.BatchPracBz = 1; } else { continue; } } expenseList = expenseList.ToList().FindAll(t => t.BatchPracBz == 1); } } } result.Results = expenseList.Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize).ToList(); result.TotalItems = expenseList.Count; } return(DCHelper.ModelListToJson <ExpenseMstModel>(result.Results, (Int32)result.TotalItems)); }