增加交易唯一码,方便在网络状态不佳的情况下重新获取操作结果

This commit is contained in:
qmj
2026-05-26 08:45:24 +08:00
parent 8208ba7488
commit 42e6579447
30 changed files with 2891 additions and 374 deletions
@@ -13,28 +13,31 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
{
public class BEHelper
{
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
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 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;
private readonly string _cCardNum;
public BEHelper(dynamic be)
public BEHelper(dynamic be, string cCardNum="")
{
_be = be;
var tp = be.GetType();
_props = tp.GetProperties();
_cCardNum = cCardNum;
}
public void SetValue(Dictionary<string,object> dictionary)
@@ -42,7 +45,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
foreach (var key in dictionary.Keys)
{
if(key != "body")
logInfo.Debug($"正在设置字段:{key}--{dictionary[key]}");
_logInfo.Debug($"正在设置字段:{key}--{dictionary[key]}");
if (key.Contains("define") && !key.Contains("chdefine") && !key.Contains("cbdefine"))
{
@@ -60,7 +63,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
{
_be.ExtendUserDefineItem[defineCode] = dictionary[key];
}
} else if (key.Contains("cbdefine"))
}
else if (key.Contains("cbdefine"))
{
var defineCode = int.Parse(key.Replace("cbdefine", ""));
@@ -68,7 +72,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
{
_be.ExtendUserDefineItem[defineCode] = dictionary[key];
}
}else if (key.Contains("free"))
}
else if (key.Contains("free"))
{
var freeCode = int.Parse(key.Replace("free", ""));
@@ -80,7 +85,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
if (string.Equals(key, "invCode", StringComparison.OrdinalIgnoreCase))
{
_invCode = $"{dictionary[key]}";
}else if (string.Equals(key, "bomversion", StringComparison.OrdinalIgnoreCase))
}
else if (string.Equals(key, "bomversion", StringComparison.OrdinalIgnoreCase))
{
_bomVersion = int.Parse($"{dictionary[key]}");
}
@@ -141,5 +147,14 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
{
_be.SetBomId(_be.PartId, _bomVersion);
}
public void SetMoAllocateId()
{
if (_cCardNum == "MO39")
{
_be.SetMoAllocateId(_be.PartId);
}
}
}
}