1
0
Fork 0

add - oracle数据链接

master
wenjy 1 year ago
parent ef177e4a75
commit e216a9f811

BIN
.DS_Store vendored

Binary file not shown.

Binary file not shown.

@ -13,4 +13,3 @@ Z:\Desktop\日常代码\HighWayIot\HighWayIot.Log4net\obj\Debug\HighWayIot.Log4n
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Log4net\obj\Debug\HighWayIot.Log4net.csproj.CopyComplete
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Log4net\obj\Debug\HighWayIot.Log4net.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Log4net\obj\Debug\HighWayIot.Log4net.pdb
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Log4net\obj\Debug\HighWayIot.Log4net.csproj.AssemblyReference.cache

@ -36,6 +36,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>Z:\Desktop\日常代码\HighWayIot\HighWayIot.Library\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="Oracle.ManagedDataAccess">
<HintPath>..\HighWayIot.Library\Oracle.ManagedDataAccess.dll</HintPath>
</Reference>
<Reference Include="SqlSugar">
<HintPath>Z:\Desktop\日常代码\HighWayIot\HighWayIot.Library\SqlSugar.dll</HintPath>
</Reference>
@ -56,10 +59,13 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="domain\BaseBomInfo.cs" />
<Compile Include="domain\SysUserInfo.cs" />
<Compile Include="domain\BaseDeviceinfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repository.cs" />
<Compile Include="service\IBaseBomInfoService.cs" />
<Compile Include="service\Impl\BaseBomInfoServiceImpl.cs" />
<Compile Include="service\ISysUserInfoService.cs" />
<Compile Include="service\IBaseDeviceinfoService.cs" />
<Compile Include="service\Impl\BaseSysUserInfoServiceImpl.cs" />

@ -26,7 +26,9 @@ namespace HighWayIot.Repository
/**
* Mysql
*/
private static string mysqlConnStr = "Data Source=124.70.63.37;Port=3306;Initial Catalog=ry-cloud;uid=root;pwd=haiwei@123;Charset=utf8mb4;SslMode=none;";
private static string mysqlConnStr = "Data Source=124.70.63.37;Port=6000;Initial Catalog=ry-cloud;uid=root;pwd=haiwei@123;Charset=utf8mb4;SslMode=none";
private static string oracleConnStr = "Data Source=175.27.215.92/helowin;User ID=aucma_mes;Password=aucma";
#endregion
//如果是固定多库可以传 new SqlSugarScope(List<ConnectionConfig>,db=>{}) 文档:多租户
@ -50,6 +52,14 @@ namespace HighWayIot.Repository
DbType = DbType.MySql,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true
},
new ConnectionConfig()
{
ConfigId = "aucma_mes",
ConnectionString = oracleConnStr,
DbType = DbType.Oracle,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true
}
},
db =>

@ -0,0 +1,22 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.domain
{
[SugarTable("BASE_BOMINFO")]
public class BaseBomInfo
{
/// <summary>
/// 主键标识
///</summary>
[SugarColumn(ColumnName = "OBJID", IsPrimaryKey = true, IsIdentity = true)]
public int ObjId { get; set; }
[SugarColumn(ColumnName = "BOM_CODE")]
public string bomCode { get; set; }
}
}

@ -1 +1 @@
57cc02bde6e8ef0bef3d13412afd6b66537bda7a
d76d94154f93492487ee2c4ed32d7c2ed0caf8f5

@ -10,6 +10,7 @@ Z:\Desktop\日常代码\HighWayIot\HighWayIot.Repository\obj\Debug\HighWayIot.Re
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\bin\Debug\HighWayIot.Common.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\bin\Debug\HighWayIot.Log4net.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\bin\Debug\MySql.Data.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\bin\Debug\Oracle.ManagedDataAccess.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\bin\Debug\SqlSugar.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\bin\Debug\System.Data.SQLite.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\bin\Debug\Newtonsoft.Json.dll

