public static IQueryable <TaskWork> Query(TaskWorkCondition searchCondition, out int totalSize) { var predicate = PredicateBuilder.True <TaskWork>(); if (!string.IsNullOrEmpty(searchCondition.Title)) { predicate = predicate.And(e => e.Title.Contains(searchCondition.Title)); } if (!string.IsNullOrEmpty(searchCondition.StoreCode)) { predicate = predicate.And(e => e.StoreCode.Contains(searchCondition.StoreCode)); } if (!string.IsNullOrEmpty(searchCondition.StoreNameZHCN)) { var storeList = StoreBasicInfo.Search(e => e.NameZHCN.Contains(searchCondition.StoreNameZHCN)); var storeCodeList = storeList.Select(e => e.StoreCode).ToList(); predicate = predicate.And(e => storeCodeList.Contains(e.StoreCode)); } if (searchCondition.Status.HasValue) { predicate = predicate.And(e => e.Status == searchCondition.Status.Value); } if (!string.IsNullOrEmpty(searchCondition.TypeCode)) { //var employeeList = Employee.Search(e => e.NameZHCN.Contains(searchCondition.SenderZHCN)); //var employeeCodeList = employeeList.Select(e => e.Code).ToList(); predicate = predicate.And(e => e.TypeCode.Contains(searchCondition.TypeCode)); } if (!string.IsNullOrEmpty(searchCondition.ReceiverAccount)) { predicate = predicate.And(e => e.ReceiverAccount == searchCondition.ReceiverAccount); } //从多少页开始取数据 var list = Search(predicate, e => e.Num, searchCondition.PageIndex, searchCondition.PageSize, out totalSize, true); return(list); }
public static TTMFinanceData GetFinanceData(string projectId, string financeYear = "", string financeMonth = "") { var ldw_FinanceData = LDW_FinanceData.Get(projectId); var ttmData = new TTMFinanceData(); if (string.IsNullOrEmpty(financeYear) && string.IsNullOrEmpty(financeMonth) && ldw_FinanceData != null) { ttmData.Accounting = DataConverter.ToDecimal(ldw_FinanceData.Accounting_TTM); ttmData.DepreciationEssd = DataConverter.ToDecimal(ldw_FinanceData.Depreciation_Essd_TTM); ttmData.DepreciationLhi = DataConverter.ToDecimal(ldw_FinanceData.Depreciation_LHI_TTM); ttmData.NonProductCosts = DataConverter.ToDecimal(ldw_FinanceData.Non_Product_Costs_TTM); ttmData.NonProductSales = DataConverter.ToDecimal(ldw_FinanceData.Non_Product_Sales_TTM); ttmData.Insurance = DataConverter.ToDecimal(ldw_FinanceData.Insurance_TTM); ttmData.InterestEssd = DataConverter.ToDecimal(ldw_FinanceData.Interest_Essd_TTM); ttmData.InterestLhi = DataConverter.ToDecimal(ldw_FinanceData.Interest_LHI_TTM); ttmData.OtherIncExp = DataConverter.ToDecimal(ldw_FinanceData.Other_Exp_TTM); ttmData.Pac = DataConverter.ToDecimal(ldw_FinanceData.Pac_TTM); ttmData.ProductSales = DataConverter.ToDecimal(ldw_FinanceData.ProductSales_TTM); ttmData.Rent = DataConverter.ToDecimal(ldw_FinanceData.Rent_TTM); ttmData.ServiceFee = DataConverter.ToDecimal(ldw_FinanceData.Service_Fee_TTM); ttmData.TaxesAndLicenses = DataConverter.ToDecimal(ldw_FinanceData.Taxes_Licenses_TTM); ttmData.CompSales = DataConverter.ToDecimal(ldw_FinanceData.comp_sales_ttm); } else { var yearMonthObj = StoreSTMonthlyFinaceInfoTTM.FirstOrDefault(f => true); if (string.IsNullOrEmpty(financeYear)) { if (yearMonthObj != null && !string.IsNullOrEmpty(yearMonthObj.TTMValue)) { financeYear = yearMonthObj.TTMValue.Substring(0, yearMonthObj.TTMValue.IndexOf('-')); } else { financeYear = Utils.GetLatestYear(); } } if (string.IsNullOrEmpty(financeMonth)) { if (yearMonthObj != null && !string.IsNullOrEmpty(yearMonthObj.TTMValue)) { financeMonth = yearMonthObj.TTMValue.Substring(yearMonthObj.TTMValue.IndexOf('-') + 1); } else { financeMonth = Utils.GetLatestMonth(); } } var uscode = RenewalInfo.Get(projectId).USCode; var storeId = StoreBasicInfo.Search(s => s.StoreCode.Equals(uscode)).Select(id => id.StoreID).FirstOrDefault(); var financeData = DataSync_LDW_AM_STFinanceData.FirstOrDefault(f => f.UsCode == uscode && f.FinanceYear.Equals(financeYear) && f.FinanceMonth.Equals(financeMonth)); var financeData2 = DataSync_LDW_AM_STFinanceData2.FirstOrDefault(f => f.UsCode == uscode && f.FinanceYear.Equals(financeYear) && f.FinanceMonth.Equals(financeMonth)); var re = DataSync_LDW_AM_STMonthlyFinaceInfo.Search(f => f.StoreID == storeId).OrderByDescending(f => f.Year).FirstOrDefault(); ttmData.Accounting = DataConverter.ToDecimal(financeData2.Accounting_TTM); ttmData.DepreciationEssd = DataConverter.ToDecimal(financeData2.Depreciation_Essd_TTM); ttmData.DepreciationLhi = DataConverter.ToDecimal(financeData2.Depreciation_LHI_TTM); ttmData.NonProductCosts = DataConverter.ToDecimal(financeData2.Non_Product_Costs_TTM); ttmData.NonProductSales = DataConverter.ToDecimal(financeData2.Non_Product_Sales_TTM); ttmData.Insurance = DataConverter.ToDecimal(financeData2.Insurance_TTM); ttmData.InterestEssd = DataConverter.ToDecimal(financeData2.Interest_Essd_TTM); ttmData.InterestLhi = DataConverter.ToDecimal(financeData2.Interest_LHI_TTM); ttmData.OtherIncExp = DataConverter.ToDecimal(financeData2.Other_Exp_TTM); ttmData.Pac = DataConverter.ToDecimal(financeData2.Pac_TTM); ttmData.ProductSales = DataConverter.ToDecimal(financeData.ProductSales_TTM); ttmData.Rent = DataConverter.ToDecimal(financeData2.Rent_TTM); ttmData.ServiceFee = DataConverter.ToDecimal(financeData2.Service_Fee_TTM); ttmData.TaxesAndLicenses = DataConverter.ToDecimal(financeData2.Taxes_Licenses_TTM); ttmData.CompSales = DataConverter.ToDecimal(financeData2.comp_sales_ttm); } return(ttmData); }