From 5217afeb8760820a618bf4a5e41a5f579be6d524 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 May 2023 16:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9TSL=E7=9A=84=20EDI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/EDI/TSLEdiHelper.cs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Myshipping.Application/EDI/TSLEdiHelper.cs b/Myshipping.Application/EDI/TSLEdiHelper.cs index fae89004..28344cc9 100644 --- a/Myshipping.Application/EDI/TSLEdiHelper.cs +++ b/Myshipping.Application/EDI/TSLEdiHelper.cs @@ -866,7 +866,7 @@ namespace Myshipping.Application.EDI.TSL //if (bill.ISSUETYPE == "正本") if (bill.ISSUETYPE == "ORIGINAL") { - r.WriteLine("DOC+706+:26++" + GetBillNum(bill.NOBILL) + "'"); + r.WriteLine("DOC+706+:26++" + GetBillNum(bill.NOBILL).EmptyDefaultNum() + "'"); icount = icount + 1; if (!string.IsNullOrWhiteSpace(copynum)) { @@ -877,14 +877,14 @@ namespace Myshipping.Application.EDI.TSL } else if (bill.ISSUETYPE == "海运单" || bill.ISSUETYPE.ToUpper() == "SEAWAY" || bill.ISSUETYPE.ToUpper() == "SEAWAY BILL" || bill.ISSUETYPE.ToUpper() == "WAYBILL" || bill.ISSUETYPE.ToUpper() == "SWB正本" || bill.ISSUETYPE.ToUpper() == "SWB无正本") { - r.WriteLine("DOC+710+:26++" + GetBillNum(bill.NOBILL) + "'"); + r.WriteLine("DOC+710+:26++" + GetBillNum(bill.NOBILL).EmptyDefaultNum() + "'"); icount = icount + 1; } //else if (bill.ISSUETYPE.ToUpper() == "BILL COPY" || bill.ISSUETYPE == "电放") else if (bill.ISSUETYPE.ToUpper() == "BILL COPY" || bill.ISSUETYPE == "TELEX") { - r.WriteLine("DOC+706+:26++" + GetBillNum(bill.NOBILL) + "'"); + r.WriteLine("DOC+706+:26++" + GetBillNum(bill.NOBILL).EmptyDefaultNum() + "'"); icount = icount + 1; if (!string.IsNullOrWhiteSpace(copynum)) { @@ -895,7 +895,7 @@ namespace Myshipping.Application.EDI.TSL } else if (bill.ISSUETYPE == "正副本") { - r.WriteLine("DOC+706+:26++" + GetBillNum(bill.NOBILL) + "'"); + r.WriteLine("DOC+706+:26++" + GetBillNum(bill.NOBILL).EmptyDefaultNum() + "'"); icount = icount + 1; if (!string.IsNullOrWhiteSpace(copynum)) { @@ -906,7 +906,7 @@ namespace Myshipping.Application.EDI.TSL } else if (bill.ISSUETYPE.ToUpper() == "HOUSE BILL") { - r.WriteLine("DOC+714+:26++" + GetBillNum(bill.NOBILL) + "'"); + r.WriteLine("DOC+714+:26++" + GetBillNum(bill.NOBILL).EmptyDefaultNum() + "'"); icount = icount + 1; } @@ -2137,8 +2137,20 @@ namespace Myshipping.Application.EDI.TSL } #endregion + } + /// + /// 订舱提单份数为空时,默认返回"0" + /// + public static class NoBillSOExts + { + public static string EmptyDefaultNum(this string s) + { + if (string.IsNullOrWhiteSpace(s)) + return "0"; + return s; + } } }