@ -0,0 +1,14 @@
using HighWayIot.Repository.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service
{
public interface IBaseBomInfoService
{
List<BaseBomInfo> GetBomInfos();
}
}

@ -0,0 +1,30 @@
using HighWayIot.Log4net;
using HighWayIot.Repository.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service.Impl
{
public class BaseBomInfoServiceImpl:IBaseBomInfoService
{
Repository<BaseBomInfo> _bomInfoRepository => new Repository<BaseBomInfo>("aucma_mes");
private LogHelper logHelper = LogHelper.Instance;
public List<BaseBomInfo> GetBomInfos()
{
try
{
var info = _bomInfoRepository.GetList();
return info;
}catch(Exception ex)
{
logHelper.Error("获取BOM集合异常", ex);
return null;
}
}
}
}

@ -38,6 +38,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>Z:\Desktop\日常代码\HighWayIot\HighWayIot.Library\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="Oracle.ManagedDataAccess">
<HintPath>..\HighWayIot.Library\Oracle.ManagedDataAccess.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite">

@ -17,6 +17,8 @@ namespace HighWayIot
private static ISysUserInfoService mysqlTest = new BaseSysUserInfoServiceImpl();
private static IBaseBomInfoService oracleTest = new BaseBomInfoServiceImpl();
static void Main(string[] args)
{
logger.Info("初始化启动");
@ -24,6 +26,8 @@ namespace HighWayIot
var info = sqliteTest.GetDeviceInfoListByProcessId(3);
var info2 = mysqlTest.GetUserInfos();
var info3 = oracleTest.GetBomInfos();
}
}
}

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
@ -26,5 +26,11 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.122.21.1" newVersion="4.122.21.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>

@ -0,0 +1,6 @@
<HR COLOR=red>
异常时间2023-09-18 09:28:13,297 [1] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 获取BOM集合异常<br>【异常类型】Exception <br>【异常信息】:中文提示 : 需要引用ManagedDataAccess.dll 未安装或者版本冲突, 按下面步骤操作即可 1、从Nuget卸载所有项目的ManagedDataAccess.dll和SqlSugar用Nuget重新安装即可,如果还报错在最上层 WBE层 用NUGET安装详细教程https://www.donet5.com/Doc/8/1154<br>English Message : You need to refer to Oracle.ManagedDataAccess.dll <br>【堆栈调用】: at SqlSugar.DependencyManagement.TryOracle()<br> at SqlSugar.SqlSugarProvider.CheckDbDependency(ConnectionConfig config)<br> at SqlSugar.SqlSugarProvider..ctor(ConnectionConfig config)<br> at SqlSugar.SqlSugarClient.GetConnection(Object configId)<br> at SqlSugar.SqlSugarClient.GetConnectionScope(Object configId)<br> at SqlSugar.SqlSugarScope.GetConnectionScope(Object configId)<br> at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)<br> at HighWayIot.Repository.Repository`1..ctor(Object configId) in \\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\Repository.cs:line 18<br> at HighWayIot.Repository.service.Impl.BaseBomInfoServiceImpl.get__bomInfoRepository() in \\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\service\Impl\BaseBomInfoServiceImpl.cs:line 13<br> at HighWayIot.Repository.service.Impl.BaseBomInfoServiceImpl.GetBomInfos() in \\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot.Repository\service\Impl\BaseBomInfoServiceImpl.cs:line 21 <BR>
<HR Size=1>

@ -0,0 +1,13 @@
<-------------->
日志时间2023-09-18 09:27:40,038 [1]
日志级别INFO
日志内容:初始化启动
<-------------->
日志时间2023-09-18 09:28:58,148 [1]
日志级别INFO
日志内容:初始化启动
<-------------->
日志时间2023-09-18 09:30:59,210 [1]
日志级别INFO
日志内容:初始化启动

