diff --git a/DSWeb.Service.Output.DS7/App.config b/DSWeb.Service.Output.DS7/App.config index d468b125..f2c23398 100644 --- a/DSWeb.Service.Output.DS7/App.config +++ b/DSWeb.Service.Output.DS7/App.config @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/DSWeb.Service.Output.DS7/DS7DataContext.cs b/DSWeb.Service.Output.DS7/DS7DataContext.cs index 5b077939..4521c431 100644 --- a/DSWeb.Service.Output.DS7/DS7DataContext.cs +++ b/DSWeb.Service.Output.DS7/DS7DataContext.cs @@ -1021,7 +1021,7 @@ namespace DSWeb.Service.Output.DS7 public string TRUCKNO { get; set; } public string SOURCEOP { get; set; } public string SHIPAGENT { get; set; } - public string DUIYUEHAO { get; set; } + //public string DUIYUEHAO { get; set; } } @@ -1305,4 +1305,6 @@ namespace DSWeb.Service.Output.DS7 public string OFFICEADDR { get; set; } } + + } diff --git a/DSWeb.Service.Output.DS7/DS7Service.cs b/DSWeb.Service.Output.DS7/DS7Service.cs index 28439fb7..7ff8d6f8 100644 --- a/DSWeb.Service.Output.DS7/DS7Service.cs +++ b/DSWeb.Service.Output.DS7/DS7Service.cs @@ -14,9 +14,11 @@ using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; +using System.Data.Entity.Migrations; using System.Data.SqlClient; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Threading.Tasks; using Topshelf; @@ -654,7 +656,9 @@ namespace DSWeb.Service.Output.DS7 orderinfo.Add(""); } - var custEdi2 = dS7Data.CodeCustEdi.AsNoTracking().FirstOrDefault(x => x.EDINAME == "DJY_OUTPUT" && x.EDICODE == orderinfo[0]); + var cust = orderinfo[0]; + + var custEdi2 = dS7Data.CodeCustEdi.AsNoTracking().FirstOrDefault(x => x.EDINAME == "DJY_OUTPUT" && x.EDICODE == cust); if (custEdi2 != null) { CUSTOMERNAME = custEdi2.CUST; @@ -713,9 +717,16 @@ namespace DSWeb.Service.Output.DS7 KGS= KGS, NETWEIGHT=0, CBM= CBM, - SOURCEOP= SOURCEOP, - DUIYUEHAO= 对账约号 + SOURCEOP= SOURCEOP + }; + //,DUIYUEHAO = 对账约号 + //20230317 对账约号存于opLogic + var cdc = new CommonDataContext(); + var dic = new Dictionary + { + { "DUIYUEHAO",对账约号 } }; + SaveLogicInfo(BSNO, "舱单业务", dic); var billnoset = dS7Data.SysBillNoSet.AsNoTracking().FirstOrDefault(x => x.COMPANYID == Corpid && x.OPLBNAME == "舱单申报" && x.RULEBLNO == "委托编号"); if (billnoset != null) @@ -809,7 +820,8 @@ namespace DSWeb.Service.Output.DS7 BLFRT = _edi.BLFRT, SENDTIME = _edi.SENDTIME, YARD = _edi.YARD, - FORWARDER = _edi.FORWARDER + FORWARDER = _edi.FORWARDER, + CORPID= Corpid }; dS7Data.op_seae_edi.Add(newedi); @@ -1195,5 +1207,85 @@ SELECT @ps_BillNo as N'billno'"; } } + + #region 逻辑信息子表操作 + + #region 将一个dictionary转化为用;;和::隔开的文本 + public static string DicToStr(Dictionary dic) + { + var result = ""; + + foreach (var item in dic) + { + result += item.Key + "::" + item.Value + ";;"; + } + + return result; + } + #endregion + + #region 将一个用;;和::隔开的文本转化为dictionary + public static Dictionary StrToDic(string dicstr) + { + var result = new Dictionary(); + + var list = Regex.Split(dicstr, ";;").ToList(); + + foreach (var item in list) + { + var itemarray = Regex.Split(item, "::"); + if (itemarray.Length < 2) continue; + result.Add(itemarray[0], itemarray[1] == null ? "" : itemarray[1]); + } + + return result; + } + #endregion + + public static Dictionary GetLogicInfo(string BSNO, string PROPNAME) + { + + CommonDataContext cdc = new CommonDataContext(); + + var result = new Dictionary(); + + var infoList = cdc.OP_LOGICINFO.Where(x => x.BSNO == BSNO && x.PROPNAME == PROPNAME).ToList(); + + if (infoList != null && infoList.Count > 0) + { + result = StrToDic(infoList[0].PROPVALUE); + } + + return result; + } + + public static void SaveLogicInfo(string BSNO, string PROPNAME, Dictionary InfoDic) + { + + CommonDataContext cdc = new CommonDataContext(); + + var result = new Dictionary(); + + var infoList = cdc.OP_LOGICINFO.Where(x => x.BSNO == BSNO && x.PROPNAME == PROPNAME).ToList(); + + if (infoList != null && infoList.Count > 0) + { + infoList[0].PROPVALUE = DicToStr(InfoDic); + cdc.OP_LOGICINFO.AddOrUpdate(infoList[0]); + cdc.SaveChanges(); + } + else + { + var newinfo = new OP_LOGICINFO_md(); + newinfo.GID = Guid.NewGuid(); + newinfo.BSNO = BSNO; + newinfo.PROPNAME = PROPNAME; + newinfo.PROPVALUE = DicToStr(InfoDic); + cdc.OP_LOGICINFO.Add(newinfo); + cdc.SaveChanges(); + } + } + + #endregion } } diff --git a/DSWeb.Service.Output.DS7/quartz_jobs.xml b/DSWeb.Service.Output.DS7/quartz_jobs.xml index 9c4c2f35..60c4817f 100644 --- a/DSWeb.Service.Output.DS7/quartz_jobs.xml +++ b/DSWeb.Service.Output.DS7/quartz_jobs.xml @@ -27,7 +27,7 @@ - + - + \ No newline at end of file diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs index 8713ad3c..01b43c7d 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs @@ -89,7 +89,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL } else { - strSql.Append(" order by INPUTDATE desc"); + strSql.Append(" order by HBLNO asc"); } return SetData(strSql); } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyEdit.js index b6356c89..1d203786 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyEdit.js @@ -25,6 +25,7 @@ Ext.extend(Shipping.MsOpApplyEdit, Ext.Panel, { this.SALEORDERDEPTBYOP = 0; this.ENTERSAMEASCUSTOMER = 0; this.copyfee = false; + _this = this; //枚举参照相关 //#region 表参照相关 @@ -244,7 +245,18 @@ Ext.extend(Shipping.MsOpApplyEdit, Ext.Panel, { proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' } }); - this.storeCustCode.load(); + this.storeCustCode2 = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsShipping.ux.CustomRefModel', + proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' } + }); + + this.storeCustCode.load({ + callback: function (r, options, success) { + _this.storeCustCode2.loadData(_this.storeCustCode.data.items); + } + }); + + this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '委托单位', @@ -306,7 +318,7 @@ Ext.extend(Shipping.MsOpApplyEdit, Ext.Panel, { this.comboxCUSTOMERNAME2 = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '实际客户', - store: this.storeCustCode, + store: this.storeCustCode2, forceSelection: true, queryMode: 'remote', minChars: 1, @@ -2504,6 +2516,8 @@ Ext.extend(Shipping.MsOpApplyEdit, Ext.Panel, { data = result.data; + this.LoadInit(data); + this.formEdit.getForm().reset(); this.formEdit.getForm().setValues(data); this.formHead.getForm().reset(); @@ -2745,7 +2759,40 @@ Ext.extend(Shipping.MsOpApplyEdit, Ext.Panel, { } }, + LoadInit: function (data) { + if (data.CUSTOMERNAME != '') { + var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', { + GId: NewGuid(), + CustCode: data.CUSTOMERNAME, + CustName: data.CUSTOMERNAME, + CodeAndName: data.CUSTOMERNAME + }); + + this.storeCustCode.add(recordCustCode); + } + if (data.CUSTOMERNAME2 != '') { + var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', { + GId: NewGuid(), + CustCode: data.CUSTOMERNAME2, + CustName: data.CUSTOMERNAME2, + CodeAndName: data.CUSTOMERNAME2 + }); + + this.storeCustCode2.add(recordCustCode); + } + if (data.CUSTOMSER != '') { + var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', { + GId: NewGuid(), + CustCode: data.CUSTOMSER, + CustName: data.CUSTOMSER, + CodeAndName: data.CUSTOMSER + }); + + this.storeCustomCode.add(recordCustCode); + } + + }, // end LoadDate