optimize
wet 2 years ago
parent b7d58d434c
commit 42b24b2553

@ -256,10 +256,11 @@ namespace Myshipping.Application
Directory.CreateDirectory(fileFullPath);
}
var fileName = string.Format("订舱{0}.xls", DateTime.Now.Ticks);
_logger.LogInformation("导出excel:" + Path.Combine(fileFullPath, fileName));
var filestream = new FileStream(Path.Combine(fileFullPath ,fileName), FileMode.OpenOrCreate, FileAccess.ReadWrite);
excelwork.Write(filestream);
var result = new FileStreamResult(filestream, "application/octet-stream") { FileDownloadName = fileName };
return Path.Combine(fileFullPath, fileName);
var result = new FileStreamResult(new FileStream(Path.Combine(fileFullPath, fileName), FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
return result;
}

@ -10867,6 +10867,20 @@
船期手工维护模块
</summary>
</member>
<member name="M:Myshipping.Core.Service.DjyVesselInfoService.GetListPage(System.String)">
<summary>
获取列表
</summary>
<param name="KeyWord"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyVesselInfoService.Delete(System.Int64[])">
<summary>
删除
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyVesselInfoService.AddOrUpdate(Myshipping.Application.Entity.DjyVesselInfo)">
<summary>
新增编辑

@ -27,6 +27,30 @@ namespace Myshipping.Core.Service
_sysCacheService = sysCacheService;
_rep = rep;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="KeyWord"></param>
/// <returns></returns>
[HttpGet("/DjyVesselInfoService/GetListPage")]
public async Task<dynamic> GetListPage([FromQuery] string KeyWord) {
return await _rep.AsQueryable().WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)).ToListAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("/DjyVesselInfoService/Delete")]
public async Task Delete([FromQuery] long[] Ids)
{
var entity = await _rep.FirstOrDefaultAsync(u => Ids.Contains(u.Id));
await _rep.DeleteAsync(entity);
}
/// <summary>

Loading…
Cancel
Save