雷池测试
This commit is contained in:
@@ -19,13 +19,24 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// 保存单据
|
||||
/// </summary>
|
||||
/// <param name="login"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="VouchClass"></param>
|
||||
/// <param name="bGetCode"></param>
|
||||
/// <param name="codeKey"></param>
|
||||
/// <param name="bPrintDom"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> SaveVouch(BaseLogin login, Dictionary<string, object> input,string VouchClass,bool bGetCode=false,string codeKey="",bool bPrintDom=false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var clsVouchFacade = $"UFAPBO.clsVouchFacade".GetComObject();
|
||||
|
||||
clsVouchFacade.Init(VouchClass, login._vbLogin, login.Connection);
|
||||
clsVouchFacade.Init(VouchClass, login._vbLogin);
|
||||
|
||||
IXMLDOMDocument2 domHead = new DOMDocument();
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
@@ -50,37 +61,39 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
throw new Exception("无法获取表体数据");
|
||||
}
|
||||
|
||||
if (bGetCode)
|
||||
{
|
||||
var cardNum = "";
|
||||
//if (bGetCode)
|
||||
//{
|
||||
// var cardNum = "";
|
||||
|
||||
switch (VouchClass)
|
||||
{
|
||||
case "收款单":
|
||||
cardNum = "AR48";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// switch (VouchClass)
|
||||
// {
|
||||
// case "收款单":
|
||||
// cardNum = "AR48";
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
|
||||
var clsBillComponent = "UFBillComponent.clsBillComponent".GetComObject();
|
||||
// //var clsBillComponent = "UFBillComponent.clsBillComponent".GetComObject();
|
||||
|
||||
if (!clsBillComponent.InitBill(login._vbLogin.UfDbName, cardNum))
|
||||
{
|
||||
throw new Exception("初始化单据编号组件失败");
|
||||
}
|
||||
// //if (!clsBillComponent.InitBill(login._vbLogin.UfDbName, cardNum))
|
||||
// //{
|
||||
// // throw new Exception("初始化单据编号组件失败");
|
||||
// //}
|
||||
|
||||
var newCode = clsBillComponent.GetNumber(clsBillComponent.GetBillFormat());
|
||||
// //var newCode = clsBillComponent.GetNumber(clsBillComponent.GetBillFormat());
|
||||
|
||||
logInfo.Debug($"获取新单号:{newCode}");
|
||||
// var newCode = "0000000001";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(newCode))
|
||||
{
|
||||
CommonHelper.SetDomKeyValue(domHead, codeKey, newCode);
|
||||
}
|
||||
// logInfo.Debug($"获取新单号:{newCode}");
|
||||
|
||||
input[codeKey] = newCode;
|
||||
}
|
||||
// if (!string.IsNullOrWhiteSpace(newCode))
|
||||
// {
|
||||
// CommonHelper.SetDomKeyValue(domHead, codeKey, newCode);
|
||||
// }
|
||||
|
||||
// input[codeKey] = newCode;
|
||||
//}
|
||||
|
||||
logInfo.Debug("填充表体DOM...");
|
||||
domBody = dictionarys.ToDocument2(domBody);
|
||||
@@ -96,8 +109,6 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
|
||||
var res = new BaseResult<string>();
|
||||
|
||||
clsVouchFacade.bOutTrans = true;
|
||||
|
||||
res.bSuccess = clsVouchFacade.SaveVouch(domHead, domBody, ref errMsg);
|
||||
|
||||
if (!res.bSuccess)
|
||||
|
||||
Reference in New Issue
Block a user