From c92272b0b98011de5cd29a44ef0711a64af06fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Mon, 15 Mar 2021 11:50:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=87=BA=E5=BA=93=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.U8/Store/OtherStoreOutDAL.cs | 79 +++++++++++++++++++ .../Store/OtherStoreOutController.cs | 9 +++ NX.ERP.WebAPi/Web.config | 2 +- 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/NX.ERP.U8/Store/OtherStoreOutDAL.cs b/NX.ERP.U8/Store/OtherStoreOutDAL.cs index 405cf4c..50967dc 100644 --- a/NX.ERP.U8/Store/OtherStoreOutDAL.cs +++ b/NX.ERP.U8/Store/OtherStoreOutDAL.cs @@ -93,5 +93,84 @@ namespace NX.ERP.U8.Store throw err; } } + public bool UpdateVocher(Model.Request.OtherStoreInOut storeIn) + { + + + VoucherParameter voucherParameter = this.LoadVoucher($"cCode='{storeIn.Code}'"); + + + DOMDocument domHead = voucherParameter.DomHead; + DOMDocument domBody = voucherParameter.DomBody; + + IXMLDOMElement headXml = domHead.createElement("z:row"); + + + headXml.setAttribute("bpufirst", "0"); + headXml.setAttribute("bisstqc", "0"); + headXml.setAttribute("bomfirst", "0"); + headXml.setAttribute("biafirst", "0"); + headXml.setAttribute("brdflag", 1); + headXml.setAttribute("ccode", storeIn.Code); + headXml.setAttribute("ddate", storeIn.Date); + headXml.setAttribute("cmaker", storeIn.Maker); + headXml.setAttribute("cvouchtype", this.VoucherID); + headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0302")); + headXml.setAttribute("editprop", "A"); + headXml.setAttribute("cdepcode", ""); + headXml.setAttribute("cpersoncode", ""); + headXml.setAttribute("crdcode", ""); + + headXml.setAttribute("csource", "库存"); + headXml.setAttribute("cwhcode", storeIn.WhCode); + headXml.setAttribute("cbustype", "其他出库"); + headXml.setAttribute("cmemo", ""); + + + IXMLDOMElement bodyXml; + for (var n = 0; n < storeIn.details.Count(); n++) + { + var detail = storeIn.details[n]; + //var arrivalDetail = Arrival.ArrivalDetails.First(m => { return m.Id == detail.SorceDetailId; }); + //headXml.setAttribute("cordercode", arrivalDetail.OrderCode); + // headXml.setAttribute("ipurorderid", arrivalDetail.PoId); + bodyXml = domBody.createElement("z:row"); + bodyXml.setAttribute("cinvcode", detail.InvCode); + bodyXml.setAttribute("iquantity", detail.Quantity); + + + bodyXml.setAttribute("cbatch", ""); + + bodyXml.setAttribute("cposition", detail.Position); + bodyXml.setAttribute("cvmivencode", ""); + bodyXml.setAttribute("dmadedate", ""); + bodyXml.setAttribute("dvdate", ""); + bodyXml.setAttribute("iexpiratdatecalcu", ""); + bodyXml.setAttribute("cmassunit", ""); + bodyXml.setAttribute("imassdate", ""); + bodyXml.setAttribute("cexpirationdate", ""); + bodyXml.setAttribute("dexpirationdate", ""); + bodyXml.setAttribute("citem_class", ""); + bodyXml.setAttribute("citemcode", ""); + bodyXml.setAttribute("cbmemo", ""); + bodyXml.setAttribute("editprop", "A"); + + bodyXml.setAttribute("irowno", domBody.selectSingleNode("//rs:data").childNodes.length + 1); + domBody.selectSingleNode("//rs:data").appendChild(bodyXml); + + } + domHead.selectSingleNode("//rs:data").appendChild(headXml); + var str = voucherParameter.DomBody.xml; + Console.WriteLine(str); + try + { + return UpdateRdVoucher(voucherParameter); + } + catch (Exception err) + { + + throw err; + } + } } } diff --git a/NX.ERP.WebAPi/Controllers/Store/OtherStoreOutController.cs b/NX.ERP.WebAPi/Controllers/Store/OtherStoreOutController.cs index 928c23e..9e88493 100644 --- a/NX.ERP.WebAPi/Controllers/Store/OtherStoreOutController.cs +++ b/NX.ERP.WebAPi/Controllers/Store/OtherStoreOutController.cs @@ -17,5 +17,14 @@ namespace NX.ERP.WebAPi.Controllers.Store var dal = new NX.ERP.U8.Store.OtherStoreOutDAL(); return dal.AddVocher(storeIn); } + + + [Route("api/OtherOut/Update")] + [HttpPost] + public bool UpdateVoucher([FromBody] Model.Request.OtherStoreInOut storeIn) + { + var dal = new NX.ERP.U8.Store.OtherStoreOutDAL(); + return dal.UpdateVocher(storeIn); + } } } \ No newline at end of file diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index 3c461db..48b7482 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -7,7 +7,7 @@ - +