This commit is contained in:
邱敏健
2024-12-10 09:03:59 +08:00
parent d35c684d08
commit 7d3133c79d
37 changed files with 678 additions and 490 deletions
@@ -3,10 +3,8 @@ using System;
using System.Collections.Generic;
using ADODB;
using MSXML2;
using NoteManageAR;
using UFIDA.U8.Framework.Api.ControlObject.Common;
using UFIDA.U8.Framework.Api.ControlObject.Json;
using UFIDA.U8.Framework.Api.ControlObject.Models;
using UFIDA.U8.Framework.Api.ControlObject.Entity;
using UFIDA.U8.Framework.Api.ControlObject.U8M;
// ReSharper disable IdentifierTypo
@@ -153,41 +151,41 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
if (cSubId == "AR")
{
var pub = "NoteManageAR.clsPub".GetComObject();
//var pub = "NoteManageAR.clsPub".GetComObject();
pub.main(m_Login);
//pub.main(m_Login);
var ar = "NoteManageAR.Voucher".GetComObject();
//var ar = "NoteManageAR.Voucher".GetComObject();
ar.Init(m_Login, pub.RepSys, pub.RepManager);
//ar.Init(m_Login, pub.RepSys, pub.RepManager);
var da = new VoucherDataClass();
//var da = new VoucherDataClass();
var apar = new APARHelper(da);
//var apar = new APARHelper(da);
ar.m_bStartFlag = false;
ar.bLastYearBill = false;
ar.m_strCardNum = "RP02";
ar.m_strVoucherType = "50";
ar.m_strVoucherDirect = pub.strNoteDirect;
//ar.m_bStartFlag = false;
//ar.bLastYearBill = false;
//ar.m_strCardNum = "RP02";
//ar.m_strVoucherType = "50";
//ar.m_strVoucherDirect = pub.strNoteDirect;
//ar.bUpdateiAmount = true;
//ar.NotExec = true;
//ar.NotExec = true;
ar.objPub = pub;
////ar.bUpdateiAmount = true;
////ar.NotExec = true;
////ar.NotExec = true;
//ar.objPub = pub;
apar.SetValue(dictionary);
//apar.SetValue(dictionary);
ar.m_strVoucherID = da.CVouchId;
ar.m_VoucherHead = domHead;
ar.OneVoucherData = da;
//ar.m_strVoucherID = da.CVouchId;
//ar.m_VoucherHead = domHead;
//ar.OneVoucherData = da;
ar.bNeedBillClosed = true;
//ar.bNeedBillClosed = true;
//da.cVouchTypeName = "银行承兑汇票";
//da.cPayBillBank = "华夏银行股份有限公司深圳分行营业部";
@@ -203,28 +201,28 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
//msg = "";
if (!ar.NoteCheck(da, ref msg))
{
throw new Exception(msg);
}
msg = "";
//if (!ar.NoteCheck(da, ref msg))
//{
// throw new Exception(msg);
//}
//msg = "";
if (!ar.NoteSave(da, ref msg))
{
throw new Exception(msg);
}
//if (!ar.NoteSave(da, ref msg))
//{
// throw new Exception(msg);
//}
//ar.re
////ar.re
//var bo = "UFAPBO.clsApNote".GetComObject();
var apPub = "NoteManageAR.PZ_Proc".GetComObject();
////var bo = "UFAPBO.clsApNote".GetComObject();
//var apPub = "NoteManageAR.PZ_Proc".GetComObject();
apPub.objPub = pub;
//apPub.objPub = pub;
var aa=apPub.ProcSign("9A");
//var aa=apPub.ProcSign("9A");
var bb = pub.cNoteCancelNo;
//var bb = pub.cNoteCancelNo;
//var m_conn = new Connection();
@@ -5,22 +5,21 @@ using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using NoteManageAR;
namespace UFIDA.U8.Framework.Api.ControlObject.Common
{
public class APARHelper
{
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
private readonly VoucherData _vd;
//private readonly VoucherData _vd;
private readonly PropertyInfo[] _props;
public APARHelper(VoucherDataClass vd)
{
_vd = vd;
var tp = vd.GetType();
_props = tp.GetProperties();
}
//public APARHelper(VoucherDataClass vd)
//{
// _vd = vd;
// var tp = vd.GetType();
// _props = tp.GetProperties();
//}
public void SetValue(Dictionary<string, object> dictionary)
{
@@ -33,7 +32,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
{
var prop = _props.First(a => string.Equals(a.Name, key, StringComparison.OrdinalIgnoreCase));
prop.SetPropValue(_vd, dictionary[key]);
//prop.SetPropValue(_vd, dictionary[key]);
}
}
}
@@ -1,10 +1,11 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using GetComObj;
using MSXML2;
using Newtonsoft.Json.Linq;
using NoteManageAR;
using UFIDA.U8.Framework.Api.ControlObject.Json;
namespace UFIDA.U8.Framework.Api.ControlObject.Common
@@ -69,121 +70,121 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
}
}
public static void SetPropValue(this PropertyInfo prop, VoucherData obj, object value)
{
if (prop.PropertyType == typeof(string))
{
prop.SetValue(obj, value);
return;
}
//public static void SetPropValue(this PropertyInfo prop, VoucherData obj, object value)
//{
// if (prop.PropertyType == typeof(string))
// {
// prop.SetValue(obj, value);
// return;
// }
if (prop.PropertyType == typeof(DateTime))
{
prop.SetValue(obj, DateTime.Parse($"{value}"));
return;
}
// if (prop.PropertyType == typeof(DateTime))
// {
// prop.SetValue(obj, DateTime.Parse($"{value}"));
// return;
// }
if (prop.PropertyType == typeof(byte))
{
prop.SetValue(obj, byte.Parse($"{value}"));
return;
}
// if (prop.PropertyType == typeof(byte))
// {
// prop.SetValue(obj, byte.Parse($"{value}"));
// return;
// }
if (prop.PropertyType == typeof(int))
{
prop.SetValue(obj, int.Parse($"{value}"));
return;
}
// if (prop.PropertyType == typeof(int))
// {
// prop.SetValue(obj, int.Parse($"{value}"));
// return;
// }
if (prop.PropertyType == typeof(long))
{
prop.SetValue(obj, long.Parse($"{value}"));
return;
}
// if (prop.PropertyType == typeof(long))
// {
// prop.SetValue(obj, long.Parse($"{value}"));
// return;
// }
if (prop.PropertyType == typeof(decimal))
{
prop.SetValue(obj, decimal.Parse($"{value}"));
return;
}
// if (prop.PropertyType == typeof(decimal))
// {
// prop.SetValue(obj, decimal.Parse($"{value}"));
// return;
// }
if (prop.PropertyType == typeof(double))
{
prop.SetValue(obj, double.Parse($"{value}"));
return;
}
// if (prop.PropertyType == typeof(double))
// {
// prop.SetValue(obj, double.Parse($"{value}"));
// return;
// }
if (prop.PropertyType == typeof(float))
{
prop.SetValue(obj, float.Parse($"{value}"));
return;
}
// if (prop.PropertyType == typeof(float))
// {
// prop.SetValue(obj, float.Parse($"{value}"));
// return;
// }
if (prop.PropertyType == typeof(short))
{
prop.SetValue(obj, short.Parse($"{value}"));
return;
}
// if (prop.PropertyType == typeof(short))
// {
// prop.SetValue(obj, short.Parse($"{value}"));
// return;
// }
//if (prop.PropertyType == typeof(object))
//{
// switch (prop.Name)
// {
// case "cDefine1":
// obj.set_cDefine1($"{value}");
// break;
// case "cDefine2":
// obj.set_cDefine2($"{value}");
// break;
// case "cDefine3":
// obj.set_cDefine3($"{value}");
// break;
// case "cDefine4":
// obj.set_cDefine4(DateTime.Parse($"{value}"));
// break;
// case "cDefine5":
// obj.set_cDefine5(int.Parse($"{value}"));
// break;
// case "cDefine6":
// obj.set_cDefine6(DateTime.Parse($"{value}"));
// break;
// case "cDefine7":
// obj.set_cDefine7(float.Parse($"{value}"));
// break;
// case "cDefine8":
// obj.set_cDefine8($"{value}");
// break;
// case "cDefine9":
// obj.set_cDefine9($"{value}");
// break;
// case "cDefine10":
// obj.set_cDefine10($"{value}");
// break;
// case "cDefine11":
// obj.set_cDefine11($"{value}");
// break;
// case "cDefine12":
// obj.set_cDefine12($"{value}");
// break;
// case "cDefine13":
// obj.set_cDefine13($"{value}");
// break;
// case "cDefine14":
// obj.set_cDefine14($"{value}");
// break;
// case "cDefine15":
// obj.set_cDefine15(int.Parse($"{value}"));
// break;
// case "cDefine16":
// obj.set_cDefine16(float.Parse($"{value}"));
// break;
// default:
// prop.SetValue(obj, $"{value}");
// break;
// //if (prop.PropertyType == typeof(object))
// //{
// // switch (prop.Name)
// // {
// // case "cDefine1":
// // obj.set_cDefine1($"{value}");
// // break;
// // case "cDefine2":
// // obj.set_cDefine2($"{value}");
// // break;
// // case "cDefine3":
// // obj.set_cDefine3($"{value}");
// // break;
// // case "cDefine4":
// // obj.set_cDefine4(DateTime.Parse($"{value}"));
// // break;
// // case "cDefine5":
// // obj.set_cDefine5(int.Parse($"{value}"));
// // break;
// // case "cDefine6":
// // obj.set_cDefine6(DateTime.Parse($"{value}"));
// // break;
// // case "cDefine7":
// // obj.set_cDefine7(float.Parse($"{value}"));
// // break;
// // case "cDefine8":
// // obj.set_cDefine8($"{value}");
// // break;
// // case "cDefine9":
// // obj.set_cDefine9($"{value}");
// // break;
// // case "cDefine10":
// // obj.set_cDefine10($"{value}");
// // break;
// // case "cDefine11":
// // obj.set_cDefine11($"{value}");
// // break;
// // case "cDefine12":
// // obj.set_cDefine12($"{value}");
// // break;
// // case "cDefine13":
// // obj.set_cDefine13($"{value}");
// // break;
// // case "cDefine14":
// // obj.set_cDefine14($"{value}");
// // break;
// // case "cDefine15":
// // obj.set_cDefine15(int.Parse($"{value}"));
// // break;
// // case "cDefine16":
// // obj.set_cDefine16(float.Parse($"{value}"));
// // break;
// // default:
// // prop.SetValue(obj, $"{value}");
// // break;
// }
//}
}
// // }
// //}
//}
public static IXMLDOMDocument2 ToDocument2(this Dictionary<string,object> dictionary,IXMLDOMDocument2 domDocument2=null)
{
@@ -292,5 +293,26 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
return obj;
}
public static string U8Encrypt(string input)
{
var rethash = "";
var hash = SHA1.Create();
var encoder = new ASCIIEncoding();
var combined = encoder.GetBytes(input);
hash.ComputeHash(combined);
rethash = Convert.ToBase64String(hash.Hash);
if (string.IsNullOrWhiteSpace(rethash))
return rethash;
return rethash + (char)3;
}
}
}
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UFIDA.U8.Framework.Api.ControlObject.Models
namespace UFIDA.U8.Framework.Api.ControlObject.Entity
{
public class BaseResult<T>
{
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UFIDA.U8.Framework.Api.ControlObject.Models
namespace UFIDA.U8.Framework.Api.ControlObject.Entity
{
/// <summary>
/// U8登录参数
@@ -5,7 +5,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UFIDA.U8.Framework.Api.ControlObject.Models
namespace UFIDA.U8.Framework.Api.ControlObject.Entity
{
/// <summary>
/// 通用状态枚举
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UFIDA.U8.Framework.Api.ControlObject.Models
namespace UFIDA.U8.Framework.Api.ControlObject.Entity
{
public class SysU8AccountConfig
{
@@ -1,16 +1,12 @@
using log4net;
using MSXML2;
using NoteManageAR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UFIDA.U8.Framework.Api.ControlObject.Common;
using UFIDA.U8.Framework.Api.ControlObject.Entity;
using UFIDA.U8.Framework.Api.ControlObject.Json;
using UFIDA.U8.Framework.Api.ControlObject.Models;
using UFIDA.U8.Framework.Api.ControlObject.U8M;
using UFSoft.U8.SF.BE;
namespace UFIDA.U8.Framework.Api.ControlObject.ST
{
@@ -1,7 +1,7 @@
using System;
using ADODB;
using log4net;
using UFIDA.U8.Framework.Api.ControlObject.Models;
using UFIDA.U8.Framework.Api.ControlObject.Entity;
using UFSoft.U8.Framework.ContextSrv;
using UFSoft.U8.Framework.Login.UI;
using UFSoft.U8.Framework.LoginContext;
@@ -30,6 +30,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
public Connection Connection;
public string userToken => _vbLogin.userToken;
/// <summary>
/// 初始化生产制造上下文
/// </summary>
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UFIDA.U8.Framework.Api.ControlObject.Models;
using UFIDA.U8.Framework.Api.ControlObject.Entity;
namespace UFIDA.U8.Framework.Api.ControlObject.U8M
{
@@ -2,12 +2,9 @@
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.Entity;
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;
@@ -7,8 +7,8 @@ using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using UFIDA.U8.Framework.Api.ControlObject.Common;
using UFIDA.U8.Framework.Api.ControlObject.Entity;
using UFIDA.U8.Framework.Api.ControlObject.Json;
using UFIDA.U8.Framework.Api.ControlObject.Models;
using UFSoft.U8.Framework.BizBase;
using UFSoft.U8.Framework.ContextSrv;
using UFSoft.U8.U8M.BFDispatcher;
@@ -7,7 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using UFIDA.U8.Framework.Api.ControlObject.Common;
using UFIDA.U8.Framework.Api.ControlObject.Json;
using UFIDA.U8.Framework.Api.ControlObject.Models;
using UFIDA.U8.Framework.Api.ControlObject.Entity;
using UFSoft.U8.Framework.BizBase;
using UFSoft.U8.Framework.ContextSrv;
using UFSoft.U8.U8M.BFDispatcher;
@@ -37,14 +37,6 @@
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>D:\U8SOFT\Interop\ADODB.dll</HintPath>
</Reference>
<Reference Include="Interop.ADOX">
<HintPath>D:\U8SOFT\COBat\Interop.ADOX.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Interop.DAO">
<HintPath>D:\U8SOFT\COBat\Interop.DAO.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Interop.GetComObj">
<HintPath>D:\U8SOFT\Interop\Interop.GetComObj.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
@@ -53,10 +45,6 @@
<HintPath>D:\U8SOFT\Interop\Interop.MSXML2.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Interop.NoteManageAR">
<HintPath>D:\U8SOFT\COBat\Interop.NoteManageAR.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Interop.U8ColumnSet">
<HintPath>D:\U8SOFT\Interop\Interop.U8ColumnSet.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
@@ -78,23 +66,11 @@
<HintPath>D:\U8SOFT\Interop\Interop.UFGeneralFilterPub.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Interop.UfHeronReport">
<HintPath>D:\U8SOFT\COBat\Interop.UfHeronReport.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
<Reference Include="log4net, Version=3.0.3.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.0.3\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="Interop.UFRPPub">
<HintPath>D:\U8SOFT\COBat\Interop.UFRPPub.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Interop.USDbKit">
<HintPath>D:\U8SOFT\COBat\Interop.USDbKit.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
</Reference>
<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 Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.9.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>
@@ -105,11 +81,11 @@
<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 Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\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 Include="System.Threading.Tasks.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
@@ -206,10 +182,10 @@
<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" />
<Compile Include="Models\StatusEnum.cs" />
<Compile Include="Models\SysU8AccountConfig.cs" />
<Compile Include="Entity\BaseResult.cs" />
<Compile Include="Entity\LoginParamter.cs" />
<Compile Include="Entity\StatusEnum.cs" />
<Compile Include="Entity\SysU8AccountConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ST\USERPCO.cs" />
<Compile Include="U8M\BaseLogin.cs" />
@@ -6,6 +6,10 @@
<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>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -1,8 +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="log4net" version="3.0.3" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.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" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.6.0" targetFramework="net48" />
</packages>