wet 2 years ago
commit db5a21e2b1

@ -61,5 +61,10 @@ namespace Myshipping.Application
/// 业务信息列表 M
/// </summary>
public List<MsOpSeaeEDIBaseModel> BSLIST { get; set; }
/// <summary>
/// 发送方公司代码
/// </summary>
public string SENDCOMPANYCODE { get; set; }
}
}

@ -574,5 +574,11 @@ namespace Myshipping.Application
/// 订舱人说明
/// </summary>
public string ORDERREMARK { get; set; }
/// <summary>
/// 运输条款EDI代码 M
/// </summary>
public string SERVICEEDICODE { get; set; }
}
}

@ -687,12 +687,13 @@ namespace Myshipping.Application.EDI.ESL
}
//2023-03-03 修改运输条款SERVICE改为EDI的映射值经过韩工确认
if (InttrEdi.filetype == "E")
{
r.WriteLine("02"
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + bill.SERVICEEDICODE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + formatEdiStr("txt", InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "))//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C
@ -716,10 +717,11 @@ namespace Myshipping.Application.EDI.ESL
}
else
{
//2023-03-03 修改运输条款SERVICE改为EDI的映射值经过韩工确认
r.WriteLine("02"
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + bill.SERVICEEDICODE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + formatEdiStr("txt", InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "))//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C

@ -654,11 +654,11 @@ namespace Myshipping.Application.EDI.WY
icount++;
}
//2023-03-03 修改运输条款SERVICE改为EDI的映射值经过韩工确认
r.WriteLine("02"
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + bill.SERVICEEDICODE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + formatEdiStr("txt", InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "))//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C

@ -705,11 +705,11 @@ namespace Myshipping.Application.EDI.YML
}
//2023-03-03 修改运输条款SERVICE改为EDI的映射值经过韩工确认
r.WriteLine("02"
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + bill.SERVICEEDICODE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + InttrEdi.SENDNAME//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C
@ -753,8 +753,9 @@ namespace Myshipping.Application.EDI.YML
r.WriteLine("03:" + ISSUETYPE + ":" + bill.ISSUEPLACEID.Trim() + ":" + bill.ISSUEPLACE.Trim() + ":" + GetDateStr(bill.ISSUEDATE, "yyyyMMdd") + ":" + GetBillNum2(bill.NOBILL) + ":" + bill.PREPARDAT + ":" + bill.PAYABLEAT + "'");
icount++;
r.WriteLine("11:" + bill.VESSELID + ":" + bill.VESSEL + ":" + bill.VOYNO + ":::::" + GetDateStr(bill.ETD, "yyyyMMdd") + ":::::'");
//2023-03-03 测试东胜这行缺了FTP配置接收人代码经韩工确认加上
//r.WriteLine("11:" + bill.VESSELID + ":" + bill.VESSEL + ":" + bill.VOYNO + ":::::" + GetDateStr(bill.ETD, "yyyyMMdd") + ":::::'");
r.WriteLine("11:" + bill.VESSELID + ":" + bill.VESSEL + ":" + bill.VOYNO + ":::" + InttrEdi.RECEIVECODE + "::" + GetDateStr(bill.ETD, "yyyyMMdd") + ":::::'");
icount++;
var DESTINATIONID = bill.DESTINATIONID;

@ -712,7 +712,8 @@ namespace Myshipping.Application.EDI.YT
MBLNO = MBLNO.Substring(4, MBLNO.Length - 4);
}
//2023-02-28 ONE的逻辑是去掉了提单号的前4位跟韩工已确认与东胜7相同
//2023-03-03 韩工给提供了新的02行的处理SENDNAME改为读取FTP配置的
/*
r.WriteLine("02"
+ ":" + MBLNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
@ -734,15 +735,39 @@ namespace Myshipping.Application.EDI.YT
+ ":" + sendno//19 AMS CODE AMS代码 X(15)   C
//注QUOTATION NO.项填本票订舱货的运价是通过向中集询价后定下的特殊运价编号。
+ "'");
*/
//2023-03-03 修改运输条款SERVICE改为EDI的映射值经过韩工确认
r.WriteLine("02"
+ ":" + MBLNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICEEDICODE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + formatEdiStr("txt", InttrEdi.SENDCOMPANYCODE) //5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":ONEY" //6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C
+ ":"//8 APPLICANT 询价单位 X(13) 向船公司询价的单位代码 C
+ ":"//9 FOB BK PARTY 国外订舱单位 X(13) 国外FOB货订舱单位的代码 C
+ ":"//10 B/L TRANSHIP ID 转船标识 X(1) Y/N C
+ ":"//11 BATCH ID 分批 X(1) Y/N C
+ ":"//12 SHIPMENT DATE 装期 9(8) CCYYMMDD C
+ ":"//13 EXPIRY DATE 效期 9(8) CCYYMMDD C
+ ":" + bill.CONTRACTNO//14 QUOTATION NO. 运费协议号 X(30) MAERSK为必选 C
+ ":"//15 CHARGE TYPE 费率本代码 X(1)   C
+ ":" + bill.CONTRACTNO//16 S/C NO. 合约号 X(30)   C
+ ":"//17 BOOKING NO. 船公司订舱编号 X(20) 船公司系统内部订舱编号 C
+ ":"//18 SLOT CHARTER ID 舱位互用标识 X(1)   C
+ ":" + sendno//19 AMS CODE AMS代码 X(15)   C
//注QUOTATION NO.项填本票订舱货的运价是通过向中集询价后定下的特殊运价编号。
+ "'");
}
else
if (InttrEdi.filetype == "E")
{
//2023-03-03 修改运输条款SERVICE改为EDI的映射值经过韩工确认
r.WriteLine("02"
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + bill.SERVICEEDICODE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + formatEdiStr("txt", !string.IsNullOrWhiteSpace(InttrEdi.ForWarderName)?InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "):"")//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C
@ -766,10 +791,11 @@ namespace Myshipping.Application.EDI.YT
}
else
{
//2023-03-03 修改运输条款SERVICE改为EDI的映射值经过韩工确认
r.WriteLine("02"
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + bill.SERVICEEDICODE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + formatEdiStr("txt", !string.IsNullOrWhiteSpace(InttrEdi.ForWarderName)?InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "):"")//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C

@ -12,9 +12,9 @@ namespace Myshipping.Application.Entity
public class BookingOrder : DBEntityTenant
{
/// <summary>
/// 业务编号
/// 第三方系统编号
/// </summary>
//[Description("业务编号")]
//[Description("第三方系统编号")]
public string BSNO { get; set; }
/// <summary>
/// 业务状态
@ -42,9 +42,9 @@ namespace Myshipping.Application.Entity
[Description("分提单号")]
public string HBLNO { get; set; }
/// <summary>
/// 系统编号
/// 业务编号
/// </summary>
[Description("系统编号")]
[Description("业务编号")]
public string BOOKINGNO { get; set; }
/// <summary>
/// 合约号

@ -2946,16 +2946,19 @@ namespace Myshipping.Application
if (ediExtModel == null)
throw Oops.Bah($"获取EDI信息失败");
if (string.IsNullOrWhiteSpace(ediExtModel.OpEName))
throw Oops.Bah("未填写(EDI并补充信息)操作英文名称");
_logger.LogInformation("批次={no}提取订单EDI信息完成", batchNo);
CheckBookingOrClosingEDI(order);
EDIRouteEnum ediRouteEnum = GetEDIRoute(order.CARRIERID);
//部分船公司EDI需要填写操作英文名称这里预先预警其他船公司如果也需要可以再此追加
if (ediRouteEnum == EDIRouteEnum.TSL)
{
if (string.IsNullOrWhiteSpace(ediExtModel.OpEName))
throw Oops.Bah("未填写(EDI并补充信息)操作英文名称");
}
_logger.LogInformation("批次={no} 获取EDI路由完成 路由={route}", batchNo, ediRouteEnum.ToString());
if (ediRouteEnum == EDIRouteEnum.NULL)
@ -2982,7 +2985,6 @@ namespace Myshipping.Application
if (ediSOSICfg == null || string.IsNullOrWhiteSpace(ediSOSICfg.MapCode))
throw Oops.Bah($"CARRIERID={order.CARRIERID} 发送SO(SI)的船公司EDI代码未找到");
var ediModel = new EDIBaseModel();
var ftpSet = _cache.GetAllEdiSetting().GetAwaiter().GetResult()
@ -2997,6 +2999,7 @@ namespace Myshipping.Application
ediModel.SENDCODE = ftpSet.SENDCODE;
ediModel.SENDNAME = ftpSet.SENDNAME;
ediModel.RECEIVECODE = ftpSet.RECEIVECODE;
ediModel.SENDCOMPANYCODE = ftpSet.SENDCOMPANYCODE;
ediModel.filetype = model.sendType; //订舱
ediModel.filerole = model.fileRole;
@ -3093,6 +3096,31 @@ namespace Myshipping.Application
}
}
//运输条款EDI
var baseServiceList = _cache.GetAllCodeService().GetAwaiter().GetResult();
var baseServiceInfo = baseServiceList.FirstOrDefault(t =>
t.Name.Equals(order.SERVICE, StringComparison.OrdinalIgnoreCase));
if (baseServiceInfo == null)
throw Oops.Bah($"运输条款{order.SERVICE}的基础代码未找到");
//付费方式映射
var ediServiceList = _cache.GetAllMappingService().GetAwaiter().GetResult()
.Where(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase)
&& !string.IsNullOrWhiteSpace(t.CarrierCode) && t.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase)
).ToList();
if (!string.IsNullOrWhiteSpace(order.SERVICE))
{
var currServiceInfo = ediServiceList.FirstOrDefault(t => t.Code.Equals(baseServiceInfo.Code, StringComparison.OrdinalIgnoreCase));
if (currServiceInfo == null)
throw Oops.Bah($"运输条款{order.SERVICE}的EDI代码未找到");
primaryModel.SERVICEEDICODE = currServiceInfo.MapCode?.Trim();
}
primaryModel.CARRIEREDICODE = ediSOSICfg.MapCode;
primaryModel.ORDERNO = order.BOOKINGNO;

@ -16,9 +16,9 @@ namespace Myshipping.Application
public long Id { get; set; }
/// <summary>
/// 业务编号
/// 第三方系统编号
/// </summary>
[Description("业务编号")]
[Description("第三方系统编号")]
public string BSNO { get; set; }
/// <summary>
/// 业务状态
@ -41,7 +41,7 @@ namespace Myshipping.Application
/// </summary>
public string HBLNO { get; set; }
/// <summary>
/// 系统编号
/// 业务编号
/// </summary>
public string BOOKINGNO { get; set; }
/// <summary>

@ -14,7 +14,7 @@ namespace Myshipping.Application
/// <summary>
/// 业务编号
/// 第三方系统编号
/// </summary>
public virtual string BSNO { get; set; }
@ -47,7 +47,7 @@ namespace Myshipping.Application
public virtual string HBLNO { get; set; }
/// <summary>
/// 系统编号
/// 业务编号
/// </summary>
public virtual string BOOKINGNO { get; set; }

Loading…
Cancel
Save