添加采购入库单接口
统一
This commit is contained in:
@@ -14,7 +14,7 @@ namespace NX.ERP.U8.Store
|
||||
public class MaterielStoreOutDAL : VoucherBase
|
||||
{
|
||||
|
||||
public MaterielStoreOutDAL() : base("11")
|
||||
public MaterielStoreOutDAL() : base("11", "U8API/MaterialOut")
|
||||
{
|
||||
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
try
|
||||
{
|
||||
return U8LoginContext.Instance.AddRdVoucher("U8API/MaterialOut/Add", voucherParameter);
|
||||
return U8LoginContext.Instance.AddRdVoucher(AddUrl, voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
public class OtherStoreInDAL : VoucherBase
|
||||
{
|
||||
public OtherStoreInDAL() : base("08")
|
||||
public OtherStoreInDAL() : base("08", "U8API/otherin")
|
||||
{
|
||||
|
||||
}
|
||||
@@ -86,7 +86,7 @@ namespace NX.ERP.U8.Store
|
||||
Console.WriteLine(str);
|
||||
try
|
||||
{
|
||||
return U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter);
|
||||
return U8LoginContext.Instance.AddRdVoucher(AddUrl, voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
public class OtherStoreOutDAL : VoucherBase
|
||||
{
|
||||
public OtherStoreOutDAL() : base("09")
|
||||
public OtherStoreOutDAL() : base("09", "U8API/otherout")
|
||||
{
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace NX.ERP.U8.Store
|
||||
Console.WriteLine(str);
|
||||
try
|
||||
{
|
||||
return U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter);
|
||||
return U8LoginContext.Instance.AddRdVoucher(AddUrl, voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
public class PuStoreInDAL : VoucherBase
|
||||
{
|
||||
public PuStoreInDAL() : base("01")
|
||||
public PuStoreInDAL() : base("01", "U8API/PuStoreIn")
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
@@ -65,9 +65,9 @@ namespace NX.ERP.U8.Store
|
||||
headXml.setAttribute("cptcode", Arrival.PTCode);
|
||||
|
||||
IXMLDOMElement bodyXml;
|
||||
for (var n = 0; n < puStoreIn.PuStoreInDetails.Count; n++)
|
||||
for (var n = 0; n < puStoreIn.Details.Count; n++)
|
||||
{
|
||||
var detail = puStoreIn.PuStoreInDetails[n];
|
||||
var detail = puStoreIn.Details[n];
|
||||
var arrivalDetail = Arrival.ArrivalDetails.First(m => { return m.Id == detail.SorceDetailId; });
|
||||
headXml.setAttribute("cordercode", arrivalDetail.OrderCode);
|
||||
// headXml.setAttribute("ipurorderid", arrivalDetail.PoId);
|
||||
@@ -110,7 +110,7 @@ namespace NX.ERP.U8.Store
|
||||
Console.WriteLine(str);
|
||||
try
|
||||
{
|
||||
return U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter);
|
||||
return U8LoginContext.Instance.AddRdVoucher(AddUrl, voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,23 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
private string voucherID;
|
||||
|
||||
private string Url;
|
||||
|
||||
public string LoadUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{Url}/Load";
|
||||
}
|
||||
}
|
||||
|
||||
public string AddUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{Url}/Add";
|
||||
}
|
||||
}
|
||||
|
||||
protected string VoucherID
|
||||
{
|
||||
@@ -18,14 +35,15 @@ namespace NX.ERP.U8.Store
|
||||
return this.voucherID;
|
||||
}
|
||||
}
|
||||
public VoucherBase(string voucherID)
|
||||
public VoucherBase(string voucherID, string Url)
|
||||
{
|
||||
this.voucherID = voucherID;
|
||||
this.Url = Url;
|
||||
}
|
||||
|
||||
protected string HeadTemplate
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetHeadTemplate();
|
||||
}
|
||||
@@ -42,7 +60,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
private string GetHeadTemplate()
|
||||
{
|
||||
var strTemlate = FileHelp.ReadFile(AppDomain.CurrentDomain.BaseDirectory + $"XMLDOM\\XMLDomHead{this.voucherID}.xml");
|
||||
var strTemlate = FileHelp.ReadFile(AppDomain.CurrentDomain.RelativeSearchPath + $"XMLDOM\\XMLDomHead{this.voucherID}.xml");
|
||||
if (strTemlate == string.Empty)
|
||||
{
|
||||
this.LoadTemplate();
|
||||
@@ -53,7 +71,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
private string GetBodyTemplate()
|
||||
{
|
||||
var strTemlate = FileHelp.ReadFile(AppDomain.CurrentDomain.BaseDirectory + $"XMLDOM\\XMLDomBody{this.voucherID}.xml");
|
||||
var strTemlate = FileHelp.ReadFile(AppDomain.CurrentDomain.RelativeSearchPath + $"XMLDOM\\XMLDomBody{this.voucherID}.xml");
|
||||
if (strTemlate == string.Empty)
|
||||
{
|
||||
this.LoadTemplate();
|
||||
@@ -68,18 +86,18 @@ namespace NX.ERP.U8.Store
|
||||
VoucherParameter rdVoucherParameter = null;
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "XMLDOM"))
|
||||
if (!Directory.Exists(AppDomain.CurrentDomain.RelativeSearchPath + "XMLDOM"))
|
||||
{
|
||||
Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "XMLDOM");
|
||||
Directory.CreateDirectory(AppDomain.CurrentDomain.RelativeSearchPath + "XMLDOM");
|
||||
}
|
||||
rdVoucherParameter = new VoucherParameter();
|
||||
rdVoucherParameter.VoucherType =this.VoucherID;
|
||||
rdVoucherParameter.VoucherType = this.VoucherID;
|
||||
rdVoucherParameter.IsGetBlank = true;
|
||||
U8LoginContext.Instance.LoadRdVoucher(rdVoucherParameter);
|
||||
U8LoginContext.Instance.LoadRdVoucher(this.LoadUrl, rdVoucherParameter);
|
||||
if (rdVoucherParameter.ReturnValue)
|
||||
{
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomHead.xml, AppDomain.CurrentDomain.BaseDirectory + $"XMLDOM\\XMLDomHead{this.voucherID}.xml");
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomBody.xml, AppDomain.CurrentDomain.BaseDirectory + $"XMLDOM\\XMLDomBody{this.voucherID}.xml");
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomHead.xml, AppDomain.CurrentDomain.RelativeSearchPath + $"XMLDOM\\XMLDomHead{this.voucherID}.xml");
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomBody.xml, AppDomain.CurrentDomain.RelativeSearchPath + $"XMLDOM\\XMLDomBody{this.voucherID}.xml");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user