diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs index bbe1f6f6..392beb36 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs @@ -1648,7 +1648,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL public static string IsCreateEdi(List headData, string type, string filetype, string filerole, int isbill=0,string carrier = "") { var error = ""; - if (type == "WDEDI" || type == "COSCOEDI" || type == "COSCOEDIJP" || type == "COSCOEDIKR" || type == "ZTEDI" || type == "RUSSIAEDI" || type == "WYEDI" || type == "SJJEDI") + if (type == "WDEDI" || type == "COSCOEDI" || type == "COSCOEDIJP" || type == "COSCOEDIKR" || type == "ZTEDI" || type == "RUSSIAEDI2" || type == "RUSSIAEDI" || type == "WYEDI" || type == "SJJEDI") { error = IsCreateEdiWD(headData, type, filetype, filerole); } @@ -1759,6 +1759,10 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL { result = CreateEdiRUSSIAEDI(headData, usercode, path, mblno, filerole, ftpset, type, isbill, portload); } + else if (type == "RUSSIAEDI2") + { + result = CreateEdiRUSSIAEDI2(headData, usercode, path, mblno, filerole, ftpset, type, isbill, portload); + } else if (type == "JFYARD") { result = CreateEdiJFYARD(headData, usercode, path, mblno, filetype, filerole, ftpset, type, isbill); @@ -22412,6 +22416,437 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL } + public static string CreateEdiRUSSIAEDI2(List headData, string usercode, string path, string mblno, string filerole, CodeFtpSet ftpset, string type, int isbill, string typeIFCSUM) + { + + typeIFCSUM = "RUSSIAEDI"; + string filename = path + "\\" + mblno + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".txt"; + if (System.IO.File.Exists(filename)) + { + System.IO.File.Delete(filename); + } + FileStream f = new FileStream(filename, FileMode.Create); + StreamWriter r = new StreamWriter(f, Encoding.Default); + var OpBill = new MsOpSeaeBill(); + T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); + + var icount = 0; + r.WriteLine("00:IFCSUM:MANIFEST:" + filerole + ":" + ftpset.SENDCODE + ":" + ftpset.RECEIVECODE + ":" + DateTime.Now.ToString("yyyyMMddHHmm") + "'"); + icount++; + var isfirst = true; + + foreach (var bill in headData) + { + if (isbill == 1) + { + OpBill = MsOpSeaeDAL.MsOpSeaeDAL.GetBillData("BSNO='" + bill.BSNO + "'"); + } + var billams = GetAmsData("BSNO='" + bill.BSNO + "'"); + if (isfirst) + { + #region 10/11 船舶有关的基本信息 + r.WriteLine("10" + + ":" + GetVesselEDICode(bill.VESSEL, typeIFCSUM) //2 + + ":" + bill.VESSEL//3 + + ":" + GetVesselFlag(bill.VESSEL) + + ":" + bill.VOYNO//5 + + ":"//6航线代码 + + ":"//7航线 + + ":" + GetDateStr(bill.ETA, "yyyyMMdd")//8 ETD ARRIVED DATE 预计到达日期CCYYMMDD + + ":" + GetDateStr(bill.ETD, "yyyyMMdd")//9 SAILING DATE (Vessel departure date &time) 离港日期 9(8) + + ":" + GetPortEDICode(bill.PORTLOADID, typeIFCSUM)//10 DEPART PORT CODE(Vessel off-border custom code) 离港地点代码 X(5) + + ":" + bill.PORTLOAD//11 DEPART PORT 离港地点 X(35) + + ":"//12 NEXT CALLING PORT 下一挂港代码 X(5) + + ":"//13 NEXT CALLING PORT 下一挂港 X(35) + + "'"); + icount++; + + r.WriteLine("11" + + ":" + GetCustEDICode(bill.CARRIER, typeIFCSUM)//2 SHIPPING LINE CODE 船公司(承运人)代码 X(13) + + ":" + bill.CARRIER//3 SHIPPING LINE 船公司(承运人) X(35) + + "'"); + icount++; + #endregion + + + } + + + isfirst = false; + + #region 12 提单的第一个记录 + var xtype = "P"; + if (bill.BLFRT.IndexOf("COLLECT") >= 0) + { + xtype = "C"; + } + + r.WriteLine("12" + + ":" + bill.MBLNO// 2 B/L NO. 提单号 X(20) + + ":"// 3 PRE. VESSEL CODE 前程运输船名代码 X(9) C + + ":"// 4 PRE. VESSEL 前程运输船名 X(35) C + + ":"// 5 PRE. VOYAGE 前程运输航次 X(6) C + + ":" + GetPortEDICode(bill.PLACERECEIPTID, typeIFCSUM)// 6 PLACE CODE OF RECEIPT 收货地代码(货物托运地或者国家代码) X(5) C + + ":" + bill.PLACERECEIPT// 7 PLACE OF RECEIPT 收货地名称 X(70)C + + ":" + GetPortEDICode(bill.PORTLOADID, typeIFCSUM)// 8 LOAD PORT CODE 装货港代码 X(5)M + + ":" + bill.PORTLOAD// 9 LOAD PORT 装货港 X(35) C + + ":" + bill.SERVICE// 10 B/L CY-CFS ITEM 运输条款 X(9) M + + ":" + xtype// 11 PREPAID OR COLLECT 付款方式(运费支付方法代码) X(1) "C:Collect到付,P:Prepaid only预付,F=免费" M + + ":" + GetDateStr(bill.ETD, "yyyyMMdd")// 12 Consignment loading date 货物装船时间 9(8) "YYYYMMDD" M + + ":"// 13 QUARANTINE CODING 检疫代码 X(1) C + + ":"// 14 DATE OF ISSUE 签发日期 9(8) CCYYMMDD C + + ":"// 15 CURRENCY 币种(金额类型代码) X(3) 填写“托运货物价值”数据项填写的金额数值对应的货币代码,参照代码表:CN025 C + + ":"// 16 EXCHANGE RATE 汇率 9(5). 9999 C + + "'"); + icount++; + #endregion + + #region 13 提单的地点信息 + r.WriteLine("13" + + ":" + GetPortEDICode(bill.PORTDISCHARGEID, typeIFCSUM)//2 DISCHARGE PORT CODE 卸货地代码 X(5)M + + ":" + bill.PORTDISCHARGE//3 DISCHARGE PORT 卸货港 X(35) C + + ":" + GetPortEDICode(bill.PLACEDELIVERYID, typeIFCSUM)//4 PLACE CODE OF DELIVERY 交货地代码 X(5) C + + ":" + bill.PLACEDELIVERY//5 PLACE OF DELIVERY 交货地 X(70)C + + ":"//6 TRANSFER PORT CODE 中转港代码 X(5) C + + ":"//7 TRANSFER PORT 中转港 X(35) C + + ":"//8 PLACE CODE OF B/L ISSUE 提单签发地代码 X(5) C + + ":"//9 PLACE OF B/L ISSUE 提单签发地 X(35) C + + ":"//10 TRANSFER FLAG 中转标志 X(2) "10=国内中转统码,11=国内水路中转,12=国内公路中转,13=国内铁路中转,21=国际水水中转,30=内贸本地,31=内贸中转" C + + "'"); + icount++; + #endregion + + var strtemp = ""; + string Shipping = ""; + #region 16 发货人1-6/35 + if (isbill != 1) + { + Shipping = formatEdiStr("txt", bill.SHIPPER); + } + else + { + Shipping = formatEdiStr("txt", OpBill.SHIPPER); + } + //List ShippingList = formatlengthStr(Shipping, 35); + //if (ShippingList.Count != 0 && Shipping.Length > 0) + //{ + // strtemp = "16:"; + // for (int i = 0; i < ShippingList.Count; i++) + // { + // strtemp += ":" + ShippingList[i]; + // } + // strtemp += "'"; + // r.WriteLine(strtemp); + // icount++; + //} + + List ShippingList = formatlengthStr(Shipping, 100); + + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + r.WriteLine("16::" + formatListStr(ShippingList, 12) + "'"); + + } + + #endregion + + #region 17 收货人1-6/35 + if (isbill != 1) + { + Shipping = formatEdiStr("txt", bill.CONSIGNEE); + } + else + { + Shipping = formatEdiStr("txt", OpBill.CONSIGNEE); + } + //ShippingList.Clear(); + //ShippingList = formatlengthStr(Shipping, 35); + //if (ShippingList.Count != 0 && Shipping.Length > 0) + //{ + // strtemp = "17:"; + // for (int i = 0; i < ShippingList.Count; i++) + // { + // strtemp += ":" + ShippingList[i]; + // } + // strtemp += "'"; + // r.WriteLine(strtemp); + // icount++; + //} + ShippingList = formatlengthStr(Shipping, 100); + + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + r.WriteLine("17::" + formatListStr(ShippingList, 16) + "'"); + + } + #endregion + + #region 18 通知人1-6/35 + if (isbill != 1) + { + Shipping = formatEdiStr("txt", bill.NOTIFYPARTY); + } + else + { + Shipping = formatEdiStr("txt", OpBill.NOTIFYPARTY); + } + //ShippingList.Clear(); + //ShippingList = formatlengthStr(Shipping, 35); + //if (ShippingList.Count != 0 && Shipping.Length > 0) + //{ + // strtemp = "18:"; + // for (int i = 0; i < ShippingList.Count; i++) + // { + // strtemp += ":" + ShippingList[i]; + // } + // strtemp += "'"; + // r.WriteLine(strtemp); + // icount++; + //} + ShippingList = formatlengthStr(Shipping, 100); + + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + r.WriteLine("18::" + formatListStr(ShippingList, 11) + "'"); + + } + #endregion + + #region 41 货物信息 + r.WriteLine("41" + + ":1" //2 CARGO SEQUENCE NO. 货物序号 9(3) 填写提单中的货物顺序号,每票提运单中的不同商品从“1”开始按顺序填写,舱单变更时原序号不得变更,只能出现数字和字母 M + + ":" //3 CARGO CODE 货类代码 X(3) C + + ":" + bill.PKGS //4 NUMBERS OF PACKAGES 货物件数 9(6) 填写本项货物的包装数量,包装以不再拆解为准;散货时, 件数=“1” M + + ":" + GetPackageEDICode(bill.KINDPKGS, typeIFCSUM)//5 PACKAGES KIND CODE 包装类型代码 X(2) 参照代码表CN005,只能填写数字或字母 M + + ":" + bill.KINDPKGS //6 PACKAGES KIND 包装类型 X(35) C + + ":" + Math.Round(Convert.ToDecimal(bill.KGS), 2) //7 CARGO GROSS WEIGHT 货毛重 9(8).99 单位:千克;最大长度:10位整数,精确到小数点后2位。 M + + ":" //8 CARGO NET WEIGHT 货净重 9(8).99 单位:KG,千克;整数位最多10位,小数位最多2位 C + + ":" + Math.Round(Convert.ToDecimal(bill.CBM), 3) //9 CARGO MEASUREMENT 货尺码 9(5).999 单位:M3,立方米 C + + "'"); + icount++; + #endregion + + #region 43 危险品和冷藏信息 + var cargoid = bill.CARGOID; + if (cargoid == "" || cargoid == " ") { cargoid = "S"; } + if (cargoid == "D") + { + #region 危险品 + r.WriteLine("43" + + ":" + bill.DCLASS //2 CLASS 危险品分类 X(5) O + + ":" + bill.DPAGE //3 PAGE 危险品页号 X(7) O + + ":" + bill.DUNNO //4 UNDG NO. 联合国危险品编号 9(4) 参照代码表CN032,由4位数字和大写字母组成 O + + ":" + bill.DLABEL //5 LABEL 危险品标签 X(32) O + + ":" //6 FLASH POINT 危险货物闪点 X(5) 摄氏 C + + ":" //7 EMS NO. 船运危险品应急措施号 X(6) C + + ":" //8 MFAG NO. 医疗急救指南号 X(4) C + + ":" //9 EMERGENCY CONTACT 应急联系 X(35) C + + ":" //10 TEMPERATURE ID 温度计量单位 X(1) C = 摄氏 F = 华氏 O + + ":" //11 TEMPERATURE SETTING 设置温度 X(5) O + + ":" //12 MIN. TEMPERATURE 冷藏最低温度 X(5) C + + ":" //13 MAX. TEMPERATURE 冷藏最高温度 X(5) C + //注: 温度中,除正(+)负(-)号及小数点外,最多只能三位数字。 + // 若是危险品箱,则字段2、3、4、5为必填;若是冷藏箱,则字段10、11为必填。 + + "'"); + icount++; + #endregion + } + else if (cargoid == "R") + { + #region 冷藏 + string sTEMPID = "C"; + if (bill.TEMPID.IndexOf("F") > -1 || bill.TEMPID.IndexOf("华") > -1) + { + sTEMPID = "F"; + } + + r.WriteLine("43" + + ":" //2 CLASS 危险品分类 X(5) O + + ":" //3 PAGE 危险品页号 X(7) O + + ":" //4 UNDG NO. 联合国危险品编号 9(4) 参照代码表CN032,由4位数字和大写字母组成 O + + ":" //5 LABEL 危险品标签 X(32) O + + ":" //6 FLASH POINT 危险货物闪点 X(5) 摄氏 C + + ":" //7 EMS NO. 船运危险品应急措施号 X(6) C + + ":" //8 MFAG NO. 医疗急救指南号 X(4) C + + ":" //9 EMERGENCY CONTACT 应急联系 X(35) C + + ":" + sTEMPID //10 TEMPERATURE ID 温度计量单位 X(1) C = 摄氏 F = 华氏 O + + ":" + bill.TEMPSET //11 TEMPERATURE SETTING 设置温度 X(5) O + + ":" //12 MIN. TEMPERATURE 冷藏最低温度 X(5) C + + ":" //13 MAX. TEMPERATURE 冷藏最高温度 X(5) C + //注: 温度中,除正(+)负(-)号及小数点外,最多只能三位数字。 + // 若是危险品箱,则字段2、3、4、5为必填;若是冷藏箱,则字段10、11为必填。 + + "'"); + icount++; + #endregion + } + #endregion + + + #region 44 唛头 + //2 MARKS 唛头 X(512) 填写运输包装的标志及代码(唛头)M。每条记录44允许有10项,每项长度为35;该记录一次最多允许重复9次 + var m = 1;//项,允许有10项 + var iLine = 0;//行,最多允许重复9次 + strtemp = ""; + Shipping = formatEdiStr("txt", bill.MARKS); + List ShippingListName = formatlengthStr(Shipping, 35); + if (ShippingListName.Count != 0) + { + for (var i = 0; i < ShippingListName.Count; i++) + { + if (iLine > 9) + { + break; + } + if (m <= 10) + { + if (m == 1) + { + strtemp = "44:" + ShippingListName[i] + ":"; + iLine++; + } + else + { + if (m == 10) + strtemp += ShippingListName[i]; + else + strtemp += ShippingListName[i] + ":"; + } + } + else + { + m = 1; + r.WriteLine(strtemp + "'"); + strtemp = "44:" + ShippingListName[i] + ":"; + icount++; + iLine++; + } + m++; + } + if (strtemp != "") + { + r.WriteLine(strtemp + "'"); + icount++; + }; + } + #endregion + + #region 47 货物描述 + //2 CARGO DESCRIPTION 货物描述 X(256) 填写足以鉴别货物的性质的简明描述 M。每条记录47允许有5项,每项长度为70;该记录一次最多允许重复9次 + m = 1;//项,允许有5项 + iLine = 0;//行,最多允许重复9次 + strtemp = ""; + Shipping = formatEdiStr("txt", bill.DESCRIPTION); + List ListName = formatlengthStr(Shipping, 70); + if (ListName.Count != 0) + { + for (var i = 0; i < ListName.Count; i++) + { + if (iLine > 9) + { + break; + } + if (m <= 9) + { + if (m == 1) + { + strtemp = "47:" + ListName[i] + ":"; + iLine++; + } + else + { + if (m == 9) + strtemp += ListName[i]; + else + strtemp += ListName[i] + ":"; + } + } + else + { + m = 1; + r.WriteLine(strtemp + "'"); + strtemp = "47:" + ListName[i] + ":"; + icount++; + iLine++; + } + m++; + } + if (strtemp != "") + { + r.WriteLine(strtemp + "'"); + icount++; + }; + } + #endregion + + + #region 51/52 集装箱 + var ctndetaillist = MsOpSeaeDAL.MsOpSeaeDAL.GetBodyList("BSNO='" + bill.BSNO + "'"); + foreach (var ctn in ctndetaillist) + { + if (ctn.CNTRNO != "") + { + r.WriteLine("51" + + ":001"//2 CARGO SEQUENCE NO. 货物序号 9(3) 此字段无意义 M + + ":" + ctn.CNTRNO//3 CTN. NO. 箱号 X(17) "由4个字母即货主编码、6位数字序列号以及1位检测数字组成。填写内容必须由大写字母与数字组成,可以出现一次中划线。非集装箱货没有箱号的情况下填写:0000" M 测试数据不能超过12位 + + ":" + ctn.SEALNO//4 SEAL NO. 主铅封号 X(30) 机械封志且封志人为CA C 铅封号以52记录为准 + + ":" + GetCtnEDICode(ctn.CTNALL, typeIFCSUM)//5 CTN. SIZE & TYPE 集装箱尺寸类型 X(4) "使用UN95码,非集装箱货填写:0000" M + + ":" + ctn.CTNSTATUS//6 ctn.CTNSTATUS 箱状态(重箱或者空箱标识代码) X(1) + //1=货物多于1/4容量 + //2=货物多于1/2容量 + //3=货物多于3/4容量 + //4=空箱 + //5=重箱 + //6=满箱 + //7=拼箱 + //8=整箱 + //非集装箱货填写:5=重箱" M + + ":" + ctn.PKGS//7 CTN. NUMBERS OF PACKAGES 箱内货物件数 9(6) 按实填写 M + + ":" + Math.Round(ctn.KGS, 3)//8 NET WEIGHT 箱内货重 9(5). 999 按实填写 M + + ":" + Math.Round(ctn.TAREWEIGHT, 3)//9 TARE WEIGHT 箱皮重 9(5). 999 非集装箱货填写:0 M + + ":" + Math.Round(ctn.CBM, 3)//10 CTN. CARGO MEASUREMENT 箱内货物尺码 9(5) . 999 C + //+ ":"11 Over Length Front 前超 9(4) CM,厘米 C + //+ ":"12 Over Length Back 后超 9(4) CM,厘米 C + //+ ":"13 Over Width Left 左超 9(4) CM,厘米 C + //+ ":"14 Over Width Right 右超 9(4) CM,厘米 C + //+ ":"15 Over Height 超高 9(4) CM,厘米 C + //+ ":"16 STOWAGE LOCATION 贝位 9(7) C + //+ ":"17 Container supplier type, coded 集装箱来源代码 9(2) + //1=货主自备箱 + //2=承运人提供箱 + //3=拼箱人提供箱 + //4=拆箱人提供箱 + //5=第三方提供箱" O + //注: 此记录反应的是该提单在该箱下的信息 + + "'"); + icount++; + + //r.WriteLine("52" + //+ ":" + ctn.SEALNO// 2 SEAL NO 封志号 X(30) 对于特种箱不能施封,但属于重箱的封志号码填写“0000”。如:框架箱、开顶箱、油罐箱 M 测试数据不能超过10位 + //+ ":M"// 3 SEAL KIND,CODE 封志类型 X(1) "M=机械封志、E=电子封志,只有特种箱不能施封可不填" O + //+ ":CA"// 4 SEALER,CODE 施加封志人 X(2) "AA=拼箱人 + // //AB=未知 + // //AC=检疫 + // //CA=承运人 + // //CU=海关 + // //SH=发货人 + // //TO=码头 + // //只有特种箱不能施封可不填" O + // // 注: 第一条出现的记录为主铅封信息 + //+ "'"); + //icount++; + } + } + #endregion + + } + icount++; + r.WriteLine("99:" + icount.ToString() + "'");//包括;头、尾记录 + r.Close(); + f.Close(); + return filename; + } + + #endregion diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js index e4a8a332..d53a6be3 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js @@ -2663,6 +2663,12 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { handler: function (menu, event) { _this.onCreateEDIClick(menu, event, 'RUSSIAEDI'); } + }, { + text: Zi.LAN.EDIRUSSIA+'(LFD)', //"远大EDI", + id: 'EDI-RUSSIA2', + handler: function (menu, event) { + _this.onCreateEDIClick(menu, event, 'RUSSIAEDI2'); + } }, { text: Zi.LAN.EDICSSA, //"远大EDI", hidden: true, diff --git a/DSWeb/Web(2).config b/DSWeb/Web(2).config deleted file mode 100644 index 7702a15a..00000000 --- a/DSWeb/Web(2).config +++ /dev/null @@ -1,399 +0,0 @@ - - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://api.rongetong.cn/WebService/WebInterFace.asmx - - - - \ No newline at end of file