修改EDI 增加日志记录功能

optimize
jianghaiqing 2 years ago
parent 519e1c91de
commit b0b206cb31

@ -70,6 +70,8 @@ using System.Collections.Specialized;
using System.Net.Http.Headers;
using MySqlX.XDevAPI.Common;
using Ubiety.Dns.Core;
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
using System.Security.Cryptography;
namespace Myshipping.Application
{
@ -3574,9 +3576,27 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no} 发送完成,耗时:{timeDiff}ms. 结果{msg}", batchNo, timeDiff, sendStatus.succ ? "成功" : "失败");
var logId = await _bookinglog.InsertReturnSnowflakeIdAsync(new BookingLog
{
Type = "Trace",
BookingId = model.Id,
TenantId = Convert.ToInt64(UserManager.TENANT_ID),
CreatedTime = DateTime.Now,
CreatedUserId = UserManager.UserId,
CreatedUserName = UserManager.Name
});
await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
{
PId = logId,
Field = String.Empty,
OldValue = String.Empty,
NewValue = $"发送 {order.CARRIERID} EDI 类型={model.sendType} 通过{(isSendEmail?"":"FTP")} {(sendStatus.succ ? "":"")}",
});
if (!sendStatus.succ)
{
throw Oops.Bah($"FTP发送失败原因{sendStatus.msg}");
throw Oops.Bah($"发送失败,原因:{sendStatus.msg}");
}
}

Loading…
Cancel
Save