@ -0,0 +1,13 @@
<-------------->
日志时间2023-09-18 09:27:48,644 [1]
日志级别INFO
日志内容SELECT `objId`,`process_Id`,`position_Id`,`device_Id`,`device_Name`,`device_Ip`,`device_Port`,`device_Ant`,`device_Type` FROM `base_deviceInfo` WHERE ( `process_Id` = @ProcessId0 ) ;参数:[{"_Size":4000,"IsRefCursor":false,"IsClob":false,"IsNvarchar2":false,"DbType":11,"Direction":0,"IsNullable":false,"ParameterName":"@ProcessId0","Size":4000,"SourceColumn":null,"SourceColumnNullMapping":false,"UdtTypeName":null,"Value":3,"TempDate":null,"SourceVersion":0,"TypeName":null,"IsJson":false,"IsArray":false,"CustomDbType":null,"Precision":0,"Scale":0}]
<-------------->
日志时间2023-09-18 09:29:01,498 [1]
日志级别INFO
日志内容SELECT `objId`,`process_Id`,`position_Id`,`device_Id`,`device_Name`,`device_Ip`,`device_Port`,`device_Ant`,`device_Type` FROM `base_deviceInfo` WHERE ( `process_Id` = @ProcessId0 ) ;参数:[{"_Size":4000,"IsRefCursor":false,"IsClob":false,"IsNvarchar2":false,"DbType":11,"Direction":0,"IsNullable":false,"ParameterName":"@ProcessId0","Size":4000,"SourceColumn":null,"SourceColumnNullMapping":false,"UdtTypeName":null,"Value":3,"TempDate":null,"SourceVersion":0,"TypeName":null,"IsJson":false,"IsArray":false,"CustomDbType":null,"Precision":0,"Scale":0}]
<-------------->
日志时间2023-09-18 09:31:02,413 [1]
日志级别INFO
日志内容SELECT `objId`,`process_Id`,`position_Id`,`device_Id`,`device_Name`,`device_Ip`,`device_Port`,`device_Ant`,`device_Type` FROM `base_deviceInfo` WHERE ( `process_Id` = @ProcessId0 ) ;参数:[{"_Size":4000,"IsRefCursor":false,"IsClob":false,"IsNvarchar2":false,"DbType":11,"Direction":0,"IsNullable":false,"ParameterName":"@ProcessId0","Size":4000,"SourceColumn":null,"SourceColumnNullMapping":false,"UdtTypeName":null,"Value":3,"TempDate":null,"SourceVersion":0,"TypeName":null,"IsJson":false,"IsArray":false,"CustomDbType":null,"Precision":0,"Scale":0}]

@ -1 +1 @@
424f587f07917fde0ae82db0137348704e0c3cb7
ea37f033f486c008bf46f91689270ff097a0d10f

@ -16,6 +16,7 @@ Z:\Desktop\日常代码\HighWayIot\HighWayIot\obj\Debug\HighWayIot.pdb
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\HighWayIot.Log4net.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\HighWayIot.Repository.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\MySql.Data.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\Oracle.ManagedDataAccess.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\System.Data.SQLite.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\log4net.dll
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\SqlSugar.dll
@ -27,6 +28,7 @@ Z:\Desktop\日常代码\HighWayIot\HighWayIot\obj\Debug\HighWayIot.pdb
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\HighWayIot.Common.pdb
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\bin\Debug\Newtonsoft.Json.xml
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\obj\Debug\HighWayIot.csproj.AssemblyReference.cache
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\obj\Debug\HighWayIot.exe.config
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\obj\Debug\HighWayIot.csproj.CoreCompileInputs.cache
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\obj\Debug\HighWayIot.csproj.CopyComplete
\\Mac\Home\Desktop\日常代码\HighWayIot\HighWayIot\obj\Debug\HighWayIot.exe

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.1.0.0" newVersion="8.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.116.0" newVersion="1.0.116.0" />
</dependentAssembly>
<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>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.122.21.1" newVersion="4.122.21.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Loading…
Cancel
Save