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; + } } }