Commit 8fedda00 authored by zhanglongtao's avatar zhanglongtao

update

parent c0ef3bff
...@@ -2,11 +2,14 @@ ...@@ -2,11 +2,14 @@
using Abp.Domain.Repositories; using Abp.Domain.Repositories;
using HYH.AspNetCore; using HYH.AspNetCore;
using HYH.Core.DbModels; using HYH.Core.DbModels;
using HYH.Registry.DbModels;
using HYH.Registry.EntityFrameworkCore; using HYH.Registry.EntityFrameworkCore;
using HYH.SqlSugarCore; using HYH.SqlSugarCore;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace HYH.Registry.Services.Encryption namespace HYH.Registry.Services.Encryption
...@@ -17,22 +20,25 @@ namespace HYH.Registry.Services.Encryption ...@@ -17,22 +20,25 @@ namespace HYH.Registry.Services.Encryption
public class EncryptionService : ApplicationService public class EncryptionService : ApplicationService
{ {
private readonly ICurrentUser _currentUser; private readonly ICurrentUser _currentUser;
//private readonly RegistryDbContext _dbContext; private readonly RegistryDbContext _dbContext;
//private readonly DbContext<Tenant> _dbTenant; private readonly DbContext<Tenant> _dbTenant;
private readonly IRepository<Tenant, int> _repTenant; private readonly IRepository<Tenant, int> _repTenant;
private readonly IRepository<MaterialPowder, int> _repMaterialPowder;
/// <summary> /// <summary>
/// 构造函数 /// 构造函数
///</summary> ///</summary>
public EncryptionService( public EncryptionService(
ICurrentUser currentUser, ICurrentUser currentUser,
// RegistryDbContext dbContext, RegistryDbContext dbContext,
// DbContext<Tenant> dbTenant, DbContext<Tenant> dbTenant,
IRepository<MaterialPowder, int> repMaterialPowder,
IRepository<Tenant, int> repTenant IRepository<Tenant, int> repTenant
) )
{ {
_repMaterialPowder = repMaterialPowder;
_currentUser = currentUser; _currentUser = currentUser;
// _dbContext = dbContext; _dbContext = dbContext;
// _dbTenant = dbTenant; // _dbTenant = dbTenant;
_repTenant = repTenant; _repTenant = repTenant;
...@@ -46,6 +52,10 @@ namespace HYH.Registry.Services.Encryption ...@@ -46,6 +52,10 @@ namespace HYH.Registry.Services.Encryption
[HttpGet] [HttpGet]
public string GetNetCardMACAddress() public string GetNetCardMACAddress()
{ {
//var dfsff = _dbContext.Database.GetDbConnection().ConnectionString
string code = _currentUser.TenantCode;
//var tenant = _repTenant.FirstOrDefault(q => q.Code == code);
var ddf = _dbContext.Tenants.ToList();
string netCardMACAddress = ComputerInfoHelper.GetNetCardMACAddress(); string netCardMACAddress = ComputerInfoHelper.GetNetCardMACAddress();
return netCardMACAddress; return netCardMACAddress;
} }
...@@ -94,6 +104,7 @@ namespace HYH.Registry.Services.Encryption ...@@ -94,6 +104,7 @@ namespace HYH.Registry.Services.Encryption
{ {
string data = AESHelper.AESDecrypt(input, "jianzhukeji", "jzkj"); string data = AESHelper.AESDecrypt(input, "jianzhukeji", "jzkj");
string code = _currentUser.TenantCode; string code = _currentUser.TenantCode;
var tenant = _repTenant.FirstOrDefault(q => q.Code == code); var tenant = _repTenant.FirstOrDefault(q => q.Code == code);
string day = (tenant.EndTime - tenant.StartTime).ToString(); string day = (tenant.EndTime - tenant.StartTime).ToString();
string companyName = tenant.Name; string companyName = tenant.Name;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<ProjectReference Include="..\HYH.Registry.Core\HYH.Registry.Core.csproj" /> <ProjectReference Include="..\HYH.Registry.Core\HYH.Registry.Core.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Abp.EntityFrameworkCore" Version="5.10.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
......
{ {
"ConnectionStrings": {
"Default": "Server=39.100.148.168; Database=system; charset=utf8;user=root;password=root@Mysql8@228;port=3307;pooling=true;min pool size=1;max pool size=5;"
},
//"Logging": { //"Logging": {
// "IncludeScopes": true, // "IncludeScopes": true,
// "LogLevel": { // "LogLevel": {
...@@ -11,8 +14,8 @@ ...@@ -11,8 +14,8 @@
"ServerAddress": "http://*:10160" "ServerAddress": "http://*:10160"
}, },
"apollo": { "apollo": {
"AppId": "saas_mes_Registry", "AppId": "saas_mes_registry",
"Env": "Pro", "Env": "Pro",
"Meta": { "Meta": {
//"MetaServer": "http://39.100.148.168:8080", //"MetaServer": "http://39.100.148.168:8080",
"FAT": "http://39.100.148.168:8082", "FAT": "http://39.100.148.168:8082",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment