|
|
@ -195,6 +195,9 @@ namespace Myshipping.Application.EDI.ESL
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public static string formatEdiStr(string fileType, string str)
|
|
|
|
public static string formatEdiStr(string fileType, string str)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (str == null)
|
|
|
|
|
|
|
|
str = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
if (fileType == "txt")
|
|
|
|
if (fileType == "txt")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return str.Replace("?", "??").Replace(":", "?:").Replace("+", "?+").Replace("'", "?'");
|
|
|
|
return str.Replace("?", "??").Replace(":", "?:").Replace("+", "?+").Replace("'", "?'");
|
|
|
@ -282,7 +285,7 @@ namespace Myshipping.Application.EDI.ESL
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 检查
|
|
|
|
#region 检查
|
|
|
|
public static string IsCreateESLEDI(MsESLEdiModel InttrEdi)
|
|
|
|
public static string IsCreateESLEDI(EDIBaseModel InttrEdi)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var error = "";
|
|
|
|
var error = "";
|
|
|
|
|
|
|
|
|
|
|
@ -317,8 +320,9 @@ namespace Myshipping.Application.EDI.ESL
|
|
|
|
if (string.IsNullOrEmpty(headData.BLFRT))
|
|
|
|
if (string.IsNullOrEmpty(headData.BLFRT))
|
|
|
|
{ error = error + "<br />提单号:" + headData.MBLNO + " 付费方式不能为空"; }
|
|
|
|
{ error = error + "<br />提单号:" + headData.MBLNO + " 付费方式不能为空"; }
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(headData.ESLLINECODE))
|
|
|
|
//2023-01-04 JHQ 跟韩训涛确认,ESL这里不处理航线代码,去掉不为空校验,并在生成EDI报文时,对ESL航线代码赋空串
|
|
|
|
{ error = error + "<br />提单号:" + headData.MBLNO + " ESL航线代码不能为空"; }
|
|
|
|
//if (string.IsNullOrEmpty(headData.ESLLINECODE))
|
|
|
|
|
|
|
|
//{ error = error + "<br />提单号:" + headData.MBLNO + " ESL航线代码不能为空"; }
|
|
|
|
|
|
|
|
|
|
|
|
if (InttrEdi.filetype == "E")
|
|
|
|
if (InttrEdi.filetype == "E")
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -610,10 +614,12 @@ namespace Myshipping.Application.EDI.ESL
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 生成报文(订舱(InttrEdi.filetype=="B"),截单(InttrEdi.filetype=="E"))
|
|
|
|
#region 生成报文(订舱(InttrEdi.filetype=="B"),截单(InttrEdi.filetype=="E"))
|
|
|
|
public static CommonWebApiResult CreateEdiESL(MsESLEdiModel InttrEdi)
|
|
|
|
public static CommonWebApiResult CreateEdiESL(EDIBaseModel InttrEdi)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CommonWebApiResult result = new CommonWebApiResult { succ = false };
|
|
|
|
CommonWebApiResult result = new CommonWebApiResult { succ = false };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var filetype = "IFTMIN";
|
|
|
|
var filetype = "IFTMIN";
|
|
|
|
if (InttrEdi.filetype != "E") filetype = "IFTMBF";
|
|
|
|
if (InttrEdi.filetype != "E") filetype = "IFTMBF";
|
|
|
|
|
|
|
|
|
|
|
@ -628,8 +634,17 @@ namespace Myshipping.Application.EDI.ESL
|
|
|
|
var icount = 0;
|
|
|
|
var icount = 0;
|
|
|
|
var bsno = "";
|
|
|
|
var bsno = "";
|
|
|
|
var isfirst = true;
|
|
|
|
var isfirst = true;
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var bill in InttrEdi.BSLIST)
|
|
|
|
foreach (var bill in InttrEdi.BSLIST)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
//2023-01-04 JHQ 跟韩训涛确认,ESL这里不处理航线代码,去掉不为空校验,并在生成EDI报文时,对ESL航线代码赋空串
|
|
|
|
|
|
|
|
if (bill.ESLLINECODE == null)
|
|
|
|
|
|
|
|
bill.ESLLINECODE = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//2022-01-04
|
|
|
|
|
|
|
|
if (InttrEdi.ForWarderName == null)
|
|
|
|
|
|
|
|
InttrEdi.ForWarderName = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
if (isfirst)
|
|
|
|
if (isfirst)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (InttrEdi.filetype == "E")
|
|
|
|
if (InttrEdi.filetype == "E")
|
|
|
@ -697,6 +712,8 @@ namespace Myshipping.Application.EDI.ESL
|
|
|
|
icount++;
|
|
|
|
icount++;
|
|
|
|
|
|
|
|
|
|
|
|
var ISSUETYPE = "";
|
|
|
|
var ISSUETYPE = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 2022-01-04 这里新订舱系统的签单方式代码已变更采用新的编码来判断
|
|
|
|
if (bill.ISSUETYPE == "正本")
|
|
|
|
if (bill.ISSUETYPE == "正本")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ISSUETYPE = "ORI";
|
|
|
|
ISSUETYPE = "ORI";
|
|
|
@ -706,7 +723,19 @@ namespace Myshipping.Application.EDI.ESL
|
|
|
|
ISSUETYPE = "TER";
|
|
|
|
ISSUETYPE = "TER";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else ISSUETYPE = "EXP";
|
|
|
|
else ISSUETYPE = "EXP";
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bill.ISSUETYPE == "ORIGINAL")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//正本
|
|
|
|
|
|
|
|
ISSUETYPE = "ORI";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (bill.ISSUETYPE == "TELEX")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//电放
|
|
|
|
|
|
|
|
ISSUETYPE = "TER";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else ISSUETYPE = "EXP";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r.WriteLine("03:" + ISSUETYPE + ":" + bill.ISSUEPLACEID.Trim() + ":" + bill.ISSUEPLACE.Trim() + ":" + GetDateStr(bill.ISSUEDATE, "yyyyMMdd") + ":" + GetBillNum2(bill.NOBILL) + ":" + bill.PREPARDAT + ":" + bill.PAYABLEAT + "'");
|
|
|
|
r.WriteLine("03:" + ISSUETYPE + ":" + bill.ISSUEPLACEID.Trim() + ":" + bill.ISSUEPLACE.Trim() + ":" + GetDateStr(bill.ISSUEDATE, "yyyyMMdd") + ":" + GetBillNum2(bill.NOBILL) + ":" + bill.PREPARDAT + ":" + bill.PAYABLEAT + "'");
|
|
|
|