From 7308892ff431885dc614a07c01ff4d0b2843f1c9 Mon Sep 17 00:00:00 2001 From: gongxh Date: Sat, 10 Jul 2021 16:01:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=87=BA=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E9=A2=86=E6=96=99=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.U8/Store/MaterielStoreOutDAL.cs | 93 ++++++++++++++++++++++++-- NX.ERP.WebAPi/Web.config | 4 +- 2 files changed, 89 insertions(+), 8 deletions(-) diff --git a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs index 8c817ab..e6f6979 100644 --- a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs +++ b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs @@ -222,7 +222,7 @@ namespace NX.ERP.U8.Store voucherParameter.DomHead.loadXML(HeadTemplate); voucherParameter.DomBody.loadXML(BodyTemplate); IXMLDOMElement headXml = domHead.createElement("z:row"); - headXml.setAttribute("ccode", storeOut.Code); //DomHead[0]["ccode"] = ""; //入库单号,string类型 + headXml.setAttribute("ccode","AAA"/* storeOut.Code*/); //DomHead[0]["ccode"] = ""; //入库单号,string类型 headXml.setAttribute("ddate", storeOut.Date.ToShortDateString()); //DomHead[0]["ddate"] = ""; //入库日期,DateTime类型 headXml.setAttribute("bpufirst", "0"); headXml.setAttribute("bisstqc", "0"); @@ -342,11 +342,6 @@ namespace NX.ERP.U8.Store bodyXml = domBody.createElement("z:row"); var metail = new NX.ERP.U8.MaterialDAL().GetInvPrice(detail.InvCode, 1, storeOut.Whcode, out var _cost); - - - - - bodyXml.setAttribute("iunitcost", _cost); var info = new Account.Accinformation(); bodyXml.setAttribute("iprice", info.FormatMoney(_cost * detail.Quantity)); @@ -380,6 +375,92 @@ namespace NX.ERP.U8.Store } + } else if (storeOut.Source=="领料申请单") + { + + var metailApp = new U8.Store.MaterialAppDAL().GetModel(storeOut.SourceCode); + if (metailApp == null) + { + throw new Exception("未知的领料申请单"); + } + + string lastProductNo = null; + decimal moqty = 0; + string DeptName = ""; + string moCode = ""; + string DeptCode = ""; + IXMLDOMElement bodyXml; + for (var n = 0; n < storeOut.Details.Count(); n++) + { + var detail = storeOut.Details[n]; + var materialAppDetail = metailApp.MaterialAppVouchsLst.FirstOrDefault(m => m.MaterialAppDtlId == detail.SorceDetailId); + if (materialAppDetail == null) + { + throw new Exception("未知明细"); + } + + if (lastProductNo == null) + { + lastProductNo = materialAppDetail.ProductNo; + moqty = materialAppDetail.MoQuantity; + DeptName = materialAppDetail.DeptName; + DeptCode = materialAppDetail.DeptCode; + moCode = materialAppDetail.MoCode; + } + else if (lastProductNo != "" && lastProductNo != materialAppDetail.ProductNo) + { + lastProductNo = ""; + moqty = 0; + } + bodyXml = domBody.createElement("z:row"); + var metail = new NX.ERP.U8.MaterialDAL().GetInvPrice(detail.InvCode, 1, storeOut.Whcode, out var _cost); + bodyXml.setAttribute("iunitcost", _cost); + bodyXml.setAttribute("imaids", materialAppDetail.MaterialAppDtlId);// + var info = new Account.Accinformation(); + bodyXml.setAttribute("iprice", info.FormatMoney(_cost * detail.Quantity)); + bodyXml.setAttribute("cinvcode", detail.InvCode); + bodyXml.setAttribute("iquantity", detail.Quantity); + bodyXml.setAttribute("irowno", domBody.selectSingleNode("//rs:data").childNodes.length + 1); + bodyXml.setAttribute("cbatch", ""); + bodyXml.setAttribute("cvmivencode", ""); + bodyXml.setAttribute("cposition", detail.Position); + bodyXml.setAttribute("editprop", "A"); + bodyXml.setAttribute("innum", 10); + bodyXml.setAttribute("imoseq", materialAppDetail.Moseq); + bodyXml.setAttribute("inquantity", materialAppDetail.Quantit - materialAppDetail.OutQuantity); + bodyXml.setAttribute("crejectcode", materialAppDetail.RejectCode); + bodyXml.setAttribute("iOMoMID", materialAppDetail.OmomId); + bodyXml.setAttribute("iopseq", materialAppDetail.OpSeq); + bodyXml.setAttribute("copdesc", materialAppDetail.OpDesc); + bodyXml.setAttribute("invcode", materialAppDetail.MaterialCode); + bodyXml.setAttribute("cMoLotCode", materialAppDetail.MoLotCode); + bodyXml.setAttribute("cmocode", materialAppDetail.MoCode); + bodyXml.setAttribute("iMPoIds", materialAppDetail.MPoIds); + bodyXml.setAttribute("comcode", materialAppDetail.OmCode); + bodyXml.setAttribute("iOMoDID", materialAppDetail.OMoDId); + bodyXml.setAttribute("cciqbookcode", materialAppDetail.ciqBookCode); + bodyXml.setAttribute("cmworkcentercode", materialAppDetail.mWorkCenterCode); + bodyXml.setAttribute("cservicecode", materialAppDetail.ServiceCode); + bodyXml.setAttribute("isotype", materialAppDetail.SoType); + bodyXml.setAttribute("csocode", materialAppDetail.SoCode); + bodyXml.setAttribute("isodid", materialAppDetail.SodId); + bodyXml.setAttribute("isoseq", materialAppDetail.SoSeq); + bodyXml.setAttribute("iordertype", materialAppDetail.OrderType); + bodyXml.setAttribute("iordercode", materialAppDetail.OrderCode); + bodyXml.setAttribute("iorderdid", materialAppDetail.OrderdId); + bodyXml.setAttribute("iorderseq", materialAppDetail.OrderSeq); + bodyXml.setAttribute("ipesotype", materialAppDetail.PesoType); + bodyXml.setAttribute("cpesocode", materialAppDetail.PesoCode); + bodyXml.setAttribute("ipesodid", materialAppDetail.PesodId); + bodyXml.setAttribute("ipesoseq", materialAppDetail.PesoSeq); + + domBody.selectSingleNode("//rs:data").appendChild(bodyXml); + + } + + + + } diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index 3e4344f..f7a6455 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -7,8 +7,8 @@ - - + +