diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs index 559dc190..c1904731 100644 --- a/DSWeb.Common/DB/Comm.cs +++ b/DSWeb.Common/DB/Comm.cs @@ -1506,4 +1506,5 @@ namespace DSWeb.Common.DB #endregion } + } \ No newline at end of file diff --git a/DSWeb.Common/DB/CommonDataContext.cs b/DSWeb.Common/DB/CommonDataContext.cs index 08c0b283..f025dfd8 100644 --- a/DSWeb.Common/DB/CommonDataContext.cs +++ b/DSWeb.Common/DB/CommonDataContext.cs @@ -58,6 +58,8 @@ namespace DSWeb.Common.DB public DbSet Receipt_Doc { get; set; } + + public class InvMailInfo { public string MBLNO { get; set; } diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs index a9bcbedc..5016366a 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs @@ -3551,7 +3551,7 @@ namespace DSWeb.MvcShipping.Controllers error = MsOpSeaeEdiPortDAL.IsCreateINTTR(headList, filetype, filerole, isbill, "YML", 0, "", ""); } - else if (type == "EVERGREENEDI") { + else if (type == "EVERGREEN") { error = MsOpSeaeEdiPortDAL.IsCreateEVERGREEN(headList, filetype, filerole, isbill); } @@ -3579,7 +3579,7 @@ namespace DSWeb.MvcShipping.Controllers else filename = MsOpSeaeEdiPortDAL.CreateEdiYMSI(headEdiList, Convert.ToString(Session["USERCODE"]), path, mblno, filerole, ftpset, isbill, filetype); - } else if (type == "EVERGREENEDI") + } else if (type == "EVERGREEN") { if (filetype == "B") filename = MsOpSeaeEdiPortDAL.CreateEdiEVERGREEN(headList, Convert.ToString(Session["USERCODE"]), path, mblno, filerole, ftpset, isbill,filetype); @@ -3681,7 +3681,7 @@ namespace DSWeb.MvcShipping.Controllers error = MsOpSeaeEdiPortDAL.IsCreateINTTR(headList, filetype, filerole, isbill, "YML", 0, "", ""); } - else if (type == "EVERGREENEDI") + else if (type == "EVERGREEN") { error = MsOpSeaeEdiPortDAL.IsCreateEVERGREEN(headList, filetype, filerole, isbill); @@ -3704,7 +3704,7 @@ namespace DSWeb.MvcShipping.Controllers filename = MsOpSeaeEdiPortDAL.CreateEdiYMSI(headEdiList, Convert.ToString(Session["USERCODE"]), path, mblno, filerole, ftpset, isbill, filetype); } - else if (type == "EVERGREENEDI") + else if (type == "EVERGREEN") { if (filetype == "B") filename = MsOpSeaeEdiPortDAL.CreateEdiEVERGREEN(headList, Convert.ToString(Session["USERCODE"]), path, mblno, filerole, ftpset, isbill, filetype); diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs index 60366aa9..ff257c1f 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs @@ -2051,7 +2051,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL var wordcheckResult = BasicDataRefDAL.是否有非字母数字标点(fieldstr); if (wordcheckResult.Success) { - isPost = false; + //isPost = false; errorstr += $"{fieldName} 包含文本:【{wordcheckResult.Message}】;"; } } @@ -2266,6 +2266,9 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL string uname =username; sdal.SaveStatusTree(BSNO, uname == null ? "" : uname); result.Data = BSNO; + if (!string.IsNullOrWhiteSpace(errorstr)) { + result.setMessage(errorstr); + } return result; } else diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs index 55c3a0bc..a0824e1c 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs @@ -15158,1264 +15158,2728 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL #endregion #region 订舱 + public static string CreateEdiEVERGREEN(List headData, string usercode, string path, string mblno, string filerole, CodeFtpSet ftpset, int isbill, string filetype) + { + 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 icount = 0; + var bsno = ""; + var OpBill = new MsOpSeaeBill(); - r.WriteLine("UNB+UNOA:1+" + ftpset.SENDCODE + ":ZZZ+" + ftpset.RECEIVECODE + ":ZZZ+" + DateTime.Now.ToString("yyMMdd:HHmm") + "+" + headData[0].CUSTNO + "'"); + + r.WriteLine("UNB+UNOC:1+" + ftpset.SENDCODE + ":ZZZ+" + ftpset.RECEIVECODE + ":ZZZ+" + DateTime.Now.ToString("yyMMdd:HHmm") + "+" + headData[0].CUSTNO + "'"); + icount++; + foreach (var bill in headData) + { + T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); + DataSet dsUserOp = T_ALL_DA.GetAllSQL("select top 1 * from [user] as u INNER JOIN user_baseinfo as b on u.GID=b.USERID where [SHOWNAME]='" + bill.OP.ToString() + "'"); + // + bsno = bill.CUSTNO; + if (isbill == 1) + { + OpBill = MsOpSeaeDAL.MsOpSeaeDAL.GetBillData("BSNO='" + bill.BSNO + "'"); + } + + #region 基本 - + + + + r.WriteLine("UNH+" + bill.CUSTNO + "+IFTMBF:D:99B:UN'"); + icount++; + + if (isbill != 1) + { + r.WriteLine("BGM+335+" + bill.MBLNO + "+" + filerole + "'"); + } + else + { + r.WriteLine("BGM+335+" + OpBill.MBLNO + "+" + filerole + "'"); + } + icount++; + if (ftpset.SENDATTN != "") + { + r.WriteLine("CTA+IC+:" + ftpset.SENDATTN + "'"); + icount++; + } + if (ftpset.SENDTEL != "") + { + r.WriteLine("COM+" + ftpset.SENDTEL + ":TE'"); + icount++; + } + if (ftpset.SENDEMAIL != "") + { + r.WriteLine("COM+" + ftpset.SENDEMAIL + ":EM'"); + icount++; + } + + r.WriteLine("DTM+137:" + DateTime.Now.ToString("yyyyMMddHHmm") + ":203'"); + icount++; + #endregion + + #region 运输条款 + if (bill.SERVICE.ToUpper() == "DOOR-DOOR") + { + r.WriteLine("TSR+27+2'"); + } + else if (bill.SERVICE.ToUpper() == "DOOR-CY") + { + r.WriteLine("TSR+28+2'"); + } + else if (bill.SERVICE.ToUpper() == "CY-DOOR") + { + r.WriteLine("TSR+29+2'"); + } + else if (bill.SERVICE.ToUpper() == "CY-CY") + { + r.WriteLine("TSR+30+2'"); + } + else + { + r.WriteLine("TSR+30+2'"); + } + icount++; + #endregion + + #region 付款方式、地址 + var str_pay = ""; + if (bill.BLFRT.IndexOf("PREPAID") >= 0) + str_pay = bill.PREPARDAT; + if (bill.BLFRT.IndexOf("COLLECT") >= 0) + str_pay = bill.PAYABLEAT; + + if (isbill != 1) + { + r.WriteLine("FTX+AAI+++" + bill.BLFRT + " Payable at " + str_pay + " " + bill.SERVICE + " " + bill.PKGS + bill.KINDPKGS + " " + formatEdiStr("txt", bill.EDIREMARK.Replace("\r\n", " ").Replace("\n", " ").Replace("\r", " ")) + "'"); + } + else + { + r.WriteLine("FTX+AAI+++" + bill.BLFRT + " Payable at " + str_pay + " " + OpBill.SERVICE + " " + OpBill.PKGS + OpBill.KINDPKGS + " " + formatEdiStr("txt", bill.EDIREMARK.Replace("\r\n", " ").Replace("\n", " ").Replace("\r", " ")) + "'"); + } + icount++; + #endregion + + #region 各种单号、付款方式代码 - r.WriteLine("RFF+BN:" + bill.MBLNO + "'"); + if (!string.IsNullOrEmpty(bill.MBLNO)) + + r.WriteLine("RFF+BN:" + bill.MBLNO + "'"); + + //icount++; - r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'"); + + + + + r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'"); + icount++; + + + #endregion + + #region 船信息、港口地址 + var voyno = ""; + if (bill.VOYNO.IndexOf(".") >= 0) + voyno = bill.VOYNO.Substring(bill.VOYNO.IndexOf(".") + 1, bill.VOYNO.Length - bill.VOYNO.IndexOf(".") - 1); + else + voyno = bill.VOYNO; - r.WriteLine("TDT+20+" + voyno + "+1++" +GetCustEDICode(bill.CARRIER,"EVERGREEN") + "+++:::" + bill.VESSEL + "'"); + + + r.WriteLine("TDT+20+" + voyno + "+1++" + GetCustEDICode(bill.CARRIER, "EVERGREEN") + "+++:::" + bill.VESSEL + "'"); + r.WriteLine("LOC+9+" + GetPortEDICode(bill.PORTLOADID, "EVERGREEN") + ":139:6:" + bill.PORTLOAD + "'"); + r.WriteLine("LOC+88+" + GetPortEDICode(bill.PORTLOADID, "EVERGREEN") + ":139:6:" + bill.PORTLOAD + "'"); + r.WriteLine("DTM+133:" + GetDateStr(bill.ETD, "yyyyMMdd") + ":102'");//yyyyMMddHHmm + r.WriteLine("LOC+11+" + GetPortEDICode(bill.PORTDISCHARGEID, "EVERGREEN") + ":139:6:" + bill.PORTDISCHARGE + "'"); + icount = icount + 5; + + if (bill.DESTINATION != "") + { + r.WriteLine("LOC+7+" + GetPortEDICode(bill.DESTINATIONID, "EVERGREEN") + ":139:6:" + bill.DESTINATION + "'"); + icount++; + } + #endregion - if (ftpset.SENDNAME.Length > 35) - r.WriteLine("NAD+BA+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME.Substring(0, 35) + "+" + ftpset.SENDNAME.Substring(35) + "'"); - else - r.WriteLine("NAD+BA+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME + "'"); + + + + //if (ftpset.SENDNAME.Length > 35) + + // r.WriteLine("NAD+ZZZ" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME.Substring(0, 35) + "+" + ftpset.SENDNAME.Substring(35) + "'"); + + //else + + r.WriteLine("NAD+ZZZ+" + ftpset.SENDCODE + ":160:86++" + ftpset.SENDCODE + "'"); + icount++; - //r.WriteLine("CTA+IC+:" + billams.ATTN + "'"); - //r.WriteLine("COM+" + billams.ATTNTEL + ":TE'"); - //r.WriteLine("COM+" + billams.ATTNEMAIL + ":EM'"); - if (dsUserOp != null) - { - if (dsUserOp.Tables[0].Rows.Count > 0) - { - r.WriteLine("CTA+IC+:" + dsUserOp.Tables[0].Rows[0]["USERNAME"].ToString().Trim() + "'"); - r.WriteLine("COM+" + dsUserOp.Tables[0].Rows[0]["OFFICEPHONE"].ToString().Trim() + ":TE'"); - r.WriteLine("COM+" + dsUserOp.Tables[0].Rows[0]["EMAIL1"].ToString().Trim() + ":EM'"); - icount = icount + 3; - } - } + + //if (dsUserOp != null) + + //{ + + // if (dsUserOp.Tables[0].Rows.Count > 0) + + // { + + + + // r.WriteLine("CTA+IC+:" + dsUserOp.Tables[0].Rows[0]["USERNAME"].ToString().Trim() + "'"); + + // r.WriteLine("COM+" + dsUserOp.Tables[0].Rows[0]["OFFICEPHONE"].ToString().Trim() + ":TE'"); + + // r.WriteLine("COM+" + dsUserOp.Tables[0].Rows[0]["EMAIL1"].ToString().Trim() + ":EM'"); + + // icount = icount + 3; + + // } + + //} + + + #region 发货人 + var billams = GetAmsData("BSNO='" + bill.BSNO + "'"); + var Shipping = ""; + var DescriptionShipper = ""; + if (isbill != 1) + { + if (billams.BYCOUNTRY != "") + Shipping = formatEdiStr("txt", billams.AMSSHIPPER); + else + Shipping = formatEdiStr("txt", bill.SHIPPER); + } + else Shipping = formatEdiStr("txt", OpBill.SHIPPER); + List ShippingList = formatlengthStr(Shipping, 35); + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + for (var i = 0; i < ShippingList.Count; i++) + { + if (i == 0) Shipping = "NAD+CZ+++" + ShippingList[0] + "+"; + if (i == 1) Shipping = Shipping + ShippingList[i]; + if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i]; + if (i >= 4 && ShippingList.Count > 5) + { + if (i == 4) + { + if (ShippingList[i].Length > 34) + { + Shipping = Shipping + ":" + ShippingList[i].Substring(0, 34); + DescriptionShipper = ShippingList[i].Substring(34); + } + else + Shipping = Shipping + ":" + ShippingList[i]; + Shipping = Shipping + "*"; + DescriptionShipper = "*" + DescriptionShipper; + } + else if (i > 4) + { + DescriptionShipper = DescriptionShipper + " " + ShippingList[i]; + } + } + else + if (i == 4) Shipping = Shipping + ":" + ShippingList[i]; + } + } + r.WriteLine(Shipping + "'"); + icount++; + #endregion + + #region 收货人 + if (isbill != 1) + { + if (billams.BYCOUNTRY != "") + Shipping = formatEdiStr("txt", billams.AMSCONSIGNEE); + else + Shipping = formatEdiStr("txt", bill.CONSIGNEE); + } + else Shipping = formatEdiStr("txt", OpBill.CONSIGNEE); + ShippingList = formatlengthStr(Shipping, 35); + var DescriptionConsignee = ""; + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + for (var i = 0; i < ShippingList.Count; i++) + { + if (i == 0) Shipping = "NAD+CN+++" + ShippingList[0] + "+"; + if (i == 1) Shipping = Shipping + ShippingList[i]; + if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i]; + if (i >= 4 && ShippingList.Count > 5) + { + if (i == 4) + { + if (ShippingList[i].Length > 33) + { + Shipping = Shipping + ":" + ShippingList[i].Substring(0, 33); + DescriptionConsignee = ShippingList[i].Substring(33); + } + else + Shipping = Shipping + ":" + ShippingList[i]; + Shipping = Shipping + "**"; + DescriptionConsignee = "**" + DescriptionConsignee; + } + else if (i > 4) + { + DescriptionConsignee = DescriptionConsignee + " " + ShippingList[i]; + } + } + else + if (i == 4) Shipping = Shipping + ":" + ShippingList[i]; + } + } + if (billams.BYCOUNTRY == "USA") + { + Shipping = Shipping + "+++" + billams.CONSIGNEEPOSTCODE; + r.WriteLine(Shipping + "'"); + } + else if (billams.BYCOUNTRY == "CANADA") + { + Shipping = Shipping + "+++" + billams.CONSIGNEEPOSTCODE + "+CA"; + r.WriteLine(Shipping + "'"); + } + else if (billams.BYCOUNTRY == "BRAZIL") + { + Shipping = Shipping + "++++" + billams.CONSIGNEECOUNTRY; + r.WriteLine(Shipping + "'"); + r.WriteLine("RFF+GN:" + billams.CONSIGNEETAXNO + "'"); + icount = icount + 1; + } + else { r.WriteLine(Shipping + "'"); } + icount++; + #endregion + + #region 通知人 + if (isbill != 1) + { + if (billams.BYCOUNTRY != "") + Shipping = formatEdiStr("txt", billams.AMSNOTIFYPARTY); + else + Shipping = formatEdiStr("txt", bill.NOTIFYPARTY); + } + else Shipping = formatEdiStr("txt", OpBill.NOTIFYPARTY); + ShippingList = formatlengthStr(Shipping, 35); + var DescriptionNotifyparty = ""; + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + for (var i = 0; i < ShippingList.Count; i++) + { + if (i == 0) Shipping = "NAD+NI+++" + ShippingList[0] + "+"; + if (i == 1) Shipping = Shipping + ShippingList[i]; + if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i]; + if (i >= 4 && ShippingList.Count > 5) + { + if (i == 4) + { + if (ShippingList[i].Length > 32) + { + Shipping = Shipping + ":" + ShippingList[i].Substring(0, 32); + DescriptionNotifyparty = ShippingList[i].Substring(32); + } + else + { + Shipping = Shipping + ":" + ShippingList[i]; + } + Shipping = Shipping + "***"; + DescriptionNotifyparty = "***" + DescriptionNotifyparty; + } + else if (i > 4) + { + DescriptionNotifyparty = DescriptionNotifyparty + " " + ShippingList[i]; + } + } + else + if (i == 4) Shipping = Shipping + ":" + ShippingList[i]; + } + } + + if (billams.BYCOUNTRY == "USA") + { + Shipping = Shipping + "+++" + billams.NOTIFYPARTYPOSTCODE; + r.WriteLine(Shipping + "'"); + } + else if (billams.BYCOUNTRY == "BRAZIL") + { + if (billams.NOTIFYPARTYCOUNTRY != "") + Shipping = Shipping + "++++" + billams.NOTIFYPARTYCOUNTRY; + r.WriteLine(Shipping + "'"); + if (billams.NOTIFYPARTYTAXNO != "") + { + r.WriteLine("RFF+GN:" + billams.NOTIFYPARTYTAXNO + "'"); + icount = icount + 1; + } + } + else + { + r.WriteLine(Shipping + "'"); + } + icount++; + #endregion + + #region 运输条款、发送方 + if (bill.SERVICE == "DOOR-DOOR" || bill.SERVICE == "DOOR-CY" || bill.SERVICE == "CY-DOOR") + { + r.WriteLine("CTA+IC+:" + billams.ATTN + "'"); + r.WriteLine("COM+" + billams.ATTNTEL + ":TE'"); + r.WriteLine("COM+" + billams.ATTNEMAIL + ":EM'"); + icount = icount + 3; + } - if (ftpset.SENDNAME.Length > 35) - r.WriteLine("NAD+FW+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME.Substring(0, 35) + "+" + ftpset.SENDNAME.Substring(35) + "'"); - else - r.WriteLine("NAD+FW+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME + "'"); - icount++; - if (ftpset.SENDNAME.Length > 35) - r.WriteLine("NAD+FC+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME.Substring(0, 35) + "+" + ftpset.SENDNAME.Substring(35) + "'"); - else - r.WriteLine("NAD+FC+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME + "'"); - icount++; + + #endregion - if (bill.BLFRT.IndexOf("PREPAID") >= 0) - r.WriteLine("CPI+4++P'"); - else - r.WriteLine("CPI+4++C'"); + + + //if (bill.BLFRT.IndexOf("PREPAID") >= 0) + + // r.WriteLine("CPI+4++P'"); + + //else + + // r.WriteLine("CPI+4++C'"); + + //icount++; + + + + r.WriteLine("NAD+CA+EGLV'"); + icount++; + #region 总件数//订舱不需要分箱明细 + if (isbill != 1) + { + r.WriteLine("GID+1+" + bill.PKGS.ToString() + ":" + GetPackageEDICode(bill.KINDPKGS, "MAERSK").Trim() + "::6:" + bill.KINDPKGS + "'"); + } + else + { + r.WriteLine("GID+1+" + OpBill.PKGS.ToString() + ":" + GetPackageEDICode(OpBill.KINDPKGS, "MAERSK").Trim() + "::6:" + OpBill.KINDPKGS + "'"); + } + icount++; + #endregion + + #region 货物描述 + if (isbill != 1) + { + Shipping = formatEdiStr("txt", bill.DESCRIPTION); + } + else Shipping = formatEdiStr("txt", OpBill.DESCRIPTION); + Shipping = Shipping.Replace("\n", "\\"); + Shipping = Shipping.Replace("\r", " "); + + var tmpdescription = ""; + + List DescriptionListAll = new List(); + string[] DescriptionList = Shipping.Split('\\'); + if (DescriptionList.Length != 0) + { + for (var i = 0; i < DescriptionList.Length; i++) + { + if (DescriptionList[i] != "") + { - r.WriteLine("FTX+AAA+++" + DescriptionList[i] + "'"); - icount++; + + if ((tmpdescription.Length + DescriptionList[i].Length + 1) > 512) + + { + + DescriptionListAll.Add(tmpdescription); + + tmpdescription = DescriptionList[i]; + + } + + else + { + + tmpdescription = tmpdescription + " " + DescriptionList[i]; + + + + } + } + } + + } + + if (!string.IsNullOrEmpty(tmpdescription)) + { + + DescriptionListAll.Add(tmpdescription); + + } + + + + if (DescriptionListAll.Count != 0) + { + + foreach (var description in DescriptionListAll) + { + + r.WriteLine("FTX+AAA+++" + description + "'"); + + icount++; + + + + } + + + } + + + + + if (DescriptionShipper != "") + { + if (DescriptionShipper != "") + { + r.WriteLine("FTX+AAA+++" + DescriptionShipper + "'"); + icount++; + } + } + if (DescriptionConsignee != "") + { + if (DescriptionConsignee != "") + { + r.WriteLine("FTX+AAA+++" + DescriptionConsignee + "'"); + icount++; + } + } + if (DescriptionNotifyparty != "") + { + if (DescriptionNotifyparty != "") + { + r.WriteLine("FTX+AAA+++" + DescriptionNotifyparty + "'"); + icount++; + } + } + //if (bill.CARGOID == "R") + //{ + // r.WriteLine("PCD+52:"+bill.TEMPSET+"'"); + // icount++; + //} + #endregion + + #region 重量、尺码 + if (isbill != 1) + { - r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + "'"); - r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + "'"); - } + + r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + "'"); + + r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + "'"); + + } + else + { - r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(OpBill.KGS, 3) + "'"); + + r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(OpBill.KGS, 3) + "'"); + r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(OpBill.CBM, 3) + "'"); + } + icount = icount + 2; + #endregion + + #region 唛头 + + //if (isbill != 1) + //{ + // Shipping = formatEdiStr("txt", bill.MARKS); + //} + //else Shipping = formatEdiStr("txt", OpBill.MARKS); + //Shipping = Shipping.Replace("\n", "\\"); + //Shipping = Shipping.Replace("\r", " "); + //string[] MarksList = Shipping.Split('\\'); + //if (MarksList.Length != 0) + //{ + // for (var i = 0; i < MarksList.Length; i++) + // { + // r.WriteLine("PCI++" + MarksList[i] + "'"); + // icount++; + // } + //} + #endregion + + #region 危险品 + if (bill.CARGOID == "D") + { + r.WriteLine("DGS+IMD+" + bill.DCLASS + "+" + bill.DUNNO + "'"); + r.WriteLine("CTA+HG+:" + billams.ATTN + "'"); + r.WriteLine("COM+" + billams.ATTNTEL + ":TE'"); + icount = icount + 3; + } + #endregion + + #region 集装箱 + if (isbill != 1) + { + Shipping = bill.BSNO; + } + else Shipping = OpBill.AS_ID; + var ctnsumlist = GetCtnSum("BSNO='" + Shipping + "'"); + foreach (var ctn in ctnsumlist) + { + if (bill.ISCONTAINERSOC) + r.WriteLine("EQD+CN++" + GetCtnEDICode(ctn.CTNALL, "MAERSK") + "+1'"); + else + r.WriteLine("EQD+CN++" + GetCtnEDICode(ctn.CTNALL, "MAERSK") + "+2'"); + r.WriteLine("EQN+" + ctn.CTNNUM.ToString() + "'"); - icount = icount + 2; + + r.WriteLine("TMD+3'"); + + r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(ctn.KGS, 3) + "'"); + + r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(ctn.CBM, 3) + "'"); + + icount = icount + 3; + + if (bill.CARGOID == "R") + { + if (bill.REEFERF != "") + { + r.WriteLine("MEA+AAE+AAS+CBM:" + bill.REEFERF + "'"); + icount++; + } - r.WriteLine("TMP+2+" + bill.TEMPSET + ":CEL'"); + + var tmp = bill.TEMPSET; + + if (tmp != "") + + { + + var fuhao = ""; + + if (tmp.IndexOf("-") == 0) + + { + + fuhao = "-"; + + tmp = tmp.Replace("-", ""); + + } + + if (tmp.Length < 3) + + { + + for (int i = 0; i < 3 - tmp.Length + 1; i++) + + { + + tmp = "0" + tmp; + + } + + } + + tmp = fuhao + tmp; + + } + + else + + { + + tmp = "000"; + + } + + + + r.WriteLine("TMP+2+" + tmp + ":CEL'"); + icount++; + } + } + #endregion + } + r.WriteLine("UNT+" + icount.ToString() + "+" + bsno + "'"); + r.WriteLine("UNZ+" + headData.Count.ToString() + "+" + bsno + "'"); + r.Close(); + f.Close(); + return filename; + } + #endregion #region 确认 + public static string CreateEdiEVERGREENSI(List headData, string usercode, string path, string mblno, string filerole, CodeFtpSet ftpset, int isbill, string filetype) + { + 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 icount = 0; + var OpBill = new MsOpSeaeBill(); + var bsno = ""; - r.WriteLine("UNB+UNOA:1+" + ftpset.SENDCODE + ":ZZZ+" + ftpset.RECEIVECODE + ":ZZZ+" + DateTime.Now.ToString("yyMMdd:HHmm") + "+" + headData[0].CUSTNO + "'"); + + r.WriteLine("UNB+UNOC:2+" + ftpset.SENDCODE + ":ZZZ+" + ftpset.RECEIVECODE + ":ZZZ+" + DateTime.Now.ToString("yyMMdd:HHmm") + "+" + headData[0].CUSTNO + "'"); + + foreach (var bill in headData) + { + T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); + DataSet dsUserOp = T_ALL_DA.GetAllSQL("select top 1 * from [user] as u INNER JOIN user_baseinfo as b on u.GID=b.USERID where [SHOWNAME]='" + bill.OP.ToString() + "'"); + // + bsno = bill.CUSTNO; + var billams = GetAmsData("BSNO='" + bill.BSNO + "'"); + if (isbill == 1) + OpBill = MsOpSeaeDAL.MsOpSeaeDAL.GetBillData("BSNO='" + bill.BSNO + "'"); + + #region 报文头 + r.WriteLine("UNH+" + bill.CUSTNO + "+IFTMIN:D:99B:UN'"); + icount++; + + if (isbill != 1) + { + r.WriteLine("BGM+340+" + bill.MBLNO + "+" + filerole + "'"); + } + else + { + r.WriteLine("BGM+340+" + OpBill.MBLNO + "+" + filerole + "'"); + } + icount++; - if (ftpset.SENDATTN != "") - { - r.WriteLine("CTA+IC+:" + ftpset.SENDATTN + "'"); - icount++; - } - if (ftpset.SENDTEL != "") - { - r.WriteLine("COM+" + ftpset.SENDTEL + ":TE'"); - icount++; - } - if (ftpset.SENDEMAIL != "") + + + if (dsUserOp != null) + { - r.WriteLine("COM+" + ftpset.SENDEMAIL + ":EM'"); - icount++; + + if (dsUserOp.Tables[0].Rows.Count > 0) + + { + + r.WriteLine("CTA+IC+:" + dsUserOp.Tables[0].Rows[0]["USERNAME"].ToString().Trim() + "'"); + + r.WriteLine("COM+" + dsUserOp.Tables[0].Rows[0]["OFFICEPHONE"].ToString().Trim() + ":TE'"); + + r.WriteLine("COM+" + dsUserOp.Tables[0].Rows[0]["EMAIL1"].ToString().Trim() + ":EM'"); + + + + icount = icount + 3; + + } + } + + r.WriteLine("DTM+137:" + DateTime.Now.ToString("yyyyMMddHHmm") + ":203'"); + icount++; + + #endregion + + #region 运输条款 + if (bill.SERVICE.ToUpper() == "DOOR-DOOR") + { + r.WriteLine("TSR+27+2'"); + } + else if (bill.SERVICE.ToUpper() == "DOOR-CY") + { + r.WriteLine("TSR+28+2'"); + } + else if (bill.SERVICE.ToUpper() == "CY-DOOR") + { + r.WriteLine("TSR+29+2'"); + } + else + { + r.WriteLine("TSR+30+2'"); + } + #endregion + + #region edi备注 + var str_pay = ""; + if (bill.BLFRT.IndexOf("PREPAID") >= 0) + str_pay = bill.PREPARDAT; + if (bill.BLFRT.IndexOf("COLLECT") >= 0) + str_pay = bill.PAYABLEAT; + + if (isbill != 1) + { + r.WriteLine("FTX+AAI+++" + bill.BLFRT + " Payable at " + str_pay + " " + bill.SERVICE + " " + bill.PKGS + bill.KINDPKGS + "'"); + } + else + { + r.WriteLine("FTX+AAI+++" + bill.BLFRT + " Payable at " + str_pay + " " + OpBill.SERVICE + " " + OpBill.PKGS + OpBill.KINDPKGS + "'"); + } + icount++; + + var Shipping = ""; + Shipping = formatEdiStr("txt", billams.SIREMARK); + Shipping = Shipping.Replace("\n", "\\"); + Shipping = Shipping.Replace("\r", " "); + string[] EdiRemarkList = Shipping.Split('\\'); + if (EdiRemarkList.Length != 0) + { + for (var i = 0; i < EdiRemarkList.Length; i++) + { + if (EdiRemarkList[i] != "") + { + r.WriteLine("FTX+AAI+++" + EdiRemarkList[i] + "'"); + icount++; + } + } + } + + //if (billams.BYCOUNTRY == "USA") + //{ + // if (billams.SCACCODE != "") + // r.WriteLine("FTX+CCI++MFS+1:US:" + billams.SCACCODE + "'"); + // else + // r.WriteLine("FTX+CCI++MFS+5:US'"); + // icount++; + + //} + //else if (billams.BYCOUNTRY == "CANADA") + //{ + // if (billams.SCACCODE != "") + // r.WriteLine("FTX+CCI++MFS+1:CA:" + billams.SCACCODE + "'"); + // else + // r.WriteLine("FTX+CCI++MFS+5:CA'"); + // icount++; + //} + #endregion + + #region 总 件重尺 + if (isbill != 1) + { + r.WriteLine("CNT+7:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + ":KGM'"); - r.WriteLine("CNT+11:" + bill.PKGS + "'"); + + r.WriteLine("CNT+11:" + bill.PKGS + ":" + GetPackageEDICode(bill.KINDPKGS, "EVERGREEN") + "'"); + r.WriteLine("CNT+15:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + ":MTQ'"); + } + else + { + r.WriteLine("CNT+7:" + Math.Round(OpBill.KGS, 3) + ":KGM'"); - r.WriteLine("CNT+11:" + OpBill.PKGS + "'"); + + r.WriteLine("CNT+11:" + OpBill.PKGS + ":" + GetPackageEDICode(OpBill.KINDPKGS, "EVERGREEN") + "'"); + r.WriteLine("CNT+15:" + Math.Round(OpBill.CBM, 3) + ":MTQ'"); + } + icount = icount + 3; + var copynum = GetBillNum(bill.COPYNOBILL); + + + + + + if (bill.ISSUETYPE == "正本") + + { + + r.WriteLine("DOC+705+++" + GetBillNum(bill.NOBILL) + "'"); + + icount = icount + 1; + + if (copynum != "") + + { + + r.WriteLine("DOC+707+++" + copynum + "'"); + + icount = icount + 1; + + } + + + + } + + else if (bill.ISSUETYPE == "海运单" || bill.ISSUETYPE == "Seaway" || bill.ISSUETYPE == "WAYBILL" || bill.ISSUETYPE == "SWB正本" || bill.ISSUETYPE == "SWB" || bill.ISSUETYPE == "SWB无正本") + + { + + r.WriteLine("DOC+710+++" + GetBillNum(bill.NOBILL) + "'"); + + icount = icount + 1; + + + + } + + else if (bill.ISSUETYPE == "BILL COPY" || bill.ISSUETYPE == "电放") + + { + + r.WriteLine("DOC+705+++" + GetBillNum(bill.NOBILL) + "'"); + + icount = icount + 1; + + if (copynum != "") + + { + + r.WriteLine("DOC+707+++" + copynum + "'"); + + icount = icount + 1; + + } + + + + } + + else if (bill.ISSUETYPE == "正副本") + + { + + r.WriteLine("DOC+705+++" + GetBillNum(bill.NOBILL) + "'"); + + icount = icount + 1; + + if (copynum != "") + + { + + r.WriteLine("DOC+707+++" + copynum + "'"); + + icount = icount + 1; + + } + + + + } + + else if (bill.ISSUETYPE == "HOUSE BILL") + + { + + r.WriteLine("DOC+714+++" + GetBillNum(bill.NOBILL) + "'"); + + icount = icount + 1; + + + + } + + + + + //var ctnttllist = GetCtnTTLSum("BSNO='" + bill.BSNO + "'"); + //var ctnttl = ctnttllist[0]; + //r.WriteLine("CNT+16:" + ctnttl.CTNNUM + "'"); + //icount++; + #endregion + + #region 地址地点 - if (bill.BLFRT == "FREIGHT COLLECT") - r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + bill.PAYABLEAT + "'"); - else - r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + bill.PREPARDAT + "'"); - icount++; - r.WriteLine("LOC+73+" + GetPortEDICode(bill.ISSUEPLACEID, "MAERSK") + "::6:" + bill.ISSUEPLACE + "'"); - icount++; + //if (bill.BLFRT == "FREIGHT COLLECT") + + // r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + bill.PAYABLEAT + "'"); + + //else + + // r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + bill.PREPARDAT + "'"); + + //icount++; + + + + //r.WriteLine("LOC+73+" + GetPortEDICode(bill.ISSUEPLACEID, "MAERSK") + "::6:" + bill.ISSUEPLACE + "'"); + + //icount++; + #endregion + + #region 提单号 + if (isbill != 1) + { + Shipping = formatEdiStr("txt", billams.BSNOLIST); + Shipping = Shipping.Replace("\n", "\\"); + Shipping = Shipping.Replace("\r", " "); + EdiRemarkList = Shipping.Split('\\'); + if (EdiRemarkList.Length != 0 && billams.BSNOLIST != "") + { + for (var i = 0; i < EdiRemarkList.Length; i++) + { + r.WriteLine("RFF+BN:" + EdiRemarkList[i] + "'"); + icount++; + } + } + else + { + if (billams.ORDERNO != "") + r.WriteLine("RFF+BN:" + billams.ORDERNO + "'"); + else + r.WriteLine("RFF+BN:" + bill.MBLNO + "'"); + icount++; + } + } + else + { + r.WriteLine("RFF+BN:" + bill.MBLNO + "'"); + } + + if (isbill != 1) + r.WriteLine("RFF+BM:" + bill.MBLNO + "'"); + else + r.WriteLine("RFF+BM:" + OpBill.MBLNO + "'"); + icount++; + + //r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'"); + //icount++; - //r.WriteLine("RFF+SI:" + bill.CUSTNO + "'"); - //icount = icount + 1; + + + + //r.WriteLine("RFF+SI:" + bill.CUSTNO + "'"); + + //icount = icount + 1; + if (billams.BYCOUNTRY == "USA") + { + r.WriteLine("REF+TN:" + billams.ITNCODE + "'"); + icount = icount + 1; + } + #endregion + + #region 付费方式 + if (bill.BLFRT.IndexOf("PREPAID") >= 0) + r.WriteLine("CPI+4++P'"); + else if (bill.BLFRT.IndexOf("COLLECT") >= 0) + r.WriteLine("CPI+4++C'"); + else + r.WriteLine("CPI+4++B'"); + icount++; + #endregion + + #region 港口 + var voyno = ""; + if (bill.VOYNO.IndexOf(".") >= 0) + { + voyno = bill.VOYNO.Substring(bill.VOYNO.IndexOf(".") + 1, bill.VOYNO.Length - bill.VOYNO.IndexOf(".") - 1); + } + else + { + voyno = bill.VOYNO; + } + r.WriteLine("TDT+20+" + voyno + "+1+++++:::" + bill.VESSEL + "'"); + r.WriteLine("LOC+9+" + GetPortEDICode(bill.PORTLOADID, "EVERGREEN") + ":139:6:" + bill.PORTLOAD + "'"); + + r.WriteLine("LOC+88+" + GetPortEDICode(bill.PORTLOADID, "EVERGREEN") + ":139:6:" + bill.PORTLOAD + "'"); + r.WriteLine("LOC+11+" + GetPortEDICode(bill.PORTDISCHARGEID, "EVERGREEN") + ":139:6:" + bill.PORTDISCHARGE + "'"); + icount = icount + 4; + + if (bill.DESTINATION != "") + { + r.WriteLine("LOC+7+" + GetPortEDICode(bill.DESTINATIONID, "EVERGREEN") + ":139:6:" + bill.DESTINATION + "'"); + icount++; + } + #endregion + + #region 发货人 + var DescriptionShipper = ""; + if (isbill != 1) + { + if (billams.BYCOUNTRY != "") + Shipping = formatEdiStr("txt", billams.AMSSHIPPER); + else + Shipping = formatEdiStr("txt", bill.SHIPPER); + } + else Shipping = formatEdiStr("txt", OpBill.SHIPPER); + List ShippingList = formatlengthStr(Shipping, 35); + + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + for (var i = 0; i < ShippingList.Count; i++) + { + if (i == 0) Shipping = "NAD+CZ+++" + ShippingList[0] + "+"; + if (i == 1) Shipping = Shipping + ShippingList[i]; + if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i]; + if (i >= 4 && ShippingList.Count > 5) + { + if (i == 4) + { + if (ShippingList[i].Length > 34) + { + Shipping = Shipping + ":" + ShippingList[i].Substring(0, 34); + DescriptionShipper = ShippingList[i].Substring(34); + } + else + Shipping = Shipping + ":" + ShippingList[i]; + Shipping = Shipping + "*"; + DescriptionShipper = "*" + DescriptionShipper; + } + else if (i > 4) + { + DescriptionShipper = DescriptionShipper + " " + ShippingList[i]; + } + } + else + if (i == 4) Shipping = Shipping + ":" + ShippingList[i]; + } + } + r.WriteLine(Shipping + "'"); + icount = icount + 1; + #endregion + + #region 收货人 + if (isbill != 1) + { + if (billams.BYCOUNTRY != "") + Shipping = formatEdiStr("txt", billams.AMSCONSIGNEE); + else + Shipping = formatEdiStr("txt", bill.CONSIGNEE); + } + else Shipping = formatEdiStr("txt", OpBill.CONSIGNEE); + ShippingList = formatlengthStr(Shipping, 35); + var DescriptionConsignee = ""; + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + for (var i = 0; i < ShippingList.Count; i++) + { + if (i == 0) Shipping = "NAD+CN+++" + ShippingList[0] + "+"; + if (i == 1) Shipping = Shipping + ShippingList[i]; + if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i]; + if (i >= 4 && ShippingList.Count > 5) + { + if (i == 4) + { + if (ShippingList[i].Length > 33) + { + Shipping = Shipping + ":" + ShippingList[i].Substring(0, 33); + DescriptionConsignee = ShippingList[i].Substring(33); + } + else + Shipping = Shipping + ":" + ShippingList[i]; + Shipping = Shipping + "**"; + DescriptionConsignee = "**" + DescriptionConsignee; + } + else if (i > 4) + { + DescriptionConsignee = DescriptionConsignee + " " + ShippingList[i]; + } + + } + else + if (i == 4) Shipping = Shipping + ":" + ShippingList[i]; + } + } + + if (billams.BYCOUNTRY == "USA") + { + Shipping = Shipping + "+++" + billams.CONSIGNEEPOSTCODE; + r.WriteLine(Shipping + "'"); + } + else if (billams.BYCOUNTRY == "CANADA") + { + Shipping = Shipping + "+++" + billams.CONSIGNEEPOSTCODE + "+CA"; + r.WriteLine(Shipping + "'"); + } + else if (billams.BYCOUNTRY == "BRAZIL") + { + Shipping = Shipping + "++++" + billams.CONSIGNEECOUNTRY; + r.WriteLine(Shipping + "'"); + r.WriteLine("RFF+GN:" + billams.CONSIGNEETAXNO + "'"); + icount = icount + 1; + + } + else r.WriteLine(Shipping + "'"); + icount++; + #endregion + + //#region 代理 + //Shipping = formatEdiStr("txt", bill.AGENT); + //List AgentList = formatlengthStr(Shipping, 35); + //if (AgentList.Count != 0) + //{ + // for (var i = 0; i < AgentList.Count; i++) + // { + // if (i == 0) Shipping = "NAD+FW+++" + AgentList[0] ; + // if (i == 1) Shipping = Shipping + "+" + AgentList[i]; + // if (i >= 2 && i <= 4) Shipping = Shipping + ":" + AgentList[i]; + // } + //} + //r.WriteLine(Shipping + "'"); + //icount++; + //#endregion + + + if (ftpset.SENDNAME.Length > 35) + r.WriteLine("NAD+FW+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME.Substring(0, 35) + "+" + ftpset.SENDNAME.Substring(35) + "'"); + else + r.WriteLine("NAD+FW+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME + "'"); + icount++; + + + #region 通知人 + if (isbill != 1) + { + if (billams.BYCOUNTRY != "") + Shipping = formatEdiStr("txt", billams.AMSNOTIFYPARTY); + else + Shipping = formatEdiStr("txt", bill.NOTIFYPARTY); + } + else Shipping = formatEdiStr("txt", OpBill.NOTIFYPARTY); + ShippingList = formatlengthStr(Shipping, 35); + var DescriptionNotifyparty = ""; + if (ShippingList.Count != 0 && Shipping.Length > 0) + { + for (var i = 0; i < ShippingList.Count; i++) + { - if (i == 0) Shipping = "NAD+NI+++" + ShippingList[0] + "+"; + + if (i == 0) Shipping = "NAD+N1+++" + ShippingList[0] + "+"; + if (i == 1) Shipping = Shipping + ShippingList[i]; + if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i]; + if (i >= 4 && ShippingList.Count > 5) + { + if (i == 4) + { + if (ShippingList[i].Length > 32) + { + Shipping = Shipping + ":" + ShippingList[i].Substring(0, 32); + DescriptionNotifyparty = ShippingList[i].Substring(32); + } + else + Shipping = Shipping + ":" + ShippingList[i]; + Shipping = Shipping + "***"; + DescriptionNotifyparty = "***" + DescriptionNotifyparty; + } + else if (i > 4) + { + DescriptionNotifyparty = DescriptionNotifyparty + " " + ShippingList[i]; + } + } + else + if (i == 4) Shipping = Shipping + ":" + ShippingList[i]; + } + } + + if (billams.BYCOUNTRY == "USA") + { + Shipping = Shipping + "+++" + billams.NOTIFYPARTYPOSTCODE; + r.WriteLine(Shipping + "'"); + } + else if (billams.BYCOUNTRY == "BRAZIL") + { + if (billams.NOTIFYPARTYCOUNTRY != "") + Shipping = Shipping + "++++" + billams.NOTIFYPARTYCOUNTRY; + r.WriteLine(Shipping + "'"); + if (billams.NOTIFYPARTYTAXNO != "") + { + r.WriteLine("RFF+GN:" + billams.NOTIFYPARTYTAXNO + "'"); + icount++; + } + } + else r.WriteLine(Shipping + "'"); + icount++; + #endregion + + #region 承运公司/人 - // r.WriteLine("NAD+CA+" + carrier + ":160:86++" + bill.CARRIER + "'"); - if (ftpset.SENDNAME.Length > 35) - r.WriteLine("NAD+BA+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME.Substring(0, 35) + "+" + ftpset.SENDNAME.Substring(35) + "'"); - else - r.WriteLine("NAD+BA+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME + "'"); - //r.WriteLine("CTA+IC+:" + billams.ATTN + "'"); - //r.WriteLine("COM+" + billams.ATTNTEL + ":TE'"); - //r.WriteLine("COM+" + billams.ATTNEMAIL + ":EM'"); - if (dsUserOp != null) - { - if (dsUserOp.Tables[0].Rows.Count > 0) - { - r.WriteLine("CTA+IC+:" + dsUserOp.Tables[0].Rows[0]["USERNAME"].ToString().Trim() + "'"); - r.WriteLine("COM+" + dsUserOp.Tables[0].Rows[0]["OFFICEPHONE"].ToString().Trim() + ":TE'"); - r.WriteLine("COM+" + dsUserOp.Tables[0].Rows[0]["EMAIL1"].ToString().Trim() + ":EM'"); + //if (ftpset.SENDNAME.Length > 35) + + // r.WriteLine("NAD+BA+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME.Substring(0, 35) + "+" + ftpset.SENDNAME.Substring(35) + "'"); + + //else + + // r.WriteLine("NAD+BA+" + ftpset.SENDCOMPANYCODE + ":160:86++" + ftpset.SENDNAME + "'"); + + //icount = icount + 2; + + + + - icount = icount + 5; - } - } #endregion + + #region 签单方式 + if (bill.ISSUETYPE == "正本") + { + r.WriteLine("DOC+706+++" + GetBillNum(bill.NOBILL) + "'"); + icount++; + } + else if (bill.ISSUETYPE == "海运单" || bill.ISSUETYPE == "WAYBILL" || bill.ISSUETYPE == "Seaway" || bill.ISSUETYPE == "SWB正本" || bill.ISSUETYPE == "SWB无正本") + { + r.WriteLine("DOC+710+++" + GetBillNum(bill.NOBILL) + "'"); + icount++; + } + else if (bill.ISSUETYPE == "BILL COPY" || bill.ISSUETYPE == "电放" || bill.ISSUETYPE == "正副本") + { + r.WriteLine("DOC+706+++" + GetBillNum(bill.NOBILL) + "'"); + icount++; + } + else if (bill.ISSUETYPE == "HOUSE BILL") + { + r.WriteLine("DOC+714+++" + GetBillNum(bill.NOBILL) + "'"); + icount++; + } + #endregion + + //判断集装箱是否包含分箱明细 + string slSQL = "select count(*) as inum from op_ctn_detail where CTN_ID in (select CTN_ID from op_ctn where bsno='" + bill.BSNO.ToString() + "')"; + int inum = int.Parse(T_ALL_DA.GetStrSQL("inum", slSQL)); + if (inum < 1) + { + #region 取委托单货描、唛头信息 + if (isbill != 1) + { + r.WriteLine("GID+1+" + bill.PKGS.ToString() + ":" + GetPackageEDICode(bill.KINDPKGS, "EVERGREEN").Trim() + "::6:" + bill.KINDPKGS + "'"); + } + else + { + r.WriteLine("GID+1+" + OpBill.PKGS.ToString() + ":" + GetPackageEDICode(OpBill.KINDPKGS, "EVERGREEN").Trim() + "::6:" + OpBill.KINDPKGS + "'"); + } + icount = icount + 1; + + if (bill.HSCODE != "") + { + r.WriteLine("PIA+5+" + bill.HSCODE + ":HS'"); + icount = icount + 1; + } + + if (isbill != 1) + { + Shipping = formatEdiStr("txt", bill.DESCRIPTION); + } + else Shipping = formatEdiStr("txt", OpBill.DESCRIPTION); + Shipping = Shipping.Replace("\n", "\\"); + Shipping = Shipping.Replace("\r", " "); + + var tmpdescription = ""; + + List DescriptionListAll = new List(); + string[] DescriptionList = Shipping.Split('\\'); + if (DescriptionList.Length != 0) + { + for (var i = 0; i < DescriptionList.Length; i++) + { + if (DescriptionList[i] != "") + { - r.WriteLine("FTX+AAA+++" + DescriptionList[i] + "'"); - icount = icount + 1; + + if ((tmpdescription.Length + DescriptionList[i].Length + 1) > 512) + + { + + DescriptionListAll.Add(tmpdescription); + + tmpdescription = DescriptionList[i]; + + } + + else + + { + + tmpdescription = tmpdescription + " " + DescriptionList[i]; + + + + } + } + + } + + } + + if (!string.IsNullOrEmpty(tmpdescription)) + + { + + DescriptionListAll.Add(tmpdescription); + + } + + + + if (DescriptionListAll.Count != 0) + + { + + foreach (var description in DescriptionListAll) + + { + + r.WriteLine("FTX+AAA+++" + description + "'"); + + icount++; + + + } + + + } + + + + + if (DescriptionShipper != "") + + { + + if (DescriptionShipper != "") + + { + + r.WriteLine("FTX+AAA+++" + DescriptionShipper + "'"); + + icount++; + + } + + } + + if (DescriptionConsignee != "") + + { + + if (DescriptionConsignee != "") + + { + + r.WriteLine("FTX+AAA+++" + DescriptionConsignee + "'"); + + icount++; + + } + + } + + if (DescriptionNotifyparty != "") + { - r.WriteLine("FTX+AAA+++" + DescriptionShipper + "'"); - icount = icount + 1; + if (DescriptionNotifyparty != "") + + { + + r.WriteLine("FTX+AAA+++" + DescriptionNotifyparty + "'"); + + icount++; + + } + + } + - } - if (DescriptionConsignee != "") - { + //if (isbill != 1) - r.WriteLine("FTX+AAA+++" + DescriptionConsignee + "'"); - icount = icount + 1; + //{ + // r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + "'"); + + // r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + "'"); + + //} + + //else + + //{ + + // r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(OpBill.KGS, 3) + "'"); + + // r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(OpBill.CBM, 3) + "'"); + + //} + + //icount = icount + 2; - } - if (DescriptionNotifyparty != "") - { - r.WriteLine("FTX+AAA+++" + DescriptionNotifyparty + "'"); - icount = icount + 1; - } - if (isbill != 1) - { - r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + "'"); - r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + "'"); - } - else - { - r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(OpBill.KGS, 3) + "'"); - r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(OpBill.CBM, 3) + "'"); - } - icount = icount + 2; if (billams.GOODSNCM != "") + { + r.WriteLine("RFF+ABT:" + billams.GOODSNCM + "'"); + icount = icount + 1; + + } + + + if (isbill != 1) + { + Shipping = formatEdiStr("txt", bill.MARKS); + } + else Shipping = formatEdiStr("txt", OpBill.MARKS); + Shipping = Shipping.Replace("\n", "\\"); + Shipping = Shipping.Replace("\r", " "); + string[] MarksList = Shipping.Split('\\'); + if (MarksList.Length != 0) + { + + for (var i = 0; i < MarksList.Length; i++) + { + r.WriteLine("PCI++" + MarksList[i] + "'"); + icount = icount + 1; + + } + } + + if (isbill != 1) + { + Shipping = bill.BSNO; + } + else Shipping = OpBill.AS_ID; - var ctnsumlist2 = MsOpSeaeDAL.MsOpSeaeDAL.GetBodyList("BSNO='" + Shipping + "'"); - foreach (var ctn in ctnsumlist2) - { - r.WriteLine("SGP+" + ctn.CNTRNO + "+" + ctn.PKGS.ToString() + "'"); - r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(ctn.KGS, 3) + "'"); - r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(ctn.CBM, 3) + "'"); - icount = icount + 3; - } + + //var ctnsumlist2 = MsOpSeaeDAL.MsOpSeaeDAL.GetBodyList("BSNO='" + Shipping + "'"); + + //foreach (var ctn in ctnsumlist2) + + //{ + + // r.WriteLine("SGP+" + ctn.CNTRNO + "+" + ctn.PKGS.ToString() + "'"); + + // r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(ctn.KGS, 3) + "'"); + + // r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(ctn.CBM, 3) + "'"); + + // icount = icount + 3; + + //} + #endregion + } + else + { + #region 取集装箱分箱_货描、唛头信息 + string lsSQL = "SELECT HSCODE,KINDPKGS,DESCRIPTION,isnull(sum(PKGS),0) as PKGS,isnull(sum(KGS),0) as KGS,isnull(sum(CBM),0) as CBM from op_ctn_detail where CTN_ID in (select CTN_ID from op_ctn where bsno='" + bill.BSNO.ToString() + "') GROUP BY HSCODE,KINDPKGS,DESCRIPTION"; + DataSet dsHSCODE = T_ALL_DA.GetAllSQL(lsSQL); + if (dsHSCODE != null) + { + if (dsHSCODE.Tables[0].Rows.Count > 0) + { + for (int i = 0; i < dsHSCODE.Tables[0].Rows.Count; i++) + { + //GID+1+400:CT::6:CARTONS' + r.WriteLine("GID+" + (i + 1) + "+" + dsHSCODE.Tables[0].Rows[i]["PKGS"].ToString() + ":" + GetPackageEDICode(dsHSCODE.Tables[0].Rows[i]["KINDPKGS"].ToString(), "MAERSK") + "::6:" + dsHSCODE.Tables[0].Rows[i]["KINDPKGS"].ToString() + "'"); + icount++; + //PIA+5+HS_CODE1:HS' + r.WriteLine("PIA+5+" + dsHSCODE.Tables[0].Rows[i]["HSCODE"].ToString() + ":HS'"); + icount++; + //FTX+AAA+++MATERIAL 1' + //FTX+AAA+++HS-NO 39023012' + Shipping = formatEdiStr("txt", dsHSCODE.Tables[0].Rows[i]["DESCRIPTION"].ToString()); + Shipping = Shipping.Replace("\n", "\\"); + Shipping = Shipping.Replace("\r", " "); + string[] DescriptionList = Shipping.Split('\\'); + if (DescriptionList.Length != 0) + { + for (var j = 0; j < DescriptionList.Length; j++) + { + r.WriteLine("FTX+AAA+++" + DescriptionList[j] + "'"); + icount++; + } + } + //MEA+AAE+WT+KGM:3000' + //MEA+AAE+AAW+MTQ:110.11' + r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(Decimal.Parse(dsHSCODE.Tables[0].Rows[i]["KGS"].ToString()), 3) + "'"); + icount++; + r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Decimal.Parse(dsHSCODE.Tables[0].Rows[i]["CBM"].ToString()), 3) + "'"); + icount++; + //PCI++MARKS AND NUMBERS:FOR MATERIAL 1: OUR PONUMBER: PO_123456' + if (isbill != 1) + { + Shipping = formatEdiStr("txt", bill.MARKS); + } + else + { + Shipping = formatEdiStr("txt", OpBill.MARKS); + } + Shipping = Shipping.Replace("\n", "\\"); + Shipping = Shipping.Replace("\r", " "); + string[] MarksList = Shipping.Split('\\'); + if (MarksList.Length != 0) + { + for (var j = 0; j < MarksList.Length; j++) + { + r.WriteLine("PCI++" + MarksList[j] + "'"); + icount++; + } + } + if (billams.GOODSNCM != "") + { + r.WriteLine("RFF+ABT:" + billams.GOODSNCM + "'"); + icount++; + } + // - lsSQL = "SELECT c.CTNALL,c.CNTRNO,c.SEALNO,d.PKGS,d.KINDPKGS,d.KGS,d.CBM,d.HSCODE,d.[DESCRIPTION] from op_ctn as c INNER JOIN op_ctn_detail as d on c.CTN_ID=d.CTN_ID where d.HSCODE='" + dsHSCODE.Tables[0].Rows[i]["HSCODE"].ToString() + "' and d.KINDPKGS='" + dsHSCODE.Tables[0].Rows[i]["KINDPKGS"].ToString() + "' and d.DESCRIPTION='" + dsHSCODE.Tables[0].Rows[i]["DESCRIPTION"].ToString() + "' order by c.CTNCODE,d.[ID]"; - DataSet dsCNTRNO = T_ALL_DA.GetAllSQL(lsSQL); - if (dsCNTRNO != null) - { - if (dsCNTRNO.Tables[0].Rows.Count > 0) - { - for (int n = 0; n < dsCNTRNO.Tables[0].Rows.Count; n++) - { - //SGP+MSCU1234567+100' - r.WriteLine("SGP+" + dsCNTRNO.Tables[0].Rows[n]["CNTRNO"].ToString() + "+" + dsCNTRNO.Tables[0].Rows[n]["PKGS"].ToString() + "'"); - //MEA+AAE+WT+KGM:1000' - r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(Decimal.Parse(dsCNTRNO.Tables[0].Rows[n]["KGS"].ToString()), 3) + "'"); - //MEA+AAE+AAW+MTQ:50.11' - r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Decimal.Parse(dsCNTRNO.Tables[0].Rows[n]["CBM"].ToString()), 3) + "'"); - icount = icount + 3; - } - } - } + + //lsSQL = "SELECT c.CTNALL,c.CNTRNO,c.SEALNO,d.PKGS,d.KINDPKGS,d.KGS,d.CBM,d.HSCODE,d.[DESCRIPTION] from op_ctn as c INNER JOIN op_ctn_detail as d on c.CTN_ID=d.CTN_ID where d.HSCODE='" + dsHSCODE.Tables[0].Rows[i]["HSCODE"].ToString() + "' and d.KINDPKGS='" + dsHSCODE.Tables[0].Rows[i]["KINDPKGS"].ToString() + "' and d.DESCRIPTION='" + dsHSCODE.Tables[0].Rows[i]["DESCRIPTION"].ToString() + "' order by c.CTNCODE,d.[ID]"; + + //DataSet dsCNTRNO = T_ALL_DA.GetAllSQL(lsSQL); + + //if (dsCNTRNO != null) + + //{ + + // if (dsCNTRNO.Tables[0].Rows.Count > 0) + + // { + + // for (int n = 0; n < dsCNTRNO.Tables[0].Rows.Count; n++) + + // { + + // //SGP+MSCU1234567+100' + + // r.WriteLine("SGP+" + dsCNTRNO.Tables[0].Rows[n]["CNTRNO"].ToString() + "+" + dsCNTRNO.Tables[0].Rows[n]["PKGS"].ToString() + "'"); + + // //MEA+AAE+WT+KGM:1000' + + // r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(Decimal.Parse(dsCNTRNO.Tables[0].Rows[n]["KGS"].ToString()), 3) + "'"); + + // //MEA+AAE+AAW+MTQ:50.11' + + // r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Decimal.Parse(dsCNTRNO.Tables[0].Rows[n]["CBM"].ToString()), 3) + "'"); + + // icount = icount + 3; + + // } + + // } + + //} + } + } + } + #endregion + } + + #region 集装箱 主箱循环 + if (isbill != 1) + { + Shipping = bill.BSNO; + } + else Shipping = OpBill.AS_ID; + var ctnsumlist = MsOpSeaeDAL.MsOpSeaeDAL.GetBodyList("BSNO='" + Shipping + "'"); + foreach (var ctn in ctnsumlist) + { + if (bill.ISCONTAINERSOC) + r.WriteLine("EQD+CN+" + ctn.CNTRNO + "+" + GetCtnEDICode(ctn.CTNALL, "EVERGREEN") + "+1'"); + else + r.WriteLine("EQD+CN+" + ctn.CNTRNO + "+" + GetCtnEDICode(ctn.CTNALL, "EVERGREEN") + "+2'"); - r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(ctn.KGS, 3) + "'"); - r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(ctn.CBM, 3) + "'"); + + r.WriteLine("TMD+3'"); + + icount++; + + r.WriteLine("MEA+WT+AAL+KGM:" + Math.Round(ctn.KGS, 3) + "'"); + + r.WriteLine("MEA+VOL+AAW+MTQ:" + Math.Round(ctn.CBM, 3) + "'"); + + r.WriteLine("MEA+AAU++" + GetPackageEDICode(ctn.KINDPKGS, "EVERGREEN") + ":" + ctn.PKGS.ToString() + "'"); + icount = icount + 3; + + if (bill.CARGOID == "R") + { + if (bill.REEFERF != "") + { + r.WriteLine("MEA+AAE+AAS+CBM:" + bill.REEFERF + "'"); + icount = icount + 1; + } + } + r.WriteLine("SEL+" + ctn.SEALNO + "+CA'"); + icount = icount + 1; + + if (bill.CARGOID == "R") + { + r.WriteLine("TMP+2+" + bill.TEMPSET + ":CEL'"); + icount = icount + 1; + } + if (bill.CARGOID == "D") + { + r.WriteLine("DGS+IMD+" + bill.DCLASS + "+" + bill.DUNNO + "'"); + r.WriteLine("CTA+HG+:" + billams.ATTN + "'"); + r.WriteLine("COM+" + billams.ATTNTEL + ":TE'"); + icount = icount + 3; + } + } + #endregion + } + r.WriteLine("UNT+" + icount.ToString() + "+" + bsno + "'"); + r.WriteLine("UNZ+" + headData.Count.ToString() + "+" + bsno + "'"); + r.Close(); + f.Close(); + + return filename; + } + #endregion + + #endregion diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyIndex.js index fb0b20f1..f040cdaf 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyIndex.js @@ -1720,7 +1720,7 @@ Ext.extend(Shipping.MsOpApplyIndex, Ext.Panel, { // scope: this //}); //this.onRefreshSumClick(_this.sqlcontext); - this.getPageData(sqlcontext); + this.getPageData(this.sqlcontext); this.storeList.on('beforeload', function (store) { diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js index 8938dcd1..3a103940 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js @@ -167,7 +167,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { //this.storeOpCode4.loadData(astoreOpCode.data.items); this.storeOpCode5.loadData(astoreOpCode.data.items); this.storeOpCode6.loadData(astoreOpCode.data.items); - + this.storeOpCode7.loadData(astoreOpCode.data.items); } /* @@ -208,7 +208,7 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人 }, this); - //海外操作 + //订舱中心 this.storeOpCode6.on('beforeload', function (store) { var sql = " u.GID IN (SELECT USERID FROM user_userattribute WHERE ATTRIBUTEID='31AC11C1-D005-46EC-A0EE-05BC211AE1B7' and VALUE='true' ) "; @@ -228,6 +228,15 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人 }, this); + //海外操作 + this.storeOpCode7.on('beforeload', + function (store) { + var sql = " u.GID IN (SELECT USERID FROM user_userattribute WHERE ATTRIBUTEID='31AC11C1-D005-46EC-A0EE-05BC211AE1B7' and VALUE='true' ) "; + Ext.apply(store.proxy.extraParams, { + condition: sql + }); + }, + this); //客服 @@ -291,8 +300,8 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人 }); this.comboxOP_OVERSEA = Ext.create('DsExt.ux.RefTableCombox', { - fieldLabel: Zi.LAN.OP_OVERSEA, //'操 作', - store: this.storeOpCode6, + fieldLabel: Zi.LAN.OP_OVERSEA, //'海外操作', + store: this.storeOpCode7, forceSelection: true, queryMode: 'remote', minChars: 0, @@ -13925,7 +13934,9 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人 _this.onSendINTTR(FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, CARRIER.CARRIER, IsNADFW, Ext.getCmp('tbNADFWID').getValue().toString(), Ext.getCmp('tbNADFW').getValue().toString()); } - + if (jsonresult.Message != "数据保存成功") { + Ext.Msg.show({ title: Zi.LAN.JingGao, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + } } else { Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); @@ -14189,8 +14200,9 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人 } } this.tabSeaepanel.doLayout(); - - + if (jsonresult.Message != "数据保存成功") { + Ext.Msg.show({ title: Zi.LAN.JingGao, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + } } else { Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); @@ -16461,7 +16473,7 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人 CodeAndName: data.OP_OVERSEA }); - this.storeOpCode6.add(recordCustCode); + this.storeOpCode7.add(recordCustCode); } var BLTYPE = this.formHead.getForm().findField('BLTYPE').getValue(); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js index a7f4f2ae..e31a50be 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js @@ -13601,7 +13601,7 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要修改的业务! return; } else { - + var _this = this; Ext.MessageBox.confirm(Zi.LAN.TiShi, '确定要批量修改【' + records.length + '】条数据吗?', function (btn) { if (btn == 'yes') { @@ -13617,7 +13617,7 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { //var rangeUser = [op, inputby, doc, orderop, custservice] //canedit = DsStoreExistsList(_this.StoreOpRange, 'OPID', rangeUser) - var mrecords = DsStoreQueryBy(this.StoreOpRange, 'OPID', op); + var mrecords = DsStoreQueryBy(_this.StoreOpRange, 'OPID', op); if (mrecords.getCount() > 0) { rec.data.SHIPPER = ''; @@ -13627,7 +13627,7 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { rec.data.DESCRIPTION = ''; bodyAddDatas.push(rec); } else { - var recordins = DsStoreQueryBy(this.StoreOpRange, 'OPID', inputby); + var recordins = DsStoreQueryBy(_this.StoreOpRange, 'OPID', inputby); if (recordins.getCount() > 0) { rec.data.SHIPPER = ''; rec.data.CONSIGNEE = ''; @@ -13646,9 +13646,8 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { } - var data = this.formModify.getForm().getValues(); + var data = _this.formModify.getForm().getValues(); - _this = this; if (bodyAddDatas.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoXiuGaiDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; @@ -13686,7 +13685,7 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, - scope: this + scope: _this }); } } diff --git a/DSWeb/Web.config b/DSWeb/Web.config index cd2d6a92..6453b1a9 100644 --- a/DSWeb/Web.config +++ b/DSWeb/Web.config @@ -96,14 +96,14 @@ --> - - --> - + +