public async Task <FileStreamResult> OrderSetStoneStatisticsExport(SetStoneReportQuery reportQuery) { var manager = new ShipmentManager(User); var orderSetStoneStatistics = await manager.GetOrderSetStoneStatisticsAsync(reportQuery); var titles = new string[] { "序号", "配石名称", "重量(ct)", "数量", "副石额" }; var result = Dickson.Web.Helper.ExcelHelp.Export(titles, "配石报表", ws => { var row = 2; int index = 1; foreach (var orderSetStoneStatistic in orderSetStoneStatistics) { ws.Cells[row, 1].Value = index; ws.Cells[row, 2].Value = orderSetStoneStatistic.SetStoneName; ws.Cells[row, 3].Value = orderSetStoneStatistic.Weight; ws.Cells[row, 4].Value = orderSetStoneStatistic.Number; ws.Cells[row, 5].Value = orderSetStoneStatistic.SetStoneAmount; row++; index++; } ; }); return(result); }
public async Task <ActionResult> OrderSetStoneStatistics(SetStoneReportQuery reportQuery) { if (!Request.IsAjaxRequest()) { return(View(reportQuery)); } var manager = new ShipmentManager(User); var list = await manager.GetOrderSetStoneStatisticsAsync(reportQuery); return(Json(true, string.Empty, list)); }