From 7a5b683d980d0769ad1c8ff295191796cd987a0a Mon Sep 17 00:00:00 2001 From: gongxh Date: Tue, 1 Jun 2021 11:44:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8C=82=E8=B4=A6API=20?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.BLL/Model/InboundDetail.cs | 2 +- NX.ERP.Model/Request/ProductStoreInDetail.cs | 2 +- NX.ERP.U8/AP/APVouch.cs | 31 +++++++++++++++----- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/NX.ERP.BLL/Model/InboundDetail.cs b/NX.ERP.BLL/Model/InboundDetail.cs index 09fdafd..ef3c38c 100644 --- a/NX.ERP.BLL/Model/InboundDetail.cs +++ b/NX.ERP.BLL/Model/InboundDetail.cs @@ -13,7 +13,7 @@ namespace NX.ERP.BLL.Model public string BinCode { get; set; } - public string UniqueLabel { get; set; } + public IEnumerable UniqueLabel { get; set; } } } diff --git a/NX.ERP.Model/Request/ProductStoreInDetail.cs b/NX.ERP.Model/Request/ProductStoreInDetail.cs index 4a91662..ef8be2b 100644 --- a/NX.ERP.Model/Request/ProductStoreInDetail.cs +++ b/NX.ERP.Model/Request/ProductStoreInDetail.cs @@ -13,7 +13,7 @@ namespace NX.ERP.Model.Request public string Position { get; set; } public int SourceDetailId { get; set; } - public string UniqueLabel { get; set; } + public IEnumerable UniqueLabel { get; set; } } diff --git a/NX.ERP.U8/AP/APVouch.cs b/NX.ERP.U8/AP/APVouch.cs index 14b9477..1e1cca5 100644 --- a/NX.ERP.U8/AP/APVouch.cs +++ b/NX.ERP.U8/AP/APVouch.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using UFIDA.U8.U8APIFramework; using UFIDA.U8.U8MOMAPIFramework; - +using Dapper; namespace NX.ERP.U8.AP { public class APVouch : STVoucherBase @@ -47,6 +47,11 @@ namespace NX.ERP.U8.AP } + + + + + protected override void LoadRdVoucher(STVoucherParameter para) { @@ -196,6 +201,7 @@ namespace NX.ERP.U8.AP public string AddVocher(NX.ERP.Model.Request.ApVouch ApVouch) { + var id = Guid.NewGuid().ToString().Replace("-", ""); STVoucherParameter voucherParameter = new STVoucherParameter { VoucherType = this.VoucherID, @@ -220,11 +226,12 @@ namespace NX.ERP.U8.AP headXml.setAttribute("VT_ID", 8056); headXml.setAttribute("bd_c", false); headXml.setAttribute("bStartFlag", false); - headXml.setAttribute("cVouchID",""); + headXml.setAttribute("cVouchID", ""); headXml.setAttribute("cFlag", "AP"); headXml.setAttribute("cDeptCode", ApVouch.DeptCode); headXml.setAttribute("cDigest", ApVouch.Digest); - // headXml.setAttribute("cLink", ""); + headXml.setAttribute("cDefine10", id); + // headXml.setAttribute("cLink", ""); IXMLDOMElement bodyXml; //for (var n = 0; n < storeIn.details.Count(); n++) @@ -239,23 +246,31 @@ namespace NX.ERP.U8.AP bodyXml.setAttribute("iAmount", ApVouch.Amount); bodyXml.setAttribute("iAmount_f", ApVouch.Amount); bodyXml.setAttribute("iAmt_s", 0); - // bodyXml.setAttribute("cLink", ""); + // bodyXml.setAttribute("cLink", ""); headXml.setAttribute("cDwCode", ApVouch.supplierCode); bodyXml.setAttribute("bd_c", true); domBody.selectSingleNode("//rs:data").appendChild(bodyXml); //} domHead.selectSingleNode("//rs:data").appendChild(headXml); - + try { - AddRdVoucher(voucherParameter); + AddRdVoucher(voucherParameter); ///处理单号不增加的异常 - var number = new NX.ERP.U8.VoucherHistory(); + var number = new NX.ERP.U8.VoucherHistory(); number.IncNumber("P0", "单据日期", ApVouch.Date.ToString("yyyyMM")); + var strsql = "select Auto_ID from AP_ApVouch where cDefine10=@id"; + string code = ""; + using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection) + { + code = conn.ExecuteScalar(strsql, new { id }, null, 30, System.Data.CommandType.Text); - return ""; + } + + + return code; } catch (Exception err) {