提交
This commit is contained in:
@@ -3,7 +3,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using ADODB;
|
||||
using MSXML2;
|
||||
using NoteManageAR;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
|
||||
@@ -17,6 +19,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// 收付款单保存
|
||||
/// </summary>
|
||||
/// <param name="baseLogin">登录对象</param>
|
||||
/// <param name="dictionary">单据数据</param>
|
||||
/// <param name="cSubId">子系统Id</param>
|
||||
/// <param name="isAdd">是否新增</param>
|
||||
/// <param name="bFirst">是否期初</param>
|
||||
/// <param name="bodyKey">表体数据字段</param>
|
||||
/// <returns></returns>
|
||||
public BaseResult<dynamic> CloseBillSave(BaseLogin baseLogin,Dictionary<string,object> dictionary,string cSubId,bool isAdd=true, bool bFirst=false,string bodyKey="body")
|
||||
{
|
||||
try
|
||||
@@ -65,5 +77,212 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = "保存失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 收付款单审核
|
||||
/// </summary>
|
||||
/// <param name="baseLogin">登录对象</param>
|
||||
/// <param name="cLink">单号</param>
|
||||
/// <param name="cVouchType">单据类型</param>
|
||||
/// <param name="cVouchID">单据Id</param>
|
||||
/// <param name="cSubId">子系统Id</param>
|
||||
/// <param name="bFirst">是否期初</param>
|
||||
/// <returns></returns>
|
||||
public BaseResult<dynamic> CloseBillSign(BaseLogin baseLogin,string cLink,string cVouchType,string cVouchID, string cSubId, bool bFirst = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
IXMLDOMDocument2 oDom = new DOMDocument();
|
||||
|
||||
oDom.loadXML("<condition/>");
|
||||
|
||||
var oElm = oDom.documentElement;
|
||||
|
||||
oElm.setAttribute("type", 0);
|
||||
oElm.setAttribute("cLink", cLink);
|
||||
oElm.setAttribute("cVouchType", cVouchType);
|
||||
oElm.setAttribute("cVouchID", cVouchID);
|
||||
oElm.setAttribute("bFirst", bFirst);
|
||||
|
||||
var bo = "UFAPBO.clsCloseBill".GetComObject();
|
||||
|
||||
var m_Login = baseLogin._vbLogin;
|
||||
|
||||
var m_conn = new Connection();
|
||||
|
||||
m_conn.Open(m_Login.UfDbName);
|
||||
|
||||
bo.Init(m_Login, m_conn, null, cSubId);
|
||||
|
||||
var errorMessage = "";
|
||||
|
||||
var signFlag = bo.Sign(oElm.xml, ref errorMessage);
|
||||
|
||||
if (!signFlag)
|
||||
throw new Exception(errorMessage);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = true, message = "审核成功", result = "审核成功" };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 票据录入
|
||||
/// </summary>
|
||||
/// <param name="baseLogin">登录对象</param>
|
||||
/// <param name="dictionary">单据数据</param>
|
||||
/// <param name="isAdd">是否新增</param>
|
||||
/// <param name="bFirst"></param>
|
||||
/// <returns></returns>
|
||||
public BaseResult<dynamic> ApNoteSave(BaseLogin baseLogin, Dictionary<string, object> dictionary, string cSubId, bool isAdd = true, bool bFirst = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var m_Login = baseLogin._vbLogin;
|
||||
|
||||
var domHead = dictionary.ToDocument2();
|
||||
|
||||
|
||||
if (cSubId == "AR")
|
||||
{
|
||||
var pub = "NoteManageAR.clsPub".GetComObject();
|
||||
|
||||
pub.main(m_Login);
|
||||
|
||||
var ar = "NoteManageAR.Voucher".GetComObject();
|
||||
|
||||
ar.Init(m_Login, pub.RepSys, pub.RepManager);
|
||||
|
||||
var da = new VoucherDataClass();
|
||||
|
||||
var apar = new APARHelper(da);
|
||||
|
||||
|
||||
|
||||
ar.m_bStartFlag = false;
|
||||
ar.bLastYearBill = false;
|
||||
ar.m_strCardNum = "RP02";
|
||||
ar.m_strVoucherType = "50";
|
||||
ar.m_strVoucherDirect = pub.strNoteDirect;
|
||||
|
||||
|
||||
//ar.bUpdateiAmount = true;
|
||||
//ar.NotExec = true;
|
||||
//ar.NotExec = true;
|
||||
ar.objPub = pub;
|
||||
|
||||
|
||||
|
||||
apar.SetValue(dictionary);
|
||||
|
||||
ar.m_strVoucherID = da.CVouchId;
|
||||
ar.m_VoucherHead = domHead;
|
||||
ar.OneVoucherData = da;
|
||||
|
||||
ar.bNeedBillClosed = true;
|
||||
|
||||
//da.cVouchTypeName = "银行承兑汇票";
|
||||
//da.cPayBillBank = "华夏银行股份有限公司深圳分行营业部";
|
||||
|
||||
var msg = "";
|
||||
|
||||
//logInfo.Debug($"da:{da.ToJson()}");
|
||||
|
||||
//if (!ar.VoucherHeadCheck(da, true, ref msg))
|
||||
//{
|
||||
// throw new Exception(msg);
|
||||
//}
|
||||
|
||||
//msg = "";
|
||||
|
||||
if (!ar.NoteCheck(da, ref msg))
|
||||
{
|
||||
throw new Exception(msg);
|
||||
}
|
||||
msg = "";
|
||||
|
||||
if (!ar.NoteSave(da, ref msg))
|
||||
{
|
||||
throw new Exception(msg);
|
||||
}
|
||||
|
||||
//ar.re
|
||||
|
||||
|
||||
//var bo = "UFAPBO.clsApNote".GetComObject();
|
||||
var apPub = "NoteManageAR.PZ_Proc".GetComObject();
|
||||
|
||||
apPub.objPub = pub;
|
||||
|
||||
var aa=apPub.ProcSign("9A");
|
||||
|
||||
var bb = pub.cNoteCancelNo;
|
||||
|
||||
//var m_conn = new Connection();
|
||||
|
||||
//m_conn.Open(m_Login.UfDbName);
|
||||
|
||||
//bo.Init(m_Login, m_conn);
|
||||
|
||||
//var errorMessage = "";
|
||||
|
||||
//var saveFlag = bo.Sign($"<condition type=\"1\" cLink=\"AR{da.CVouchId}\" cVouchType=\"{da.cVouchType}\" cVouchID=\"{da.CVouchId}\" />", ref errorMessage);
|
||||
|
||||
//if (!saveFlag)
|
||||
// throw new Exception(errorMessage);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = true, message = "保存成功", result = "保存成功" };
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//var ap= "UFAPBO.clsAccount_AP".GetComObject();
|
||||
|
||||
//var bo = "UFAPBO.clsApNote".GetComObject();
|
||||
|
||||
//var a=ap.Init(m_Login, cSubId);
|
||||
//logInfo.Debug($"ap.Init:{a}");
|
||||
|
||||
//var b=ap.InitSubOption2(cSubId);
|
||||
//logInfo.Debug($"ap.InitSubOption2:{b}");
|
||||
//var c=ap.ARAPStart(cSubId);
|
||||
//logInfo.Debug($"ap.ARAPStart:{c}");
|
||||
|
||||
//var m_conn = new Connection();
|
||||
|
||||
//m_conn.Open(m_Login.UfDbName);
|
||||
|
||||
//var d=bo.Init(m_Login);
|
||||
|
||||
//logInfo.Debug($"bo.Init:{d}");
|
||||
|
||||
//var errorMessage = "";
|
||||
|
||||
//var saveFlag = bo.SaveVouch(domHead, ref errorMessage);
|
||||
|
||||
//logInfo.Debug($"bo.SaveVouch:{errorMessage}");
|
||||
|
||||
//if (!saveFlag)
|
||||
// throw new Exception(errorMessage);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = true, message = "保存成功", result = "保存成功" };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = "保存失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NoteManageAR;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
public class APARHelper
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
private readonly VoucherData _vd;
|
||||
private readonly PropertyInfo[] _props;
|
||||
|
||||
public APARHelper(VoucherDataClass vd)
|
||||
{
|
||||
_vd = vd;
|
||||
var tp = vd.GetType();
|
||||
_props = tp.GetProperties();
|
||||
}
|
||||
|
||||
public void SetValue(Dictionary<string, object> dictionary)
|
||||
{
|
||||
foreach (var key in dictionary.Keys)
|
||||
{
|
||||
if (key != "body")
|
||||
logInfo.Debug($"正在设置字段:{key}--{dictionary[key]}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace($"{dictionary[key]}") && _props.Any(a => string.Equals(a.Name, key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var prop = _props.First(a => string.Equals(a.Name, key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
prop.SetPropValue(_vd, dictionary[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using GetComObj;
|
||||
using MSXML2;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NoteManageAR;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
@@ -15,32 +17,172 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
if (prop.PropertyType == typeof(string))
|
||||
{
|
||||
prop.SetValue(obj, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(DateTime))
|
||||
{
|
||||
prop.SetValue(obj, DateTime.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(byte))
|
||||
{
|
||||
prop.SetValue(obj, byte.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(int))
|
||||
{
|
||||
prop.SetValue(obj, int.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(long))
|
||||
{
|
||||
prop.SetValue(obj, long.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(decimal))
|
||||
{
|
||||
prop.SetValue(obj, decimal.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(double))
|
||||
{
|
||||
prop.SetValue(obj, double.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(float))
|
||||
{
|
||||
prop.SetValue(obj, float.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(short))
|
||||
{
|
||||
prop.SetValue(obj, short.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetPropValue(this PropertyInfo prop, VoucherData obj, object value)
|
||||
{
|
||||
if (prop.PropertyType == typeof(string))
|
||||
{
|
||||
prop.SetValue(obj, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(DateTime))
|
||||
{
|
||||
prop.SetValue(obj, DateTime.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(byte))
|
||||
{
|
||||
prop.SetValue(obj, byte.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(int))
|
||||
{
|
||||
prop.SetValue(obj, int.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(long))
|
||||
{
|
||||
prop.SetValue(obj, long.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(decimal))
|
||||
{
|
||||
prop.SetValue(obj, decimal.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(double))
|
||||
{
|
||||
prop.SetValue(obj, double.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(float))
|
||||
{
|
||||
prop.SetValue(obj, float.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(short))
|
||||
{
|
||||
prop.SetValue(obj, short.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
//if (prop.PropertyType == typeof(object))
|
||||
//{
|
||||
// switch (prop.Name)
|
||||
// {
|
||||
// case "cDefine1":
|
||||
// obj.set_cDefine1($"{value}");
|
||||
// break;
|
||||
// case "cDefine2":
|
||||
// obj.set_cDefine2($"{value}");
|
||||
// break;
|
||||
// case "cDefine3":
|
||||
// obj.set_cDefine3($"{value}");
|
||||
// break;
|
||||
// case "cDefine4":
|
||||
// obj.set_cDefine4(DateTime.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine5":
|
||||
// obj.set_cDefine5(int.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine6":
|
||||
// obj.set_cDefine6(DateTime.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine7":
|
||||
// obj.set_cDefine7(float.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine8":
|
||||
// obj.set_cDefine8($"{value}");
|
||||
// break;
|
||||
// case "cDefine9":
|
||||
// obj.set_cDefine9($"{value}");
|
||||
// break;
|
||||
// case "cDefine10":
|
||||
// obj.set_cDefine10($"{value}");
|
||||
// break;
|
||||
// case "cDefine11":
|
||||
// obj.set_cDefine11($"{value}");
|
||||
// break;
|
||||
// case "cDefine12":
|
||||
// obj.set_cDefine12($"{value}");
|
||||
// break;
|
||||
// case "cDefine13":
|
||||
// obj.set_cDefine13($"{value}");
|
||||
// break;
|
||||
// case "cDefine14":
|
||||
// obj.set_cDefine14($"{value}");
|
||||
// break;
|
||||
// case "cDefine15":
|
||||
// obj.set_cDefine15(int.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine16":
|
||||
// obj.set_cDefine16(float.Parse($"{value}"));
|
||||
// break;
|
||||
// default:
|
||||
// prop.SetValue(obj, $"{value}");
|
||||
// break;
|
||||
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
public static IXMLDOMDocument2 ToDocument2(this Dictionary<string,object> dictionary,IXMLDOMDocument2 domDocument2=null)
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
using log4net;
|
||||
using MSXML2;
|
||||
using NoteManageAR;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFSoft.U8.SF.BE;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
{
|
||||
/// <summary>
|
||||
/// 库存管理
|
||||
/// </summary>
|
||||
public class USERPCO
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
|
||||
public async Task<BaseResult<string>> Insert(BaseLogin baseLogin, Dictionary<string, object> dictionary,string sVouchType,bool bCheck=true,bool bBeforCheckStock=true,bool bIsRedVouch=false,string sAddedState="", bool bReMote=false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var co = "USERPCO.USERPCO".GetComObject();
|
||||
|
||||
var errorMsg = "";
|
||||
|
||||
if (!co.IniLogin(baseLogin._vbLogin, ref errorMsg))
|
||||
{
|
||||
await Task.Delay(1);
|
||||
throw new Exception(errorMsg);
|
||||
}
|
||||
|
||||
var domHead = dictionary.ToDocument2();
|
||||
|
||||
if (!dictionary.TryGetValue("body", out var bodys))
|
||||
{
|
||||
await Task.Delay(1);
|
||||
throw new Exception("无法获取表体数据");
|
||||
}
|
||||
|
||||
if (!(bodys is List<Dictionary<string, object>> dictionarys) || dictionarys.Count <= 0)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
throw new Exception("无法获取表体数据");
|
||||
}
|
||||
|
||||
|
||||
var domBody = dictionarys.ToDocument2();
|
||||
IXMLDOMDocument2 domPosition = new DOMDocument();
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
errorMsg = "";
|
||||
baseLogin.Connection.BeginTrans();
|
||||
var vouchId = "";
|
||||
|
||||
var res = new BaseResult<string>();
|
||||
try
|
||||
{
|
||||
res.bSuccess = co.Update(sVouchType, domHead, domBody, domPosition, ref errorMsg, baseLogin.Connection, ref vouchId, ref domMsg, bCheck, bBeforCheckStock, bIsRedVouch, sAddedState, bReMote);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
throw ex;
|
||||
}
|
||||
|
||||
if (!res.bSuccess)
|
||||
{
|
||||
res.message = "新增失败";
|
||||
res.result = errorMsg;
|
||||
}
|
||||
else
|
||||
{
|
||||
res.message = "新增成功";
|
||||
res.result = vouchId;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
//var bodys = dictionary.TryGetValue() dictionary["body"];
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<BaseResult<string>> Update(BaseLogin baseLogin, Dictionary<string, object> dictionary, string sCardNum , string sVouchType,
|
||||
bool bCheck = true, bool bBeforCheckStock = true, bool bIsRedVouch = false, string sAddedState = "",
|
||||
bool bUpdateNeedEas = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
var co = "USERPCO.VoucherCO".GetComObject();
|
||||
|
||||
var errorMsg = "";
|
||||
|
||||
if (!co.IniLogin(baseLogin._vbLogin, ref errorMsg))
|
||||
{
|
||||
await Task.Delay(1);
|
||||
throw new Exception(errorMsg);
|
||||
}
|
||||
|
||||
IXMLDOMDocument2 domHead = new DOMDocument();
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domPosition = new DOMDocument();
|
||||
errorMsg = "";
|
||||
if (!co.GetDefaultVoucherDom(sVouchType, sCardNum, ref domHead, ref domBody, ref domPosition, ref errorMsg))
|
||||
{
|
||||
throw new Exception(errorMsg);
|
||||
}
|
||||
|
||||
domHead = dictionary.ToDocument2(domHead);
|
||||
|
||||
var bodys = dictionary["body"] as List<Dictionary<string, object>> ?? $"{dictionary["body"]}".ToObject<List<Dictionary<string, object>>>();
|
||||
|
||||
if (bodys==null || bodys.Count<=0)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
throw new Exception("无法获取表体数据");
|
||||
}
|
||||
|
||||
//if (!(bodys is List<Dictionary<string, object>> dictionarys) || dictionarys.Count <= 0)
|
||||
//{
|
||||
|
||||
// await Task.Delay(1);
|
||||
// throw new Exception("无法获取表体数据");
|
||||
//}
|
||||
|
||||
|
||||
domBody = bodys.ToDocument2(domBody);
|
||||
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
|
||||
errorMsg = "";
|
||||
baseLogin.Connection.BeginTrans();
|
||||
var vouchId = "";
|
||||
|
||||
var res = new BaseResult<string>();
|
||||
try
|
||||
{
|
||||
res.bSuccess = co.Update(sVouchType, domHead, domBody, domPosition);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
throw ex;
|
||||
}
|
||||
|
||||
if (!res.bSuccess)
|
||||
{
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
res.message = "新增失败";
|
||||
res.result = errorMsg;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseLogin.Connection.CommitTrans();
|
||||
res.message = "新增成功";
|
||||
res.result = vouchId;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
//var bodys = dictionary.TryGetValue() dictionary["body"];
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,26 +10,32 @@ using ThreadContext = UFSoft.U8.Framework.ContextSrv.ThreadContext;
|
||||
using VBLogin = U8Login.clsLogin;
|
||||
// ReSharper disable IdentifierTypo
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CommentTypo
|
||||
// ReSharper disable FieldCanBeMadeReadOnly.Local
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
|
||||
public class BaseLogin
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
static ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
|
||||
private NetLogin _netLogin { get; set; }
|
||||
public VBLogin _vbLogin { get; set; }
|
||||
public NetLogin _netLogin;
|
||||
|
||||
public ProductContext _productContext { get; set; }
|
||||
public VBLogin _vbLogin;
|
||||
|
||||
public Connection Connection { get; set; }
|
||||
public ProductContext _productContext;
|
||||
|
||||
public Connection Connection;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化生产制造上下文
|
||||
/// </summary>
|
||||
/// <param name="paramter">登录参数</param>
|
||||
/// <param name="bMon"></param>
|
||||
/// <param name="traceTimes"></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public void Init(LoginParamter paramter,bool bMon=true, int traceTimes=0)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
public interface IBaseBF
|
||||
{
|
||||
BaseResult<string> Save(string cCardNum, Dictionary<string, object> input);
|
||||
|
||||
BaseResult<string> Save(string cCardNum, List<Dictionary<string, object>> inputs);
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,9 @@ using UFSoft.U8.U8M.DOSchema.MO;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产订单
|
||||
/// </summary>
|
||||
public class MOrder
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Reflection;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFSoft.U8.Framework.BizBase;
|
||||
using UFSoft.U8.Framework.ContextSrv;
|
||||
using UFSoft.U8.U8M.BFDispatcher;
|
||||
using UFSoft.U8.U8M.Common;
|
||||
@@ -22,15 +23,19 @@ using UFSoft.U8.U8M.Exceptions;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
|
||||
public class MoRoutingBill
|
||||
/// <summary>
|
||||
/// 报工单
|
||||
/// </summary>
|
||||
public class MoRoutingBill: IBaseBF
|
||||
{
|
||||
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private IContextContainer callar { get; set; }
|
||||
|
||||
private MoRoutingBillDs GetEmptyDs(string cCardNum)
|
||||
{
|
||||
var ds = SFExecutor.BFMoRoutingBill_LoadData("LoadFirst", 0, "", cCardNum, new DefaultContextContainer());
|
||||
var ds = SFExecutor.BFMoRoutingBill_LoadData("LoadFirst", 0, "", cCardNum, callar);
|
||||
|
||||
#region 清除数据集里的数据
|
||||
|
||||
@@ -63,7 +68,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
ds.MoRoutingBill.AddMoRoutingBillRow(head);
|
||||
|
||||
var docNo = U8MCommonExecutor.BFVoucher_GetVoucherID(cCardNum, docNoParam.Paramaters, false, new DefaultContextContainer());
|
||||
var docNo = U8MCommonExecutor.BFVoucher_GetVoucherID(cCardNum, docNoParam.Paramaters, false, callar);
|
||||
|
||||
var be = new UFSoft.U8.SF.BE.MoRoutingBill(ds);
|
||||
|
||||
@@ -98,14 +103,17 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
}
|
||||
|
||||
|
||||
|
||||
public BaseResult<string> Save(string cCardNum, Dictionary<string, object> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
callar = new DefaultContextContainer();
|
||||
|
||||
var docNoParam = new AutoDocNoGenerateParam(EnumAutoDocNoType.HandAuto, cCardNum)
|
||||
{
|
||||
IsCurrentDocNoByHand = false
|
||||
};
|
||||
{
|
||||
IsCurrentDocNoByHand = false
|
||||
};
|
||||
|
||||
var ds = GetVoucherDs(cCardNum, docNoParam, input);
|
||||
|
||||
@@ -119,7 +127,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
logInfo.Debug($"单据编码:{cCardNum},开始保存");
|
||||
|
||||
var id = SFExecutor.BFMoRoutingBill_MoRoutingBillSave(ds, docNoParam, new DefaultContextContainer());
|
||||
var id = SFExecutor.BFMoRoutingBill_MoRoutingBillSave(ds, docNoParam, callar);
|
||||
|
||||
|
||||
logInfo.Debug($"单据编码:{cCardNum},保存完成,id:{id}");
|
||||
@@ -139,8 +147,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
logInfo.Error(ex.InnerException.Message, ex.InnerException);
|
||||
|
||||
return new BaseResult<string>
|
||||
{ bSuccess = false, message = "新增失败", result = ex.InnerException.Message };
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.InnerException.Message };
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFSoft.U8.Framework.BizBase;
|
||||
using UFSoft.U8.Framework.ContextSrv;
|
||||
using UFSoft.U8.U8M.BFDispatcher;
|
||||
using UFSoft.U8.U8M.Common;
|
||||
using UFSoft.U8.U8M.DOSchema.BO;
|
||||
using UFSoft.U8.U8M.DOSchema.SF;
|
||||
using UFSoft.U8.U8M.Exceptions;
|
||||
using UFSoft.U8.U8MCommon.GSetup;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
/// <summary>
|
||||
/// 标准BOM
|
||||
/// </summary>
|
||||
public class StandardBom
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private IContextContainer callar { get; set; }
|
||||
|
||||
public StandardBom()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private StandardBomDs GetEmptyDs()
|
||||
{
|
||||
var standardBomDs = new StandardBomDs();
|
||||
var standardBomRow = standardBomDs.StandardBom.NewStandardBomRow();
|
||||
standardBomRow.BomType = 1;
|
||||
standardBomRow.VersionEffDate = MParameters.Instance.DefaultVersionDate;
|
||||
standardBomRow.Status = (byte)MParameters.Instance.Options.BomDefaultStatus;
|
||||
standardBomDs.StandardBom.AddStandardBomRow(standardBomRow);
|
||||
var bomParentRow = standardBomDs.BomParent.NewBomParentRow();
|
||||
bomParentRow.BomId = standardBomRow.BomId;
|
||||
bomParentRow.AutoId = $"{Guid.NewGuid()}";
|
||||
standardBomDs.BomParent.AddBomParentRow(bomParentRow);
|
||||
return standardBomDs;
|
||||
}
|
||||
|
||||
private StandardBomDs GetVoucherDs(Dictionary<string, object> input)
|
||||
{
|
||||
var ds = GetEmptyDs();
|
||||
|
||||
var be = new UFSoft.U8.BO.BE.BomEntity(ds);
|
||||
|
||||
be.BomType = EnumBOMCatalogType.StandardBom;
|
||||
|
||||
var beHead = new BEHelper(be.Bom);
|
||||
|
||||
beHead.SetValue(input);
|
||||
|
||||
beHead.SetPartId();
|
||||
|
||||
var bodys = input["body"] as List<Dictionary<string, object>> ?? $"{input["body"]}".ToObject<List<Dictionary<string, object>>>();
|
||||
|
||||
for (var i = 0; i < bodys.Count; i++)
|
||||
{
|
||||
var body = bodys[i];
|
||||
var detail = be.Bom.Components[i];
|
||||
|
||||
var beBody = new BEHelper(detail);
|
||||
|
||||
beBody.SetValue(body);
|
||||
|
||||
beBody.SetPartId();
|
||||
}
|
||||
|
||||
return (StandardBomDs)be.InstanceBom.DataObject;
|
||||
}
|
||||
|
||||
public BaseResult<string> Save(Dictionary<string, object> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
callar = new DefaultContextContainer();
|
||||
|
||||
var ds = GetVoucherDs(input);
|
||||
|
||||
if (ds == null)
|
||||
{
|
||||
throw new Exception("未能构建数据集");
|
||||
}
|
||||
|
||||
//var context = new DefaultContextContainer();
|
||||
//context.context["taskid"] = taskId;
|
||||
|
||||
logInfo.Debug("单据编码:BO11,开始保存");
|
||||
|
||||
var id = BOMExecutor.BFStandardBom_Save(ds, callar);
|
||||
|
||||
|
||||
logInfo.Debug($"单据编码:BO11,保存完成,id:{id}");
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "新增成功", result = $"{id}" };
|
||||
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
}
|
||||
catch (TargetInvocationException ex)
|
||||
{
|
||||
if (ex.InnerException is U8MReferenceBENotExistException)
|
||||
{
|
||||
logInfo.Error(ex.InnerException.Message, ex.InnerException);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.InnerException.Message };
|
||||
}
|
||||
else
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,14 @@
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
<HintPath>D:\U8SOFT\Interop\ADODB.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Interop.ADOX">
|
||||
<HintPath>D:\U8SOFT\COBat\Interop.ADOX.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.DAO">
|
||||
<HintPath>D:\U8SOFT\COBat\Interop.DAO.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.GetComObj">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.GetComObj.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
@@ -45,11 +53,43 @@
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.MSXML2.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.NoteManageAR">
|
||||
<HintPath>D:\U8SOFT\COBat\Interop.NoteManageAR.dll</HintPath>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.U8ColumnSet">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.U8ColumnSet.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.U8Login, Version=1.14.0.0, Culture=neutral, PublicKeyToken=79a4e7ad54eeabca, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.U8Login.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Interop.UFGeneralFilter">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.UFGeneralFilter.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.UFGeneralFilterOCX">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.UFGeneralFilterOCX.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.UFGeneralFilterPub">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.UFGeneralFilterPub.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.UfHeronReport">
|
||||
<HintPath>D:\U8SOFT\COBat\Interop.UfHeronReport.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.UFRPPub">
|
||||
<HintPath>D:\U8SOFT\COBat\Interop.UFRPPub.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.USDbKit">
|
||||
<HintPath>D:\U8SOFT\COBat\Interop.USDbKit.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -78,6 +118,9 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UFSoft.U8.BO.BE">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.BO.BE.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.Framework.BE">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.Framework.BE.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
@@ -152,9 +195,14 @@
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.U8M.Exceptions.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.U8MCommon.GSetup">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.U8MCommon.GSetup.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AP\UFAPBO.cs" />
|
||||
<Compile Include="Common\APARHelper.cs" />
|
||||
<Compile Include="Common\BEHelper.cs" />
|
||||
<Compile Include="Common\CommonHelper.cs" />
|
||||
<Compile Include="Json\JsonHelper.cs" />
|
||||
@@ -163,17 +211,30 @@
|
||||
<Compile Include="Models\StatusEnum.cs" />
|
||||
<Compile Include="Models\SysU8AccountConfig.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ST\USERPCO.cs" />
|
||||
<Compile Include="U8M\BaseLogin.cs" />
|
||||
<Compile Include="U8M\IBaseBF.cs" />
|
||||
<Compile Include="U8M\MOrder.cs" />
|
||||
<Compile Include="U8M\MoRoutingBill.cs" />
|
||||
<Compile Include="U8M\StandardBom.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="AA\" />
|
||||
<Folder Include="ST\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="stdole">
|
||||
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UFIDA.U8.Framework.Api.Comm
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UFIDA.U8.Framework.Api.ControlObject", "UFIDA.U8.Framework.Api.ControlObject\UFIDA.U8.Framework.Api.ControlObject.csproj", "{22C84BE9-1613-4E32-9E98-237E96FD3540}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VoucherPlugTest", "VoucherPlugTest\VoucherPlugTest.csproj", "{20CD37D3-70D0-410B-8765-02E10766EBB2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -33,6 +35,10 @@ Global
|
||||
{22C84BE9-1613-4E32-9E98-237E96FD3540}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{22C84BE9-1613-4E32-9E98-237E96FD3540}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{22C84BE9-1613-4E32-9E98-237E96FD3540}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{20CD37D3-70D0-410B-8765-02E10766EBB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{20CD37D3-70D0-410B-8765-02E10766EBB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{20CD37D3-70D0-410B-8765-02E10766EBB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{20CD37D3-70D0-410B-8765-02E10766EBB2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Binary file not shown.
@@ -568,11 +568,25 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.APController">
|
||||
<summary>
|
||||
应收应付
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.APController.logInfo">
|
||||
<summary>
|
||||
日志组件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.APController.Save(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
应收应付单据保存接口
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="cCardNum"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.APController.CloseBillSave(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
收付款单保存
|
||||
@@ -598,6 +612,31 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.APController.ApNoteSave(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
票据保存
|
||||
</summary>
|
||||
<param name="cAccId">系统号</param>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="input">报文数据</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.APController.AP03Save(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
票据保存
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.APController.AR03Save(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
票据保存
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.MOController">
|
||||
<summary>
|
||||
生产订单
|
||||
@@ -745,6 +784,39 @@
|
||||
<param name="input">报文数据</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.STController.logInfo">
|
||||
<summary>
|
||||
日志组件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Insert(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean,System.Boolean,System.Boolean,System.String,System.Boolean)">
|
||||
<summary>
|
||||
新增单据
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="cCardNum"></param>
|
||||
<param name="input"></param>
|
||||
<param name="bCheck"></param>
|
||||
<param name="bBeforCheckStock"></param>
|
||||
<param name="bIsRedVouch"></param>
|
||||
<param name="sAddedState"></param>
|
||||
<param name="bReMote"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Update(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean,System.Boolean,System.Boolean,System.String,System.Boolean)">
|
||||
<summary>
|
||||
更新单据
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="cCardNum"></param>
|
||||
<param name="input"></param>
|
||||
<param name="bCheck"></param>
|
||||
<param name="bBeforCheckStock"></param>
|
||||
<param name="bIsRedVouch"></param>
|
||||
<param name="sAddedState"></param>
|
||||
<param name="bUpdateNeedEas"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.WebApiApplication.CurrentDomain_AssemblyResolve(System.Object,System.ResolveEventArgs)">
|
||||
<summary>
|
||||
缺少程序集全局处理事件
|
||||
@@ -772,6 +844,11 @@
|
||||
<member name="T:UFIDA.U8.Framework.Api.Models.ListU8AccountConfigInput">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Unit.AssemblyDynamicLoader.Unload">
|
||||
<summary>
|
||||
卸载应用程序域
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Unit.CommUnit">
|
||||
<summary>
|
||||
公共帮助类
|
||||
@@ -820,5 +897,34 @@
|
||||
<param name="pDate"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Unit.RemoteLoader">
|
||||
<summary>
|
||||
跨域加载
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Unit.RemoteLoader.#ctor(UFIDA.U8.Framework.Api.ControlObject.Models.LoginParamter)">
|
||||
<summary>
|
||||
构造函数
|
||||
</summary>
|
||||
<param name="paramter">登录参数</param>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Unit.RemoteLoader.Save(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
保存
|
||||
</summary>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="input">数据包</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Unit.RemoteLoader.Save(System.String,System.Collections.Generic.List{System.Collections.Generic.Dictionary{System.String,System.Object}})">
|
||||
<summary>
|
||||
批量保存
|
||||
</summary>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="inputs">数据包</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -12,7 +12,9 @@ using UFIDA.U8.Framework.Api.Unit;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 应收应付
|
||||
/// </summary>
|
||||
public class APController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
@@ -22,6 +24,44 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
private static readonly MemoryCache _cache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
|
||||
/// <summary>
|
||||
/// 应收应付单据保存接口
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AP/{cCardNum}/Save")]
|
||||
[Route("api/U8/AR/{cCardNum}/Save")]
|
||||
public async Task<BaseResult<dynamic>> Save(string cAccId, string cCardNum, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (cCardNum)
|
||||
{
|
||||
case "AP03":
|
||||
case "AR03":
|
||||
return await ApNoteSave(cAccId, cCardNum, input);
|
||||
case "AP48":
|
||||
case "AP49":
|
||||
case "AR48":
|
||||
case "AR49":
|
||||
return await CloseBillSave(cAccId, cCardNum, input);
|
||||
default:
|
||||
throw new Exception("单据标识不正确");
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 收付款单保存
|
||||
/// </summary>
|
||||
@@ -36,7 +76,19 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!_cache.TryGetValue($"U8AP_{cAccId}", out BaseLogin baseLogin))
|
||||
var subId = "";
|
||||
|
||||
if (cCardNum == "AR48" || cCardNum == "AR49")
|
||||
{
|
||||
subId = "AR";
|
||||
}
|
||||
|
||||
if (cCardNum == "AP48" || cCardNum == "AP49")
|
||||
{
|
||||
subId = "AP";
|
||||
}
|
||||
|
||||
if (!_cache.TryGetValue($"U8AP_{cAccId}_{subId}", out BaseLogin baseLogin))
|
||||
{
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -49,19 +101,9 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
baseLogin.Init(param, false);
|
||||
|
||||
_cache.Set($"U8AP_{cAccId}", baseLogin);
|
||||
}
|
||||
_cache.Clear();
|
||||
|
||||
var subId = "";
|
||||
|
||||
if (cCardNum == "AP48")
|
||||
{
|
||||
subId = "AR";
|
||||
}
|
||||
|
||||
if (cCardNum == "AP49")
|
||||
{
|
||||
subId = "AP";
|
||||
_cache.Set($"U8AP_{cAccId}_{subId}", baseLogin);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +133,8 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AR/AP48/CloseBillSave")]
|
||||
[Route("api/U8/AR/AP48/Save")]
|
||||
[Route("api/U8/AR/AP49/Save")]
|
||||
public async Task<BaseResult<dynamic>> AP48Save(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
return await CloseBillSave(cAccId, "AP48", input);
|
||||
@@ -104,11 +147,105 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AP/AP49/CloseBillSave")]
|
||||
[Route("api/U8/AP/AP49/Save")]
|
||||
[Route("api/U8/AP/AP49/Save")]
|
||||
public async Task<BaseResult<dynamic>> AP49Save(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
return await CloseBillSave(cAccId, "AP49", input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 票据保存
|
||||
/// </summary>
|
||||
/// <param name="cAccId">系统号</param>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="input">报文数据</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AP/{cCardNum}/ApNoteSave")]
|
||||
[Route("api/U8/AR/{cCardNum}/ApNoteSave")]
|
||||
public async Task<BaseResult<dynamic>> ApNoteSave(string cAccId, string cCardNum, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
var subId = "";
|
||||
|
||||
if (cCardNum == "AR03")
|
||||
{
|
||||
subId = "AR";
|
||||
}
|
||||
|
||||
if (cCardNum == "AP03")
|
||||
{
|
||||
subId = "AP";
|
||||
}
|
||||
|
||||
|
||||
if (!_cache.TryGetValue($"U8AP_{cAccId}_{subId}", out BaseLogin baseLogin))
|
||||
{
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
var param = await CommUnit.GetLoginParamter(cAccId);
|
||||
|
||||
if (param == null)
|
||||
{
|
||||
throw new Exception("未能加载指定系统号的登录信息");
|
||||
}
|
||||
|
||||
param.pSubId = subId;
|
||||
|
||||
baseLogin.Init(param, false);
|
||||
|
||||
_cache.Set($"U8AP_{cAccId}_{subId}", baseLogin);
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(subId))
|
||||
throw new Exception("单据标识不正确");
|
||||
|
||||
var bo = new UFAPBO();
|
||||
|
||||
var res = bo.ApNoteSave(baseLogin, input, subId);
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 票据保存
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AP/AP03/Save")]
|
||||
public async Task<BaseResult<dynamic>> AP03Save(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
return await ApNoteSave(cAccId, "AP03", input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 票据保存
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AR/AR03/Save")]
|
||||
public async Task<BaseResult<dynamic>> AR03Save(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
return await ApNoteSave(cAccId, "AR03", input);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
[Route("api/U8/SFC/MoRoutingBillSave")]
|
||||
public async Task<BaseResult<string>> MoRoutingBillSave(string cAccId,string cCardNum, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var taskId = 0L;
|
||||
//var taskId = 0L;
|
||||
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
@@ -58,48 +58,50 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92")
|
||||
throw new Exception("当前接口不支持此类型的单据");
|
||||
|
||||
var runtimes = 0;
|
||||
//var runtimes = 0;
|
||||
|
||||
var u8mTask = new SysU8MTask()
|
||||
{
|
||||
U8MPool = $"U8M_{cAccId}"
|
||||
};
|
||||
//var u8mTask = new SysU8MTask()
|
||||
//{
|
||||
// U8MPool = $"U8M_{cAccId}"
|
||||
//};
|
||||
|
||||
#if !DEBUG
|
||||
while (await db.Queryable<SysU8MTask>().AnyAsync())
|
||||
{
|
||||
if (runtimes > 20)
|
||||
{
|
||||
throw new Exception("当前任务队列过长");
|
||||
}
|
||||
//#if !DEBUG
|
||||
// while (await db.Queryable<SysU8MTask>().AnyAsync())
|
||||
// {
|
||||
// if (runtimes > 20)
|
||||
// {
|
||||
// throw new Exception("当前任务队列过长");
|
||||
// }
|
||||
|
||||
runtimes++;
|
||||
// runtimes++;
|
||||
|
||||
await Task.Delay(100 * runtimes);
|
||||
// await Task.Delay(100 * runtimes);
|
||||
|
||||
//u8mTask.Id = DateTime.Now.Ticks;
|
||||
// //u8mTask.Id = DateTime.Now.Ticks;
|
||||
|
||||
if (await db.Queryable<SysU8MTask>()
|
||||
.AnyAsync(a => SqlFunc.DateDiff(DateType.Minute, a.dDate, DateTime.Now) > 1))
|
||||
{
|
||||
await db.Deleteable<SysU8MTask>()
|
||||
.Where(a => SqlFunc.DateDiff(DateType.Minute, a.dDate, DateTime.Now) > 1)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
// if (await db.Queryable<SysU8MTask>()
|
||||
// .AnyAsync(a => SqlFunc.DateDiff(DateType.Minute, a.dDate, DateTime.Now) > 1))
|
||||
// {
|
||||
// await db.Deleteable<SysU8MTask>()
|
||||
// .Where(a => SqlFunc.DateDiff(DateType.Minute, a.dDate, DateTime.Now) > 1)
|
||||
// .ExecuteCommandAsync();
|
||||
// }
|
||||
|
||||
}
|
||||
#endif
|
||||
// }
|
||||
//#endif
|
||||
|
||||
u8mTask.dDate = DateTime.Now;
|
||||
//u8mTask.dDate = DateTime.Now;
|
||||
|
||||
//if (u8mTask.Id == null)
|
||||
//{
|
||||
// u8mTask.Id = DateTime.Now.Ticks;
|
||||
//}
|
||||
|
||||
taskId = await db.Insertable(u8mTask).ExecuteReturnSnowflakeIdAsync();
|
||||
//taskId = await db.Insertable(u8mTask).ExecuteReturnSnowflakeIdAsync();
|
||||
|
||||
logInfo.Debug($"开始操作,当前任务ID:{taskId}");
|
||||
//var taskid = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
//logInfo.Debug($"开始操作,当前任务ID:{taskId}");
|
||||
//if (!_cache.TryGetValue($"U8M_{cAccId}", out BaseLogin baseLogin))
|
||||
//{
|
||||
// _cache.Clear();
|
||||
@@ -113,37 +115,57 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
throw new Exception("未能加载指定系统号的登录信息");
|
||||
}
|
||||
|
||||
logInfo.Debug($"开始登录,当前任务ID:{taskId}");
|
||||
logInfo.Debug("开始登录");
|
||||
|
||||
baseLogin.Init(param,true);
|
||||
|
||||
//_cache.Set($"U8M_{cAccId}", baseLogin);
|
||||
//}
|
||||
|
||||
|
||||
var bf = new MoRoutingBill();
|
||||
|
||||
logInfo.Debug($"开始保存,当前任务ID:{taskId}");
|
||||
|
||||
var bo = new MoRoutingBill();
|
||||
BaseResult<string> res;
|
||||
if (input.ContainsKey("bBatch") && Convert.ToBoolean(input["bBatch"]))
|
||||
{
|
||||
var inputs = input["inputs"] as List<Dictionary<string, object>> ?? $"{input["inputs"]}".ToObject<List<Dictionary<string, object>>>();
|
||||
|
||||
res = bf.Save(cCardNum, inputs);
|
||||
res = bo.Save(cCardNum, inputs);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = bf.Save(cCardNum, input);
|
||||
res = bo.Save(cCardNum, input);
|
||||
}
|
||||
|
||||
logInfo.Debug($"退出登录,当前任务ID:{taskId}");
|
||||
baseLogin.ShutDown();
|
||||
//loader.Unload();
|
||||
|
||||
if (taskId != 0)
|
||||
{
|
||||
await db.Deleteable<SysU8MTask>(taskId).ExecuteCommandAsync();
|
||||
}
|
||||
//var res= loader.Save(param, cCardNum, input);
|
||||
|
||||
|
||||
|
||||
|
||||
//_cache.Set($"U8M_{cAccId}", baseLogin);
|
||||
//}
|
||||
|
||||
|
||||
//var bf = new MoRoutingBill();
|
||||
|
||||
logInfo.Debug($"开始保存");
|
||||
|
||||
//BaseResult<string> res;
|
||||
//if (input.ContainsKey("bBatch") && Convert.ToBoolean(input["bBatch"]))
|
||||
//{
|
||||
// var inputs = input["inputs"] as List<Dictionary<string, object>> ?? $"{input["inputs"]}".ToObject<List<Dictionary<string, object>>>();
|
||||
|
||||
// res = bf.Save(cCardNum, inputs);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// res = bf.Save(cCardNum, input);
|
||||
//}
|
||||
|
||||
logInfo.Debug($"退出登录");
|
||||
//baseLogin.ShutDown();
|
||||
|
||||
//if (taskId != 0)
|
||||
//{
|
||||
// await db.Deleteable<SysU8MTask>(taskId).ExecuteCommandAsync();
|
||||
//}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -152,21 +174,21 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
if (taskId != 0)
|
||||
{
|
||||
await db.Deleteable<SysU8MTask>(taskId).ExecuteCommandAsync();
|
||||
}
|
||||
//if (taskId != 0)
|
||||
//{
|
||||
// await db.Deleteable<SysU8MTask>(taskId).ExecuteCommandAsync();
|
||||
//}
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (taskId != 0)
|
||||
{
|
||||
await db.Deleteable<SysU8MTask>(taskId).ExecuteCommandAsync();
|
||||
}
|
||||
//if (taskId != 0)
|
||||
//{
|
||||
// await db.Deleteable<SysU8MTask>(taskId).ExecuteCommandAsync();
|
||||
//}
|
||||
|
||||
baseLogin?.ShutDown();
|
||||
//baseLogin?.ShutDown();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
using log4net;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.AP;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.ST;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
public class STController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志组件
|
||||
/// </summary>
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private static readonly MemoryCache _cache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
|
||||
/// <summary>
|
||||
/// 新增单据
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="bCheck"></param>
|
||||
/// <param name="bBeforCheckStock"></param>
|
||||
/// <param name="bIsRedVouch"></param>
|
||||
/// <param name="sAddedState"></param>
|
||||
/// <param name="bReMote"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/ST/0411/Insert")]
|
||||
public async Task<BaseResult<string>> Insert(string cAccId, string cCardNum,[FromBody] Dictionary<string, object> input, bool bCheck = true,bool bBeforCheckStock=true,bool bIsRedVouch=false,string sAddedState="",bool bReMote=false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
var param = await CommUnit.GetLoginParamter(cAccId);
|
||||
|
||||
if (param == null)
|
||||
{
|
||||
throw new Exception("未能加载指定系统号的登录信息");
|
||||
}
|
||||
|
||||
baseLogin.Init(param, false);
|
||||
|
||||
_cache.Clear();
|
||||
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
var bo = new USERPCO();
|
||||
|
||||
var res =await bo.Insert(baseLogin, input, "11", bCheck, bBeforCheckStock, bIsRedVouch, sAddedState,
|
||||
bReMote);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新单据
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="bCheck"></param>
|
||||
/// <param name="bBeforCheckStock"></param>
|
||||
/// <param name="bIsRedVouch"></param>
|
||||
/// <param name="sAddedState"></param>
|
||||
/// <param name="bUpdateNeedEas"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/ST/0411/Update")]
|
||||
public async Task<BaseResult<string>> Update(string cAccId, string cCardNum, [FromBody] Dictionary<string, object> input, bool bCheck = true, bool bBeforCheckStock = true, bool bIsRedVouch = false, string sAddedState = "", bool bUpdateNeedEas = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
var param = await CommUnit.GetLoginParamter(cAccId);
|
||||
|
||||
if (param == null)
|
||||
{
|
||||
throw new Exception("未能加载指定系统号的登录信息");
|
||||
}
|
||||
|
||||
|
||||
baseLogin.Init(param, false);
|
||||
|
||||
_cache.Clear();
|
||||
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
var bo = new USERPCO();
|
||||
|
||||
var res = await bo.Update(baseLogin, input, "0412", "11", bCheck, bBeforCheckStock, bIsRedVouch, sAddedState,
|
||||
bUpdateNeedEas);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,8 +62,8 @@
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.5.1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net, Version=3.0.2.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.3.0.2\lib\net462\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
@@ -78,8 +78,8 @@
|
||||
<Reference Include="Microsoft.Extensions.Caching.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Caching.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.Caching.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Caching.Memory, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Caching.Memory.8.0.0\lib\net462\Microsoft.Extensions.Caching.Memory.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.Caching.Memory, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Caching.Memory.8.0.1\lib\net462\Microsoft.Extensions.Caching.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Configuration, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Configuration.8.0.0\lib\net462\Microsoft.Extensions.Configuration.dll</HintPath>
|
||||
@@ -105,11 +105,11 @@
|
||||
<Reference Include="Microsoft.Extensions.Configuration.UserSecrets, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Configuration.UserSecrets.8.0.0\lib\net462\Microsoft.Extensions.Configuration.UserSecrets.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.8.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.8.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Diagnostics, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Diagnostics.8.0.0\lib\net462\Microsoft.Extensions.Diagnostics.dll</HintPath>
|
||||
@@ -132,11 +132,11 @@
|
||||
<Reference Include="Microsoft.Extensions.Hosting.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Hosting.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.Hosting.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.8.0.0\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.Logging, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.8.0.1\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.2\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Configuration, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Configuration.8.0.0\lib\net462\Microsoft.Extensions.Logging.Configuration.dll</HintPath>
|
||||
@@ -286,8 +286,8 @@
|
||||
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.8.0.4\lib\net462\System.Text.Json.dll</HintPath>
|
||||
<Reference Include="System.Text.Json, Version=8.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.8.0.5\lib\net462\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
@@ -401,13 +401,16 @@
|
||||
<Compile Include="Controllers\U8\APController.cs" />
|
||||
<Compile Include="Controllers\U8\MOController.cs" />
|
||||
<Compile Include="Controllers\U8\SFCController.cs" />
|
||||
<Compile Include="Controllers\U8\STController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\SFCInput.cs" />
|
||||
<Compile Include="Models\U8AccountConfigInput.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Unit\AssemblyDynamicLoader.cs" />
|
||||
<Compile Include="Unit\CommUnit.cs" />
|
||||
<Compile Include="Unit\RemoteLoader.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App_Data\AP49.json" />
|
||||
@@ -507,7 +510,9 @@
|
||||
<Content Include="SwaggerUI\lib\.DS_Store" />
|
||||
<Content Include="Views\System\Index.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Folder Include="Views\ST\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\bootstrap.rtl.min.css.map" />
|
||||
<Content Include="Content\bootstrap.rtl.css.map" />
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Unit
|
||||
{
|
||||
internal class AssemblyDynamicLoader
|
||||
{
|
||||
private long taskId;
|
||||
private AppDomain appDomain;
|
||||
private RemoteLoader remoteLoader;
|
||||
|
||||
internal AssemblyDynamicLoader(long taskId)
|
||||
{
|
||||
var basePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"Bin");
|
||||
var binPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"U8M{taskId}");
|
||||
|
||||
Directory.CreateDirectory(binPath);
|
||||
|
||||
var setup = new AppDomainSetup
|
||||
{
|
||||
ApplicationName = $"U8M_{taskId}",
|
||||
ApplicationBase = basePath,
|
||||
PrivateBinPath = binPath,
|
||||
ShadowCopyFiles = "true"
|
||||
};
|
||||
setup.CachePath = setup.ApplicationBase;
|
||||
setup.ShadowCopyDirectories = setup.ApplicationBase;
|
||||
|
||||
appDomain = AppDomain.CreateDomain($"U8M_{taskId}", null, setup);
|
||||
|
||||
var name = Assembly.GetExecutingAssembly().GetName().FullName;
|
||||
remoteLoader = (RemoteLoader)appDomain.CreateInstanceAndUnwrap(name, typeof(RemoteLoader).FullName ?? throw new InvalidOperationException());
|
||||
}
|
||||
|
||||
internal BaseResult<string> Save(LoginParamter paramter, string cCardNum, Dictionary<string, object> input)
|
||||
{
|
||||
remoteLoader._paramter = paramter;
|
||||
|
||||
return remoteLoader.Save(cCardNum, input);
|
||||
}
|
||||
|
||||
internal BaseResult<string> Save(LoginParamter paramter, string cCardNum, List<Dictionary<string, object>> inputs)
|
||||
{
|
||||
remoteLoader._paramter = paramter;
|
||||
|
||||
return remoteLoader.Save(cCardNum, inputs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 卸载应用程序域
|
||||
/// </summary>
|
||||
internal void Unload()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (appDomain == null) return;
|
||||
AppDomain.Unload(appDomain);
|
||||
appDomain = null;
|
||||
remoteLoader = null;
|
||||
}
|
||||
catch (CannotUnloadAppDomainException ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Unit
|
||||
{
|
||||
/// <summary>
|
||||
/// 跨域加载
|
||||
/// </summary>
|
||||
internal class RemoteLoader : MarshalByRefObject
|
||||
{
|
||||
public LoginParamter _paramter;
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="paramter">登录参数</param>
|
||||
internal RemoteLoader(LoginParamter paramter)
|
||||
{
|
||||
_paramter = paramter;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="input">数据包</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
internal BaseResult<string> Save(string cCardNum, Dictionary<string, object> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
IBaseBF bf;
|
||||
|
||||
switch (cCardNum)
|
||||
{
|
||||
case "FC90":
|
||||
case "FC91":
|
||||
case "FC92":
|
||||
bf = new MoRoutingBill();
|
||||
break;
|
||||
default:
|
||||
bf = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bf == null)
|
||||
{
|
||||
throw new Exception("不支持的单据");
|
||||
}
|
||||
|
||||
var baseLogin = new BaseLogin();
|
||||
|
||||
baseLogin.Init(_paramter);
|
||||
|
||||
return bf.Save(cCardNum, input);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量保存
|
||||
/// </summary>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="inputs">数据包</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
internal BaseResult<string> Save(string cCardNum, List<Dictionary<string, object>> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
IBaseBF bf;
|
||||
|
||||
switch (cCardNum)
|
||||
{
|
||||
case "FC90":
|
||||
case "FC91":
|
||||
case "FC92":
|
||||
bf = new MoRoutingBill();
|
||||
break;
|
||||
default:
|
||||
bf = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bf == null)
|
||||
{
|
||||
throw new Exception("不支持的单据");
|
||||
}
|
||||
|
||||
var baseLogin = new BaseLogin();
|
||||
|
||||
baseLogin.Init(_paramter);
|
||||
|
||||
return bf.Save(cCardNum, inputs);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.4" newVersion="8.0.0.4" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.5" newVersion="8.0.0.5" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
@@ -105,7 +105,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.2" newVersion="8.0.0.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
@@ -113,7 +113,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.2" newVersion="8.0.0.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Configuration.Binder" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
@@ -151,6 +151,14 @@
|
||||
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.17.0" newVersion="2.0.17.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<package id="DapperExtensions" version="1.7.0" targetFramework="net48" />
|
||||
<package id="EntityFramework" version="6.5.1" targetFramework="net48" />
|
||||
<package id="jQuery" version="3.7.1" targetFramework="net48" />
|
||||
<package id="log4net" version="2.0.17" targetFramework="net48" />
|
||||
<package id="log4net" version="3.0.2" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.3.0" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="5.3.0" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.3.0" targetFramework="net48" />
|
||||
@@ -32,7 +32,7 @@
|
||||
<package id="Microsoft.Data.Sqlite" version="8.0.7" targetFramework="net48" />
|
||||
<package id="Microsoft.Data.Sqlite.Core" version="8.0.7" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Caching.Abstractions" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Caching.Memory" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Caching.Memory" version="8.0.1" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration.Abstractions" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration.Binder" version="8.0.2" targetFramework="net48" />
|
||||
@@ -41,8 +41,8 @@
|
||||
<package id="Microsoft.Extensions.Configuration.FileExtensions" version="8.0.1" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration.Json" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Configuration.UserSecrets" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.1" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection" version="8.0.1" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.2" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Diagnostics" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Diagnostics.Abstractions" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.FileProviders.Abstractions" version="8.0.0" targetFramework="net48" />
|
||||
@@ -50,8 +50,8 @@
|
||||
<package id="Microsoft.Extensions.FileSystemGlobbing" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Hosting" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Hosting.Abstractions" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="8.0.1" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging" version="8.0.1" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="8.0.2" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging.Configuration" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging.Console" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.Logging.Debug" version="8.0.0" targetFramework="net48" />
|
||||
@@ -99,7 +99,7 @@
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net48" />
|
||||
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net48" />
|
||||
<package id="System.Text.Json" version="8.0.4" targetFramework="net48" />
|
||||
<package id="System.Text.Json" version="8.0.5" targetFramework="net48" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
|
||||
<package id="WebActivator" version="1.5.1" targetFramework="net48" />
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("VoucherPlugTest")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("VoucherPlugTest")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(true)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("20cd37d3-70d0-410b-8765-02e10766ebb2")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Interop.UAPvouchercontrol130;
|
||||
using Microsoft.VisualBasic;
|
||||
|
||||
namespace VoucherPlugTest
|
||||
{
|
||||
[Guid("D6C73518-AA4C-49B8-8568-31ACBCD62732")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public class TestClass
|
||||
{
|
||||
[DispId(5)]
|
||||
public void AfterRunSysCommand(object objLogin, object objForm, object objVoucher, string sKey, object VarentValue, ref bool Cancel, string other)
|
||||
{
|
||||
var oVoucher = objVoucher as ctlVoucher;
|
||||
|
||||
var dom = oVoucher?.GetHeadDom();
|
||||
|
||||
var aa = Information.TypeName(objForm);
|
||||
|
||||
|
||||
dom?.save(@"D:\AP_Note.xml");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{20CD37D3-70D0-410B-8765-02E10766EBB2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>VoucherPlugTest</RootNamespace>
|
||||
<AssemblyName>VoucherPlugTest</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<RegisterForComInterop>true</RegisterForComInterop>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Interop.MSXML2">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.MSXML2.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.UAPvouchercontrol130">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.UAPvouchercontrol130.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="TestClass.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user