测试线程静态前提交
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ADODB;
|
||||
using MSXML2;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
|
||||
// ReSharper disable IdentifierTypo
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable StringLiteralTypo
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
{
|
||||
public class UFAPBO
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
public BaseResult<dynamic> CloseBillSave(BaseLogin baseLogin,Dictionary<string,object> dictionary,string cSubId,bool isAdd=true, bool bFirst=false,string bodyKey="body")
|
||||
{
|
||||
try
|
||||
{
|
||||
var m_Login = baseLogin._vbLogin;
|
||||
|
||||
var domHead = dictionary.ToDocument2();
|
||||
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
|
||||
if (dictionary[bodyKey] is List<Dictionary<string, object>> bodyList && bodyList.Count > 0)
|
||||
{
|
||||
domBody = bodyList.ToDocument2(domBody);
|
||||
}
|
||||
|
||||
var bo = "UFAPBO.clsCloseBill".GetComObject();
|
||||
|
||||
var m_conn = new Connection();
|
||||
|
||||
m_conn.Open(m_Login.UfDbName);
|
||||
|
||||
bo.Init(m_Login, m_conn, null,cSubId);
|
||||
|
||||
bo.First = bFirst;
|
||||
|
||||
var errorMessage = "";
|
||||
|
||||
var checkFlag = bo.VouchCheck(domHead, domBody, ref errorMessage, isAdd);
|
||||
|
||||
if (!checkFlag)
|
||||
throw new Exception(errorMessage);
|
||||
|
||||
errorMessage = "";
|
||||
|
||||
var saveFlag = bo.SaveVouch(domHead, domBody, ref errorMessage, isAdd);
|
||||
|
||||
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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable IdentifierTypo
|
||||
@@ -11,8 +13,22 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
public class BEHelper
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private readonly dynamic _be;
|
||||
private readonly PropertyInfo[] _props;
|
||||
private string _invCode;
|
||||
private string _free1;
|
||||
private string _free2;
|
||||
private string _free3;
|
||||
private string _free4;
|
||||
private string _free5;
|
||||
private string _free6;
|
||||
private string _free7;
|
||||
private string _free8;
|
||||
private string _free9;
|
||||
private string _free10;
|
||||
private int _bomVersion;
|
||||
|
||||
public BEHelper(dynamic be)
|
||||
{
|
||||
@@ -25,7 +41,10 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
foreach (var key in dictionary.Keys)
|
||||
{
|
||||
if (key.Contains("define") && !key.Contains("chdefine"))
|
||||
if(key != "body")
|
||||
logInfo.Debug($"正在设置字段:{key}--{dictionary[key]}");
|
||||
|
||||
if (key.Contains("define") && !key.Contains("chdefine") && !key.Contains("cbdefine"))
|
||||
{
|
||||
var defineCode = int.Parse(key.Replace("define", ""));
|
||||
if (dictionary.TryGetValue(key, out var bValue) && !string.IsNullOrWhiteSpace($"{bValue}"))
|
||||
@@ -41,46 +60,86 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
_be.ExtendUserDefineItem[defineCode] = dictionary[key];
|
||||
}
|
||||
} else if (key.Contains("cbdefine"))
|
||||
{
|
||||
var defineCode = int.Parse(key.Replace("cbdefine", ""));
|
||||
|
||||
if (dictionary.TryGetValue(key, out var bValue) && !string.IsNullOrWhiteSpace($"{bValue}"))
|
||||
{
|
||||
_be.ExtendUserDefineItem[defineCode] = dictionary[key];
|
||||
}
|
||||
}else if (key.Contains("free"))
|
||||
{
|
||||
var freeCode = int.Parse(key.Replace("free", ""));
|
||||
|
||||
SetFreeItem(freeCode, dictionary[key]);
|
||||
|
||||
}
|
||||
else if (key != "body")
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace($"{dictionary[key]}") && _props.Any(a => string.Equals(a.Name, key, StringComparison.OrdinalIgnoreCase)))
|
||||
if (string.Equals(key, "invCode", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_invCode = $"{dictionary[key]}";
|
||||
}else if (string.Equals(key, "bomversion", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_bomVersion = int.Parse($"{dictionary[key]}");
|
||||
}
|
||||
else 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));
|
||||
|
||||
if (prop.PropertyType == typeof(string))
|
||||
{
|
||||
prop.SetValue(_be, dictionary[key]);
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(DateTime))
|
||||
{
|
||||
prop.SetValue(_be, DateTime.Parse($"{dictionary[key]}"));
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(byte))
|
||||
{
|
||||
prop.SetValue(_be, byte.Parse($"{dictionary[key]}"));
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(int))
|
||||
{
|
||||
prop.SetValue(_be, int.Parse($"{dictionary[key]}"));
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(long))
|
||||
{
|
||||
prop.SetValue(_be, long.Parse($"{dictionary[key]}"));
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(decimal))
|
||||
{
|
||||
prop.SetValue(_be, decimal.Parse($"{dictionary[key]}"));
|
||||
}
|
||||
|
||||
CommonHelper.SetPropValue(prop, _be, dictionary[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetFreeItem(int i, object value)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
_free1 = $"{value}";
|
||||
break;
|
||||
case 2:
|
||||
_free2 = $"{value}";
|
||||
break;
|
||||
case 3:
|
||||
_free3 = $"{value}";
|
||||
break;
|
||||
case 4:
|
||||
_free4 = $"{value}";
|
||||
break;
|
||||
case 5:
|
||||
_free5 = $"{value}";
|
||||
break;
|
||||
case 6:
|
||||
_free6 = $"{value}";
|
||||
break;
|
||||
case 7:
|
||||
_free7 = $"{value}";
|
||||
break;
|
||||
case 8:
|
||||
_free8 = $"{value}";
|
||||
break;
|
||||
case 9:
|
||||
_free9 = $"{value}";
|
||||
break;
|
||||
case 10:
|
||||
_free10 = $"{value}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetPartId()
|
||||
{
|
||||
_be.SetPartId(_invCode, new[] { _free1, _free2, _free3, _free4, _free5, _free6, _free7, _free8, _free9, _free10 });
|
||||
}
|
||||
|
||||
public void SetBomId()
|
||||
{
|
||||
_be.SetBomId(_be.PartId, _bomVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using GetComObj;
|
||||
using MSXML2;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
public static class CommonHelper
|
||||
{
|
||||
|
||||
public static void SetPropValue(this PropertyInfo prop, object obj, object value)
|
||||
{
|
||||
if (prop.PropertyType == typeof(string))
|
||||
{
|
||||
prop.SetValue(obj, value);
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(DateTime))
|
||||
{
|
||||
prop.SetValue(obj, DateTime.Parse($"{value}"));
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(byte))
|
||||
{
|
||||
prop.SetValue(obj, byte.Parse($"{value}"));
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(int))
|
||||
{
|
||||
prop.SetValue(obj, int.Parse($"{value}"));
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(long))
|
||||
{
|
||||
prop.SetValue(obj, long.Parse($"{value}"));
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(decimal))
|
||||
{
|
||||
prop.SetValue(obj, decimal.Parse($"{value}"));
|
||||
}
|
||||
}
|
||||
|
||||
public static IXMLDOMDocument2 ToDocument2(this Dictionary<string,object> dictionary,IXMLDOMDocument2 domDocument2=null)
|
||||
{
|
||||
|
||||
if (domDocument2 == null)
|
||||
{
|
||||
domDocument2 = new DOMDocument();
|
||||
}
|
||||
|
||||
var root = domDocument2.ClearDocument();
|
||||
|
||||
var newRow = SetRowData(dictionary, domDocument2);
|
||||
|
||||
root.appendChild(newRow);
|
||||
|
||||
return domDocument2;
|
||||
|
||||
}
|
||||
|
||||
public static IXMLDOMNode SetRowData(this Dictionary<string, object> dictionary, IXMLDOMDocument2 domDocument2 = null,string bodyKey="body")
|
||||
{
|
||||
if (domDocument2 == null)
|
||||
{
|
||||
domDocument2 = new DOMDocument();
|
||||
}
|
||||
|
||||
var newRow = domDocument2.createElement("z:row");
|
||||
|
||||
foreach (var key in dictionary.Keys)
|
||||
{
|
||||
if(key==bodyKey)
|
||||
continue;
|
||||
|
||||
var attr = domDocument2.createAttribute(key);
|
||||
|
||||
attr.value = dictionary[key];
|
||||
|
||||
newRow.attributes.setNamedItem(attr);
|
||||
}
|
||||
|
||||
return newRow;
|
||||
}
|
||||
|
||||
public static IXMLDOMDocument2 ToDocument2(this List<Dictionary<string, object>> dictionaryList, IXMLDOMDocument2 domDocument2 = null)
|
||||
{
|
||||
|
||||
if (domDocument2 == null)
|
||||
{
|
||||
domDocument2 = new DOMDocument();
|
||||
}
|
||||
|
||||
var root = domDocument2.ClearDocument();
|
||||
|
||||
foreach (var dictionary in dictionaryList)
|
||||
{
|
||||
var newRow = SetRowData(dictionary, domDocument2);
|
||||
|
||||
root.appendChild(newRow);
|
||||
}
|
||||
|
||||
return domDocument2;
|
||||
|
||||
}
|
||||
|
||||
public static IXMLDOMNode ClearDocument(this IXMLDOMDocument2 domDocument2)
|
||||
{
|
||||
var root = domDocument2.selectSingleNode("//rs:data");
|
||||
|
||||
if (root == null)
|
||||
{
|
||||
root = domDocument2.createElement("rs:data");
|
||||
|
||||
domDocument2.appendChild(root);
|
||||
}
|
||||
|
||||
var rows = domDocument2.selectNodes("//z:row");
|
||||
|
||||
if (rows != null && rows.length > 0)
|
||||
{
|
||||
for (var i = 0; i < rows.length; i++)
|
||||
{
|
||||
var row = rows[i];
|
||||
|
||||
root.removeChild(row);
|
||||
}
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public static void ResetDictionary(this Dictionary<string, object> dictionary, string bodyKey = "body")
|
||||
{
|
||||
if (dictionary.ContainsKey(bodyKey))
|
||||
{
|
||||
var body= dictionary[bodyKey].ToJson().ToList<Dictionary<string,object>>();
|
||||
|
||||
dictionary[bodyKey] = body;
|
||||
}
|
||||
}
|
||||
|
||||
public static dynamic GetComObject(this string comName)
|
||||
{
|
||||
var comInstance = new GetComInstance();
|
||||
|
||||
var obj = comInstance.GetComObject(ref comName);
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ADODB;
|
||||
using log4net;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFSoft.U8.Framework.ContextSrv;
|
||||
using UFSoft.U8.Framework.Login.UI;
|
||||
using UFSoft.U8.Framework.LoginContext;
|
||||
using NetLogin = UFSoft.U8.Framework.Login.UI.clsLogin;
|
||||
using ThreadContext = UFSoft.U8.Framework.ContextSrv.ThreadContext;
|
||||
using VBLogin = U8Login.clsLogin;
|
||||
// ReSharper disable IdentifierTypo
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
public class BaseLogin
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
|
||||
private NetLogin _netLogin { get; set; }
|
||||
private VBLogin _vbLogin { get; set; }
|
||||
public VBLogin _vbLogin { get; set; }
|
||||
|
||||
public ProductContext _productContext { get; set; }
|
||||
|
||||
@@ -27,78 +29,221 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
/// 初始化生产制造上下文
|
||||
/// </summary>
|
||||
/// <param name="paramter">登录参数</param>
|
||||
/// <param name="bMon"></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public void Init(LoginParamter paramter)
|
||||
public void Init(LoginParamter paramter,bool bMon=true, int traceTimes=0)
|
||||
{
|
||||
|
||||
//if (!string.IsNullOrWhiteSpace(ThreadContext.ServerToken))
|
||||
//{
|
||||
// ThreadContext.ServerToken = null;
|
||||
//}
|
||||
if (traceTimes > 5)
|
||||
throw new Exception("U8登录异常");
|
||||
|
||||
//if (!string.IsNullOrWhiteSpace(ThreadContext.U8LoginInfo!=null))
|
||||
//{
|
||||
// ThreadContext.U8LoginInfo = null;
|
||||
//}
|
||||
|
||||
|
||||
if (paramter == null) throw new ArgumentNullException(nameof(paramter));
|
||||
|
||||
_vbLogin = new VBLogin();
|
||||
|
||||
_netLogin = new NetLogin();
|
||||
|
||||
_vbLogin.ClearError();
|
||||
|
||||
if (!_vbLogin.Login(paramter.pSubId, paramter.pAccId, paramter.pYearId, paramter.pUserId, paramter.pPassword, paramter.pDate, paramter.cSrv, paramter.cSerial) && string.IsNullOrWhiteSpace(_vbLogin.userToken))
|
||||
try
|
||||
{
|
||||
//_vbLogin.ShutDown();
|
||||
throw new Exception(_vbLogin.ShareString);
|
||||
}
|
||||
Trace.WriteLine($"U8版本:{_vbLogin.GetVersionInfo()}");
|
||||
Trace.WriteLine($"1--登录令牌:{_netLogin.userToken}");
|
||||
//if (!string.IsNullOrWhiteSpace(ThreadContext.ServerToken))
|
||||
//{
|
||||
// ThreadContext.ServerToken = null;
|
||||
//}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Cryptography.m_userToken))
|
||||
{
|
||||
Cryptography.m_userToken = "";
|
||||
}
|
||||
//if (!string.IsNullOrWhiteSpace(ThreadContext.U8LoginInfo!=null))
|
||||
//{
|
||||
// ThreadContext.U8LoginInfo = null;
|
||||
//}
|
||||
|
||||
if (_netLogin.login(paramter.pSubId, paramter.pUserId, paramter.pPassword, paramter.cSrv, paramter.pDate, paramter.pAccId, paramter.cSerial))
|
||||
{
|
||||
_productContext = _netLogin.SubLogin("AS");
|
||||
if (paramter == null) throw new ArgumentNullException(nameof(paramter));
|
||||
|
||||
if (_productContext == null)
|
||||
throw new Exception($"1--初始化U8登录上下文失败------{_netLogin.ErrDescript}");
|
||||
if (!string.IsNullOrWhiteSpace(Cryptography.m_userToken))
|
||||
{
|
||||
Cryptography.m_userToken = "";
|
||||
}
|
||||
|
||||
Trace.WriteLine($"2--登录令牌:{_netLogin.userToken}");
|
||||
//Trace.WriteLine($"2--上下文令牌:{_productContext.calledContext.token}");
|
||||
if (bMon)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
_vbLogin = new VBLogin();
|
||||
|
||||
_vbLogin.ClearError();
|
||||
|
||||
logInfo.Debug($"VB--开始进行U8登录:{paramter.cSrv}--{paramter.pUserId}--{paramter.pAccId}");
|
||||
|
||||
if (!_vbLogin.Login(paramter.pSubId, paramter.pAccId, paramter.pYearId, paramter.pUserId, paramter.pPassword, paramter.pDate, paramter.cSrv, paramter.cSerial) && string.IsNullOrWhiteSpace(_vbLogin.userToken))
|
||||
{
|
||||
throw new Exception($"VB--U8登录失败---{_vbLogin.ShareString}");
|
||||
}
|
||||
|
||||
_netLogin = new NetLogin();
|
||||
|
||||
_productContext= _netLogin.Login("DP", _vbLogin.userToken);
|
||||
|
||||
if (_productContext == null)
|
||||
{
|
||||
logInfo.Debug($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
|
||||
|
||||
if (!_netLogin.login(paramter.pSubId, paramter.pUserId, paramter.pPassword, paramter.cSrv, paramter.pDate, paramter.pAccId, paramter.cSerial) && string.IsNullOrWhiteSpace(_netLogin.userToken))
|
||||
{
|
||||
//throw new Exception($"Net--U8登录失败---{_netLogin.ErrDescript}");
|
||||
}
|
||||
|
||||
logInfo.Debug($"Net--开始进行上下文构建:{_netLogin.userToken}");
|
||||
|
||||
_productContext = _netLogin.SubLogin("DP") ?? _netLogin.Login("DP", _vbLogin.userToken);
|
||||
//throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
|
||||
}
|
||||
|
||||
logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
|
||||
|
||||
ClientUserContext.Instance.RefreshContext();
|
||||
|
||||
logInfo.Debug("Net--完成生产制造登录进程");
|
||||
|
||||
#else
|
||||
_netLogin = new NetLogin();
|
||||
|
||||
logInfo.Debug($"Net--开始进行U8登录:{paramter.cSrv}--{paramter.pUserId}--{paramter.pAccId}");
|
||||
|
||||
if (!_netLogin.login(paramter.pSubId, paramter.pUserId, paramter.pPassword, paramter.cSrv, paramter.pDate, paramter.pAccId, paramter.cSerial) && string.IsNullOrWhiteSpace(_netLogin.userToken))
|
||||
{
|
||||
throw new Exception($"Net--U8登录失败---{_netLogin.ErrDescript}");
|
||||
}
|
||||
|
||||
logInfo.Debug($"Net--开始进行上下文构建:{_netLogin.userToken}");
|
||||
|
||||
_productContext = _netLogin.SubLogin("DP");
|
||||
|
||||
if (_productContext == null)
|
||||
{
|
||||
throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
|
||||
}
|
||||
|
||||
|
||||
logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
|
||||
|
||||
ClientUserContext.Instance.RefreshContext();
|
||||
|
||||
logInfo.Debug("Net--完成生产制造登录进程");
|
||||
|
||||
return;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
_vbLogin = new VBLogin();
|
||||
|
||||
_vbLogin.ClearError();
|
||||
_vbLogin.ConstructLogin(_netLogin.userToken);
|
||||
var taskId = DateTime.Now.Ticks.ToString();
|
||||
_vbLogin.set_TaskId(taskId);
|
||||
|
||||
logInfo.Debug($"VB--开始进行U8登录:{paramter.cSrv}--{paramter.pUserId}--{paramter.pAccId}");
|
||||
|
||||
Trace.WriteLine($"3--登录令牌:{_vbLogin.userToken}");
|
||||
if (!_vbLogin.Login(paramter.pSubId, paramter.pAccId, paramter.pYearId, paramter.pUserId, paramter.pPassword, paramter.pDate, paramter.cSrv, paramter.cSerial) && string.IsNullOrWhiteSpace(_vbLogin.userToken))
|
||||
{
|
||||
throw new Exception($"VB--U8登录失败---{_vbLogin.ShareString}");
|
||||
}
|
||||
|
||||
Trace.WriteLine($"4--正在创建应用池:{_netLogin.userToken}");
|
||||
logInfo.Debug($"VB--开始创建连接对象:{_vbLogin.userToken}");
|
||||
|
||||
Connection = new Connection();
|
||||
Connection.Open(_vbLogin.UfDbName);
|
||||
|
||||
logInfo.Debug("VB--完成登录进程");
|
||||
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (!bMon)
|
||||
{
|
||||
logInfo.Debug("非生产制造模块无需下面操作");
|
||||
//Trace.WriteLine("非生产制造模块无需下面操作");
|
||||
return;
|
||||
}
|
||||
|
||||
logInfo.Debug($"U8版本:{_vbLogin.GetVersionInfo()}");
|
||||
|
||||
logInfo.Debug($"1--登录令牌:{_vbLogin.userToken}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Cryptography.m_userToken))
|
||||
{
|
||||
Cryptography.m_userToken = "";
|
||||
}
|
||||
|
||||
_productContext = _netLogin.Login("DP", _vbLogin.userToken);
|
||||
|
||||
if (_productContext != null)
|
||||
{
|
||||
logInfo.Debug($"222--成功初始化上下文信息:{_vbLogin.userToken}");
|
||||
|
||||
ClientUserContext.Instance.RefreshContext();
|
||||
//ThreadContext.ServerToken = _netLogin.userToken;
|
||||
|
||||
Connection = new Connection();
|
||||
Connection.Open(_vbLogin.UfDbName);
|
||||
|
||||
logInfo.Debug($"333--完成局部构建:{_netLogin.userToken}");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (_netLogin.login(paramter.pSubId, paramter.pUserId, paramter.pPassword, paramter.cSrv, paramter.pDate, paramter.pAccId, paramter.cSerial))
|
||||
{
|
||||
_productContext = _netLogin.SubLogin("AS");
|
||||
|
||||
if (_productContext == null)
|
||||
throw new Exception($"11--初始化U8登录上下文失败------{_netLogin.ErrDescript}");
|
||||
|
||||
logInfo.Debug($"22--登录令牌:{_netLogin.userToken}");
|
||||
//Trace.WriteLine($"2--上下文令牌:{_productContext.calledContext.token}");
|
||||
|
||||
|
||||
//_vbLogin.ClearError();
|
||||
//_vbLogin.ConstructLogin(_netLogin.userToken);
|
||||
//var taskId = DateTime.Now.Ticks.ToString();
|
||||
//_vbLogin.set_TaskId(taskId);
|
||||
|
||||
|
||||
logInfo.Debug($"33--登录令牌:{_vbLogin.userToken}");
|
||||
|
||||
logInfo.Debug($"44--正在创建应用池:{_netLogin.userToken}");
|
||||
|
||||
ClientUserContext.Instance.RefreshContext();
|
||||
//ThreadContext.ServerToken = _netLogin.userToken;
|
||||
|
||||
|
||||
|
||||
logInfo.Debug($"55--完成局部构建:{_netLogin.userToken}");
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
_productContext = _netLogin.Login("AS", _vbLogin.userToken);
|
||||
|
||||
logInfo.Debug($"3--上下文令牌:{_productContext.calledContext.token}");
|
||||
|
||||
if (_productContext == null)
|
||||
throw new Exception($"2--初始化U8登录上下文失败------{_netLogin.ErrDescript}");
|
||||
|
||||
ClientUserContext.Instance.RefreshContext();
|
||||
//ThreadContext.ServerToken = _netLogin.userToken;
|
||||
Connection = new Connection();
|
||||
Connection.Open(_vbLogin.UfDbName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error($"重试次数:{traceTimes},错误信息:{ex.Message}", ex);
|
||||
|
||||
_productContext = _netLogin.Login("AS", _vbLogin.userToken);
|
||||
|
||||
Trace.WriteLine($"3--上下文令牌:{_productContext.calledContext.token}");
|
||||
|
||||
if (_productContext == null)
|
||||
throw new Exception($"2--初始化U8登录上下文失败------{_netLogin.ErrDescript}");
|
||||
|
||||
ClientUserContext.Instance.RefreshContext();
|
||||
Connection = new Connection();
|
||||
Connection.Open(_vbLogin.UfDbName);
|
||||
Init(paramter, bMon, traceTimes + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShutDown()
|
||||
@@ -109,15 +254,10 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
_vbLogin?.ShutDown();
|
||||
_productContext=null;
|
||||
_netLogin?.SubLogout("DP");
|
||||
_netLogin?.ShutDown();
|
||||
_netLogin?.Dispose();
|
||||
_vbLogin = null;
|
||||
_netLogin = null;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Cryptography.m_userToken))
|
||||
{
|
||||
Cryptography.m_userToken = "";
|
||||
}
|
||||
}
|
||||
|
||||
public bool CheckAccId(string cAccId)
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections;
|
||||
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 UFSoft.U8.Framework.ContextSrv;
|
||||
using UFSoft.U8.U8M.BFDispatcher;
|
||||
using UFSoft.U8.U8M.Common;
|
||||
using UFSoft.U8.U8M.DAC;
|
||||
using UFSoft.U8.U8M.DOSchema.MO;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
public class MOrder
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private MOrderDs GetEmptyDs()
|
||||
{
|
||||
var ds = MOMExecutor.BFMOrder_LoadData("LoadFirst", 0, new DefaultContextContainer());
|
||||
|
||||
#region 清除数据集里的数据
|
||||
|
||||
if (ds.Tables.Contains("mom_orderdetail_ExtraDefine"))
|
||||
{
|
||||
ds.Tables["mom_orderdetail_ExtraDefine"].Clear();
|
||||
}
|
||||
if (ds.Tables.Contains("mom_order_ExtraDefine"))
|
||||
{
|
||||
ds.Tables["mom_order_ExtraDefine"].Clear();
|
||||
}
|
||||
|
||||
ds.MoAllocateSubs.Clear();
|
||||
ds.MoAllocates.Clear();
|
||||
ds.MOrderDetails.Clear();
|
||||
ds.Order.Clear();
|
||||
|
||||
#endregion
|
||||
|
||||
return ds;
|
||||
}
|
||||
|
||||
private MOrderDs GetVoucherDs(string cCardNum, AutoDocNoGenerateParam docNoParam, Dictionary<string, object> input)
|
||||
{
|
||||
|
||||
var ds = GetEmptyDs();
|
||||
|
||||
var head = ds.Order.NewOrderRow();
|
||||
|
||||
ds.Order.AddOrderRow(head);
|
||||
|
||||
var docNo = U8MCommonExecutor.BFVoucher_GetVoucherID(cCardNum, docNoParam.Paramaters, false, new DefaultContextContainer());
|
||||
|
||||
var be = new UFSoft.U8.MO.BE.MOrder(ds);
|
||||
|
||||
var beHead = new BEHelper(be);
|
||||
|
||||
beHead.SetValue(input);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(be.MoCode))
|
||||
{
|
||||
be.MoCode = docNo;
|
||||
}
|
||||
|
||||
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.MOrderDetails[i];
|
||||
|
||||
var beBody = new BEHelper(detail);
|
||||
|
||||
beBody.SetValue(body);
|
||||
|
||||
beBody.SetPartId();
|
||||
|
||||
beBody.SetBomId();
|
||||
}
|
||||
|
||||
|
||||
return (MOrderDs)be.DataObject;
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> Save(string cCardNum, Dictionary<string, object> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
var docNoParam = new AutoDocNoGenerateParam(EnumAutoDocNoType.HandAuto, cCardNum)
|
||||
{
|
||||
IsCurrentDocNoByHand = false
|
||||
};
|
||||
|
||||
var ds = GetVoucherDs(cCardNum, docNoParam, input);
|
||||
|
||||
if (ds == null)
|
||||
{
|
||||
throw new Exception("未能构建数据集");
|
||||
}
|
||||
|
||||
//var context = new DefaultContextContainer();
|
||||
//context.context["taskid"] = taskId;
|
||||
|
||||
var id = MOMExecutor.BFMomProcess_HMOSaveWithDocNoPara(ds, docNoParam, new DefaultContextContainer());
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = true, message = "新增成功", result = id };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> Delete(string cCardNum, List<string> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (inputs == null || inputs.Count <= 0)
|
||||
throw new Exception("没有需要删除的数据");
|
||||
|
||||
var dataReader = SimpleDACObject.ExecuteReader($"SELECT MID FROM dbo.fc_MoRoutingBill WHERE cVouchCode IN ('{string.Join("','", inputs)}') AND cVouchType='{cCardNum}'");
|
||||
|
||||
var newInput = new List<int>();
|
||||
|
||||
while (dataReader.Read())
|
||||
{
|
||||
newInput.Add(int.Parse($"{dataReader[0]}"));
|
||||
}
|
||||
|
||||
return Delete(newInput);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> Delete(List<int> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (inputs == null || inputs.Count <= 0)
|
||||
throw new Exception("没有需要删除的数据");
|
||||
|
||||
var ht = new Hashtable();
|
||||
|
||||
foreach (var input in inputs)
|
||||
{
|
||||
ht.Add(input, input);
|
||||
}
|
||||
|
||||
var id = MOMExecutor.BFMomProcess_MODeleteProcess(ht, new DefaultContextContainer());
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = true, message = "删除成功", result = id };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//public BaseResult<dynamic> Verify(string cCardNum, List<string> inputs)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// if (inputs == null || inputs.Count <= 0)
|
||||
// throw new Exception("没有需要审核的数据");
|
||||
|
||||
// var dataReader = SimpleDACObject.ExecuteReader($"SELECT MID FROM dbo.fc_MoRoutingBill WHERE cVouchCode IN ('{string.Join("','", inputs)}') AND cVouchType='{cCardNum}'");
|
||||
|
||||
// var newInput = new List<int>();
|
||||
|
||||
// while (dataReader.Read())
|
||||
// {
|
||||
// newInput.Add(int.Parse($"{dataReader[0]}"));
|
||||
// }
|
||||
|
||||
// return Verify(newInput);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// logInfo.Error(ex.Message, ex);
|
||||
|
||||
// return new BaseResult<dynamic>() { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
// }
|
||||
//}
|
||||
|
||||
//public BaseResult<dynamic> StatusProcess(List<int> inputs)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// if (inputs == null || inputs.Count <= 0)
|
||||
// throw new Exception("没有需要审核的数据");
|
||||
|
||||
// var ht = new Dictionary<int, string>();
|
||||
|
||||
// foreach (var input in inputs)
|
||||
// {
|
||||
// ht.Add(input, $"{input}");
|
||||
// }
|
||||
|
||||
// var id = MOMExecutor.BFMomProcess_MOStatusProcess(ht, new DefaultContextContainer());
|
||||
|
||||
// return new BaseResult<dynamic>() { bSuccess = true, message = "审核成功", result = id };
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// logInfo.Error(ex.Message, ex);
|
||||
|
||||
// return new BaseResult<dynamic>() { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
//public BaseResult<dynamic> UnVerify(string cCardNum, List<string> inputs)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// if (inputs == null || inputs.Count <= 0)
|
||||
// throw new Exception("没有需要弃审的数据");
|
||||
|
||||
// var dataReader = SimpleDACObject.ExecuteReader($"SELECT MID FROM dbo.fc_MoRoutingBill WHERE cVouchCode IN ('{string.Join("','", inputs)}') AND cVouchType='{cCardNum}'");
|
||||
|
||||
// var newInput = new List<int>();
|
||||
|
||||
// while (dataReader.Read())
|
||||
// {
|
||||
// newInput.Add(int.Parse($"{dataReader[0]}"));
|
||||
// }
|
||||
|
||||
// return UnVerify(newInput);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// logInfo.Error(ex.Message, ex);
|
||||
|
||||
// return new BaseResult<dynamic>() { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
// }
|
||||
//}
|
||||
|
||||
//public BaseResult<dynamic> UnVerify(List<int> inputs)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// if (inputs == null || inputs.Count <= 0)
|
||||
// throw new Exception("没有需要弃审的数据");
|
||||
|
||||
// var ht = new Dictionary<int, string>();
|
||||
|
||||
// foreach (var input in inputs)
|
||||
// {
|
||||
// ht.Add(input, $"{input}");
|
||||
// }
|
||||
|
||||
// var id = SFExecutor.BFMoRoutingBill_UnVerify(ht, new DefaultContextContainer());
|
||||
|
||||
// return new BaseResult<dynamic>() { bSuccess = true, message = "弃审成功", result = id };
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// logInfo.Error(ex.Message, ex);
|
||||
|
||||
// return new BaseResult<dynamic>() { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
@@ -10,12 +14,15 @@ using UFSoft.U8.U8M.BFDispatcher;
|
||||
using UFSoft.U8.U8M.Common;
|
||||
using UFSoft.U8.U8M.DAC;
|
||||
using UFSoft.U8.U8M.DOSchema.SF;
|
||||
using UFSoft.U8.U8M.Exceptions;
|
||||
|
||||
// ReSharper disable IdentifierTypo
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable StringLiteralTypo
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
|
||||
public class MoRoutingBill
|
||||
{
|
||||
|
||||
@@ -45,6 +52,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
return ds;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private MoRoutingBillDs GetVoucherDs(string cCardNum, AutoDocNoGenerateParam docNoParam, Dictionary<string, object> input)
|
||||
{
|
||||
|
||||
@@ -83,43 +92,112 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
}
|
||||
|
||||
|
||||
return (MoRoutingBillDs)be.DataObject;
|
||||
ds = (MoRoutingBillDs)be.DataObject;
|
||||
|
||||
return ds;
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> Save(string cCardNum, Dictionary<string, object> input)
|
||||
|
||||
public BaseResult<string> Save(string cCardNum, Dictionary<string, object> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
var docNoParam = new AutoDocNoGenerateParam(EnumAutoDocNoType.HandAuto, cCardNum)
|
||||
{
|
||||
IsCurrentDocNoByHand = false
|
||||
};
|
||||
{
|
||||
IsCurrentDocNoByHand = false
|
||||
};
|
||||
|
||||
var ds = GetVoucherDs(cCardNum, docNoParam, input);
|
||||
var ds = GetVoucherDs(cCardNum, docNoParam, input);
|
||||
|
||||
if (ds == null)
|
||||
{
|
||||
throw new Exception("未能构建数据集");
|
||||
}
|
||||
if (ds == null)
|
||||
{
|
||||
throw new Exception("未能构建数据集");
|
||||
}
|
||||
|
||||
//var context = new DefaultContextContainer();
|
||||
//context.context["taskid"] = taskId;
|
||||
|
||||
logInfo.Debug($"单据编码:{cCardNum},开始保存");
|
||||
|
||||
var id = SFExecutor.BFMoRoutingBill_MoRoutingBillSave(ds, docNoParam, new DefaultContextContainer());
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = true, message = "新增成功", result = id };
|
||||
|
||||
logInfo.Debug($"单据编码:{cCardNum},保存完成,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 };
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<string> Save(string cCardNum, List<Dictionary<string, object>> inputs)
|
||||
{
|
||||
|
||||
var idList = new List<int>();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var input in inputs)
|
||||
{
|
||||
var iRes = Save(cCardNum, input);
|
||||
|
||||
if (!iRes.bSuccess && idList.Count > 0)
|
||||
{
|
||||
Delete(idList);
|
||||
|
||||
return iRes;
|
||||
}
|
||||
else if (!iRes.bSuccess)
|
||||
{
|
||||
return iRes;
|
||||
}
|
||||
|
||||
idList.Add(Convert.ToInt32(iRes.result));
|
||||
|
||||
}
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "新增成功", result = $"{string.Join(",", idList)}" };
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> Delete(string cCardNum, List<string> inputs)
|
||||
public BaseResult<string> Delete(string cCardNum, List<string> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -137,15 +215,21 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
return Delete(newInput);
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
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<dynamic>() { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> Delete(List<int> inputs)
|
||||
public BaseResult<string> Delete(List<int> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -161,19 +245,25 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
var id = SFExecutor.BFMoRoutingBill_MoRoutingBillBatchDelete(ht, new DefaultContextContainer());
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = true, message = "删除成功", result = 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 (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> Verify(string cCardNum, List<string> inputs)
|
||||
public BaseResult<string> Verify(string cCardNum, List<string> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -191,15 +281,21 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
return Verify(newInput);
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
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<dynamic>() { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> Verify(List<int> inputs)
|
||||
public BaseResult<string> Verify(List<int> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -215,19 +311,25 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
var id = SFExecutor.BFMoRoutingBill_Verify(ht, new DefaultContextContainer());
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = true, message = "审核成功", result = 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 (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> UnVerify(string cCardNum, List<string> inputs)
|
||||
public BaseResult<string> UnVerify(string cCardNum, List<string> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -245,15 +347,21 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
return UnVerify(newInput);
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
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<dynamic>() { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> UnVerify(List<int> inputs)
|
||||
public BaseResult<string> UnVerify(List<int> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -269,13 +377,19 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
var id = SFExecutor.BFMoRoutingBill_UnVerify(ht, new DefaultContextContainer());
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = true, message = "弃审成功", result = 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 (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,19 +50,27 @@
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.U8Login.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Interop.UFBillComponent">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.UFBillComponent.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>
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Runtime.Caching" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.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>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
@@ -91,6 +99,10 @@
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.Framework.DBConnection.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.Framework.Exceptions">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.Framework.Exceptions.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.Framework.Login.BO">
|
||||
<HintPath>D:\U8SOFT\Framework\UFSoft.U8.Framework.Login.BO.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
@@ -104,6 +116,10 @@
|
||||
<HintPath>D:\U8SOFT\Framework\UFSoft.U8.Framework.LoginContext.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.MO.BE">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.MO.BE.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.SF.BE">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.SF.BE.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
@@ -132,9 +148,15 @@
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.U8M.DOSchema.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.U8M.Exceptions">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.U8M.Exceptions.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AP\UFAPBO.cs" />
|
||||
<Compile Include="Common\BEHelper.cs" />
|
||||
<Compile Include="Common\CommonHelper.cs" />
|
||||
<Compile Include="Json\JsonHelper.cs" />
|
||||
<Compile Include="Models\BaseResult.cs" />
|
||||
<Compile Include="Models\LoginParamter.cs" />
|
||||
@@ -142,6 +164,7 @@
|
||||
<Compile Include="Models\SysU8AccountConfig.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="U8M\BaseLogin.cs" />
|
||||
<Compile Include="U8M\MOrder.cs" />
|
||||
<Compile Include="U8M\MoRoutingBill.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -149,6 +172,7 @@
|
||||
<Folder Include="ST\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.17" targetFramework="net48" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user