diff --git a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs index 592c9a21..4dffbbbf 100644 --- a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs @@ -4869,11 +4869,18 @@ namespace DSWeb.Areas.CommMng.DAL public static string DicToStr(Dictionary dic) { var result = ""; - - foreach (var item in dic) + if (dic != null) { - result += item.Key + "::" + item.Value + ";;"; + foreach (var item in dic) + { + result += item.Key + "::" + item.Value + ";;"; + } } + else + { + + } + return result; } @@ -4914,7 +4921,7 @@ namespace DSWeb.Areas.CommMng.DAL return result; } - public static void SaveLogicInfo(string BSNO, string PROPNAME, Dictionary InfoDic) + public static void SaveLogicInfo(string BSNO, string PROPNAME, Dictionary InfoDic=null) { CommonDataContext cdc = new CommonDataContext(); @@ -6770,5 +6777,6 @@ namespace DSWeb.Areas.CommMng.DAL return stringBuilder.ToString(); } + } } \ No newline at end of file diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs index ab0a5b69..5d168e94 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs @@ -14513,6 +14513,45 @@ namespace DSWeb.MvcShipping.Controllers } #endregion + #region 推送港联顺费用 + public ContentResult SendGLSFee(string BSNO) + { + + var result = new DBResult(); + + result = MsOpSeaeDAL.CanSendGLSFee(); + var _result = BasicDataRefDAL.GetContentResult(result); + if (!result.Success) { + return _result; + } + + var data = MsOpSeaeDAL.SendGLSFee(BSNO, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + result.OK("获取成功", data); + + _result = BasicDataRefDAL.GetContentResult(result); + return _result; + } + + public ContentResult DoSendGLSFee(string BSNO,string GIDs) + { + + var result = new DBResult(); + + result = MsOpSeaeDAL.CanSendGLSFee(); + var _result = BasicDataRefDAL.GetContentResult(result); + if (!result.Success) + { + return _result; + } + + result = MsOpSeaeDAL.DoSendGLSFee(BSNO, GIDs, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + //result.OK("发送成功"); + + _result = BasicDataRefDAL.GetContentResult(result); + return _result; + } + #endregion + public ContentResult PiLiangZhengPiaoTiJiao(string bsno, int statusvalue) { string message = ""; diff --git a/DSWeb/Areas/MvcShipping/DAL/MsChFee/MsChFeeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsChFee/MsChFeeDAL.cs index 46cb4f2c..35059bd8 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsChFee/MsChFeeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsChFee/MsChFeeDAL.cs @@ -5697,7 +5697,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL public static string getfeename(string feeename, Database db, DbTransaction tran) { var feename = ""; - string sql2 = "select top 1 [FEENAME] from code_fee_edi where [FEEENAME]='" + feeename + "'"; + string sql2 = "select top 1 [FEENAME] from code_fee_edi where [FEEENAME]='" + feeename + "' and isnull(EDINAME,'')=''"; var blno = db.ExecuteScalar(tran,CommandType.Text, sql2); if (blno == DBNull.Value || blno == null) { diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs index 7ca48cb9..a0d70f9e 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs @@ -63,8 +63,11 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi return SetData(strSql); } - - + public static List GetCustListByName(string CUSTOMERNAME, string EDINAME) { + var condition = $"code_cust_edi.CUST='{CUSTOMERNAME}' and EDINAME='{EDINAME}'"; + var result = GetCustList(condition); + return result; + } static public List GetPkgsList(string strCondition, string sort = null) { @@ -190,8 +193,8 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi { var strSql = new StringBuilder(); strSql.Append("SELECT "); - strSql.Append("ID as GID,FEENAME as CTN,FEEENAME EDICODE,'' EDINAME,'' REMARK"); - strSql.Append(",'' as EDINAMEREF,'' PORTID"); + strSql.Append("ID as GID,FEENAME as CTN,FEEENAME EDICODE, EDINAME,'' REMARK"); + strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97012 and EnumValueID=code_fee_edi.EDINAME) EDINAMEREF,'' PORTID"); strSql.Append(" from code_fee_edi where 1=1 "); if (!string.IsNullOrEmpty(strCondition)) { @@ -269,6 +272,21 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi return headList; } + public static Dictionary GetFeeNameDicByName( string EDINAME) + { + var result = new Dictionary(); + var condition = $" EDINAME='{EDINAME}'"; + var namelist = GetFeeNameList(condition); + + if (namelist != null && namelist.Count > 0) { + foreach (var item in namelist) { + result.Add(item.CTN, item.EDICODE); + } + } + + return result; + } + static public List GetAFRList(string strCondition, string sort = null) { var strSql = new StringBuilder(); @@ -1164,12 +1182,12 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi { var cmdInsert = db.GetSqlStringCommand( - @"insert into code_fee_edi (FEENAME,FEEENAME) - values (@CTN,@EDICODE) "); + @"insert into code_fee_edi (FEENAME,FEEENAME,EDINAME) + values (@CTN,@EDICODE,@EDINAME) "); var cmdUpdate = db.GetSqlStringCommand( - @"update code_fee_edi set FEENAME=@CTN,FEEENAME=@EDICODE where ID=@GID "); + @"update code_fee_edi set FEENAME=@CTN,FEEENAME=@EDICODE,EDINAME=@EDINAME where ID=@GID "); if (bodyList != null) { @@ -1181,6 +1199,7 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi cmdInsert.Parameters.Clear(); db.AddInParameter(cmdInsert, "@CTN", DbType.String, enumValue.CTN); db.AddInParameter(cmdInsert, "@EDICODE", DbType.String, enumValue.EDICODE); + db.AddInParameter(cmdInsert, "@EDINAME", DbType.String, enumValue.EDINAME); db.ExecuteNonQuery(cmdInsert, tran); } else @@ -1190,6 +1209,7 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi db.AddInParameter(cmdUpdate, "@GID", DbType.String, enumValue.GID); db.AddInParameter(cmdUpdate, "@CTN", DbType.String, enumValue.CTN); db.AddInParameter(cmdUpdate, "@EDICODE", DbType.String, enumValue.EDICODE); + db.AddInParameter(cmdUpdate, "@EDINAME", DbType.String, enumValue.EDINAME); db.ExecuteNonQuery(cmdUpdate, tran); } } @@ -1199,12 +1219,12 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi tran.Commit(); } - catch (Exception) + catch (Exception e) { tran.Rollback(); result.Success = false; - result.Message = "保存出现错误,请重试或联系系统管理员"; + result.Message = $"保存出现错误[{e.Message}],请重试或联系系统管理员"; return result; } diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs index 222e90be..b4aa4401 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs @@ -39,6 +39,9 @@ using System.Linq; using DSWeb.MvcShipping.DAL.MsCompanysDAL; using DSWeb.MvcShipping.Helper; using DSWeb.Areas.MvcShipping.Comm; +using DSWeb.Areas.MvcShipping.DB; +using Org.BouncyCastle.Bcpg; +using DSWeb.MvcShipping.DAL.MsCodeCtnEdi; namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL { @@ -7814,5 +7817,298 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL } } } + + /// + /// 判断能否发送港联顺费用信息 + /// 1看code_cust_edi当中是否有ediname=GLSFEE的信息 + /// 2看code_fee_edi当中是否有ediname=GLSFEE的信息 + /// + /// + static public DBResult CanSendGLSFee() { + var result = new DBResult(); + result.OK(); + var custList = MsCodeCtnEdiDAL.GetCustList($" EDINAME='GLSFEE'"); + if (custList == null || custList.Count == 0) { + result.SetErrorInfo("请在【参数设置-EDI代码设置-往来单位】当中,增加[EDI类别]为 港联顺接口 的信息,客户名称选择含义为港联顺的往来单位。"); + return result; + } + + var feenameList = MsCodeCtnEdiDAL.GetFeeNameList($" EDINAME='GLSFEE'"); + if (feenameList == null || feenameList.Count == 0) + { + result.SetErrorInfo("请在【参数设置-EDI代码设置-费用名称】当中,增加[EDI类别]为 港联顺接口 的信息,以对应系统内的费用名称和港联顺的费用名称。"); + return result; + } + + var url = MsSysParamSetDAL.GetSysParamValue("GLSFEE_URL"); + if (string.IsNullOrWhiteSpace(url)) { + result.SetErrorInfo("请在【参数设置-业务参数设置】当中,增加[GLSFEE_URL 港联顺费用推送URL]并填写地址。"); + return result; + } + + var key = MsSysParamSetDAL.GetSysParamValue("GLSFEE_KEY"); + if (string.IsNullOrWhiteSpace(key)) + { + result.SetErrorInfo("请在【参数设置-业务参数设置】当中,增加[GLSFEE_KEY 港联顺费用推送KEY]并填写数据。"); + return result; + } + + return result; + } + + static public List SendGLSFee(string BSNO,string userid, string username, string copmpanyid) + { + var result = new List(); + var headList = GetDataList("BSNO IN (" + BSNO + ")", userid, username, copmpanyid); + + var feeheadlist = GetGLSFEEHeadList(headList, userid, username, copmpanyid); + + if (feeheadlist.Count > 0) { + foreach(var item in feeheadlist) { + var newrecList = item.getFeeInfo(); + result.AddRange(newrecList); + } + } + + return result; + } + + private static List GetGLSFEEHeadList(List headlist, string userid, string username, string copmpanyid) + { + var result = new List(); + if (headlist != null && headlist.Count > 0) { + foreach (var item in headlist) { + var newhead = new GLSFEEHead(item, userid, username, copmpanyid); + if(newhead.billInfoList!=null && newhead.billInfoList.Count>0) + result.Add(newhead); + } + } + return result; + } + + static public DBResult DoSendGLSFee(string BSNO, string GIDs, string userid, string username, string copmpanyid) + { + var result = new DBResult(); + var headList = GetDataList("BSNO IN (" + BSNO + ")", userid, username, copmpanyid); + var url= MsSysParamSetDAL.GetSysParamValue("GLSFEE_URL"); + var key = MsSysParamSetDAL.GetSysParamValue("GLSFEE_KEY"); + + var GLSFeelist = GetGLSFEEHeadList(headList, userid, username, copmpanyid); + + var feeidList = GIDs.Split(',').ToList(); + + if (GLSFeelist == null || GLSFeelist.Count == 0) { + return result.SetErrorInfo($"没有需要推送的费用"); + } + + //var errorFeeName = ""; + //if (GLSFeelist.Exists(x => x.billInfoList.Exists(y => y.feeItem == ""))) { + // var errorList = GLSFeelist.Where(x => x.billInfoList.Exists(y => y.feeItem == "")); + + // foreach (var errorhead in errorList) + // { + // var errorfeeList = errorhead.billInfoList.Where(y => y.feeItem == ""); + // foreach (var errorfee in errorfeeList) + // { + // if (errorFeeName.IndexOf(errorfee.FEENAME) < 0) + // { + // if (errorFeeName != "") errorFeeName += ","; + // errorFeeName += errorfee.FEENAME; + // } + // } + // } + //} + //if (errorFeeName!="") { + // return result.SetErrorInfo($"费用名称[{errorFeeName}]没有在EDI代码设置中配置对应的费用名称"); + //} + + try + { + foreach (var item in GLSFeelist) { + + //清除掉未选中的费用; + for (var i = item.billInfoList.Count - 1; i < 0; i--) { + var fee = item.billInfoList[i]; + if (feeidList.Contains(fee.GID)) + { + + } + else { + item.billInfoList.RemoveAt(i); + } + } + item.key = key; + + var strSendObj = JsonConvert.Serialize(item); + + BasicDataRefDAL.SaveLog(strSendObj, "", "港联顺费用推送", "发送"); + + var rtn = WebRequestHelper.DoPost(url, strSendObj, timeout: 50000); + BasicDataRefDAL.SaveLog(rtn, "", "港联顺费用推送", "返回"); + //log.Debug($"发送vgm返回:{rtn}"); + var jobjRtn = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(rtn, new { code = "0", subCode = false, msg = string.Empty, ok = true, data = string.Empty }); + if (!jobjRtn.ok) + { + return result.SetErrorInfo($"港联顺费用推送错误:{jobjRtn.code + ":" + jobjRtn.msg}"); + } + else { + //记录chfee发送结果 + foreach (var fee in item.billInfoList) { + BasicDataRefDAL.SaveLogicInfo(fee.GID, "港联顺费用推送"); + } + + } + + result.OK("发送完成"); + } + } + catch (Exception e) { + result.SetErrorInfo(e.Message); + } + + return result; + } + } + + public class GLSFEEHead + { + public string key { get; set; } + public string mbl { get; set; } + public string vessel { get; set; } + public string voyage { get; set; } + public string placeStart { get; set; } + public string placeEnd { get; set; } + public string etd { get; set; } + public string cartonInfo { get; set; } + public string goodsName { get; set; } + public string number { get; set; } = "0"; + public string grossWeight { get; set; } = "0"; + public string volume { get; set; } = "0"; + public string remark { get; set; } + public List billInfoList { get; set; } = new List(); + + public GLSFEEHead() { } + public GLSFEEHead(MsOpSeae head,string userid,string username,string companyid) + { + var CUSTOMERNAME = ""; + var CUSTOMERNAMEInfo= MsCodeCtnEdiDAL.GetCustList($" EDINAME='GLSFEE'"); + if (CUSTOMERNAMEInfo != null && CUSTOMERNAMEInfo.Count > 0) { + CUSTOMERNAME = CUSTOMERNAMEInfo[0].CTN; + } + + var chfeeCondition = $" CUSTOMERNAME='{CUSTOMERNAME}' and BSNO='{head.BSNO}' and not exists(select 1 from OP_LOGICINFO where BSNO=ch_fee.GID and PROPNAME='港联顺费用推送') "; + var 应收费用List = MsChFeeDAL.MsChFeeDAL.GetDataList(chfeeCondition + " and feetype=1 ", 1, "op_seae", userid, username, companyid); + var 应付费用List = MsChFeeDAL.MsChFeeDAL.GetDataList(chfeeCondition + " and feetype=2 ", 2, "op_seae", userid, username, companyid); + + var feenamedic = MsCodeCtnEdiDAL.GetFeeNameDicByName("GLSFEE"); + + mbl = head.MBLNO; + vessel = head.VESSEL; + voyage = head.VOYNO; + placeStart = head.PORTLOAD; + placeEnd = head.DESTINATION; + etd = head.ETD; + cartonInfo = head.CNTRTOTAL; + goodsName = head.GOODSNAME; + number = head.PKGS; + grossWeight = head.KGS; + volume = head.CBM; + billInfoList=new List(); + if (应收费用List != null && 应收费用List.Count > 0) + { + foreach (var item in 应收费用List) { + var newfee = new GLSFEE(item, feenamedic); + billInfoList.Add(newfee); + } + } + if (应付费用List != null && 应付费用List.Count > 0) + { + foreach (var item in 应付费用List) + { + var newfee = new GLSFEE(item, feenamedic); + billInfoList.Add(newfee); + } + } + } + public List getFeeInfo() { + var result = new List(); + if (billInfoList!=null && billInfoList.Count>0) + { + foreach (var item in billInfoList) { + var newrec = new GLSFEEINFO(this); + //newrec.CUSTOMERNAME = CUSTOMERNAME; + newrec.GID = item.GID; + newrec.FEENAME = item.feeItem; + newrec.FEETYPEREF = item.feeType; + newrec.AMOUNT = item.totalPrice; + newrec.CURRENT = item.currency; + result.Add(newrec); + } + } + return result; + } + } + + public class GLSFEE + { + public string feeType { get; set; } + public string feeItem { get; set; } + public string FEENAME { get; set; } + public string GID { get; set; } + public string currency { get; set; } + public decimal? quantity { get; set; } + public string unit { get; set; } + public decimal? unitPrice { get; set; } + public decimal? totalPrice { get; set; } + public string remark { get; set; } + + public GLSFEE() { } + + public GLSFEE(MsChFee chfee, Dictionary feenamedic) + { + if (chfee.FeeType == 1) feeType = "R"; + if (chfee.FeeType == 2) feeType = "P"; + FEENAME = chfee.FeeName; + GID = chfee.GId; + if (feenamedic.ContainsKey(chfee.FeeName)) + { + feeItem = feenamedic[chfee.FeeName]; + } + else { + //feeItem = ""; + //改为不强制要求设置费用名称 未设置的使用原名称 + feeItem = chfee.FeeName; + } + currency=chfee.Currency; + quantity = chfee.Quantity; + unit = chfee.Unit; + unitPrice = chfee.TaxUnitPrice; + totalPrice = chfee.Amount; + } + } + + public class GLSFEEINFO + { + public string GID { get; set; } + public string MBLNO { get; set; } + public string VESSEL { get; set; } + public string VOYNO { get; set; } + public string DESTINATION { get; set; } + public string ETD { get; set; } + public string FEENAME { get; set; } + public string FEETYPEREF { get; set; } + public decimal? AMOUNT { get; set; } + public string CURRENT { get; set; } + + public GLSFEEINFO() { } + + public GLSFEEINFO(GLSFEEHead feehead) + { + MBLNO = feehead.mbl; + VESSEL = feehead.vessel; + VOYNO = feehead.voyage; + ETD = feehead.etd; + DESTINATION = feehead.placeEnd; + } } } diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpTask/MsOpTaskDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpTask/MsOpTaskDAL.cs index 790c5d48..9d29d86c 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpTask/MsOpTaskDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpTask/MsOpTaskDAL.cs @@ -538,7 +538,7 @@ namespace DSWeb.Areas.MvcShipping.DAL { var strSql = new StringBuilder(); - strSql.Append("select top 1 [FEENAME] from code_fee_edi where [FEEENAME]='" + FEECODE + "'"); + strSql.Append("select top 1 [FEENAME] from code_fee_edi where [FEEENAME]='" + FEECODE + "' and isnull(EDINAME,'')=''"); var FEENAME = ""; Database db = DatabaseFactory.CreateDatabase(); using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeCtnEdi/MsCodeCtnEdiIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeCtnEdi/MsCodeCtnEdiIndex.js index 10112d66..147d34ad 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeCtnEdi/MsCodeCtnEdiIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeCtnEdi/MsCodeCtnEdiIndex.js @@ -774,6 +774,20 @@ Ext.extend(Shipping.MsCodeCtnEdiIndex, Ext.Panel, { xtype: 'textfield', selectOnFocus: true } + }, { + sortable: true, + dataIndex: 'EDINAME', + header: 'EDI类别', + width: 100, + editor: this.comboxEdiType, + renderer: function (value, p, record) { + return record.data.EDINAMEREF; + } + }, { + hidden: true, + dataIndex: 'EDINAMEREF', + header: 'EDINAMEREF', + width: 100 }] }); //#endregion @@ -1093,6 +1107,11 @@ Ext.extend(Shipping.MsCodeCtnEdiIndex, Ext.Panel, { }, this); + this.gridListFeeName.on('edit', function (editor, e, eOpts) { + this.gridListAfterEdit(editor, e, eOpts); + }, this); + + this.onRefreshClick(); //#endregion }, //end initUIComponents diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js index f4d52b1a..076df043 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js @@ -2715,14 +2715,17 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { } }], scope: this - }, '-', { + }, '-' + , { text: Zi.LAN.OtherCaoZuo, //"其他操作", - menu: [{ - text: Zi.LAN.BillEdit, //"提单信息", - handler: function (menu, event) { - _this.onBillEditClick(menu, event); - } - }, { + menu: [ + { + text: Zi.LAN.BillEdit, //"提单信息", + handler: function (menu, event) { + _this.onBillEditClick(menu, event); + } + } + , { text: Zi.LAN.plbs, //"批量生成函电", menu: [{ text: Zi.LAN.SaveSEAI, //"生成海运进口业务", @@ -2748,12 +2751,14 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { _this.SubCorpFee(menu, event); } }] - }, { - text: Zi.LAN.FeeEdit, //"费用编辑", - handler: function (menu, event) { - _this.onFeeEditClick(menu, event); - } - }, { + } + , { + text: Zi.LAN.FeeEdit, //"费用编辑", + handler: function (menu, event) { + _this.onFeeEditClick(menu, event); + } + } + , { text: Zi.LAN.plfee, //"批量生成函电", menu: [{ text: Zi.LAN.PiLiangFeeAdd, @@ -2771,7 +2776,8 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { _this.onPiLiangAddFeeTemplate(menu, event, 1); } }] - }, { + } + , { text: Zi.LAN.plbsedi, //"批量生成函电", menu: [{ text: Zi.LAN.UpOpStatus, //"批量状态更新", @@ -2789,22 +2795,26 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { _this.winModifyIssueShow.show(); } }] - }, { + } + , { text: Zi.LAN.InvPay, //"生成发票申请", handler: function (menu, event) { _this.onInvPayClick(menu, event); } - }, { + } + , { text: Zi.LAN.Letter, //"费用编辑", handler: function (menu, event) { _this.onLetterEditClick(menu, event); } - }, { + } + , { text: Zi.LAN.DocEdit, //"单据管理", handler: function (menu, event) { _this.onDocEditClick(menu, event); } - }, { + } + , { text: Zi.LAN.plcletter, //"批量生成函电", menu: [ { @@ -2823,19 +2833,22 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { _this.onCreateletter('派车通知'); } }] - }, { + } + , { text: Zi.LAN.TUISHENQING, //"申请推航次或退舱", id: "btnShenTui", handler: function (menu, event) { _this.winTuiShow.show(); } - }, { + } + , { text: Zi.LAN.CANCELTUISHENQING, //"申请推航次或退舱", id: "btnCancelShenTui", handler: function (menu, event) { _this.CancelDoTui(); } - }, { + } + , { text: Zi.LAN.TuiCangCaoZuo, //"退舱", id: "btnOpTui", menu: [ @@ -2850,53 +2863,81 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { _this.onCancelShippingOrderClick('0'); } }] - }, { + } + , { text: Zi.LAN.FDTZ, //"放单通知", handler: function (menu, event) { _this.onFDTZClick(menu, event); } - }, { + } + , { text: Zi.LAN.UNFDTZ, //"取消放单通知", handler: function (menu, event) { _this.onUNFDTZPLClick(menu, event); } - }, { - text: Zi.LAN.fnLoad, //"提单状态查询", - handler: function (menu, event) { - var selections = _this.gridList.getSelectionModel().getSelection(); - if (selections.length == 0) { - Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); - return; + } + , { + text: Zi.LAN.fnLoad, //"提单状态查询", + handler: function (menu, event) { + var selections = _this.gridList.getSelectionModel().getSelection(); + if (selections.length == 0) { + Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + var record = selections[0]; + + steplay.fnLoad(record.data.MBLNO, record.data.BSNO); } - var record = selections[0]; + } + , { + text: Zi.LAN.fnLoad, //"提单状态查询", + handler: function (menu, event) { + var selections = _this.gridList.getSelectionModel().getSelection(); + if (selections.length == 0) { + Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + var record = selections[0]; - steplay.fnLoad(record.data.MBLNO, record.data.BSNO); - } - } + steplay.fnLoad(record.data.MBLNO, record.data.BSNO); + } + } - , { - text: '批量整票提交', //"批量整票提交", - handler: function (menu, event) { - _this.onPiLiangZhengPiaoTiJiaoClick(menu, event, 1); - } - }, { + , { + text: '批量整票提交', //"批量整票提交", + handler: function (menu, event) { + _this.onPiLiangZhengPiaoTiJiaoClick(menu, event, 1); + } + } + , { text: '取消整票提交', //"批量整票提交", handler: function (menu, event) { _this.onPiLiangZhengPiaoTiJiaoClick(menu, event, 0); } - }, { + } + , { text: '发送大简云运踪订阅', handler: function (menu, event) { _this.onSendToDJY('send'); } - }, { + } + , { text: '取消大简云运踪订阅', handler: function (menu, event) { _this.onSendToDJY('del'); } - }], + } + + , { + text: '推送港联顺费用', + handler: function (menu, event) { + _this.onSendGLSFee(); + } + } + ], scope: this - }, '-', { + }, '-' + , { iconCls: "btnotherinf", menu: [ { @@ -3033,7 +3074,8 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { } }], scope: this - }, '-', { + }, '-' + , { text: '显示Cover', id: 'btnCover', handler: function (button, event) { @@ -3055,7 +3097,8 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { }, scope: this - }, { + } + , { text: '创建跑单', id: 'btnRunBill', handler: function (button, event) { @@ -3063,7 +3106,8 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { this.onCreateRunBill(button, event); }, scope: this - }, this.CheckSaveQuery] + } + , this.CheckSaveQuery] }); //#endregion @@ -15681,6 +15725,270 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, { scope: this }); } + + , onSendGLSFee: function () { + + var selections = this.GridCheckBoxModel.selected.items; + if (selections.length == 0) { + Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要更新的业务! + return; + } + var BSNOStr = ''; + for (var i = 0; i < selections.length; i++) { + var rec = selections[i]; + var BSNO = "'" + rec.data.BSNO + "'"; + if (BSNOStr == '') + BSNOStr = BSNO; + else { + + BSNOStr = BSNOStr + ',' + BSNO; + } + } + + if (BSNOStr == '') { + Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + + } + else + { + Ext.Ajax.request({ + waitMsg: '', + url: '/MvcShipping/MsOpSeae/SendGLSFee', + params: { + BSNO: BSNOStr + }, + callback: function (options, success, response) { + if (success) { + var result = Ext.JSON.decode(response.responseText); + if (result.Success != true) { + + Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + + } else { + + var checkresult = result.Data; + + this.ruleCheckNameArr_2 = []; + + //var btnWarning = Ext.getCmp('btnRuleWarning'); + //btnWarning.setText(checkresult.length + ''); + + for (var idx = 0; idx < checkresult.length; idx++) { + var item = checkresult[idx]; + var newrec = { + GID: item.GID, + MBLNO: item.MBLNO, + DESTINATION: item.DESTINATION, + VESSEL: item.VESSEL, + VOYNO: item.VOYNO, + ETD: item.ETD, + FEENAME: item.FEENAME, + FEETYPEREF: item.FEETYPEREF, + AMOUNT: item.AMOUNT, + CURRENT: item.CURRENT + }; + + this.ruleCheckNameArr_2.push(newrec); + } + + if (checkresult.length > 0) { + + store = Ext.create('Ext.data.Store', { + autoLoad: true, + fields: [ + { + name: 'MBLNO', type: "string" + } + , { + name: 'GID', type: "string" + } + , { + name: 'DESTINATION', type: "string" + } + , { + name: 'VESSEL', type: "string" + }, { + name: 'VOYNO', type: "string" + }, { + name: 'ETD', type: "string" + }, { + name: 'FEENAME', type: "string" + }, { + name: 'FEETYPEREF', type: "string" + }, { + name: 'AMOUNT', type: "string" + }, { + name: 'CURRENT', type: "string" + }], + data: [] + }); + var _GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); + + this.rulegrid = Ext.create('Ext.grid.Panel', { + id: "RuleResultGrid", + store: store, + selModel: _GridCheckBoxModel, + viewConfig: { + enableTextSelection: true, //允许复制数据 + }, + columns: [ + { + text: "GID", + dataIndex: 'GID', + hidden: true, + width: 100 + }, { + text: "提单号", + dataIndex: 'MBLNO', + sortable: true, + width: 100 + }, { + text: "目的港", + dataIndex: 'DESTINATION', + sortable: true, + width: 100 + }, { + text: "船名", + dataIndex: 'VESSEL', + sortable: true, + width: 100 + }, { + text: "航次", + dataIndex: 'VOYNO', + sortable: true, + width: 100 + }, { + text: "ETD", + dataIndex: 'ETD', + sortable: true, + width: 110 + }, { + text: "费用名称", + dataIndex: 'FEENAME', + sortable: true, + width: 100 + }, { + text: "收付方向", + dataIndex: 'FEETYPEREF', + sortable: true, + width: 100 + }, { + text: "金额", + dataIndex: 'AMOUNT', + sortable: true, + width: 100 + }, { + text: "币别", + dataIndex: 'CURRENT', + sortable: true, + width: 50 + } + ], + forceFit: true, + split: true, + region: 'center' + }); + + + + this.winGLSFeeListForm = Ext.create('Ext.window.Window', { + title: "港联顺费用推送", + width: 800, + height: 550, + plain: true, + layout: "border", + iconCls: "addicon", + resizable: false, + draggable: false, + collapsible: true, + closeAction: 'close', + closable: true, + modal: 'true', + buttonAlign: "center", + bodyStyle: "padding:0 0 0 0", + items: [this.rulegrid], + buttons: [ + { + text: "确定发出", + minWidth: 70, + handler: function () { + var selections = _GridCheckBoxModel.selected.items; + if (selections.length == 0) { + Ext.Msg.show({ title: Zi.LAN.TiShi, msg: "请选择费用", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要更新的业务! + return; + } + var GIDs = ''; + for (var i = 0; i < selections.length; i++) { + var rec = selections[i]; + var GID = rec.data.GID ; + if (GIDs == '') + GIDs = GID; + else { + + GIDs = GIDs + ',' + GID; + } + } + Ext.Ajax.request({ + waitMsg: '', + url: '/MvcShipping/MsOpSeae/DoSendGLSFee', + params: { + BSNO: BSNOStr, + GIDs: GIDs + }, + callback: function (options, success, response) { + if (success) { + var result = Ext.JSON.decode(response.responseText); + if (result.Success != true) { + + Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + + } else { + MsgTip("提示", "发送完成", 3000); + } + } + } + }); + + } + }, + + { + text: Zi.LAN.GuanBi, //"关闭", + minWidth: 70, + handler: function () { + me.winGLSFeeListForm.close(); + } + } + + ] + }); + + store.loadData(this.ruleCheckNameArr_2); + + + this.winGLSFeeListForm.show(); + + for (i = 0; i < store.getCount(); i += 1) { + this.rulegrid.getSelectionModel().selectAll(); + } + } + + else { + //Ext.Msg.show({ title: Zi.LAN.TiShi, msg: "校验完成,无不合规内容", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + //MsgTip("提示", "校验完成,无不合规内容", 1200); + } + + + } + } else { + + } + }, + scope: this + }); + } + } }); function fnSearch() {