diff --git a/ds-wms-service/DS.WMS.Core/Op/EDI/YTEdiHelper.cs b/ds-wms-service/DS.WMS.Core/Op/EDI/YTEdiHelper.cs index 624ec52a..f3a07dc7 100644 --- a/ds-wms-service/DS.WMS.Core/Op/EDI/YTEdiHelper.cs +++ b/ds-wms-service/DS.WMS.Core/Op/EDI/YTEdiHelper.cs @@ -431,6 +431,11 @@ namespace DS.WMS.Core.Op.EDI } } + if (!new string[] { "ORI", "TER", "EXP" }.Contains(headData.ISSUETYPE)) + { + error = error + "
提单号:" + headData.MBLNO + "签单方式未识别"; + } + if (string.IsNullOrEmpty(headData.DESCRIPTION)) { error = error + "
提单号:" + headData.MBLNO + " 货物描述不能为空"; @@ -831,15 +836,20 @@ namespace DS.WMS.Core.Op.EDI } else ISSUETYPE = "EXP"; */ - if (bill.ISSUETYPE == "ORIGINAL") - { - ISSUETYPE = "ORI"; - } - else if (bill.ISSUETYPE == "TELEX") + //if (bill.ISSUETYPE == "ORIGINAL") + //{ + // ISSUETYPE = "ORI"; + //} + //else if (bill.ISSUETYPE == "TELEX") + //{ + // ISSUETYPE = "TER"; + //} + //else ISSUETYPE = "EXP"; + + if(new string[] { "ORI", "TER", "EXP" }.Contains(bill.ISSUETYPE)) { - ISSUETYPE = "TER"; + ISSUETYPE = bill.ISSUETYPE; } - else ISSUETYPE = "EXP"; r.WriteLine("03:" + ISSUETYPE + ":" + bill.ISSUEPLACEID.Trim() + ":" + bill.ISSUEPLACE.Trim() + ":" + GetDateStr(bill.ISSUEDATE, "yyyyMMdd") + ":" + GetBillNum2(bill.NOBILL) + ":" + bill.PREPARDAT + ":" + bill.PAYABLEAT + "'"); icount++; diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs index 91e7f764..a3641dda 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs @@ -1383,12 +1383,19 @@ namespace DS.WMS.Core.Op.Method #region 签单方式EDI ////签单方式EDI - if (!string.IsNullOrWhiteSpace(order.IssueType)) + if (!string.IsNullOrWhiteSpace(order.IssueTypeCode)) { - long issueTypeId = long.Parse(order.IssueType); + //long issueTypeId = long.Parse(order.IssueType); + + var codeIssue = tenantDb.Queryable().First(t => t.EdiCode == order.IssueTypeCode); + + if (codeIssue == null) + { + return DataResult.Failed($"签单方式{order.IssueTypeCode}的基础代码未找到"); + } var mapInfo = tenantDb.Queryable() - .First(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase) && t.CarrierId == order.CarrierId && t.Id == issueTypeId); + .First(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase) && t.CarrierId == order.CarrierId && t.LinkId == codeIssue.Id); if (mapInfo != null) { @@ -1397,15 +1404,13 @@ namespace DS.WMS.Core.Op.Method else { //签单方式EDI - var codeService = tenantDb.Queryable().First(x => x.Status == StatusEnum.Enable && x.Id == issueTypeId); - - if (codeService != null && !string.IsNullOrWhiteSpace(codeService.EdiCode)) + if (codeIssue != null && !string.IsNullOrWhiteSpace(codeIssue.EdiCode)) { - primaryModel.ISSUETYPE = codeService.EdiCode; + primaryModel.ISSUETYPE = codeIssue.EdiCode; } else { - return DataResult.Failed($"签单方式{order.Service}的基础代码未找到"); + return DataResult.Failed($"签单方式{order.Service}的基础代码 EdiCode 未配置"); } } } @@ -1512,7 +1517,7 @@ namespace DS.WMS.Core.Op.Method primaryModel.EDIATTNEMAIL = ediExtModel.EDIAttnMail; - if (string.IsNullOrWhiteSpace(primaryModel.EDIATTNEMAIL)) + if (string.IsNullOrWhiteSpace(primaryModel.EDIATTNEMAIL) && ediRouteEnum != EDIRouteEnum.YT) { primaryModel.EDIATTNEMAIL = ftpSet.SendEmail; }