public string GetRecordListNum([FromUri] BillRequestModel billRequest) { if (billRequest == null || billRequest.Uid == 0) { return(DCHelper.ErrorMessage("用户id为空!")); } /*if (string.IsNullOrEmpty(billRequest.OrgCode)) * { * return DCHelper.ErrorMessage("组织编码为空!"); * }*/ if (billRequest.Orgid == 0) { return(DCHelper.ErrorMessage("组织id为空!")); } if (string.IsNullOrEmpty(billRequest.Year)) { return(DCHelper.ErrorMessage("年度为空!")); } try { //获取审批所有类型 List <QTSysSetModel> procTypes = QTSysSetService.GetProcTypes(); if (procTypes != null && procTypes.Count > 0) { //若是初次加载,则获取所有组织的审批信息 if (billRequest.IsFirst == 1) { //RELATID = 'lg' AND PARENTORG IS null var orgRelatitems = this.OrgRelatitem2Service.Find(t => t.RelatId == "lg" && t.ParentOrgId == 0).Data; if (orgRelatitems != null && orgRelatitems.Count == 1) { billRequest.Orgid = orgRelatitems[0].OrgId; } } foreach (var sysSet in procTypes) { billRequest.BType = sysSet.Value; billRequest.Splx_Phid = sysSet.PhId; int total = 0; List <AppvalRecordVo> recordVos = GAppvalRecordService.GetDoneRecordList(billRequest, out total); int total2 = 0; List <AppvalRecordVo> recordVos2 = GAppvalRecordService.GetUnDoRecordList(billRequest, out total2); sysSet.YNum = total; sysSet.NNum = total2; } } return(DataConverterHelper.SerializeObject(new { Status = "success", Data = procTypes })); } catch (Exception e) { return(DCHelper.ErrorMessage(e.Message)); } }
/// <summary> /// 获取所有审批种类对应的审批单据的总数量 /// </summary> /// <returns>返回Json串</returns> public string GetRecordListNum() { long Uid = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["Uid"]); long Orgid = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["Orgid"]); string Year = System.Web.HttpContext.Current.Request.Params["Year"]; if (Uid == 0) { return(DCHelper.ErrorMessage("用户id为空!")); } if (Orgid == 0) { return(DCHelper.ErrorMessage("组织id为空!")); } if (string.IsNullOrEmpty(Year)) { return(DCHelper.ErrorMessage("年度为空!")); } //设置当前数据库连接信息 ConnectionInfoService.SetCallContextConnectString(NG3.AppInfoBase.UserConnectString); MultiDelegatingDbProvider.CurrentDbProviderName = NG3.AppInfoBase.DbName; BillRequestModel billRequest = new BillRequestModel(); billRequest.Uid = Uid; billRequest.Orgid = Orgid; billRequest.Year = Year; var YNum = 0; //已审数量 var NNum = 0; //待审数量 try { //获取审批所有类型 List <QTSysSetModel> procTypes = QTSysSetService.GetProcTypes(); if (procTypes != null && procTypes.Count > 0) { foreach (var sysSet in procTypes) { billRequest.BType = sysSet.Value; billRequest.Splx_Phid = sysSet.PhId; int total = 0; List <AppvalRecordVo> recordVos = GAppvalRecordService.GetDoneRecordList(billRequest, out total); int total2 = 0; List <AppvalRecordVo> recordVos2 = GAppvalRecordService.GetUnDoRecordList(billRequest, out total2); YNum += total; NNum += total2; } } var dic = new Dictionary <string, object>(); new CreateCriteria(dic).Add(ORMRestrictions <Int64> .NotEq("PhId", 0)); new CreateCriteria(dic).Add(ORMRestrictions <List <Int32> > .In("FState", new List <int>() { 2, 0 })); new CreateCriteria(dic).Add(ORMRestrictions <Int64> .Eq("OrgPhid", Orgid)); new CreateCriteria(dic).Add(ORMRestrictions <string> .Eq("FYear", Year)); //var Query = GKPaymentMstService.GetPaymentFailure(dic); var Query = GKPaymentMstService.Find(dic).Data; return(DataConverterHelper.SerializeObject(new { Status = "success", YNum = YNum, NNum = NNum, PaymentState = Query.Count//【待支付】信息提醒需求 })); } catch (Exception e) { return(DCHelper.ErrorMessage(e.Message)); } }