public void DownLoad(string queryJson, string companyId) { var expression = ExtLinq.True <RefundOrderViewModel>(); var queryParam = queryJson.ToJObject(); if (!queryParam["begintime"].IsEmpty()) { var begintime = queryParam["begintime"].ToDate(); //开始时间 expression = expression.And(t => t.F_RefundTime >= begintime); } if (!queryParam["endtime"].IsEmpty()) { var endtime = queryParam["endtime"].ToDate().AddDays(1); //结束时间 expression = expression.And(t => t.F_RefundTime < endtime); } if (!queryParam["keyword"].IsEmpty()) { var keyword = queryParam["keyword"].ToString(); //用户卡号、表计编码、客户姓名 expression = expression.And(t => t.F_UserCard.Contains(keyword) || t.F_MeterCode.Contains(keyword) || t.F_CustomerName.Contains(keyword)); } if (!string.IsNullOrEmpty(companyId)) { expression = expression.And(t => t.F_OwnerId == companyId); } var recordList = _viewService.IQueryable(expression).OrderByDescending(x => x.F_CreatorTime); var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("订单号"), new DataColumn("用户卡号"), new DataColumn("表计编码"), new DataColumn("退费金额"), new DataColumn("本次余额"), new DataColumn("客户名称"), new DataColumn("经办人"), new DataColumn("退费时间"), }); foreach (var en in recordList) { var row = dt.NewRow(); row[0] = en.F_OrderNumber; row[1] = en.F_UserCard; row[2] = en.F_MeterCode; row[3] = en.F_Money; row[4] = en.F_Balance; row[5] = en.F_CustomerName; row[6] = en.F_CreatorUserName; row[7] = en.F_RefundTime; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "退费记录", "退费记录.xls"); }
public void DownLoad() { var expression = ExtLinq.True <IOTEntity>(); var iotList = _service.IQueryable(); var dt = new DataTable(); if (iotList != null && iotList.Any()) { dt.Columns.AddRange(new[] { new DataColumn("序号"), new DataColumn("批次"), new DataColumn("采购日期"), new DataColumn("IEMI"), new DataColumn("SN"), new DataColumn("IMSI"), new DataColumn("ICCID"), new DataColumn("卡号"), new DataColumn("开户日期"), new DataColumn("开户经办人"), new DataColumn("使用硬件"), new DataColumn("货号"), new DataColumn("表类型"), new DataColumn("使用客户"), new DataColumn("模组所在地"), new DataColumn("余额"), new DataColumn("客户使用数量") }); foreach (var en in iotList) { var row = dt.NewRow(); row[0] = en.M_ID; row[1] = en.M_Batch; row[2] = en.M_PurchaseTime; row[3] = en.M_IMEI; row[4] = en.M_SN; row[5] = en.M_IMSI; row[6] = en.M_ICCID; row[7] = en.M_CardID; row[8] = en.M_OpenAccountTime; row[9] = en.M_OpenAccountUserName; row[10] = en.M_HardwareName; row[11] = en.M_ArtNo; row[12] = en.M_MeterTypeName; row[13] = en.M_CustomerName; row[14] = en.M_Location; row[15] = en.M_Balance; row[16] = en.M_Remarks; dt.Rows.Add(row); } } NPOIExcel.ExportByWeb(dt, "M6310模组记录", "M6310模组记录.xls"); }
public void DownLoad(string queryJson, string companyId) { var dataItems = (Dictionary <string, object>) new ItemsDetailApp().GetDataItemList(); var expression = ExtLinq.True <ReportStatisticsViewModel>(); var queryParam = queryJson.ToJObject(); if (!queryParam["device"].IsEmpty()) { var device = queryParam["device"].ToString(); //设备类型 expression = expression.And(t => t.F_MeterType == device); } if (!string.IsNullOrEmpty(companyId)) { expression = expression.And(t => t.F_OwnerId == companyId); } var recordList = _viewService.IQueryable(expression).OrderByDescending(x => x.F_ReportCycle); var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("表类型"), new DataColumn("周期"), new DataColumn("总用量"), new DataColumn("总计费"), new DataColumn("总收入"), new DataColumn("上线表数"), new DataColumn("抄表次数"), }); foreach (var en in recordList) { var row = dt.NewRow(); if (dataItems != null) { row[0] = ((Dictionary <string, string>)dataItems["DeviceType"])[en.F_MeterType]; } else { row[0] = en.F_MeterType; } row[1] = en.F_ReportCycle; row[2] = en.F_SumDosage; row[3] = en.F_SumBill; row[4] = en.F_SumPay; row[5] = en.F_CountDevice; row[6] = en.F_CountRecord; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "用量统计", "用量统计.xls"); }
public virtual void DownLoad(string queryJson) { var dataItems = (Dictionary <string, object>) new ItemsDetailApp().GetDataItemList(); queryJson = HttpUtility.UrlDecode(queryJson, System.Text.Encoding.UTF8); var companyId = OperatorProvider.Provider.GetCurrent().CompanyId; var recordList = _readRecordApp.GetNonOnlineList(null, queryJson, companyId); var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("表类型"), new DataColumn("生产厂商"), new DataColumn("用户卡号"), new DataColumn("表计编码"), new DataColumn("客户名称"), new DataColumn("上次底数"), new DataColumn("上次上线"), new DataColumn("联系方式"), new DataColumn("安装地址"), new DataColumn("备注"), }); foreach (var en in recordList) { var row = dt.NewRow(); if (dataItems != null) { row[0] = ((Dictionary <string, string>)dataItems["DeviceType"])[en.F_MeterType]; } else { row[0] = ""; } row[1] = en.F_Factor; row[2] = en.F_UserCard; row[3] = en.F_MeterCode; row[4] = en.F_CustomerName; row[5] = en.F_TotalDosage == null ? "无" : ((decimal)en.F_TotalDosage).ToString("0.00"); row[6] = en.F_LastReadTime == null ? "无" : ((DateTime)en.F_LastReadTime).ToString("yyyy-MM-dd HH:mm:ss"); row[7] = en.F_MobilePhone; row[8] = en.F_CustomerAddress; row[9] = en.F_Description; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "上线统计", "上线统计.xls"); }
public virtual void DownLoad(DateTime reportTime, string type = "day") { List<RechargeReportViewModel> data; var companyId = OperatorProvider.Provider.GetCurrent().CompanyId; switch (type) { case "day": data = _payOrderApp.GetDailyData(reportTime, companyId); break; case "month": data = _payOrderApp.GetMonthlyReport(reportTime, companyId); ; break; case "year": data = _payOrderApp.GetAnnualReport(reportTime, companyId); ; break; default: data = new List<RechargeReportViewModel>(); break; } var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("购买日期"), new DataColumn("购买人次"), new DataColumn("累计数量"), new DataColumn("累计金额"), new DataColumn("备注"), }); foreach (var en in data) { var row = dt.NewRow(); row[0] = en.F_PurchaseDate; row[1] = en.F_PurchaseNumber; row[2] = en.F_AccumulativeTotal.ToString("0.00"); row[3] = en.F_AccumulativeAmount.ToString("0.00"); row[4] = en.F_Description; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "缴费统计", "缴费统计.xls"); }
public virtual void DownLoad(string queryJson) { var dataItems = (Dictionary <string, object>) new ItemsDetailApp().GetDataItemList(); queryJson = HttpUtility.UrlDecode(queryJson, System.Text.Encoding.UTF8); var companyId = OperatorProvider.Provider.GetCurrent().CompanyId; var recordList = _statisticsApp.DownLoad(queryJson, companyId); var queryParam = queryJson.ToJObject(); if (companyId == "030eca51-483a-47b6-ad46-b6164278ebcb")//张家口水司 { var endtime = queryParam["endtime"].ToDate(); var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("UserID"), new DataColumn("UserName"), new DataColumn("Address"), new DataColumn("Tel"), new DataColumn("WaterTagID"), new DataColumn("LINENO"), new DataColumn("AreaID"), new DataColumn("InTabManID"), new DataColumn("AMTabNum"), new DataColumn("NMTabNum"), new DataColumn("WaterMete"), new DataColumn("WaterPrice"), new DataColumn("CBtDate"), }); foreach (var en in recordList) { var row = dt.NewRow(); var customPara = en.F_Description.ToObject <MeterCustomParameter>(); row[0] = en.F_UserCard; row[1] = en.F_CustomerName; row[2] = en.F_CustomerAddress; row[3] = en.F_MobilePhone; row[4] = en.F_MeterCode; row[5] = customPara == null ? "" : customPara.LINENO; row[6] = customPara == null ? "" : customPara.AreaID; row[7] = customPara == null ? "" : customPara.InTabManIDs; row[8] = int.Parse(en.F_LastRecord.ToString("#0")); row[9] = int.Parse(en.F_ThisRecord.ToString("#0")); row[10] = int.Parse(en.F_ThisRecord.ToString("#0")) - int.Parse(en.F_LastRecord.ToString("#0")); row[11] = en.F_UnitPrice.ToString("#0.0"); row[12] = endtime.ToString("yyyy-MM-dd"); dt.Rows.Add(row); } var fileName = "11" + endtime.ToString("yyyyMM") + "S.xls"; NPOIExcel.ExportByWeb(dt, fileName, fileName); } else { var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("表类型"), new DataColumn("用户卡号"), new DataColumn("表计编码"), new DataColumn("客户名称"), new DataColumn("安装位置"), new DataColumn("联系方式"), new DataColumn("期初数"), new DataColumn("期末数"), new DataColumn("总用量"), new DataColumn("单价"), new DataColumn("总计费"), }); foreach (var en in recordList) { var row = dt.NewRow(); if (dataItems != null) { row[0] = ((Dictionary <string, string>)dataItems["DeviceType"])[en.F_MeterType]; } else { row[0] = ""; } row[1] = en.F_UserCard; row[2] = en.F_MeterCode; row[3] = en.F_CustomerName; row[4] = en.F_CustomerAddress; row[5] = en.F_MobilePhone; row[6] = en.F_LastRecord; row[7] = en.F_ThisRecord; row[8] = en.F_ThisDosage; row[9] = en.F_UnitPrice; row[10] = en.F_ThisBill; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "用量统计", "用量统计.xls"); } }
/// <summary> /// 数据导出 /// </summary> /// <param name="queryJson"></param> /// <param name="companyId"></param> public void DownLoad(string queryJson, string companyId) { var dataItems = (Dictionary <string, object>) new ItemsDetailApp().GetDataItemList(); var expression = ExtLinq.True <MeterViewModel>(); var queryParam = queryJson.ToJObject(); if (!queryParam["device"].IsEmpty()) { var device = queryParam["device"].ToString(); //设备类型 expression = expression.And(t => t.F_MeterType == device); } if (!queryParam["model"].IsEmpty()) { var model = queryParam["model"].ToString(); //设备类型 expression = expression.And(t => t.F_MeterModel == model); } if (!queryParam["factor"].IsEmpty()) { var factor = queryParam["factor"].ToString(); //生产厂商 expression = expression.And(t => t.F_Factor == factor); } if (!queryParam["keyword"].IsEmpty()) { var keyword = queryParam["keyword"].ToString(); //用户卡号、表计编码、客户姓名 expression = expression.And(t => t.F_UserCard.Contains(keyword) || t.F_MeterCode.Contains(keyword) || t.F_CustomerName.Contains(keyword) || t.F_CustomerAddress.Contains(keyword) || t.F_IDNumber.Contains(keyword)); } if (!queryParam["balance"].IsEmpty()) { var balance = decimal.Parse(queryParam["balance"].ToString()); //余额小于等于 expression = expression.And(t => t.F_Balance <= balance); } if (!string.IsNullOrEmpty(companyId)) { expression = expression.And(t => t.F_OwnerId == companyId); } expression = expression.And(t => t.F_DeleteMark != true); var meterList = _viewService.IQueryable(expression).OrderByDescending(x => x.F_CreatorTime); if (companyId == "030eca51-483a-47b6-ad46-b6164278ebcb") { var dt = new DataTable(); var now = DateTime.Now; dt.Columns.AddRange(new[] { new DataColumn("UserID"), new DataColumn("UserName"), new DataColumn("Address"), new DataColumn("Tel"), new DataColumn("WaterTagID"), new DataColumn("LINENO"), new DataColumn("AreaID"), new DataColumn("InTabManID"), new DataColumn("AMTabNum"), new DataColumn("NMTabNum"), new DataColumn("WaterMete"), new DataColumn("WaterPrice"), new DataColumn("CBtDate"), }); foreach (var en in meterList) { var row = dt.NewRow(); try { var customPara = en.F_Description.ToObject <MeterCustomParameter>(); row[5] = customPara == null ? "" : customPara.LINENO; row[6] = customPara == null ? "" : customPara.AreaID; row[7] = customPara == null ? "" : customPara.InTabManIDs; } catch { } row[0] = en.F_UserCard; row[1] = en.F_CustomerName; row[2] = en.F_CustomerAddress; row[3] = en.F_MobilePhone; row[4] = en.F_MeterCode; row[8] = null; row[9] = null; row[10] = null; row[11] = _priceApp.GetForm(en.F_PriceModel).F_PriceName;; row[12] = now.ToString("yyyy-MM-dd"); dt.Rows.Add(row); } var fileName = "11" + now.ToString("yyyyMM") + "X.xls"; NPOIExcel.ExportByWeb(dt, fileName, fileName); } else { var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("表计类型"), new DataColumn("计费方式"), new DataColumn("执行价格"), new DataColumn("生产厂商"), new DataColumn("用户卡号"), new DataColumn("表计编码"), new DataColumn("当前余额"), new DataColumn("客户名称"), new DataColumn("身份证号"), new DataColumn("联系方式"), new DataColumn("安装地址"), }); foreach (var en in meterList) { var row = dt.NewRow(); if (dataItems != null) { row[0] = ((Dictionary <string, string>)dataItems["DeviceType"])[en.F_MeterType]; row[1] = ((Dictionary <string, string>)dataItems["MeterModel"])[en.F_MeterModel]; } else { row[0] = ""; row[1] = ""; } row[2] = _priceApp.GetForm(en.F_PriceModel).F_PriceName; row[3] = en.F_Factor; row[4] = en.F_UserCard; row[5] = en.F_MeterCode; row[6] = en.F_Balance; row[7] = en.F_CustomerName; row[8] = en.F_IDNumber; row[9] = en.F_MobilePhone; row[10] = en.F_CustomerAddress; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "客户档案", "客户档案.xls"); } }
public void DownLoad(string queryJson, string companyId) { var dataItems = (Dictionary <string, object>) new ItemsDetailApp().GetDataItemList(); var expression = ExtLinq.True <PayOrderViewModel>(); var queryParam = queryJson.ToJObject(); if (!queryParam["type"].IsEmpty()) { var type = queryParam["type"].ToString(); //充值类型 expression = expression.And(t => t.F_PayType == type); } if (!queryParam["state"].IsEmpty()) { var state = queryParam["state"].ToString(); //充值类型 expression = expression.And(t => t.F_State == state); } else { var state = ((int)PayStateEnum.Build).ToString(); expression = expression.And(t => t.F_State != state); } if (!queryParam["begintime"].IsEmpty()) { var begintime = queryParam["begintime"].ToDate(); //开始时间 expression = expression.And(t => t.F_PaymentTime >= begintime); } if (!queryParam["endtime"].IsEmpty()) { var endtime = queryParam["endtime"].ToDate().AddDays(1); //结束时间 expression = expression.And(t => t.F_PaymentTime < endtime); } if (!queryParam["keyword"].IsEmpty()) { var keyword = queryParam["keyword"].ToString(); //用户卡号、表计编码、客户姓名 expression = expression.And(t => t.F_UserCard.Contains(keyword) || t.F_MeterCode.Contains(keyword) || t.F_CustomerName.Contains(keyword)); } if (!string.IsNullOrEmpty(companyId)) { expression = expression.And(t => t.F_OwnerId == companyId); } expression = expression.And(t => t.F_State == ((int)PayStateEnum.Finish).ToString()); var recordList = _viewService.IQueryable(expression).OrderByDescending(x => x.F_CreatorTime); var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("订单号"), new DataColumn("用户卡号"), new DataColumn("表计编码"), new DataColumn("缴费金额"), new DataColumn("缴费方式"), new DataColumn("本次余额"), new DataColumn("客户名称"), new DataColumn("经办人"), new DataColumn("缴费时间"), new DataColumn("外部订单号"), }); foreach (var en in recordList) { var row = dt.NewRow(); row[0] = en.F_OrderNumber; row[1] = en.F_UserCard; row[2] = en.F_MeterCode; row[3] = en.F_Money; if (dataItems != null) { row[4] = ((Dictionary <string, string>)dataItems["PayType"])[en.F_PayType]; } else { row[4] = ""; } row[5] = en.F_Balance; row[6] = en.F_CustomerName; row[7] = en.F_CreatorUserName; row[8] = en.F_PaymentTime; row[9] = en.F_OutOrder; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "缴费记录", "缴费记录.xls"); }
/// <summary> /// 导出Excel /// </summary> public void DownLoad(string queryJson, string companyId) { var dataItems = (Dictionary <string, object>) new ItemsDetailApp().GetDataItemList(); var expression = ExtLinq.True <ReadUnusualViewModel>(); var queryParam = queryJson.ToJObject(); if (!queryParam["device"].IsEmpty()) { var device = queryParam["device"].ToString(); //设备类型 expression = expression.And(t => t.F_MeterType == device); } if (!queryParam["factor"].IsEmpty()) { var factor = queryParam["factor"].ToString(); //生产厂商 expression = expression.And(t => t.F_Factor == factor); } if (!queryParam["error"].IsEmpty()) { var error = queryParam["error"].ToString(); //抄表类型 expression = expression.And(t => t.F_ErrorType == error); } if (!queryParam["begintime"].IsEmpty()) { var begintime = queryParam["begintime"].ToDate(); //开始时间 expression = expression.And(t => t.F_CreatorTime >= begintime); } if (!queryParam["endtime"].IsEmpty()) { var endtime = queryParam["endtime"].ToDate().AddDays(1); //结束时间 expression = expression.And(t => t.F_CreatorTime < endtime); } if (!queryParam["keyword"].IsEmpty()) { var keyword = queryParam["keyword"].ToString(); //用户卡号、表计编码、客户姓名、安装地址 expression = expression.And(t => t.F_UserCard.Contains(keyword) || t.F_MeterCode.Contains(keyword) || t.F_CustomerName.Contains(keyword) || t.F_CustomerAddress.Contains(keyword)); } if (!string.IsNullOrEmpty(companyId)) { expression = expression.And(t => t.F_OwnerId == companyId); } var unusualList = _viewService.IQueryable(expression).OrderByDescending(x => x.F_CreatorTime); var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("表类型"), new DataColumn("异常类型"), new DataColumn("生产厂商"), new DataColumn("表计编码"), new DataColumn("当次用量"), new DataColumn("客户名称"), new DataColumn("联系方式"), new DataColumn("安装地址"), new DataColumn("异常时间") }); foreach (var en in unusualList) { var row = dt.NewRow(); if (dataItems != null) { row[0] = ((Dictionary <string, string>)dataItems["DeviceType"])[en.F_MeterType]; row[1] = ((Dictionary <string, string>)dataItems["ErrorType"])[en.F_ErrorType]; } else { row[0] = ""; row[1] = ""; } row[2] = en.F_Factor; row[3] = en.F_MeterCode; row[4] = en.F_Value; row[5] = en.F_CustomerName; row[6] = en.F_MobilePhone; row[7] = en.F_CustomerAddress; row[8] = en.F_CreatorTime; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "异常记录", "异常记录.xls"); }
public virtual void DownLoad(string queryJson) { var dataItems = (Dictionary <string, object>) new ItemsDetailApp().GetDataItemList(); queryJson = HttpUtility.UrlDecode(queryJson, System.Text.Encoding.UTF8); var companyId = OperatorProvider.Provider.GetCurrent().CompanyId; var recordList = _readRecordApp.DownLoad(queryJson, companyId); var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("表类型"), new DataColumn("抄表方式"), new DataColumn("用户卡号"), new DataColumn("表计编码"), new DataColumn("期初数"), new DataColumn("期末数"), new DataColumn("倍率"), new DataColumn("本次用量"), new DataColumn("累计用量"), new DataColumn("单位"), new DataColumn("执行价格"), new DataColumn("本次计费"), new DataColumn("本次余额"), new DataColumn("客户名称"), new DataColumn("联系方式"), new DataColumn("安装地址"), new DataColumn("抄表时间"), }); foreach (var en in recordList) { var row = dt.NewRow(); if (dataItems != null) { row[0] = ((Dictionary <string, string>)dataItems["DeviceType"])[en.F_MeterType]; row[1] = ((Dictionary <string, string>)dataItems["ReadType"])[en.F_ReadType]; row[9] = ((Dictionary <string, string>)dataItems["DeviceUnit"])[en.F_MeterType]; } else { row[0] = ""; row[1] = ""; row[9] = ""; } row[2] = en.F_UserCard; row[3] = en.F_MeterCode; row[4] = en.F_MeterRate == null || en.F_LastDosage == null ? en.F_LastDosage : (decimal)en.F_LastDosage / (decimal)en.F_MeterRate; row[5] = en.F_MeterRate == null || en.F_TotalDosage == null ? en.F_TotalDosage : (decimal)en.F_TotalDosage / (decimal)en.F_MeterRate; row[6] = en.F_MeterRate ?? 1; row[7] = en.F_ThisDosage; row[8] = en.F_TotalDosage; row[10] = en.F_UnitPrice; row[11] = en.F_ThisBill; row[12] = en.F_Balance; row[13] = en.F_CustomerName; row[14] = en.F_MobilePhone; row[15] = en.F_CustomerAddress; row[16] = en.F_ReadTime; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "抄表记录", "抄表记录.xls"); }
public virtual void DownLoad(string queryJson, string keyword = "") { var dataItems = (Dictionary <string, object>) new ItemsDetailApp().GetDataItemList(); queryJson = HttpUtility.UrlDecode(queryJson, System.Text.Encoding.UTF8); var companyId = OperatorProvider.Provider.GetCurrent().CompanyId; var recordList = _statisticsApp.DownLoad(queryJson, companyId, keyword); var queryParam = queryJson.ToJObject(); //创业园电表数据导出 if (companyId == "ff92def0-dabe-4878-915b-1b8cd0560ce4" && !queryParam["month"].IsEmpty() && !queryParam["meterType"].IsEmpty() && queryParam["meterType"].ToString() == "电表") { var month = queryParam["month"].ToString(); NPOIExcel.ExportByWeb(PioneerPark(month, recordList), month + "用电及退补情况表.xls"); } else { var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("表类型"), new DataColumn("客户名称"), new DataColumn("表计编码"), new DataColumn("上月抄表"), new DataColumn("本月抄表"), new DataColumn("倍率"), new DataColumn("本月用量"), new DataColumn("单位"), new DataColumn("执行价格"), new DataColumn("本月计费"), new DataColumn("安装地址"), }); foreach (var en in recordList) { var row = dt.NewRow(); if (dataItems != null) { row[0] = ((Dictionary <string, string>)dataItems["DeviceType"])[en.F_MeterType]; row[7] = ((Dictionary <string, string>)dataItems["DeviceUnit"])[en.F_MeterType]; } else { row[0] = ""; row[7] = ""; } row[1] = en.F_CustomerName; row[2] = en.F_MeterCode; row[3] = en.F_LastMonthRecord; row[4] = en.F_ThisMonthRecord; row[5] = en.F_MeterRate ?? 1; row[6] = en.F_ThisMonthDosage; row[8] = en.F_UnitPrice; row[9] = en.F_ThisMonthBill; row[10] = en.F_CustomerAddress; dt.Rows.Add(row); } NPOIExcel.ExportByWeb(dt, "用量详情", "用量详情.xls"); } }