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) {