修改项目格式
This commit is contained in:
@@ -19,7 +19,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public string AddVocher(MaterielStoreOut storeOut)
|
||||
{
|
||||
@@ -34,20 +34,13 @@ namespace NX.ERP.U8.Store
|
||||
voucherParameter.DomHead.loadXML(HeadTemplate);
|
||||
voucherParameter.DomBody.loadXML(BodyTemplate);
|
||||
IXMLDOMElement headXml = domHead.createElement("z:row");
|
||||
//headXml.setAttribute("id", storeOut.Id);
|
||||
|
||||
headXml.setAttribute("ccode", storeOut.Code); //DomHead[0]["ccode"] = ""; //入库单号,string类型
|
||||
|
||||
headXml.setAttribute("ddate", storeOut.Date.ToShortDateString()); //DomHead[0]["ddate"] = ""; //入库日期,DateTime类型
|
||||
|
||||
|
||||
|
||||
headXml.setAttribute("bpufirst", "0");
|
||||
headXml.setAttribute("bisstqc", "0");
|
||||
headXml.setAttribute("bomfirst", "0");
|
||||
headXml.setAttribute("biafirst", "0");
|
||||
headXml.setAttribute("brdflag", 0);
|
||||
|
||||
headXml.setAttribute("cmaker", "");
|
||||
headXml.setAttribute("cvouchtype", this.VoucherID);
|
||||
headXml.setAttribute("vt_id", "65");
|
||||
@@ -78,7 +71,7 @@ namespace NX.ERP.U8.Store
|
||||
bodyXml.setAttribute("autoid", n);
|
||||
bodyXml.setAttribute("cinvcode", detail.Cinvcode);
|
||||
bodyXml.setAttribute("iquantity", detail.Quantity);
|
||||
bodyXml.setAttribute("irowno", n+1);
|
||||
bodyXml.setAttribute("irowno", n + 1);
|
||||
bodyXml.setAttribute("cbatch", "");
|
||||
bodyXml.setAttribute("cvmivencode", "");
|
||||
bodyXml.setAttribute("cposition", detail.BinCode);
|
||||
@@ -89,8 +82,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
bodyXml.setAttribute("impoids", detail.sorceDetailId);
|
||||
bodyXml.setAttribute("cmocode", Order.Code);
|
||||
|
||||
bodyXml.setAttribute("invcode", "904008");
|
||||
bodyXml.setAttribute("invcode", "904008");//产品编码
|
||||
bodyXml.setAttribute("cwhcode", storeOut.Whcode);
|
||||
bodyXml.setAttribute("imoseq", 1);
|
||||
bodyXml.setAttribute("ipesotype", "7");
|
||||
@@ -101,15 +93,6 @@ namespace NX.ERP.U8.Store
|
||||
bodyXml.setAttribute("csocode", "");
|
||||
bodyXml.setAttribute("isodid", "");
|
||||
bodyXml.setAttribute("isoseq", "");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
|
||||
}
|
||||
}
|
||||
@@ -118,7 +101,7 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
try
|
||||
{
|
||||
return U8LoginContext.Instance.AddRdVoucher(AddUrl, voucherParameter);
|
||||
return AddRdVoucher(voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace NX.ERP.U8.Store
|
||||
Console.WriteLine(str);
|
||||
try
|
||||
{
|
||||
return U8LoginContext.Instance.AddRdVoucher(AddUrl, voucherParameter);
|
||||
return AddRdVoucher(voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace NX.ERP.U8.Store
|
||||
Console.WriteLine(str);
|
||||
try
|
||||
{
|
||||
return U8LoginContext.Instance.AddRdVoucher(AddUrl, voucherParameter);
|
||||
return AddRdVoucher( voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace NX.ERP.U8.Store
|
||||
Console.WriteLine(str);
|
||||
try
|
||||
{
|
||||
return U8LoginContext.Instance.AddRdVoucher(AddUrl, voucherParameter);
|
||||
return AddRdVoucher(voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
21
NX.ERP.U8/Store/SaleOutDAL.cs
Normal file
21
NX.ERP.U8/Store/SaleOutDAL.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.U8.Store
|
||||
{
|
||||
public class SaleOutDAL : VoucherBase
|
||||
{
|
||||
public SaleOutDAL() : base("32", "U8API/saleout")
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using MSXML2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UFIDA.U8.U8APIFramework;
|
||||
using UFIDA.U8.U8MOMAPIFramework;
|
||||
|
||||
namespace NX.ERP.U8.Store
|
||||
{
|
||||
@@ -10,13 +13,29 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
private string voucherID;
|
||||
|
||||
private string Url;
|
||||
private string BaseUrl;
|
||||
|
||||
private string BodyFile
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{AppDomain.CurrentDomain.BaseDirectory}XMLDOM\\XMLDomBody{this.voucherID}.xml";
|
||||
}
|
||||
}
|
||||
|
||||
private string HeadFile
|
||||
{
|
||||
|
||||
get
|
||||
{
|
||||
return $"{AppDomain.CurrentDomain.BaseDirectory}XMLDOM\\XMLDomHead{this.voucherID}.xml";
|
||||
}
|
||||
}
|
||||
public string LoadUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{Url}/Load";
|
||||
return $"{BaseUrl}/Load";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +43,7 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{Url}/Add";
|
||||
return $"{BaseUrl}/Add";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +57,7 @@ namespace NX.ERP.U8.Store
|
||||
public VoucherBase(string voucherID, string Url)
|
||||
{
|
||||
this.voucherID = voucherID;
|
||||
this.Url = Url;
|
||||
this.BaseUrl = Url;
|
||||
}
|
||||
|
||||
protected string HeadTemplate
|
||||
@@ -60,7 +79,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(HeadFile);
|
||||
if (strTemlate == string.Empty)
|
||||
{
|
||||
this.LoadTemplate();
|
||||
@@ -71,7 +90,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(BodyFile);
|
||||
if (strTemlate == string.Empty)
|
||||
{
|
||||
this.LoadTemplate();
|
||||
@@ -81,7 +100,165 @@ namespace NX.ERP.U8.Store
|
||||
}
|
||||
|
||||
|
||||
public void LoadTemplate()
|
||||
|
||||
private 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);
|
||||
u8ApiBroker.AssignNormalValue("sVouchType", para.VoucherType);
|
||||
u8ApiBroker.AssignNormalValue("sWhere", para.StrWhere);
|
||||
u8ApiBroker.AssignNormalValue("domPos", new DOMDocumentClass());
|
||||
u8ApiBroker.AssignNormalValue("bGetBlank", para.IsGetBlank);
|
||||
u8ApiBroker.AssignNormalValue("sBodyWhere_Order", para.SBodyWhere_Order);
|
||||
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("DomHead") as DOMDocument;
|
||||
if (dOMDocument != null)
|
||||
{
|
||||
para.DomHead = new DOMDocumentClass();
|
||||
para.DomHead.loadXML(dOMDocument.xml);
|
||||
}
|
||||
DOMDocument dOMDocument2 = u8ApiBroker.GetResult("domBody") as DOMDocument;
|
||||
if (dOMDocument2 != null)
|
||||
{
|
||||
para.DomBody = new DOMDocumentClass();
|
||||
para.DomBody.loadXML(dOMDocument2.xml);
|
||||
}
|
||||
DOMDocument dOMDocument3 = u8ApiBroker.GetResult("domPos") as DOMDocument;
|
||||
if (dOMDocument3 != null)
|
||||
{
|
||||
para.DomPosition = new DOMDocumentClass();
|
||||
para.DomPosition.loadXML(dOMDocument3.xml);
|
||||
}
|
||||
para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue());
|
||||
para.ErrMsg = u8ApiBroker.GetResult("errMsg") as string;
|
||||
u8ApiBroker.Release();
|
||||
}
|
||||
catch (Exception ex3)
|
||||
{
|
||||
throw ex3;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected string AddRdVoucher(VoucherParameter para)
|
||||
{
|
||||
string VoucherId;
|
||||
try
|
||||
{
|
||||
U8EnvContext u8EnvContext = new U8EnvContext();
|
||||
u8EnvContext.U8Login = U8LoginContext.Instance.ClsLogin;
|
||||
U8ApiAddress apiAddress = new U8ApiAddress(this.AddUrl);
|
||||
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);
|
||||
u8ApiBroker.AssignNormalValue("sVouchType", para.VoucherType);
|
||||
u8ApiBroker.AssignNormalValue("DomHead", para.DomHead);
|
||||
u8ApiBroker.AssignNormalValue("domBody", para.DomBody);
|
||||
if (para.DomPosition != null && para.DomPosition.selectNodes("//z:row").length != 0)
|
||||
{
|
||||
u8ApiBroker.AssignNormalValue("domPosition", para.DomPosition);
|
||||
}
|
||||
|
||||
u8ApiBroker.AssignNormalValue("cnnFrom", null);
|
||||
if (para.DOMMsg != null)
|
||||
{
|
||||
u8ApiBroker.AssignNormalValue("domMsg", para.DOMMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
u8ApiBroker.AssignNormalValue("domMsg", new DOMDocumentClass());
|
||||
}
|
||||
u8ApiBroker.AssignNormalValue("bCheck", para.IsCheck);
|
||||
u8ApiBroker.AssignNormalValue("bBeforCheckStock", para.IsBeforCheckStock);
|
||||
u8ApiBroker.AssignNormalValue("bIsRedVouch", para.IsRedVouch);
|
||||
u8ApiBroker.AssignNormalValue("sAddedState", para.AddedState);
|
||||
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.DOMMsg = u8ApiBroker.GetResult("domMsg") as DOMDocument;
|
||||
|
||||
para.ErrMsg = u8ApiBroker.GetResult("errMsg") as string;
|
||||
if (para.ReturnValue)
|
||||
{
|
||||
para.VoucherId = u8ApiBroker.GetResult("VouchId") as string;
|
||||
VoucherId = para.VoucherId;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(para.ErrMsg);
|
||||
}
|
||||
u8ApiBroker.Release();
|
||||
return VoucherId;
|
||||
}
|
||||
catch (Exception ex3)
|
||||
{
|
||||
|
||||
throw ex3;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void LoadTemplate()
|
||||
{
|
||||
VoucherParameter rdVoucherParameter = null;
|
||||
try
|
||||
@@ -90,14 +267,16 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
Directory.CreateDirectory(AppDomain.CurrentDomain.RelativeSearchPath + "XMLDOM");
|
||||
}
|
||||
rdVoucherParameter = new VoucherParameter();
|
||||
rdVoucherParameter.VoucherType = this.VoucherID;
|
||||
rdVoucherParameter.IsGetBlank = true;
|
||||
U8LoginContext.Instance.LoadRdVoucher(this.LoadUrl, rdVoucherParameter);
|
||||
rdVoucherParameter = new VoucherParameter
|
||||
{
|
||||
VoucherType = this.VoucherID,
|
||||
IsGetBlank = true
|
||||
};
|
||||
this.LoadRdVoucher(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, HeadFile);
|
||||
FileHelp.WriteFile(rdVoucherParameter.DomBody.xml, BodyFile);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -106,11 +285,6 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user