发送EDI失败时的参数记录

usertest
嵇文龙 3 months ago
parent 999e2ac164
commit 1d393f4e74

@ -1502,6 +1502,8 @@ public static class MultiLanguageConst
public const string TaskAuditStatusError = "Task_Audit_Status_Error"; public const string TaskAuditStatusError = "Task_Audit_Status_Error";
[Description("无法从配置中获取任务接收人,请检查是否设置了订单的操作/客服/单证等人员,或联系管理员检查配置")] [Description("无法从配置中获取任务接收人,请检查是否设置了订单的操作/客服/单证等人员,或联系管理员检查配置")]
public const string TaskReceiverNotFound = "Task_Receiver_Not_Found"; public const string TaskReceiverNotFound = "Task_Receiver_Not_Found";
[Description("未找到此票订单的订舱任务")]
public const string BookingTaskNotFound = "Booking_Task_NotFound";
[Description("任务邮件必须设置收件人")] [Description("任务邮件必须设置收件人")]
public const string TaskMailReceiverNotNull = "Task_Mail_Receiver_Not_Null"; public const string TaskMailReceiverNotNull = "Task_Mail_Receiver_Not_Null";

@ -3,6 +3,7 @@ using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.TaskInteraction; using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Interface; using DS.WMS.Core.Op.Interface;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking
{ {
@ -23,7 +24,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking
var opService = context.ServiceProvider.GetRequiredService<ISeaExportService>(); var opService = context.ServiceProvider.GetRequiredService<ISeaExportService>();
//发送订舱EDI //发送订舱EDI
var result2 = await opService.SendBookingOrClosingEDI(new BookingOrClosingEDIOrderReq var req = new BookingOrClosingEDIOrderReq
{ {
Id = context.TaskInfo.BusinessId, Id = context.TaskInfo.BusinessId,
UseForwarderCode = false, UseForwarderCode = false,
@ -32,11 +33,13 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking
FileRole = "9", FileRole = "9",
SendType = "B", SendType = "B",
Send = true Send = true
}); };
var result = await opService.SendBookingOrClosingEDI(req);
//订舱未成功 //订舱未成功
if (!result2.Succeeded) if (!result.Succeeded)
{ {
await LogService.WriteLogAsync(context.TaskInfo, "EDI返回结果失败自动订舱未成功"); await LogService.WriteLogAsync(context.TaskInfo, "EDI返回结果失败自动订舱未成功" + Environment.NewLine + "请求参数:"
+ JsonConvert.SerializeObject(req) + Environment.NewLine + "响应参数:" + result.Data);
return; return;
} }

@ -1,8 +1,9 @@
using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.TaskInteraction; using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using DS.WMS.Core.Op.Interface; using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor
{ {
@ -17,8 +18,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor
var taskService = context.ServiceProvider.GetRequiredService<ITaskService>(); var taskService = context.ServiceProvider.GetRequiredService<ITaskService>();
var logService = context.ServiceProvider.GetRequiredService<ITaskLogService>(); var logService = context.ServiceProvider.GetRequiredService<ITaskLogService>();
//发送截单EDI var req = new BookingOrClosingEDIOrderReq
var result = await opService.SendBookingOrClosingEDI(new BookingOrClosingEDIOrderReq
{ {
Id = context.TaskInfo.BusinessId, Id = context.TaskInfo.BusinessId,
UseForwarderCode = false, UseForwarderCode = false,
@ -27,11 +27,14 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor
FileRole = "9", FileRole = "9",
SendType = "E", SendType = "E",
Send = true Send = true
}); };
//发送截单EDI
var result = await opService.SendBookingOrClosingEDI(req);
//EDI提交未成功 //EDI提交未成功
if (!result.Succeeded) if (!result.Succeeded)
{ {
await logService.WriteLogAsync(context.TaskInfo, "截单EDI返回结果失败"); await logService.WriteLogAsync(context.TaskInfo, "EDI返回结果失败自动截单未成功" + Environment.NewLine + "请求参数:"
+ JsonConvert.SerializeObject(req) + Environment.NewLine + "响应参数:" + result.Data);
return; return;
} }

@ -12,6 +12,7 @@ using DS.WMS.Core.TaskPlat.Entity;
using DS.WMS.Core.TaskPlat.Interface; using DS.WMS.Core.TaskPlat.Interface;
using Masuit.Tools.Systems; using Masuit.Tools.Systems;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease
{ {
@ -122,7 +123,11 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease
var result = await BCService.SyncBookingSlotChange(taskBase.Id); var result = await BCService.SyncBookingSlotChange(taskBase.Id);
if (!result.Succeeded) if (!result.Succeeded)
{
await LogService.WriteLogAsync(context.TaskInfo, "转发BC返回结果失败自动放舱未成功" + Environment.NewLine + "请求参数:"
+ taskBase.Id + Environment.NewLine + "响应参数:" + result.Data == null ? string.Empty : JsonConvert.SerializeObject(result.Data));
return; return;
}
await SetTaskCompleteAsync(context.TaskInfo, await SetTaskCompleteAsync(context.TaskInfo,
context.ServiceProvider.GetRequiredService<ITaskService>(), LogService); context.ServiceProvider.GetRequiredService<ITaskService>(), LogService);

@ -248,7 +248,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
var businessTask = await TenantDb.Queryable<BusinessTask>().Where( var businessTask = await TenantDb.Queryable<BusinessTask>().Where(
x => x.BusinessId == businessId && x.BusinessType == businessType && x.TaskType == TaskBaseTypeEnum.WAIT_BOOKING).FirstAsync(); x => x.BusinessId == businessId && x.BusinessType == businessType && x.TaskType == TaskBaseTypeEnum.WAIT_BOOKING).FirstAsync();
if (businessTask == null) if (businessTask == null)
return DataResult.FailedWithDesc(MultiLanguageConst.TaskStatusNotSupported); return DataResult.FailedWithDesc(MultiLanguageConst.BookingTaskNotFound);
TaskFlowDataContext dataContext = new TaskFlowDataContext dataContext = new
( (

Loading…
Cancel
Save