OCR附件保存到订舱

optimize
wanghaomei 2 years ago
parent ff709bf850
commit 7171046d79

@ -4989,11 +4989,12 @@
<param name="carrierId">船公司ID</param>
<returns>返回适用的路由枚举</returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.OcrUpFile(Microsoft.AspNetCore.Http.IFormFile)">
<member name="M:Myshipping.Application.BookingOrderService.OcrUpFile(Microsoft.AspNetCore.Http.IFormFile,System.Int64)">
<summary>
上传ocr文件
</summary>
<param name="file"></param>
<param name="bookingId">订舱id</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.OcrGetImg(System.String,System.Single)">

@ -2806,9 +2806,10 @@ namespace Myshipping.Application
/// 上传ocr文件
/// </summary>
/// <param name="file"></param>
/// <param name="bookingId">订舱id</param>
/// <returns></returns>
[HttpPost("/BookingOrder/OcrUpFile")]
public async Task<string> OcrUpFile(IFormFile file)
public async Task<string> OcrUpFile(IFormFile file, long bookingId)
{
//未上传文件
if (file == null || file.Length == 0)
@ -2816,6 +2817,14 @@ namespace Myshipping.Application
throw Oops.Bah("未上传文件");
}
//保存到订舱
await AddFile(file, new BookingFileDto()
{
BookingId = bookingId,
TypeCode = "other",
TypeName = "其他"
});
var originalFilename = file.FileName; // 文件原始名称
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀

Loading…
Cancel
Save