From 1d393f4e74f9ea490f630bbd056affdb3b0d25c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Fri, 23 Aug 2024 17:53:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81EDI=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=8F=82=E6=95=B0=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.Module.Core/Constants/MultiLanguageConst.cs | 2 ++ .../ActionExecutor/Booking/EDIActionExecutor.cs | 11 +++++++---- .../ActionExecutor/ClosingOrderActionExecutor.cs | 13 ++++++++----- .../SpaceRelease/SpaceReleaseActionExecutor.cs | 5 +++++ .../Method/TaskInteraction/ActionManagerService.cs | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 2234530f..994666ad 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -1502,6 +1502,8 @@ public static class MultiLanguageConst public const string TaskAuditStatusError = "Task_Audit_Status_Error"; [Description("无法从配置中获取任务接收人,请检查是否设置了订单的操作/客服/单证等人员,或联系管理员检查配置")] public const string TaskReceiverNotFound = "Task_Receiver_Not_Found"; + [Description("未找到此票订单的订舱任务")] + public const string BookingTaskNotFound = "Booking_Task_NotFound"; [Description("任务邮件必须设置收件人")] public const string TaskMailReceiverNotNull = "Task_Mail_Receiver_Not_Null"; diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/Booking/EDIActionExecutor.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/Booking/EDIActionExecutor.cs index b29e9f17..93fbaab2 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/Booking/EDIActionExecutor.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/Booking/EDIActionExecutor.cs @@ -3,6 +3,7 @@ using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Dtos.TaskInteraction; using DS.WMS.Core.Op.Interface; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; 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(); //发送订舱EDI - var result2 = await opService.SendBookingOrClosingEDI(new BookingOrClosingEDIOrderReq + var req = new BookingOrClosingEDIOrderReq { Id = context.TaskInfo.BusinessId, UseForwarderCode = false, @@ -32,11 +33,13 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking FileRole = "9", SendType = "B", 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; } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/ClosingOrderActionExecutor.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/ClosingOrderActionExecutor.cs index a66ac038..a8cd39da 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/ClosingOrderActionExecutor.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/ClosingOrderActionExecutor.cs @@ -1,8 +1,9 @@ using DS.WMS.Core.Op.Dtos; 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.TaskInteraction; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; 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(); var logService = context.ServiceProvider.GetRequiredService(); - //发送截单EDI - var result = await opService.SendBookingOrClosingEDI(new BookingOrClosingEDIOrderReq + var req = new BookingOrClosingEDIOrderReq { Id = context.TaskInfo.BusinessId, UseForwarderCode = false, @@ -27,11 +27,14 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor FileRole = "9", SendType = "E", Send = true - }); + }; + //发送截单EDI + var result = await opService.SendBookingOrClosingEDI(req); //EDI提交未成功 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; } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/SpaceRelease/SpaceReleaseActionExecutor.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/SpaceRelease/SpaceReleaseActionExecutor.cs index 3b0de0b3..6e09f65a 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/SpaceRelease/SpaceReleaseActionExecutor.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/SpaceRelease/SpaceReleaseActionExecutor.cs @@ -12,6 +12,7 @@ using DS.WMS.Core.TaskPlat.Entity; using DS.WMS.Core.TaskPlat.Interface; using Masuit.Tools.Systems; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; 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); 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; + } await SetTaskCompleteAsync(context.TaskInfo, context.ServiceProvider.GetRequiredService(), LogService); diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs index 5c732d85..f185a7ae 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs @@ -248,7 +248,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction var businessTask = await TenantDb.Queryable().Where( x => x.BusinessId == businessId && x.BusinessType == businessType && x.TaskType == TaskBaseTypeEnum.WAIT_BOOKING).FirstAsync(); if (businessTask == null) - return DataResult.FailedWithDesc(MultiLanguageConst.TaskStatusNotSupported); + return DataResult.FailedWithDesc(MultiLanguageConst.BookingTaskNotFound); TaskFlowDataContext dataContext = new (