修改INTTRA EDI报文,CMA 订舱时 收、发、通可以不填

master
jianghaiqing 6 months ago
parent 0301b3b15a
commit 99c5147ebd

@ -425,6 +425,30 @@ namespace Myshipping.Application.EDI
{ error = error + "<br />提单号:" + headData.MBLNO + " 船公司EDI代码不能为空"; }
//CMA 订舱时,发货人可以不填
if (InttrEdi.filetype.Equals("B",StringComparison.OrdinalIgnoreCase) && headData.CARRIEREDICODE.Equals("CMDU", StringComparison.OrdinalIgnoreCase))
{
if (!string.IsNullOrWhiteSpace(headData.SHIPPER))
{
if (StringIsChinese(headData.SHIPPER))
{
error = error + "<br />提单号:" + headData.MBLNO + " 发货人含有中文或双字节字符";
}
else
{
if (headData.CARRIEREDICODE == "HLCU")
{
error += formatlengthError("txt", headData.SHIPPER, 35, headData.MBLNO, "发货人", 6, "-", false);
}
else
{
error += formatlengthError("txt", headData.SHIPPER, 35, headData.MBLNO, "发货人", 6, "*", false);
}
}
}
}
else
{
if (string.IsNullOrEmpty(headData.SHIPPER))
{
error = error + "<br />提单号:" + headData.MBLNO + " 发货人不能为空";
@ -447,10 +471,34 @@ namespace Myshipping.Application.EDI
}
}
}
//}
}
//}
//CMA 订舱时,收货人可以不填
if (InttrEdi.filetype.Equals("B", StringComparison.OrdinalIgnoreCase) && headData.CARRIEREDICODE.Equals("CMDU", StringComparison.OrdinalIgnoreCase))
{
if (!string.IsNullOrWhiteSpace(headData.CONSIGNEE))
{
if (StringIsChinese(headData.CONSIGNEE))
{
error = error + "<br />提单号:" + headData.MBLNO + " 收货人含有中文或双字节字符";
}
else
{
if (headData.CARRIEREDICODE == "HLCU")
{
error += formatlengthError("txt", headData.CONSIGNEE, 35, headData.MBLNO, "收货人", 6, "--", false);
}
else
{
error += formatlengthError("txt", headData.CONSIGNEE, 35, headData.MBLNO, "收货人", 6, "**", false);
}
}
}
}
else
{
if (string.IsNullOrEmpty(headData.CONSIGNEE))
{
error = error + "<br />提单号:" + headData.MBLNO + " 收货人不能为空";
@ -473,6 +521,7 @@ namespace Myshipping.Application.EDI
}
}
}
}
if (headData.SERVICE == "CY-DOOR")
@ -504,7 +553,30 @@ namespace Myshipping.Application.EDI
}
}
//CMA 订舱时,通知人可以不填
if (InttrEdi.filetype.Equals("B", StringComparison.OrdinalIgnoreCase) && headData.CARRIEREDICODE.Equals("CMDU", StringComparison.OrdinalIgnoreCase))
{
if (!string.IsNullOrWhiteSpace(headData.NOTIFYPARTY))
{
if (StringIsChinese(headData.NOTIFYPARTY))
{
error = error + "<br />提单号:" + headData.MBLNO + " 通知人含有中文或双字节字符";
}
else
{
if (headData.CARRIEREDICODE == "HLCU")
{
error += formatlengthError("txt", headData.NOTIFYPARTY, 35, headData.MBLNO, "通知人", 6, "---", false);
}
else
{
error += formatlengthError("txt", headData.NOTIFYPARTY, 35, headData.MBLNO, "通知人", 6, "***", false);
}
}
}
}
else
{
if (string.IsNullOrEmpty(headData.NOTIFYPARTY))
{
//CMA 订舱时可以不填通知人
@ -531,6 +603,7 @@ namespace Myshipping.Application.EDI
}
}
}
}
if (!string.IsNullOrEmpty(headData.NOTIFYPARTY2))
{

@ -7544,7 +7544,9 @@ namespace Myshipping.Application
{
var flowno = BusinessIDGenHelper.GenNext(UserManager.TENANT_ID);
if(!string.IsNullOrWhiteSpace(flowno))
_logger.LogInformation("批次={no} INTTRA 判断业务编号长度不能大于14重新生成 MBLNO={mblno} BOOKINGNO={BOOKINGNO} 新单号{flowno}", batchNo, primaryModel.MBLNO, order.BOOKINGNO, flowno);
if (!string.IsNullOrWhiteSpace(flowno))
{
order.BOOKINGNO = flowno;
await _rep.AsUpdateable(order).UpdateColumns(x => new { x.BOOKINGNO }).ExecuteCommandAsync();

Loading…
Cancel
Save