From f56c8806e7f4386344571fc63f76c597b0ada0c4 Mon Sep 17 00:00:00 2001 From: gongxh Date: Mon, 15 Mar 2021 13:34:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.BLL/Model/OutBound.cs | 1 + NX.ERP.BLL/Store/SotreIn.cs | 14 ++++++++------ NX.ERP.BLL/Store/SotreOut.cs | 9 ++++++--- NX.ERP.Model/Request/OtherStoreIn.cs | 1 + NX.ERP.Model/Request/ProductStoreIn.cs | 2 ++ NX.ERP.Model/Request/SaleStoreOut.cs | 1 + NX.ERP.U8/Store/MaterielStoreOutDAL.cs | 18 ++++++++---------- NX.ERP.U8/Store/OtherStoreInDAL.cs | 2 +- NX.ERP.U8/Store/OtherStoreOutDAL.cs | 2 +- NX.ERP.U8/Store/ProductInDAL.cs | 16 ++++++++-------- NX.ERP.U8/Store/PuStoreInDAL.cs | 2 +- NX.ERP.U8/Store/SaleOutDAL.cs | 12 ++++++------ NX.ERP.U8/U8LoginContext.cs | 2 -- NX.ERP.WebAPi/Web.config | 2 +- 14 files changed, 45 insertions(+), 39 deletions(-) diff --git a/NX.ERP.BLL/Model/OutBound.cs b/NX.ERP.BLL/Model/OutBound.cs index 0375e53..a192ddb 100644 --- a/NX.ERP.BLL/Model/OutBound.cs +++ b/NX.ERP.BLL/Model/OutBound.cs @@ -7,6 +7,7 @@ namespace NX.ERP.BLL.Model { public class OutBound { + public int Id { get; set; } public string OutboundNo { get; set; } public DateTime OutboundDate { get; set; } public OutBoundType OutboundType { get; set; } diff --git a/NX.ERP.BLL/Store/SotreIn.cs b/NX.ERP.BLL/Store/SotreIn.cs index cd60613..16ed8ca 100644 --- a/NX.ERP.BLL/Store/SotreIn.cs +++ b/NX.ERP.BLL/Store/SotreIn.cs @@ -18,7 +18,8 @@ namespace NX.ERP.BLL.Store var dal = new NX.ERP.U8.Store.PuStoreInDAL(); ID = dal.AddVocher(new ERP.Model.Request.PuStoreIn() { - Code = "190700000050", + Id = inbound.Id, + Code = inbound.InboundNo, Date = inbound.InboundDate, Source = inbound.SourceName, SourceCode = inbound.SourceNo, @@ -45,9 +46,9 @@ namespace NX.ERP.BLL.Store var dal = new NX.ERP.U8.Store.ProductInDAL(); ID = dal.AddVoucher(new ERP.Model.Request.ProductStoreIn() { - Code= "19100002", - - + + Id = inbound.Id, + Code = inbound.InboundNo, Date = inbound.InboundDate, Source = inbound.SourceName, SourceCode = inbound.SourceNo, @@ -72,7 +73,8 @@ namespace NX.ERP.BLL.Store var dal = new NX.ERP.U8.Store.OtherStoreInDAL(); ID = dal.AddVocher(new ERP.Model.Request.OtherStoreInOut() { - Code= "19100028", + Id = inbound.Id, + Code = inbound.InboundNo, Date = inbound.InboundDate, WhCode = inbound.WarehouseCode, Maker = inbound.Maker, @@ -90,7 +92,7 @@ namespace NX.ERP.BLL.Store }); } - return new StoreResult() { ID = int.Parse( ID) }; + return new StoreResult() { ID = int.Parse(ID) }; } } diff --git a/NX.ERP.BLL/Store/SotreOut.cs b/NX.ERP.BLL/Store/SotreOut.cs index 246b70a..2abc9ff 100644 --- a/NX.ERP.BLL/Store/SotreOut.cs +++ b/NX.ERP.BLL/Store/SotreOut.cs @@ -17,7 +17,8 @@ namespace NX.ERP.BLL.Store var dal = new U8.Store.MaterialStoreOutDAL(); ID = dal.AddVocher(new ERP.Model.Request.MaterialStoreOut() { - Code= "191000000007", + Id = outBound.Id, + Code = outBound.OutboundNo, Date = outBound.OutboundDate, Maker = outBound.Maker, Source = outBound.SourceName, @@ -44,7 +45,8 @@ namespace NX.ERP.BLL.Store var dal = new U8.Store.SaleOutDAL(); ID = dal.AddVoucher(new ERP.Model.Request.SaleStoreOut() { - Code = "191000000003", + Id = outBound.Id, + Code = outBound.OutboundNo, Date = outBound.OutboundDate, WhCode = outBound.WarehouseCode, Source = outBound.SourceName, @@ -70,7 +72,8 @@ namespace NX.ERP.BLL.Store { Date = outBound.OutboundDate, WhCode = outBound.WarehouseCode, - Code= "19100032", + Id = outBound.Id, + Code = outBound.OutboundNo, Maker = outBound.Maker, details = outBound.OutboundDtlLst.ConvertAll(m => { diff --git a/NX.ERP.Model/Request/OtherStoreIn.cs b/NX.ERP.Model/Request/OtherStoreIn.cs index fb30372..8b282de 100644 --- a/NX.ERP.Model/Request/OtherStoreIn.cs +++ b/NX.ERP.Model/Request/OtherStoreIn.cs @@ -7,6 +7,7 @@ namespace NX.ERP.Model.Request { public class OtherStoreInOut { + public int Id { get; set; } public string Code { get; set; } public DateTime Date { get; set; } public string WhCode { get; set; } diff --git a/NX.ERP.Model/Request/ProductStoreIn.cs b/NX.ERP.Model/Request/ProductStoreIn.cs index 10694e0..0bf83bd 100644 --- a/NX.ERP.Model/Request/ProductStoreIn.cs +++ b/NX.ERP.Model/Request/ProductStoreIn.cs @@ -7,6 +7,8 @@ namespace NX.ERP.Model.Request { public class ProductStoreIn: BaseModel { + + public int Id { get; set; } public string Code { get; set; } public string Maker { get; set; } public string Deptcode { get; set; } diff --git a/NX.ERP.Model/Request/SaleStoreOut.cs b/NX.ERP.Model/Request/SaleStoreOut.cs index 362eba5..d9ce708 100644 --- a/NX.ERP.Model/Request/SaleStoreOut.cs +++ b/NX.ERP.Model/Request/SaleStoreOut.cs @@ -7,6 +7,7 @@ namespace NX.ERP.Model.Request { public class SaleStoreOut { + public int Id { get; set; } public string Code { get; set; } public string Source { get; set; } public string SourceCode { get; set; } diff --git a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs index 1716231..23dfffe 100644 --- a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs +++ b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs @@ -61,7 +61,7 @@ namespace NX.ERP.U8.Store } headXml.setAttribute("iproorderid", Order.ProductOrderId); headXml.setAttribute("cmpocode", Order.ProductOrderNo); - + string lastProductNo = null; headXml.setAttribute("crdname", "材料出库"); headXml.setAttribute("cdepcode", "24"); @@ -142,22 +142,20 @@ namespace NX.ERP.U8.Store public bool UpdateVocher(Model.Request.MaterialStoreOut storeOut) { - VoucherParameter voucherParameter = this.LoadVoucher($"cCode='{storeOut.Code}'"); - + VoucherParameter voucherParameter = this.LoadVoucher($"Id='{storeOut.Id}'"); + DOMDocument domBody = voucherParameter.DomBody; - - if (storeOut.Source == "生产订单") { - + var Order = new Mom.MomOrderDAL().GetModel(storeOut.SourceCode); if (Order == null) { throw new Exception($"未知订单:{storeOut.SourceCode}"); } - + string lastProductNo = null; - + //headXml.setAttribute("cdepname", "研发LA组"); IXMLDOMElement bodyXml; for (var n = 0; n < storeOut.Details.Count(); n++) @@ -212,10 +210,10 @@ namespace NX.ERP.U8.Store #endregion } - + } - + try { diff --git a/NX.ERP.U8/Store/OtherStoreInDAL.cs b/NX.ERP.U8/Store/OtherStoreInDAL.cs index b42d037..4cd7bd5 100644 --- a/NX.ERP.U8/Store/OtherStoreInDAL.cs +++ b/NX.ERP.U8/Store/OtherStoreInDAL.cs @@ -98,7 +98,7 @@ namespace NX.ERP.U8.Store public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn) { - var voucherParameter = base.LoadVoucher($" cCode={storeIn.Code}"); + var voucherParameter = base.LoadVoucher($" id={storeIn.Id}"); DOMDocument domBody = voucherParameter.DomBody; for (var n = 0; n < storeIn.details.Count(); n++) diff --git a/NX.ERP.U8/Store/OtherStoreOutDAL.cs b/NX.ERP.U8/Store/OtherStoreOutDAL.cs index e2e9c04..ddc889b 100644 --- a/NX.ERP.U8/Store/OtherStoreOutDAL.cs +++ b/NX.ERP.U8/Store/OtherStoreOutDAL.cs @@ -97,7 +97,7 @@ namespace NX.ERP.U8.Store { - VoucherParameter voucherParameter = this.LoadVoucher($"cCode='{storeIn.Code}'"); + VoucherParameter voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'"); diff --git a/NX.ERP.U8/Store/ProductInDAL.cs b/NX.ERP.U8/Store/ProductInDAL.cs index 9e16882..8f54155 100644 --- a/NX.ERP.U8/Store/ProductInDAL.cs +++ b/NX.ERP.U8/Store/ProductInDAL.cs @@ -61,7 +61,7 @@ namespace NX.ERP.U8.Store bodyXml.setAttribute("iprice", new Account.Accinformation().FormatMoney(_cost * detail.Quantity)); bodyXml.setAttribute("irowno", n + 1); bodyXml.setAttribute("editprop", "A"); - + bodyXml.setAttribute("cbatch", detail.Batch); bodyXml.setAttribute("cposition", detail.Position); var momOrderDetail = momOrder.ProductDtlLst.First(m => { return m.ProductOrderDtlId == detail.SourceDetailId; }); @@ -87,14 +87,14 @@ namespace NX.ERP.U8.Store public bool UpdateVoucher(ProductStoreIn storeIn) { - var voucherParameter = this.LoadVoucher($"cCode='{storeIn.Code}'"); - + var voucherParameter = this.LoadVoucher($"id='{storeIn.Id}'"); + DOMDocument domBody = voucherParameter.DomBody; - + if (storeIn.Source == "生产订单") { var momOrder = new Mom.MomOrderDAL().GetModel(storeIn.SourceCode); - + IXMLDOMElement bodyXml; for (var n = 0; n < storeIn.Details.Count; n++) { @@ -105,20 +105,20 @@ namespace NX.ERP.U8.Store var _cost = new MaterialDAL().GetCost(detail.InvCode, 0); bodyXml.setAttribute("iunitcost", _cost); bodyXml.setAttribute("iprice", new Account.Accinformation().FormatMoney(_cost * detail.Quantity)); - + bodyXml.setAttribute("editprop", "A"); bodyXml.setAttribute("cbatch", detail.Batch); bodyXml.setAttribute("cposition", detail.Position); var momOrderDetail = momOrder.ProductDtlLst.First(m => { return m.ProductOrderDtlId == detail.SourceDetailId; }); - + bodyXml.setAttribute("cmocode", momOrder.ProductOrderNo); bodyXml.setAttribute("impoids", detail.SourceDetailId); bodyXml.setAttribute("irowno", domBody.selectSingleNode("//rs:data").childNodes.length + 1); domBody.selectSingleNode("//rs:data").appendChild(bodyXml); } } - + try { return UpdateRdVoucher(voucherParameter); diff --git a/NX.ERP.U8/Store/PuStoreInDAL.cs b/NX.ERP.U8/Store/PuStoreInDAL.cs index ea716f2..34d13ad 100644 --- a/NX.ERP.U8/Store/PuStoreInDAL.cs +++ b/NX.ERP.U8/Store/PuStoreInDAL.cs @@ -140,7 +140,7 @@ namespace NX.ERP.U8.Store { try { - var voucherParameter = this.LoadVoucher($"cCode='{puStoreIn.Code}'"); + var voucherParameter = this.LoadVoucher($"id='{puStoreIn.Id}'"); //添加一條 DOMDocument domBody = voucherParameter.DomBody; if (puStoreIn.Source == "采购到货单") diff --git a/NX.ERP.U8/Store/SaleOutDAL.cs b/NX.ERP.U8/Store/SaleOutDAL.cs index a787e8c..cc64ea3 100644 --- a/NX.ERP.U8/Store/SaleOutDAL.cs +++ b/NX.ERP.U8/Store/SaleOutDAL.cs @@ -39,7 +39,7 @@ namespace NX.ERP.U8.Store headXml.setAttribute("ccode", storeOut.Code); headXml.setAttribute("ddate", storeOut.Date); headXml.setAttribute("cmaker", storeOut.Maker); - + headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0303")); headXml.setAttribute("editprop", "A"); headXml.setAttribute("cdepcode", ""); @@ -102,24 +102,24 @@ namespace NX.ERP.U8.Store public bool UpdateVoucher(SaleStoreOut storeOut) { - VoucherParameter voucherParameter = this.LoadVoucher($"cCode='{storeOut.Code}'"); + VoucherParameter voucherParameter = this.LoadVoucher($"id='{storeOut.Id}'"); DOMDocument domBody = voucherParameter.DomBody; IXMLDOMElement bodyXml; - + if (storeOut.Source == "发货单") { var dispatch = new Sale.DispatchListDAL().GetModel(storeOut.SourceCode); - + for (var n = 0; n < storeOut.Details.Count; n++) { bodyXml = domBody.createElement("z:row"); var detail = storeOut.Details[n]; bodyXml.setAttribute("cinvcode", detail.InvCode); bodyXml.setAttribute("iquantity", detail.Quantity); - + bodyXml.setAttribute("cposition", detail.Position); @@ -137,7 +137,7 @@ namespace NX.ERP.U8.Store } - + try diff --git a/NX.ERP.U8/U8LoginContext.cs b/NX.ERP.U8/U8LoginContext.cs index 1fcb8ff..9a91d14 100644 --- a/NX.ERP.U8/U8LoginContext.cs +++ b/NX.ERP.U8/U8LoginContext.cs @@ -53,8 +53,6 @@ namespace NX.ERP.U8 { get { - - if (this._clslogin == null) { lock (locker1) diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index 48b7482..3c461db 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -7,7 +7,7 @@ - +