1.车间管理调整为异步

2.明确生产制造的部署模式为单账套部署,多账套采用多服务的形式部署
This commit is contained in:
qmj
2025-07-23 08:57:44 +08:00
parent 1141095898
commit b8a9595cc1
12 changed files with 395 additions and 191 deletions
@@ -27,11 +27,13 @@ namespace UFIDA.U8.Framework.Api.ControlObject.SA
logInfo.Debug("开始输出登录信息"); logInfo.Debug("开始输出登录信息");
logInfo.Debug(baseLogin._vbLogin.userToken); logInfo.Debug(baseLogin._vbLogin.userToken);
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml); //var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
IXMLDOMDocument2 domHead = new DOMDocument(); IXMLDOMDocument2 domHead = new DOMDocument();
IXMLDOMDocument2 domBody = new DOMDocument(); IXMLDOMDocument2 domBody = new DOMDocument();
IXMLDOMDocument2 domCur = new DOMDocument(); IXMLDOMDocument2 domCur = new DOMDocument();
return new BaseResult<string>();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -3,6 +3,7 @@ using System.Web.UI.WebControls;
using ADODB; using ADODB;
using log4net; using log4net;
using UFIDA.U8.Framework.Api.ControlObject.Entity; using UFIDA.U8.Framework.Api.ControlObject.Entity;
using UFSoft.U8.Framework.BizBase;
using UFSoft.U8.Framework.ContextSrv; using UFSoft.U8.Framework.ContextSrv;
using UFSoft.U8.Framework.Login.UI; using UFSoft.U8.Framework.Login.UI;
using UFSoft.U8.Framework.LoginContext; using UFSoft.U8.Framework.LoginContext;
@@ -20,8 +21,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
public class BaseLogin public class BaseLogin
{ {
static ILog logInfo = LogManager.GetLogger("logInfo"); private ILog _logInfo = LogManager.GetLogger("logInfo");
public NetLogin _netLogin; public NetLogin _netLogin;
@@ -43,7 +43,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
public string UfSystemDb => _vbLogin.UfSystemDb; public string UfSystemDb => _vbLogin.UfSystemDb;
public IContextContainer callar { get; set; }
/// <summary> /// <summary>
/// 初始化生产制造上下文 /// 初始化生产制造上下文
@@ -86,7 +86,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
_vbLogin.ClearError(); _vbLogin.ClearError();
logInfo.Debug($"VB--开始进行U8登录:{paramter.cSrv}--{paramter.pUserId}--{paramter.pAccId}"); _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)) if (!_vbLogin.Login(paramter.pSubId, paramter.pAccId, paramter.pYearId, paramter.pUserId, paramter.pPassword, paramter.pDate, paramter.cSrv, paramter.cSerial) && string.IsNullOrWhiteSpace(_vbLogin.userToken))
{ {
@@ -99,36 +99,40 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
if (_productContext == null) if (_productContext == null)
{ {
logInfo.Debug($"Net--U8上下文构建失败---{_netLogin.ErrDescript}"); _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)) 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}"); //throw new Exception($"Net--U8登录失败---{_netLogin.ErrDescript}");
} }
logInfo.Debug($"Net--开始进行上下文构建:{_netLogin.userToken}"); _logInfo.Debug($"Net--开始进行上下文构建:{_netLogin.userToken}");
_productContext = _netLogin.SubLogin("DP") ?? _netLogin.Login("DP", _vbLogin.userToken); _productContext = _netLogin.SubLogin("DP") ?? _netLogin.Login("DP", _vbLogin.userToken);
//throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}"); //throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
} }
logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}"); _logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
ClientUserContext.Instance.RefreshContext(); ClientUserContext.Instance.RefreshContext();
logInfo.Debug("Net--完成生产制造登录进程"); _logInfo.Debug("Net--完成生产制造登录进程");
callar = new DefaultContextContainer();
_logInfo.Debug($"Net--构建制造上下文:{callar.context.calledContext.token}");
#else #else
_netLogin = new NetLogin(); _netLogin = new NetLogin();
logInfo.Debug($"Net--开始进行U8登录:{paramter.cSrv}--{paramter.pUserId}--{paramter.pAccId}"); _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)) 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}"); throw new Exception($"Net--U8登录失败---{_netLogin.ErrDescript}");
} }
logInfo.Debug($"Net--开始进行上下文构建:{_netLogin.userToken}"); _logInfo.Debug($"Net--开始进行上下文构建:{_netLogin.userToken}");
_productContext = _netLogin.SubLogin("DP"); _productContext = _netLogin.SubLogin("DP");
@@ -138,11 +142,15 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
} }
logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}"); _logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
ClientUserContext.Instance.RefreshContext(); ClientUserContext.Instance.RefreshContext();
logInfo.Debug("Net--完成生产制造登录进程"); _logInfo.Debug("Net--完成生产制造登录进程");
callar = new DefaultContextContainer();
_logInfo.Debug($"Net--构建制造上下文:{callar.context.calledContext.token}");
return; return;
@@ -153,19 +161,19 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
_vbLogin.ClearError(); _vbLogin.ClearError();
logInfo.Debug($"VB--开始进行U8登录:{paramter.cSrv}--{paramter.pUserId}--{paramter.pAccId}"); _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)) 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}"); throw new Exception($"VB--U8登录失败---{_vbLogin.ShareString}");
} }
logInfo.Debug($"VB--开始创建连接对象:{_vbLogin.userToken}"); _logInfo.Debug($"VB--开始创建连接对象:{_vbLogin.userToken}");
Connection = new Connection(); Connection = new Connection();
Connection.Open(_vbLogin.UfDbName); Connection.Open(_vbLogin.UfDbName);
logInfo.Debug("VB--完成登录进程"); _logInfo.Debug("VB--完成登录进程");
return; return;
@@ -180,14 +188,14 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
if (!bMon) if (!bMon)
{ {
logInfo.Debug("非生产制造模块无需下面操作"); _logInfo.Debug("非生产制造模块无需下面操作");
//Trace.WriteLine("非生产制造模块无需下面操作"); //Trace.WriteLine("非生产制造模块无需下面操作");
return; return;
} }
logInfo.Debug($"U8版本:{_vbLogin.GetVersionInfo()}"); _logInfo.Debug($"U8版本:{_vbLogin.GetVersionInfo()}");
logInfo.Debug($"1--登录令牌:{_vbLogin.userToken}"); _logInfo.Debug($"1--登录令牌:{_vbLogin.userToken}");
if (!string.IsNullOrWhiteSpace(Cryptography.m_userToken)) if (!string.IsNullOrWhiteSpace(Cryptography.m_userToken))
{ {
@@ -198,7 +206,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
if (_productContext != null) if (_productContext != null)
{ {
logInfo.Debug($"222--成功初始化上下文信息:{_vbLogin.userToken}"); _logInfo.Debug($"222--成功初始化上下文信息:{_vbLogin.userToken}");
ClientUserContext.Instance.RefreshContext(); ClientUserContext.Instance.RefreshContext();
//ThreadContext.ServerToken = _netLogin.userToken; //ThreadContext.ServerToken = _netLogin.userToken;
@@ -206,7 +214,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
Connection = new Connection(); Connection = new Connection();
Connection.Open(_vbLogin.UfDbName); Connection.Open(_vbLogin.UfDbName);
logInfo.Debug($"333--完成局部构建:{_netLogin.userToken}"); _logInfo.Debug($"333--完成局部构建:{_netLogin.userToken}");
return; return;
} }
@@ -222,7 +230,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
if (_productContext == null) if (_productContext == null)
throw new Exception($"11--初始化U8登录上下文失败------{_netLogin.ErrDescript}"); throw new Exception($"11--初始化U8登录上下文失败------{_netLogin.ErrDescript}");
logInfo.Debug($"22--登录令牌:{_netLogin.userToken}"); _logInfo.Debug($"22--登录令牌:{_netLogin.userToken}");
//Trace.WriteLine($"2--上下文令牌:{_productContext.calledContext.token}"); //Trace.WriteLine($"2--上下文令牌:{_productContext.calledContext.token}");
@@ -232,16 +240,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
//_vbLogin.set_TaskId(taskId); //_vbLogin.set_TaskId(taskId);
logInfo.Debug($"33--登录令牌:{_vbLogin.userToken}"); _logInfo.Debug($"33--登录令牌:{_vbLogin.userToken}");
logInfo.Debug($"44--正在创建应用池:{_netLogin.userToken}"); _logInfo.Debug($"44--正在创建应用池:{_netLogin.userToken}");
ClientUserContext.Instance.RefreshContext(); ClientUserContext.Instance.RefreshContext();
//ThreadContext.ServerToken = _netLogin.userToken; //ThreadContext.ServerToken = _netLogin.userToken;
logInfo.Debug($"55--完成局部构建:{_netLogin.userToken}"); _logInfo.Debug($"55--完成局部构建:{_netLogin.userToken}");
return; return;
@@ -249,7 +257,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
_productContext = _netLogin.Login("AS", _vbLogin.userToken); _productContext = _netLogin.Login("AS", _vbLogin.userToken);
logInfo.Debug($"3--上下文令牌:{_productContext.calledContext.token}"); _logInfo.Debug($"3--上下文令牌:{_productContext.calledContext.token}");
if (_productContext == null) if (_productContext == null)
throw new Exception($"2--初始化U8登录上下文失败------{_netLogin.ErrDescript}"); throw new Exception($"2--初始化U8登录上下文失败------{_netLogin.ErrDescript}");
@@ -261,7 +269,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
} }
catch (Exception ex) catch (Exception ex)
{ {
logInfo.Error($"重试次数:{traceTimes},错误信息:{ex.Message}", ex); _logInfo.Error($"重试次数:{traceTimes},错误信息:{ex.Message}", ex);
Init(paramter, bMon, traceTimes + 1); Init(paramter, bMon, traceTimes + 1);
} }
@@ -297,7 +305,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
#if DEBUG #if DEBUG
_vbLogin = new VBLogin(); _vbLogin = new VBLogin();
_vbLogin.ClearError(); _vbLogin.ClearError();
logInfo.Debug($"VB--开始进行U8登录:{userToken}"); _logInfo.Debug($"VB--开始进行U8登录:{userToken}");
if (!_vbLogin.ConstructLogin(userToken)) if (!_vbLogin.ConstructLogin(userToken))
{ {
throw new Exception($"VB--U8登录失败---{_vbLogin.ShareString}"); throw new Exception($"VB--U8登录失败---{_vbLogin.ShareString}");
@@ -306,42 +314,42 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
_productContext = _netLogin.Login("DP", _vbLogin.userToken); _productContext = _netLogin.Login("DP", _vbLogin.userToken);
if (_productContext == null) if (_productContext == null)
{ {
logInfo.Debug($"Net--U8上下文构建失败---{_netLogin.ErrDescript}"); _logInfo.Debug($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
logInfo.Debug($"Net--开始进行上下文构建:{userToken}"); _logInfo.Debug($"Net--开始进行上下文构建:{userToken}");
_productContext = _netLogin.Login("DP", _vbLogin.userToken); _productContext = _netLogin.Login("DP", _vbLogin.userToken);
//throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}"); //throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
} }
logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}"); _logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
ClientUserContext.Instance.RefreshContext(); ClientUserContext.Instance.RefreshContext();
logInfo.Debug("Net--完成生产制造登录进程"); _logInfo.Debug("Net--完成生产制造登录进程");
callar = new DefaultContextContainer();
_logInfo.Debug($"Net--构建制造上下文:{callar.context.calledContext.token}");
#else #else
_netLogin = new NetLogin(); _netLogin = new NetLogin();
logInfo.Debug($"Net--开始进行U8登录:{paramter.cSrv}--{paramter.pUserId}--{paramter.pAccId}"); _logInfo.Debug($"Net--开始进行U8登录:{userToken}");
if (!_netLogin.login(paramter.pSubId, paramter.pUserId, paramter.pPassword, paramter.cSrv, paramter.pDate, paramter.pAccId, paramter.cSerial) && string.IsNullOrWhiteSpace(_netLogin.userToken)) _productContext = _netLogin.Login("DP", userToken);
{
throw new Exception($"Net--U8登录失败---{_netLogin.ErrDescript}");
}
logInfo.Debug($"Net--开始进行上下文构建:{_netLogin.userToken}");
_productContext = _netLogin.SubLogin("DP");
if (_productContext == null) if (_productContext == null)
{ {
throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}"); throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
} }
_logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
ClientUserContext.Instance.RefreshContext(); ClientUserContext.Instance.RefreshContext();
logInfo.Debug("Net--完成生产制造登录进程"); _logInfo.Debug("Net--完成生产制造登录进程");
callar = new DefaultContextContainer();
_logInfo.Debug($"Net--构建制造上下文:{callar.context.calledContext.token}");
return; return;
@@ -351,20 +359,20 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
_vbLogin = new VBLogin(); _vbLogin = new VBLogin();
_vbLogin.ClearError(); _vbLogin.ClearError();
logInfo.Debug($"VB--开始进行U8登录:{userToken}"); _logInfo.Debug($"VB--开始进行U8登录:{userToken}");
if (!_vbLogin.ConstructLogin(userToken)) if (!_vbLogin.ConstructLogin(userToken))
{ {
throw new Exception($"VB--U8登录失败---{_vbLogin.ShareString}"); throw new Exception($"VB--U8登录失败---{_vbLogin.ShareString}");
} }
logInfo.Debug($"VB--开始创建连接对象:{_vbLogin.userToken}"); _logInfo.Debug($"VB--开始创建连接对象:{_vbLogin.userToken}");
Connection = new Connection(); Connection = new Connection();
Connection.Open(_vbLogin.UfDbName); Connection.Open(_vbLogin.UfDbName);
logInfo.Debug("VB--完成登录进程"); _logInfo.Debug("VB--完成登录进程");
return; return;
} }
catch (Exception ex) catch (Exception ex)
{ {
logInfo.Error($"重试次数:{traceTimes},错误信息:{ex.Message}", ex); _logInfo.Error($"重试次数:{traceTimes},错误信息:{ex.Message}", ex);
if (ex.Message == "VB--U8登录失败---登录使用时间超过系统预置时间,请重新登录!") if (ex.Message == "VB--U8登录失败---登录使用时间超过系统预置时间,请重新登录!")
{ {
@@ -375,6 +383,128 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
} }
} }
public bool CheckCallar()
{
return callar != null;
}
public void RefreshCallar(LoginParamter paramter)
{
#if DEBUG
_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--完成生产制造登录进程");
callar = new DefaultContextContainer();
_logInfo.Debug($"Net--构建制造上下文:{callar.context.calledContext.token}");
#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--完成生产制造登录进程");
callar = new DefaultContextContainer();
_logInfo.Debug($"Net--构建制造上下文:{callar.context.calledContext.token}");
return;
#endif
}
public void RefreshCallar(string userToken)
{
#if DEBUG
_netLogin = new NetLogin();
_productContext = _netLogin.Login("DP", _vbLogin.userToken);
if (_productContext == null)
{
_logInfo.Debug($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
_logInfo.Debug($"Net--开始进行上下文构建:{userToken}");
_productContext = _netLogin.Login("DP", _vbLogin.userToken);
//throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
}
_logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
ClientUserContext.Instance.RefreshContext();
_logInfo.Debug("Net--完成生产制造登录进程");
callar = new DefaultContextContainer();
_logInfo.Debug($"Net--构建制造上下文:{callar.context.calledContext.token}");
#else
_netLogin = new NetLogin();
_logInfo.Debug($"Net--开始进行U8登录:{userToken}");
_productContext = _netLogin.Login("DP", userToken);
if (_productContext == null)
{
throw new Exception($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
}
_logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
ClientUserContext.Instance.RefreshContext();
_logInfo.Debug("Net--完成生产制造登录进程");
callar = new DefaultContextContainer();
_logInfo.Debug($"Net--构建制造上下文:{callar.context.calledContext.token}");
return;
#endif
}
public void ShutDown() public void ShutDown()
{ {
U8LoginInfoPool.Clear(); U8LoginInfoPool.Clear();
@@ -9,8 +9,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
{ {
public interface IBaseBF public interface IBaseBF
{ {
BaseResult<string> Save(string cCardNum, Dictionary<string, object> input); Task<BaseResult<string>> Save(BaseLogin baseLogin,string cCardNum, Dictionary<string, object> input);
BaseResult<string> Save(string cCardNum, List<Dictionary<string, object>> inputs); Task<BaseResult<string>> Save(BaseLogin baseLogin, string cCardNum, List<Dictionary<string, object>> inputs);
} }
} }
@@ -6,6 +6,7 @@ using System.Data;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks;
using UFIDA.U8.Framework.Api.ControlObject.Common; using UFIDA.U8.Framework.Api.ControlObject.Common;
using UFIDA.U8.Framework.Api.ControlObject.Entity; using UFIDA.U8.Framework.Api.ControlObject.Entity;
using UFIDA.U8.Framework.Api.ControlObject.Json; using UFIDA.U8.Framework.Api.ControlObject.Json;
@@ -26,14 +27,14 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
/// <summary> /// <summary>
/// 报工单 /// 报工单
/// </summary> /// </summary>
public class MoRoutingBill: IBaseBF public class MoRoutingBill:IBaseBF
{ {
protected readonly ILog logInfo = LogManager.GetLogger("logInfo"); protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
private IContextContainer callar { get; set; } private async Task<MoRoutingBillDs> GetEmptyDs(IContextContainer callar, string cCardNum)
{
private MoRoutingBillDs GetEmptyDs(string cCardNum) try
{ {
var ds = SFExecutor.BFMoRoutingBill_LoadData("LoadFirst", 0, "", cCardNum, callar); var ds = SFExecutor.BFMoRoutingBill_LoadData("LoadFirst", 0, "", cCardNum, callar);
@@ -43,6 +44,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
{ {
ds.Tables["fc_MoRoutingBilldetail_ExtraDefine"].Clear(); ds.Tables["fc_MoRoutingBilldetail_ExtraDefine"].Clear();
} }
if (ds.Tables.Contains("fc_MoRoutingBill_ExtraDefine")) if (ds.Tables.Contains("fc_MoRoutingBill_ExtraDefine"))
{ {
ds.Tables["fc_MoRoutingBill_ExtraDefine"].Clear(); ds.Tables["fc_MoRoutingBill_ExtraDefine"].Clear();
@@ -56,13 +58,20 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
return ds; return ds;
} }
catch
{
await Task.Delay(1);
throw;
}
}
private MoRoutingBillDs GetVoucherDs(string cCardNum, AutoDocNoGenerateParam docNoParam, Dictionary<string, object> input) private async Task<MoRoutingBillDs> GetVoucherDs(IContextContainer callar, string cCardNum, AutoDocNoGenerateParam docNoParam, Dictionary<string, object> input)
{ {
var ds = GetEmptyDs(cCardNum); var ds = await GetEmptyDs(callar, cCardNum);
var head = ds.MoRoutingBill.NewMoRoutingBillRow(); var head = ds.MoRoutingBill.NewMoRoutingBillRow();
@@ -104,18 +113,18 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
public BaseResult<string> Save(string cCardNum, Dictionary<string, object> input) public async Task<BaseResult<string>> Save(BaseLogin baseLogin, string cCardNum, Dictionary<string, object> input)
{ {
try try
{ {
callar = new DefaultContextContainer(); var callar = baseLogin.callar;
var docNoParam = new AutoDocNoGenerateParam(EnumAutoDocNoType.HandAuto, cCardNum) var docNoParam = new AutoDocNoGenerateParam(EnumAutoDocNoType.HandAuto, cCardNum)
{ {
IsCurrentDocNoByHand = false IsCurrentDocNoByHand = false
}; };
var ds = GetVoucherDs(cCardNum, docNoParam, input); var ds =GetVoucherDs(callar, cCardNum, docNoParam, input);
if (ds == null) if (ds == null)
{ {
@@ -127,7 +136,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
logInfo.Debug($"单据编码:{cCardNum},开始保存"); logInfo.Debug($"单据编码:{cCardNum},开始保存");
var id = SFExecutor.BFMoRoutingBill_MoRoutingBillSave(ds, docNoParam, callar); var id = SFExecutor.BFMoRoutingBill_MoRoutingBillSave(ds.Result, docNoParam, callar);
logInfo.Debug($"单据编码:{cCardNum},保存完成,id:{id}"); logInfo.Debug($"单据编码:{cCardNum},保存完成,id:{id}");
@@ -139,6 +148,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
{ {
logInfo.Error(ex.Message, ex); logInfo.Error(ex.Message, ex);
await Task.Delay(1);
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message }; return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
} }
catch (TargetInvocationException ex) catch (TargetInvocationException ex)
@@ -147,12 +158,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
{ {
logInfo.Error(ex.InnerException.Message, ex.InnerException); logInfo.Error(ex.InnerException.Message, ex.InnerException);
await Task.Delay(1);
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.InnerException.Message }; return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.InnerException.Message };
} }
else else
{ {
logInfo.Error(ex.Message, ex); logInfo.Error(ex.Message, ex);
await Task.Delay(1);
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message }; return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
} }
@@ -162,11 +177,13 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
logInfo.Error(ex.Message, ex); logInfo.Error(ex.Message, ex);
await Task.Delay(1);
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message }; return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
} }
} }
public BaseResult<string> Save(string cCardNum, List<Dictionary<string, object>> inputs) public async Task<BaseResult<string>> Save(BaseLogin baseLogin, string cCardNum, List<Dictionary<string, object>> inputs)
{ {
var idList = new List<int>(); var idList = new List<int>();
@@ -175,11 +192,11 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
{ {
foreach (var input in inputs) foreach (var input in inputs)
{ {
var iRes = Save(cCardNum, input); var iRes = await Save(baseLogin, cCardNum, input);
if (!iRes.bSuccess && idList.Count > 0) if (!iRes.bSuccess && idList.Count > 0)
{ {
Delete(idList); await Delete(baseLogin, idList);
return iRes; return iRes;
} }
@@ -204,7 +221,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
} }
public BaseResult<string> Delete(string cCardNum, List<string> inputs) public async Task<BaseResult<string>> Delete(BaseLogin baseLogin,string cCardNum, List<string> inputs)
{ {
try try
{ {
@@ -220,7 +237,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
newInput.Add(int.Parse($"{dataReader[0]}")); newInput.Add(int.Parse($"{dataReader[0]}"));
} }
return Delete(newInput); return await Delete(baseLogin, newInput);
} }
catch (U8MReferenceBENotExistException ex) catch (U8MReferenceBENotExistException ex)
{ {
@@ -236,7 +253,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
} }
} }
public BaseResult<string> Delete(List<int> inputs) public async Task<BaseResult<string>> Delete(BaseLogin baseLogin,List<int> inputs)
{ {
try try
{ {
@@ -250,7 +267,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
ht.Add(input, input); ht.Add(input, input);
} }
var id = SFExecutor.BFMoRoutingBill_MoRoutingBillBatchDelete(ht, new DefaultContextContainer()); var id = SFExecutor.BFMoRoutingBill_MoRoutingBillBatchDelete(ht, baseLogin.callar);
return new BaseResult<string> { bSuccess = true, message = "删除成功", result = $"{id}" }; return new BaseResult<string> { bSuccess = true, message = "删除成功", result = $"{id}" };
} }
@@ -258,19 +275,23 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
{ {
logInfo.Error(ex.Message, ex); logInfo.Error(ex.Message, ex);
await Task.Delay(1);
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message }; return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
} }
catch (Exception ex) catch (Exception ex)
{ {
logInfo.Error(ex.Message, ex); logInfo.Error(ex.Message, ex);
await Task.Delay(1);
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message }; return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
} }
} }
public BaseResult<string> Verify(string cCardNum, List<string> inputs) public async Task<BaseResult<string>> Verify(BaseLogin baseLogin,string cCardNum, List<string> inputs)
{ {
try try
{ {
@@ -286,7 +307,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
newInput.Add(int.Parse($"{dataReader[0]}")); newInput.Add(int.Parse($"{dataReader[0]}"));
} }
return Verify(newInput); return await Verify(baseLogin,newInput);
} }
catch (U8MReferenceBENotExistException ex) catch (U8MReferenceBENotExistException ex)
{ {
@@ -302,7 +323,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
} }
} }
public BaseResult<string> Verify(List<int> inputs) public async Task<BaseResult<string>> Verify(BaseLogin baseLogin, List<int> inputs)
{ {
try try
{ {
@@ -316,7 +337,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
ht.Add(input, $"{input}"); ht.Add(input, $"{input}");
} }
var id = SFExecutor.BFMoRoutingBill_Verify(ht, new DefaultContextContainer()); var id = SFExecutor.BFMoRoutingBill_Verify(ht,baseLogin.callar);
return new BaseResult<string> { bSuccess = true, message = "审核成功", result = $"{id}" }; return new BaseResult<string> { bSuccess = true, message = "审核成功", result = $"{id}" };
} }
@@ -324,12 +345,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
{ {
logInfo.Error(ex.Message, ex); logInfo.Error(ex.Message, ex);
await Task.Delay(1);
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message }; return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
} }
catch (Exception ex) catch (Exception ex)
{ {
logInfo.Error(ex.Message, ex); logInfo.Error(ex.Message, ex);
await Task.Delay(1);
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message }; return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
} }
+1 -17
View File
@@ -599,22 +599,6 @@
<param name="input">报文数据</param> <param name="input">报文数据</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.APController.AP48Save(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.AP49Save(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.ApNote_Save(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.String,System.Boolean)"> <member name="M:UFIDA.U8.Framework.Api.Controllers.U8.APController.ApNote_Save(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.String,System.Boolean)">
<summary> <summary>
票据保存 票据保存
@@ -862,7 +846,7 @@
车间管理 车间管理
</summary> </summary>
</member> </member>
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.SFCController.logInfo"> <member name="F:UFIDA.U8.Framework.Api.Controllers.U8.SFCController._logInfo">
<summary> <summary>
日志组件 日志组件
</summary> </summary>
@@ -0,0 +1,21 @@
{
"MoId": 1000000001, //生产订单id
"MoDId": 1000000001, //生产订单明细id
"MoCode": "000000001", //生产订单号
"WcId": "", //工作中心id
"MoSeq": 1, //生产订单行号
"Body": [
{
"cPersonCode": "", //人员编码
"cTeamCode": "", //班组编码
"dDate": "2025-07-22", //报工日期
"Qualifiedqty": 1, //合格数量
"MoRoutingId": 1000000001, //生产订单工艺路线id
"MoRoutingDId": 1000000001, //生产订单工艺路线明细id
"MoId": 1000000001, //生产订单id
"MoDId": 1000000001, //生产订单明细id
"MoCode": "000000001", //生产订单号
"MoSeq": 1 //生产订单行号
}
]
}
@@ -37,7 +37,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
/// <param name="bNeedBillClosed"></param> /// <param name="bNeedBillClosed"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("api/U8/{cSubId}/{cCardNum}/Save")] //[Route("api/U8/{cSubId}/{cCardNum}/Save")]
public async Task<BaseResult<string>> Save(string cAccId, string cCardNum, string cSubId, [FromBody] Dictionary<string, object> input, string busDate="", bool bNeedBillClosed = false) public async Task<BaseResult<string>> Save(string cAccId, string cCardNum, string cSubId, [FromBody] Dictionary<string, object> input, string busDate="", bool bNeedBillClosed = false)
{ {
try try
@@ -74,8 +74,8 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
/// <param name="input">报文数据</param> /// <param name="input">报文数据</param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("api/U8/AP/{cCardNum}/CloseBillSave")] //[Route("api/U8/AP/{cCardNum}/CloseBillSave")]
[Route("api/U8/AR/{cCardNum}/CloseBillSave")] //[Route("api/U8/AR/{cCardNum}/CloseBillSave")]
public async Task<BaseResult<string>> CloseBillSave(string cAccId, string cCardNum, [FromBody] Dictionary<string, object> input) public async Task<BaseResult<string>> CloseBillSave(string cAccId, string cCardNum, [FromBody] Dictionary<string, object> input)
{ {
try try
@@ -130,33 +130,33 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
} }
/// <summary> ///// <summary>
/// 收款单保存 ///// 收款单保存
/// </summary> ///// </summary>
/// <param name="cAccId"></param> ///// <param name="cAccId"></param>
/// <param name="input"></param> ///// <param name="input"></param>
/// <returns></returns> ///// <returns></returns>
[HttpPost] //[HttpPost]
[Route("api/U8/AR/AP48/Save")] //[Route("api/U8/AR/AP48/Save")]
[Route("api/U8/AR/AP49/Save")] //[Route("api/U8/AR/AP49/Save")]
public async Task<BaseResult<string>> AP48Save(string cAccId, [FromBody] Dictionary<string, object> input) //public async Task<BaseResult<string>> AP48Save(string cAccId, [FromBody] Dictionary<string, object> input)
{ //{
return await CloseBillSave(cAccId, "AP48", input); // return await CloseBillSave(cAccId, "AP48", input);
} //}
/// <summary> ///// <summary>
/// 收款单保存 ///// 收款单保存
/// </summary> ///// </summary>
/// <param name="cAccId"></param> ///// <param name="cAccId"></param>
/// <param name="input"></param> ///// <param name="input"></param>
/// <returns></returns> ///// <returns></returns>
[HttpPost] //[HttpPost]
[Route("api/U8/AP/AP49/Save")] //[Route("api/U8/AP/AP49/Save")]
[Route("api/U8/AP/AP49/Save")] //[Route("api/U8/AP/AP49/Save")]
public async Task<BaseResult<string>> AP49Save(string cAccId, [FromBody] Dictionary<string, object> input) //public async Task<BaseResult<string>> AP49Save(string cAccId, [FromBody] Dictionary<string, object> input)
{ //{
return await CloseBillSave(cAccId, "AP49", input); // return await CloseBillSave(cAccId, "AP49", input);
} //}
/// <summary> /// <summary>
/// 票据保存 /// 票据保存
@@ -10,6 +10,7 @@ using UFIDA.U8.Framework.Api.ControlObject.U8M;
using UFIDA.U8.Framework.Api.Unit; using UFIDA.U8.Framework.Api.Unit;
using UFIDA.U8.Framework.Api.Models; using UFIDA.U8.Framework.Api.Models;
using Convert = System.Convert; using Convert = System.Convert;
using SqlSugar;
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
// ReSharper disable IdentifierTypo // ReSharper disable IdentifierTypo
@@ -25,7 +26,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
/// <summary> /// <summary>
/// 日志组件 /// 日志组件
/// </summary> /// </summary>
protected readonly ILog logInfo = LogManager.GetLogger("logInfo"); protected readonly ILog _logInfo = LogManager.GetLogger("logInfo");
private static readonly MemoryCache _cache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) }); private static readonly MemoryCache _cache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
@@ -42,17 +43,55 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
{ {
//var taskId = 0L; //var taskId = 0L;
var db = CommUnit.GetDbClient();
BaseLogin baseLogin=null;
try try
{ {
logInfo.Debug($"接口标识:MoRoutingBillSave,系统号:{cAccId},单据类型编码:{cCardNum},报文数据:{input.ToJson()}"); var db = CommUnit.GetDbClient();
var workId = SnowFlakeSingle.Instance.NextId();
_logInfo.Debug($"作业Id:{workId}-----接口标识:MoRoutingBillSave,系统号:{cAccId},单据类型编码:{cCardNum},报文数据:{input.ToJson()}");
if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92") if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92")
throw new Exception("当前接口不支持此类型的单据"); throw new Exception("当前接口不支持此类型的单据");
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
{
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
baseLogin = new BaseLogin();
var param = await CommUnit.GetLoginParamter(cAccId);
if (param == null)
{
throw new Exception("未能加载指定系统号的登录信息");
}
baseLogin.Init(param);
try
{
_cache.Remove($"U8_{cAccId}");
}
catch
{
_logInfo.Debug($"不存在[U8_{cAccId}]的缓存");
}
_cache.Set($"U8_{cAccId}", baseLogin);
}
if (baseLogin == null)
{
throw new Exception("登录对象加载失败");
}
if (!baseLogin.CheckCallar())
{
baseLogin.RefreshCallar(baseLogin.userToken);
}
//var runtimes = 0; //var runtimes = 0;
//var u8mTask = new SysU8MTask() //var u8mTask = new SysU8MTask()
@@ -60,30 +99,30 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
// U8MPool = $"U8M_{cAccId}" // U8MPool = $"U8M_{cAccId}"
//}; //};
//#if !DEBUG //#if !DEBUG
// while (await db.Queryable<SysU8MTask>().AnyAsync()) // while (await db.Queryable<SysU8MTask>().AnyAsync())
// { // {
// if (runtimes > 20) // if (runtimes > 20)
// { // {
// throw new Exception("当前任务队列过长"); // 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>() // if (await db.Queryable<SysU8MTask>()
// .AnyAsync(a => SqlFunc.DateDiff(DateType.Minute, a.dDate, DateTime.Now) > 1)) // .AnyAsync(a => SqlFunc.DateDiff(DateType.Minute, a.dDate, DateTime.Now) > 1))
// { // {
// await db.Deleteable<SysU8MTask>() // await db.Deleteable<SysU8MTask>()
// .Where(a => SqlFunc.DateDiff(DateType.Minute, a.dDate, DateTime.Now) > 1) // .Where(a => SqlFunc.DateDiff(DateType.Minute, a.dDate, DateTime.Now) > 1)
// .ExecuteCommandAsync(); // .ExecuteCommandAsync();
// } // }
// } // }
//#endif //#endif
//u8mTask.dDate = DateTime.Now; //u8mTask.dDate = DateTime.Now;
@@ -96,23 +135,23 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
//var taskid = SnowFlakeSingle.Instance.NextId(); //var taskid = SnowFlakeSingle.Instance.NextId();
//logInfo.Debug($"开始操作,当前任务ID:{taskId}"); //_logInfo.Debug($"开始操作,当前任务ID:{taskId}");
//if (!_cache.TryGetValue($"U8M_{cAccId}", out BaseLogin baseLogin)) //if (!_cache.TryGetValue($"U8M_{cAccId}", out BaseLogin baseLogin))
//{ //{
// _cache.Clear(); // _cache.Clear();
baseLogin = new BaseLogin(); ////baseLogin = new BaseLogin();
var param = await CommUnit.GetLoginParamter(cAccId); ////var param = await CommUnit.GetLoginParamter(cAccId);
if (param == null) ////if (param == null)
{ ////{
throw new Exception("未能加载指定系统号的登录信息"); //// throw new Exception("未能加载指定系统号的登录信息");
} ////}
logInfo.Debug("开始登录"); ////_logInfo.Debug("开始登录");
baseLogin.Init(param,true); ////baseLogin.Init(param,true);
var bo = new MoRoutingBill(); var bo = new MoRoutingBill();
BaseResult<string> res; BaseResult<string> res;
@@ -120,11 +159,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
{ {
var inputs = input["inputs"] as List<Dictionary<string, object>> ?? $"{input["inputs"]}".ToObject<List<Dictionary<string, object>>>(); var inputs = input["inputs"] as List<Dictionary<string, object>> ?? $"{input["inputs"]}".ToObject<List<Dictionary<string, object>>>();
res = bo.Save(cCardNum, inputs); res =await bo.Save(baseLogin, cCardNum, inputs);
} }
else else
{ {
res = bo.Save(cCardNum, input); res =await bo.Save(baseLogin, cCardNum, input);
} }
//loader.Unload(); //loader.Unload();
@@ -140,7 +179,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
//var bf = new MoRoutingBill(); //var bf = new MoRoutingBill();
logInfo.Debug($"开始保存"); _logInfo.Debug($"开始保存");
//BaseResult<string> res; //BaseResult<string> res;
//if (input.ContainsKey("bBatch") && Convert.ToBoolean(input["bBatch"])) //if (input.ContainsKey("bBatch") && Convert.ToBoolean(input["bBatch"]))
@@ -154,7 +193,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
// res = bf.Save(cCardNum, input); // res = bf.Save(cCardNum, input);
//} //}
logInfo.Debug($"退出登录"); _logInfo.Debug($"退出登录");
//baseLogin.ShutDown(); //baseLogin.ShutDown();
//if (taskId != 0) //if (taskId != 0)
@@ -167,7 +206,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
} }
catch (Exception ex) catch (Exception ex)
{ {
logInfo.Error(ex.Message, ex); _logInfo.Error(ex.Message, ex);
//if (taskId != 0) //if (taskId != 0)
//{ //{
@@ -244,7 +283,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
{ {
try try
{ {
logInfo.Debug($"接口标识:MoRoutingBillDelete,系统号:{cAccId},单据类型编码:{cCardNum},报文数据:{input.ToJson()}"); _logInfo.Debug($"接口标识:MoRoutingBillDelete,系统号:{cAccId},单据类型编码:{cCardNum},报文数据:{input.ToJson()}");
if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92") if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92")
throw new Exception("当前接口不支持此类型的单据"); throw new Exception("当前接口不支持此类型的单据");
@@ -269,17 +308,17 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
if (input.cVouchCode != null && input.cVouchCode.Count > 0) if (input.cVouchCode != null && input.cVouchCode.Count > 0)
{ {
return bf.Delete(cCardNum, input.cVouchCode); return await bf.Delete(baseLogin,cCardNum, input.cVouchCode);
} }
else else
{ {
return bf.Delete(input.MID); return await bf.Delete(baseLogin,input.MID);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
logInfo.Error(ex.Message, ex); _logInfo.Error(ex.Message, ex);
return new BaseResult<string> {bSuccess = false,message = ex.Message,result = ex.StackTrace}; return new BaseResult<string> {bSuccess = false,message = ex.Message,result = ex.StackTrace};
} }
@@ -343,7 +382,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
{ {
try try
{ {
logInfo.Debug($"接口标识:MoRoutingBillVerify,系统号:{cAccId},单据类型编码:{cCardNum},报文数据:{input.ToJson()}"); _logInfo.Debug($"接口标识:MoRoutingBillVerify,系统号:{cAccId},单据类型编码:{cCardNum},报文数据:{input.ToJson()}");
if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92") if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92")
throw new Exception("当前接口不支持此类型的单据"); throw new Exception("当前接口不支持此类型的单据");
@@ -368,17 +407,17 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
if (input.cVouchCode != null && input.cVouchCode.Count > 0) if (input.cVouchCode != null && input.cVouchCode.Count > 0)
{ {
return bf.Verify(cCardNum, input.cVouchCode); return await bf.Verify(baseLogin, cCardNum, input.cVouchCode);
} }
else else
{ {
return bf.Verify(input.MID); return await bf.Verify(baseLogin, input.MID);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
logInfo.Error(ex.Message, ex); _logInfo.Error(ex.Message, ex);
return new BaseResult<string> {bSuccess = false,message = ex.Message,result = ex.StackTrace}; return new BaseResult<string> {bSuccess = false,message = ex.Message,result = ex.StackTrace};
} }
@@ -442,7 +481,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
{ {
try try
{ {
logInfo.Debug($"接口标识:MoRoutingBillUnVerify,系统号:{cAccId},单据类型编码:{cCardNum},报文数据:{input.ToJson()}"); _logInfo.Debug($"接口标识:MoRoutingBillUnVerify,系统号:{cAccId},单据类型编码:{cCardNum},报文数据:{input.ToJson()}");
if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92") if (cCardNum != "FC90" && cCardNum != "FC91" && cCardNum != "FC92")
@@ -478,7 +517,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
} }
catch (Exception ex) catch (Exception ex)
{ {
logInfo.Error(ex.Message, ex); _logInfo.Error(ex.Message, ex);
return new BaseResult<string> {bSuccess = false,message = ex.Message,result = ex.StackTrace}; return new BaseResult<string> {bSuccess = false,message = ex.Message,result = ex.StackTrace};
} }
@@ -488,6 +488,7 @@
<Content Include="App_Data\票据录入模板.json" /> <Content Include="App_Data\票据录入模板.json" />
<Content Include="App_Data\请购单模板.json" /> <Content Include="App_Data\请购单模板.json" />
<Content Include="App_Data\销售订单模板.json" /> <Content Include="App_Data\销售订单模板.json" />
<Content Include="App_Data\订单报工模板.json" />
<None Include="Oracle.DataAccess.Common.Configuration.Section.xsd"> <None Include="Oracle.DataAccess.Common.Configuration.Section.xsd">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</None> </None>
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks;
using System.Web; using System.Web;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using UFIDA.U8.Framework.Api.ControlObject.Entity; using UFIDA.U8.Framework.Api.ControlObject.Entity;
@@ -38,18 +39,18 @@ namespace UFIDA.U8.Framework.Api.Unit
remoteLoader = (RemoteLoader)appDomain.CreateInstanceAndUnwrap(name, typeof(RemoteLoader).FullName ?? throw new InvalidOperationException()); remoteLoader = (RemoteLoader)appDomain.CreateInstanceAndUnwrap(name, typeof(RemoteLoader).FullName ?? throw new InvalidOperationException());
} }
internal BaseResult<string> Save(LoginParamter paramter, string cCardNum, Dictionary<string, object> input) internal async Task<BaseResult<string>> Save(LoginParamter paramter, string cCardNum, Dictionary<string, object> input)
{ {
remoteLoader._paramter = paramter; remoteLoader._paramter = paramter;
return remoteLoader.Save(cCardNum, input); return await remoteLoader.Save(cCardNum, input);
} }
internal BaseResult<string> Save(LoginParamter paramter, string cCardNum, List<Dictionary<string, object>> inputs) internal async Task<BaseResult<string>> Save(LoginParamter paramter, string cCardNum, List<Dictionary<string, object>> inputs)
{ {
remoteLoader._paramter = paramter; remoteLoader._paramter = paramter;
return remoteLoader.Save(cCardNum, inputs); return await remoteLoader.Save(cCardNum, inputs);
} }
/// <summary> /// <summary>
+5 -4
View File
@@ -1,6 +1,7 @@
using log4net; using log4net;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using UFIDA.U8.Framework.Api.ControlObject.Entity; using UFIDA.U8.Framework.Api.ControlObject.Entity;
using UFIDA.U8.Framework.Api.ControlObject.U8M; using UFIDA.U8.Framework.Api.ControlObject.U8M;
@@ -30,7 +31,7 @@ namespace UFIDA.U8.Framework.Api.Unit
/// <param name="input">数据包</param> /// <param name="input">数据包</param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="Exception"></exception> /// <exception cref="Exception"></exception>
internal BaseResult<string> Save(string cCardNum, Dictionary<string, object> input) internal async Task<BaseResult<string>> Save(string cCardNum, Dictionary<string, object> input)
{ {
try try
{ {
@@ -57,7 +58,7 @@ namespace UFIDA.U8.Framework.Api.Unit
baseLogin.Init(_paramter); baseLogin.Init(_paramter);
return bf.Save(cCardNum, input); return await bf.Save(baseLogin, cCardNum, input);
} }
catch (Exception ex) catch (Exception ex)
@@ -75,7 +76,7 @@ namespace UFIDA.U8.Framework.Api.Unit
/// <param name="inputs">数据包</param> /// <param name="inputs">数据包</param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="Exception"></exception> /// <exception cref="Exception"></exception>
internal BaseResult<string> Save(string cCardNum, List<Dictionary<string, object>> inputs) internal async Task<BaseResult<string>> Save(string cCardNum, List<Dictionary<string, object>> inputs)
{ {
try try
{ {
@@ -102,7 +103,7 @@ namespace UFIDA.U8.Framework.Api.Unit
baseLogin.Init(_paramter); baseLogin.Init(_paramter);
return bf.Save(cCardNum, inputs); return await bf.Save(baseLogin, cCardNum, inputs);
} }
catch (Exception ex) catch (Exception ex)
+1 -1
View File
@@ -150,7 +150,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" /> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.17.0" newVersion="2.0.17.0" /> <bindingRedirect oldVersion="0.0.0.0-2.0.17.0" newVersion="1.2.11.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />