增加交易唯一码,方便在网络状态不佳的情况下重新获取操作结果
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
using System;
|
||||
using ADODB;
|
||||
using GetComObj;
|
||||
using log4net;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using MSXML2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
using ADODB;
|
||||
using GetComObj;
|
||||
using log4net;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using MSXML2;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UFIDA.U8.Framework.Api.Common.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
@@ -89,7 +87,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static dynamic ToVoucherData(this Dictionary<string,object> dict,dynamic obj)
|
||||
public static dynamic ToVoucherData(this Dictionary<string, object> dict, dynamic obj)
|
||||
{
|
||||
foreach (var dictKey in dict.Keys)
|
||||
{
|
||||
@@ -215,7 +213,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
// //}
|
||||
//}
|
||||
|
||||
public static IXMLDOMDocument2 ToDocument2(this Dictionary<string,object> dictionary,IXMLDOMDocument2 domDocument2=null)
|
||||
public static IXMLDOMDocument2 ToDocument2(this Dictionary<string, object> dictionary, IXMLDOMDocument2 domDocument2 = null)
|
||||
{
|
||||
|
||||
if (domDocument2 == null)
|
||||
@@ -233,7 +231,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
}
|
||||
|
||||
public static IXMLDOMNode SetRowData(this Dictionary<string, object> dictionary, IXMLDOMDocument2 domDocument2 = null,string bodyKey="body")
|
||||
public static IXMLDOMNode SetRowData(this Dictionary<string, object> dictionary, IXMLDOMDocument2 domDocument2 = null, string bodyKey = "body")
|
||||
{
|
||||
if (domDocument2 == null)
|
||||
{
|
||||
@@ -244,7 +242,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
foreach (var key in dictionary.Keys)
|
||||
{
|
||||
if(key==bodyKey)
|
||||
if (key == bodyKey)
|
||||
continue;
|
||||
|
||||
var attr = domDocument2.createAttribute(key);
|
||||
@@ -304,16 +302,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
return root;
|
||||
}
|
||||
|
||||
public static object SetDomKeyValue(this IXMLDOMDocument2 domDocument2,string key,object value)
|
||||
public static object SetDomKeyValue(this IXMLDOMDocument2 domDocument2, string key, object value)
|
||||
{
|
||||
var node= domDocument2.selectSingleNode("//z:row");
|
||||
var node = domDocument2.selectSingleNode("//z:row");
|
||||
|
||||
if (node == null)
|
||||
return null;
|
||||
|
||||
var attr = domDocument2.createAttribute(key);
|
||||
|
||||
attr.nodeValue=value;
|
||||
attr.nodeValue = value;
|
||||
|
||||
node.attributes.setNamedItem(attr);
|
||||
|
||||
@@ -325,9 +323,9 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
if (dictionary.ContainsKey(bodyKey))
|
||||
{
|
||||
var body= dictionary[bodyKey].ToJson().ToList<Dictionary<string,object>>();
|
||||
var body = dictionary[bodyKey].ToJson().ToList<Dictionary<string, object>>();
|
||||
|
||||
dictionary[bodyKey] = body;
|
||||
dictionary[bodyKey] = body;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,9 +566,11 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
var val = cPrecision == null
|
||||
? dt.Compute(calcFormula, "")
|
||||
: Math.Round(Convert.ToDecimal(dt.Compute(calcFormula, "")), cPrecision ?? 6); //计算公式结果
|
||||
: Math.Round(Convert.ToDecimal(dt.Compute(calcFormula, "")), cPrecision ?? 6, MidpointRounding.AwayFromZero); //计算公式结果
|
||||
|
||||
dict[def.FieldName] = val;
|
||||
|
||||
_logInfo.Debug($"字段:{def.FieldName}公式:{calcFormula},公式结果:{val}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -657,7 +657,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public static VouchersInfo GetVouchers(Connection conn,string cCardNum)
|
||||
public static VouchersInfo GetVouchers(Connection conn, string cCardNum)
|
||||
{
|
||||
if (conn == null) throw new ArgumentNullException(nameof(conn));
|
||||
if (cCardNum == null) throw new ArgumentNullException(nameof(cCardNum));
|
||||
@@ -698,7 +698,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
}
|
||||
|
||||
res.cCodeFieldName = codeName;
|
||||
res.voucherIdFieldName= $"{rst.Fields["VchTblPrimarykeyNames"].Value}";
|
||||
res.voucherIdFieldName = $"{rst.Fields["VchTblPrimarykeyNames"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
@@ -713,7 +713,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
/// <param name="vouchers">单据配置信息</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public static string GetVoucherCode(Connection conn,object voucherId, VouchersInfo vouchers)
|
||||
public static string GetVoucherCode(Connection conn, object voucherId, VouchersInfo vouchers)
|
||||
{
|
||||
if (conn == null) throw new ArgumentNullException(nameof(conn));
|
||||
if (voucherId == null) throw new ArgumentNullException(nameof(voucherId));
|
||||
@@ -742,6 +742,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
var cCode = $"{rst.Fields["cCode"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
return cCode;
|
||||
|
||||
}
|
||||
@@ -785,6 +787,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
var voucherId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
return voucherId;
|
||||
|
||||
}
|
||||
@@ -797,7 +801,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
/// <param name="eventId">事件Id</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public static string GetEventId(Connection conn, string cCardNum,string eventId,bool bUAP =false)
|
||||
public static string GetEventId(Connection conn, string cCardNum, string eventId, bool bUAP = false)
|
||||
{
|
||||
if (conn == null) throw new ArgumentNullException(nameof(conn));
|
||||
if (cCardNum == null) throw new ArgumentNullException(nameof(cCardNum));
|
||||
@@ -824,11 +828,13 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
var voucherId = rst.Fields["cBizEventId"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
return voucherId;
|
||||
|
||||
}
|
||||
|
||||
public static string GetVoucherWhereSqlByCode(VouchersInfo vouchers,string cVoucherCode)
|
||||
public static string GetVoucherWhereSqlByCode(VouchersInfo vouchers, string cVoucherCode)
|
||||
{
|
||||
var tableName = vouchers.cBTTblName;
|
||||
var fieldName = vouchers.voucherIdFieldName;
|
||||
@@ -865,11 +871,11 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
return $"{cDefWhere} AND {tableName}.{fieldName}='{voucherId}'";
|
||||
}
|
||||
|
||||
public static string GetQuerySql(VouchersInfo vouchers, Dictionary<string, object> input, string cCardPostion="H")
|
||||
public static string GetQuerySql(VouchersInfo vouchers, Dictionary<string, object> input, string cCardPostion = "H")
|
||||
{
|
||||
var cBTQName = vouchers.cBTQName;
|
||||
var cBWQName = vouchers.cBWQName;
|
||||
|
||||
|
||||
var voucherIdFieldName = vouchers.voucherIdFieldName;
|
||||
var tableName = cBTQName;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user