导出excel功能开发
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user