/// <summary> /// 根据条件查询数据 /// </summary> /// <param name="filter"></param> /// <param name="responseEntity"></param> public virtual void Search(EveryDueReportFilter filter , ResponseEntity responseEntity) { if (filter == null) { return; } var reportDetailList = Singleton <EveryDueReportSearchDAL <EveryDueReportViewData> > .Instance.SearchData(filter); int count = Singleton <EveryDueReportSearchDAL <EveryDueReportViewData> > .Instance.GetCount(filter); if (reportDetailList == null || reportDetailList.Count == 0) { ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult); m_Logger.Info("未查询到数据!。"); } else { var responseResult = new ResponseListResult <EveryDueReportViewData>(); responseResult.TotalCount = count; responseResult.LstResult = reportDetailList; ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success); responseEntity.Results = responseResult; } }
/// <summary> /// 根据条件查询数据 /// </summary> /// <param name="filter"></param> /// <param name="responseEntity"></param> public virtual void Search(EveryDueReportFilter filter , ResponseEntity responseEntity) { if (filter == null) { return; } var result = Singleton <EveryDueReportExportDAL <EveryDueReportViewData> > .Instance.SearchDataToDataTable(filter); if (result == null || result.Rows.Count == 0) { ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult); m_Logger.Info("未查询到数据!。"); } else { //DataTable dtb = result.Clone(); //foreach (DataRow item in result.Rows) //{ // DataRow NewRow = dtb.NewRow(); // for (int i = 0; i < 38; i++) // { // NewRow[i] = item[i]; // } // NewRow["日期"] = Convert.ToDateTime(item["日期"]).AddDays(-1).ToString("yyyy-MM-dd"); // dtb.Rows.Add(NewRow); //} // 设置输出文件 SetExportFile(filter, result, responseEntity); } }
/// <summary> /// 程序执行主入口 /// </summary> /// <param name="requestEntity"></param> /// <param name="responseEntity"></param> protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity) { // 定义接收客户端参数的变量 EveryDueReportFilter filter = ServiceUtility.ConvertToFilterFromDict <EveryDueReportFilter>(requestEntity.Parameters); // 储蓄卡修改提交修改 Singleton <EveryDueReportExportBLL> .Instance.Search(filter, responseEntity); }
/// <summary> /// 获取检索数据的存储过程参数列表 /// </summary> /// <param name="baseFilter"></param> /// <returns></returns> protected override IDictionary <string, object> GetSearchSpInParams(BaseFilter baseFilter) { EveryDueReportFilter filter = baseFilter as EveryDueReportFilter; if (filter == null) { return(null); } IDictionary <string, object> inPutParam = new Dictionary <string, object>(); if (!string.IsNullOrEmpty(filter.ContractNo)) { inPutParam.Add("@ContractNo", filter.ContractNo); } if (filter.DunId != 0) { inPutParam.Add("@DunID", filter.DunId); } if (!string.IsNullOrEmpty(filter.IdenNo)) { inPutParam.Add("@IdNumber", filter.IdenNo); } if (!string.IsNullOrEmpty(filter.CustomerName)) { inPutParam.Add("@CustomerName", filter.CustomerName); } if (!string.IsNullOrEmpty(filter.CurDueSign)) { inPutParam.Add("@TodayOverdueMark", filter.CurDueSign); } if (!string.IsNullOrEmpty(filter.FirstDueSign)) { inPutParam.Add("@BeginningOverdueMark", filter.FirstDueSign); } if (!string.IsNullOrEmpty(filter.SaleWay)) { inPutParam.Add("@SaleWay", filter.SaleWay); } if (!string.IsNullOrEmpty(filter.BusStatus)) { inPutParam.Add("@BusinessStatus", filter.BusStatus); } if (!string.IsNullOrEmpty(filter.LawitStatus)) { inPutParam.Add("@LitigationStatus", filter.LawitStatus); } if (!string.IsNullOrEmpty(filter.ProductType)) { inPutParam.Add("@ProductType", filter.ProductType); } if (!string.IsNullOrEmpty(filter.SignArean)) { inPutParam.Add("@SigningCity", filter.SignArean); } if (!string.IsNullOrEmpty(filter.ExternalStatus)) { inPutParam.Add("@OutStatus", filter.ExternalStatus); } if (!string.IsNullOrEmpty(filter.MinDueDays)) { inPutParam.Add("@MinOverdueDays", filter.MinDueDays); } if (!string.IsNullOrEmpty(filter.MaxDueDays)) { inPutParam.Add("@MaxOverdueDays", filter.MaxDueDays); } if (!string.IsNullOrEmpty(filter.StartDate)) { inPutParam.Add("@StatisticsDate", filter.StartDate); } if (filter.IsDue.HasValue) { inPutParam.Add("@IsDue", filter.IsDue.Value ? 1 : 0); } if (filter.PageSize != 0) { inPutParam.Add("@pageSize", filter.PageSize); } if (filter.PageNo != 0) { inPutParam.Add("@pageIndex", filter.PageNo); } return(inPutParam); }
/// <summary> /// 获取检索数据的Sql文 /// </summary> /// <param name="baseFilter"></param> /// <returns></returns> protected override string GetSearchSql(BaseFilter baseFilter) { EveryDueReportFilter filter = baseFilter as EveryDueReportFilter; if (filter == null) { return(""); } string sqlFilePath = "Services\\SQL\\EveryDueReport\\Sql\\EXPORT_OVERDUESTATIC.sql"; StringBuilder replaceSQL = new StringBuilder(); if (!string.IsNullOrEmpty(filter.ContractNo)) { replaceSQL.AppendLine(" and ContractNo=" + "'" + filter.ContractNo + "'"); } if (filter.DunId != 0) { replaceSQL.AppendLine(" and DunID=" + filter.DunId); } if (!string.IsNullOrEmpty(filter.IdenNo)) { replaceSQL.AppendLine(" and IdNumber=" + "'" + filter.IdenNo + "'"); } if (!string.IsNullOrEmpty(filter.CustomerName)) { replaceSQL.AppendLine(" and CustomerName=" + "'" + filter.CustomerName + "'"); } if (!string.IsNullOrEmpty(filter.CurDueSign)) { replaceSQL.AppendLine(" and TodayOverdueMark=" + "'" + filter.CurDueSign + "'"); } if (!string.IsNullOrEmpty(filter.FirstDueSign)) { replaceSQL.AppendLine(" and BeginningOverdueMark=" + "'" + filter.FirstDueSign + "'"); } if (!string.IsNullOrEmpty(filter.SaleWay)) { replaceSQL.AppendLine(" and SalesChannels=" + "'" + filter.SaleWay + "'"); } if (!string.IsNullOrEmpty(filter.BusStatus)) { replaceSQL.AppendLine(" and BusinessStatus=" + "'" + filter.BusStatus + "'"); } if (!string.IsNullOrEmpty(filter.LawitStatus)) { replaceSQL.AppendLine(" and LitigationStatus=" + "'" + filter.LawitStatus + "'"); } if (!string.IsNullOrEmpty(filter.ProductType)) { replaceSQL.AppendLine(" and ProductType=" + "'" + filter.ProductType + "'"); } if (!string.IsNullOrEmpty(filter.SignArean)) { replaceSQL.AppendLine(" and SigningCity=" + "'" + filter.SignArean + "'"); } if (!string.IsNullOrEmpty(filter.ExternalStatus)) { replaceSQL.AppendLine(" and OutStatus=" + "'" + filter.ExternalStatus + "'"); } if (!string.IsNullOrEmpty(filter.MinDueDays)) { replaceSQL.AppendLine(" and OverdueDays>=" + filter.MinDueDays); } if (!string.IsNullOrEmpty(filter.MaxDueDays)) { replaceSQL.AppendLine(" and OverdueDays<=" + filter.MaxDueDays); } if (!string.IsNullOrEmpty(filter.StartDate)) { replaceSQL.AppendLine(" and StatisticsDate=" + "'" + filter.StartDate + "'"); } if (filter.IsDue.HasValue) { replaceSQL.AppendLine(filter.IsDue.Value ? " and OverdueAmount>0" : " and OverdueAmount=0"); } return(sqlFilePath.ToFileContent(true, replaceSQL.ToString())); }