From 5022f58b6f76a7d963fdf7b0d0c75b240f551fa1 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 30 Nov 2022 14:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9EDI=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Myshipping.Application.xml | 2 +- .../BookingOrder/BookingOrderService.cs | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index 4320f11c..1f69d345 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -4923,7 +4923,7 @@ EDI文件路径 FTP配置 - true-成功 false-失败 + 返回回执 diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 8510e2c7..f5f43719 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2196,7 +2196,12 @@ namespace Myshipping.Application TimeSpan ts = eDate.Subtract(bDate); var timeDiff = ts.TotalMilliseconds; - _logger.LogInformation("批次={no} 结束发送,耗时:{timeDiff}ms. 结果{msg}", batchNo, timeDiff, sendStatus ? "成功" : "失败"); + _logger.LogInformation("批次={no} 结束发送,耗时:{timeDiff}ms. 结果{msg}", batchNo, timeDiff, sendStatus.succ ? "成功" : "失败"); + + if(!sendStatus.succ) + { + throw Oops.Bah($"FTP发送失败,原因:{sendStatus.msg}"); + } } @@ -2210,9 +2215,11 @@ namespace Myshipping.Application /// /// EDI文件路径 /// FTP配置 - /// true-成功 false-失败 - private async Task InnerSendBookingOrClosingEDIToFTP(string filePath, DjyEdiSetting ediCfg) + /// 返回回执 + private async Task InnerSendBookingOrClosingEDIToFTP(string filePath, DjyEdiSetting ediCfg) { + CommonWebApiResult result = new CommonWebApiResult { succ = true }; + CancellationTokenSource cts = new CancellationTokenSource(); //后续发送 @@ -2254,10 +2261,11 @@ namespace Myshipping.Application if (jobjRetn.GetStringValue("status") != "1") { - return false; + result.succ = false; + result.msg = jobjRetn.GetStringValue("message"); } - return true; + return result; } #endregion