增加付款单

This commit is contained in:
gongxh
2021-05-11 19:35:30 +08:00
parent c691407395
commit d53a7b5917
15 changed files with 423 additions and 45 deletions

228
NX.ERP.U8/AP/APVouch.cs Normal file
View File

@@ -0,0 +1,228 @@
using MSXML2;
using NX.ERP.U8.Store;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UFIDA.U8.U8APIFramework;
using UFIDA.U8.U8MOMAPIFramework;
namespace NX.ERP.U8.AP
{
public class APVouch : VoucherBase
{
public APVouch() : base("应付单", "U8API/APVouch")
{
}
protected override string AddUrl
{
get
{
return $"{BaseUrl}/SaveVouch";
}
}
protected override string LoadUrl
{
get
{
return $"{BaseUrl}/GetVouchData";
}
}
protected override string UpdateUrl
{
get
{
return $"{BaseUrl}/SaveVouch";
}
}
protected override void LoadRdVoucher(VoucherParameter para)
{
try
{
U8EnvContext u8EnvContext = new U8EnvContext();
u8EnvContext.U8Login = U8LoginContext.Instance.ClsLogin;
U8ApiAddress apiAddress = new U8ApiAddress(this.LoadUrl);
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);
u8EnvContext.SetApiContext("VouchType",this.VoucherID);
u8ApiBroker.AssignNormalValue("linkid", "0");
if (!u8ApiBroker.Invoke())
{
Exception exception = u8ApiBroker.GetException();
if (exception != null)
{
if (exception is MomSysException)
{
MomSysException ex = exception as MomSysException;
}
else if (exception is MomBizException)
{
MomBizException ex2 = exception as MomBizException;
}
string exceptionString = u8ApiBroker.GetExceptionString();
if (exceptionString.Length != 0)
{
}
}
para.ReturnValue = false;
u8ApiBroker.Release();
return;
}
DOMDocument dOMDocument = u8ApiBroker.GetResult("ohead") as DOMDocument;
if (dOMDocument != null)
{
para.DomHead = new DOMDocumentClass();
para.DomHead.loadXML(dOMDocument.xml);
}
DOMDocument dOMDocument2 = u8ApiBroker.GetResult("obody") as DOMDocument;
if (dOMDocument2 != null)
{
para.DomBody = new DOMDocumentClass();
para.DomBody.loadXML(dOMDocument2.xml);
}
para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue());
para.ErrMsg = u8ApiBroker.GetResult("xmlmsg") as string;
u8ApiBroker.Release();
}
catch (Exception err)
{
throw err;
}
}
protected override string AddRdVoucher(VoucherParameter para)
{
try
{
U8EnvContext u8EnvContext = new U8EnvContext();
u8EnvContext.U8Login = U8LoginContext.Instance.ClsLogin;
U8ApiAddress apiAddress = new U8ApiAddress(this.AddUrl);
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);
u8EnvContext.SetApiContext("VouchType", this.VoucherID);
u8ApiBroker.AssignNormalValue("ohead", para.DomHead);
u8ApiBroker.AssignNormalValue("obody", para.DomBody);
//给普通参数isadd赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示true新增,false修改
u8ApiBroker.AssignNormalValue("isadd",true);
if (para.DOMMsg != null)
{
u8ApiBroker.AssignNormalValue("xmlmsg", para.DOMMsg);
}
else
{
u8ApiBroker.AssignNormalValue("xmlmsg", new DOMDocumentClass());
}
// u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
if (!u8ApiBroker.Invoke())
{
Exception exception = u8ApiBroker.GetException();
if (exception != null)
{
if (exception is MomSysException)
{
MomSysException ex = exception as MomSysException;
}
else if (exception is MomBizException)
{
MomBizException ex2 = exception as MomBizException;
}
string exceptionString = u8ApiBroker.GetExceptionString();
if (exceptionString.Length != 0)
{
}
}
para.ReturnValue = false;
u8ApiBroker.Release();
}
para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue());
para.ErrMsg = u8ApiBroker.GetResult("xmlmsg") as string;
u8ApiBroker.Release();
return "";
}
catch (Exception err)
{
throw err;
}
finally
{
}
}
public string AddVocher()
{
VoucherParameter voucherParameter = new VoucherParameter
{
VoucherType = this.VoucherID,
DomHead = new DOMDocumentClass(),
DomBody = new DOMDocumentClass()
};
DOMDocument domHead = voucherParameter.DomHead;
DOMDocument domBody = voucherParameter.DomBody;
voucherParameter.DomHead.loadXML(HeadTemplate);
voucherParameter.DomBody.loadXML(BodyTemplate);
IXMLDOMElement headXml = domHead.createElement("z:row");
IXMLDOMElement bodyXml;
//for (var n = 0; n < storeIn.details.Count(); n++)
//{
//var detail = storeIn.details[n];
bodyXml = domBody.createElement("z:row");
//}
domHead.selectSingleNode("//rs:data").appendChild(headXml);
var str = voucherParameter.DomBody.xml;
Console.WriteLine(str);
try
{
return AddRdVoucher(voucherParameter);
}
catch (Exception err)
{
throw err;
}
}
}
}

View File

@@ -36,6 +36,7 @@
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Compile Include="AP\APVouch.cs" />
<Compile Include="Base\BinDAL.cs" />
<Compile Include="Base\CustomerDAL.cs" />
<Compile Include="Base\MaterielDAL.cs" />
@@ -70,6 +71,11 @@
<Compile Include="XmlHelper.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="ADODB, Version=2.6.0.0, Culture=neutral, PublicKeyToken=79a4e7ad54eeabca">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>lib\ADODB.dll</HintPath>
</Reference>
<Reference Include="Dapper, Version=1.40.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.1.42\lib\net35\Dapper.dll</HintPath>
</Reference>

View File

@@ -13,7 +13,6 @@ namespace NX.ERP.U8.Store
}
public string AddVocher(Model.Request.OtherStoreInOut storeIn)
{

View File

@@ -13,7 +13,7 @@ namespace NX.ERP.U8.Store
{
private string voucherID;
private string BaseUrl;
protected string BaseUrl;
private static string BasePath;
@@ -50,7 +50,7 @@ namespace NX.ERP.U8.Store
}
}
protected string LoadUrl
protected virtual string LoadUrl
{
get
{
@@ -58,7 +58,7 @@ namespace NX.ERP.U8.Store
}
}
protected string AddUrl
protected virtual string AddUrl
{
get
{
@@ -66,7 +66,7 @@ namespace NX.ERP.U8.Store
}
}
protected string UpdateUrl
protected virtual string UpdateUrl
{
get
{
@@ -131,7 +131,7 @@ namespace NX.ERP.U8.Store
private void LoadRdVoucher(VoucherParameter para)
protected virtual void LoadRdVoucher(VoucherParameter para)
{
try
{
@@ -286,7 +286,7 @@ namespace NX.ERP.U8.Store
}
protected string AddRdVoucher(VoucherParameter para)
protected virtual string AddRdVoucher(VoucherParameter para)
{
string VoucherId;

Binary file not shown.