修改挂账API 返回单号

This commit is contained in:
gongxh
2021-06-01 11:44:55 +08:00
parent 8d76e37b42
commit 7a5b683d98
3 changed files with 25 additions and 10 deletions

View File

@@ -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<string>(strsql, new { id }, null, 30, System.Data.CommandType.Text);
return "";
}
return code;
}
catch (Exception err)
{