修改挂账API 返回单号
This commit is contained in:
@@ -13,7 +13,7 @@ namespace NX.ERP.BLL.Model
|
|||||||
public string BinCode { get; set; }
|
public string BinCode { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public string UniqueLabel { get; set; }
|
public IEnumerable<string> UniqueLabel { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace NX.ERP.Model.Request
|
|||||||
public string Position { get; set; }
|
public string Position { get; set; }
|
||||||
public int SourceDetailId { get; set; }
|
public int SourceDetailId { get; set; }
|
||||||
|
|
||||||
public string UniqueLabel { get; set; }
|
public IEnumerable<string> UniqueLabel { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using UFIDA.U8.U8APIFramework;
|
using UFIDA.U8.U8APIFramework;
|
||||||
using UFIDA.U8.U8MOMAPIFramework;
|
using UFIDA.U8.U8MOMAPIFramework;
|
||||||
|
using Dapper;
|
||||||
namespace NX.ERP.U8.AP
|
namespace NX.ERP.U8.AP
|
||||||
{
|
{
|
||||||
public class APVouch : STVoucherBase
|
public class APVouch : STVoucherBase
|
||||||
@@ -47,6 +47,11 @@ namespace NX.ERP.U8.AP
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected override void LoadRdVoucher(STVoucherParameter para)
|
protected override void LoadRdVoucher(STVoucherParameter para)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -196,6 +201,7 @@ namespace NX.ERP.U8.AP
|
|||||||
public string AddVocher(NX.ERP.Model.Request.ApVouch ApVouch)
|
public string AddVocher(NX.ERP.Model.Request.ApVouch ApVouch)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var id = Guid.NewGuid().ToString().Replace("-", "");
|
||||||
STVoucherParameter voucherParameter = new STVoucherParameter
|
STVoucherParameter voucherParameter = new STVoucherParameter
|
||||||
{
|
{
|
||||||
VoucherType = this.VoucherID,
|
VoucherType = this.VoucherID,
|
||||||
@@ -220,11 +226,12 @@ namespace NX.ERP.U8.AP
|
|||||||
headXml.setAttribute("VT_ID", 8056);
|
headXml.setAttribute("VT_ID", 8056);
|
||||||
headXml.setAttribute("bd_c", false);
|
headXml.setAttribute("bd_c", false);
|
||||||
headXml.setAttribute("bStartFlag", false);
|
headXml.setAttribute("bStartFlag", false);
|
||||||
headXml.setAttribute("cVouchID","");
|
headXml.setAttribute("cVouchID", "");
|
||||||
headXml.setAttribute("cFlag", "AP");
|
headXml.setAttribute("cFlag", "AP");
|
||||||
headXml.setAttribute("cDeptCode", ApVouch.DeptCode);
|
headXml.setAttribute("cDeptCode", ApVouch.DeptCode);
|
||||||
headXml.setAttribute("cDigest", ApVouch.Digest);
|
headXml.setAttribute("cDigest", ApVouch.Digest);
|
||||||
// headXml.setAttribute("cLink", "");
|
headXml.setAttribute("cDefine10", id);
|
||||||
|
// headXml.setAttribute("cLink", "");
|
||||||
IXMLDOMElement bodyXml;
|
IXMLDOMElement bodyXml;
|
||||||
|
|
||||||
//for (var n = 0; n < storeIn.details.Count(); n++)
|
//for (var n = 0; n < storeIn.details.Count(); n++)
|
||||||
@@ -239,7 +246,7 @@ namespace NX.ERP.U8.AP
|
|||||||
bodyXml.setAttribute("iAmount", ApVouch.Amount);
|
bodyXml.setAttribute("iAmount", ApVouch.Amount);
|
||||||
bodyXml.setAttribute("iAmount_f", ApVouch.Amount);
|
bodyXml.setAttribute("iAmount_f", ApVouch.Amount);
|
||||||
bodyXml.setAttribute("iAmt_s", 0);
|
bodyXml.setAttribute("iAmt_s", 0);
|
||||||
// bodyXml.setAttribute("cLink", "");
|
// bodyXml.setAttribute("cLink", "");
|
||||||
headXml.setAttribute("cDwCode", ApVouch.supplierCode);
|
headXml.setAttribute("cDwCode", ApVouch.supplierCode);
|
||||||
bodyXml.setAttribute("bd_c", true);
|
bodyXml.setAttribute("bd_c", true);
|
||||||
|
|
||||||
@@ -249,13 +256,21 @@ namespace NX.ERP.U8.AP
|
|||||||
|
|
||||||
try
|
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"));
|
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<string>(strsql, new { id }, null, 30, System.Data.CommandType.Text);
|
||||||
|
|
||||||
return "";
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return code;
|
||||||
}
|
}
|
||||||
catch (Exception err)
|
catch (Exception err)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user