发送委托书接口

usertest
cjy 4 months ago
parent 66dd864ad7
commit 6f197cd39b

@ -182,4 +182,11 @@ public interface ISeaExportService
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
public Task<DataResult<List<BookingStatusLogRes>>> GetBookingStatusLogList(PageRequest request); public Task<DataResult<List<BookingStatusLogRes>>> GetBookingStatusLogList(PageRequest request);
/// <summary>
/// 发送托书
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public Task<DataResult<string>> SendShippingOrderEmail(SendShippingOrderReq req);
} }

@ -127,6 +127,7 @@ namespace DS.WMS.Core.Op.Method
var limitFiles = AppSetting.app<string>(new string[] { "FileSettings", "FileType" }); var limitFiles = AppSetting.app<string>(new string[] { "FileSettings", "FileType" });
var basePath = AppSetting.app(new string[] { "FileSettings", "BasePath" }); var basePath = AppSetting.app(new string[] { "FileSettings", "BasePath" });
var relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" }); var relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" });
var filesPath = new List<string>();
foreach (IFormFile file in fileCollection) foreach (IFormFile file in fileCollection)
{ {
var originalFilename = file.FileName; // 文件原始名称 var originalFilename = file.FileName; // 文件原始名称
@ -170,8 +171,9 @@ namespace DS.WMS.Core.Op.Method
{ {
await file.CopyToAsync(stream); await file.CopyToAsync(stream);
} }
filesPath.Add(fileSaveName);
} }
return await Task.FromResult(DataResult<string>.Success("批量上传成功")); return await Task.FromResult(DataResult<string>.Success("批量上传成功", filesPath.ToString()));
//return await Task.FromResult(DataResult<string>.Success(fileRelaPath)); //return await Task.FromResult(DataResult<string>.Success(fileRelaPath));
} }
/// <summary> /// <summary>

@ -61,15 +61,32 @@ namespace DS.WMS.Core.Op.Method
var attPostArr = new List<dynamic>(); var attPostArr = new List<dynamic>();
foreach (var file in req.FileList) foreach (var file in req.FileList)
{ {
//var opt = App.GetOptions<TempFileOptions>().Path; var basePath = AppSetting.app(new string[] { "FileSettings", "BasePath" });
//var fileFullPath = Path.Combine(App.WebHostEnvironment.WebRootPath, opt); var relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" });
//var fileFullName = Path.Combine(fileFullPath, file); var dirAbs = string.Empty;
var fileRelaPath = string.Empty;
var fileAbsPath = string.Empty;
if (string.IsNullOrEmpty(basePath))
{
dirAbs = Path.Combine(_environment.WebRootPath, relativePath);
}
else
{
dirAbs = Path.Combine(basePath, relativePath);
}
var fileFullName = Path.Combine(dirAbs, file);
fileFullName = fileFullName.Replace(".OpApi", ".MainApi");
//attPostArr.Add(new if (!File.Exists(fileFullName))
//{ {
// AttachName = Path.GetFileName(file), return await Task.FromResult(DataResult<string>.Failed("附件不存在,请检查"));
// AttachContent = Convert.ToBase64String(File.ReadAllBytes(fileFullName)) }
//});
attPostArr.Add(new
{
AttachName = Path.GetFileName(file),
AttachContent = Convert.ToBase64String(File.ReadAllBytes(fileFullName))
});
} }
var mailJson = new dynamic[]{ var mailJson = new dynamic[]{

@ -416,4 +416,17 @@ public class SeaExportController : ApiController
return res; return res;
} }
/// <summary>
/// 发送托书
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("SendShippingOrderEmail")]
public async Task<DataResult<string>> SendShippingOrderEmail([FromBody] SendShippingOrderReq req)
{
var res = await _invokeService.SendShippingOrderEmail(req);
return res;
}
} }

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>

Loading…
Cancel
Save