导出excel功能开发

This commit is contained in:
范露尧
2023-06-30 11:37:23 +08:00
parent 7fa72212d4
commit cdd2235535
15 changed files with 12007 additions and 17 deletions

View File

@@ -72,15 +72,17 @@ namespace Vote.Services.ApiController
[HttpPost]
[UnitOfWork]
[Route("export_excel")]
public async Task<dynamic> ExportExcel(NbzcGetListInput args)
public async Task<dynamic> ExportExcel(OutsideWallQueryInput args)
{
var list = await QueryBuildings(args);
//var list = await repoutside_wall.AsQueryable().Where(a => !a.IsDeleted).OrderByDescending(a => a.CreatedTime).ToListAsync();
//var filepath = Tools.ExcelHelper.WriteExcelNingBoZhiChun(list);
//return new FileStreamResult(new FileStream(filepath, FileMode.Open), "application/octet-stream") { FileDownloadName = filepath };
var filepath = Tools.ExcelHelper.WriteExcelOutsideWallBuilding(list);
return new FileStreamResult(new FileStream(filepath, FileMode.Open), "application/octet-stream") { FileDownloadName = filepath };
return 1;
}
[HttpPost("querybuildings")]
public async Task<dynamic> QueryBuildings(OutsideWallQueryInput args)
public async Task<List<OutsideWallBuildingsOutput>> QueryBuildings(OutsideWallQueryInput args)
{
var entity = await repoutside_wall_building.AsQueryable().LeftJoin<outside_wall>((a, b) => a.outsidewallId == b.Id)
.WhereIF(!string.IsNullOrWhiteSpace(args.communityId), (a, b) => b.communityId == args.communityId)