Commit 8fedda00 authored by zhanglongtao's avatar zhanglongtao

update

parent c0ef3bff
......@@ -2,11 +2,14 @@
using Abp.Domain.Repositories;
using HYH.AspNetCore;
using HYH.Core.DbModels;
using HYH.Registry.DbModels;
using HYH.Registry.EntityFrameworkCore;
using HYH.SqlSugarCore;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HYH.Registry.Services.Encryption
......@@ -17,22 +20,25 @@ namespace HYH.Registry.Services.Encryption
public class EncryptionService : ApplicationService
{
private readonly ICurrentUser _currentUser;
//private readonly RegistryDbContext _dbContext;
//private readonly DbContext<Tenant> _dbTenant;
private readonly RegistryDbContext _dbContext;
private readonly DbContext<Tenant> _dbTenant;
private readonly IRepository<Tenant, int> _repTenant;
private readonly IRepository<MaterialPowder, int> _repMaterialPowder;
/// <summary>
/// 构造函数
///</summary>
public EncryptionService(
ICurrentUser currentUser,
// RegistryDbContext dbContext,
// DbContext<Tenant> dbTenant,
RegistryDbContext dbContext,
DbContext<Tenant> dbTenant,
IRepository<MaterialPowder, int> repMaterialPowder,
IRepository<Tenant, int> repTenant
)
{
_repMaterialPowder = repMaterialPowder;
_currentUser = currentUser;
// _dbContext = dbContext;
_dbContext = dbContext;
// _dbTenant = dbTenant;
_repTenant = repTenant;
......@@ -46,6 +52,10 @@ namespace HYH.Registry.Services.Encryption
[HttpGet]
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();
return netCardMACAddress;
}
......@@ -94,6 +104,7 @@ namespace HYH.Registry.Services.Encryption
{
string data = AESHelper.AESDecrypt(input, "jianzhukeji", "jzkj");
string code = _currentUser.TenantCode;
var tenant = _repTenant.FirstOrDefault(q => q.Code == code);
string day = (tenant.EndTime - tenant.StartTime).ToString();
string companyName = tenant.Name;
......
......@@ -28,6 +28,7 @@
<ProjectReference Include="..\HYH.Registry.Core\HYH.Registry.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Abp.EntityFrameworkCore" Version="5.10.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
<PrivateAssets>all</PrivateAssets>
<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": {
// "IncludeScopes": true,
// "LogLevel": {
......@@ -11,8 +14,8 @@
"ServerAddress": "http://*:10160"
},
"apollo": {
"AppId": "saas_mes_Registry",
"Env": "Pro",
"AppId": "saas_mes_registry",
"Env": "Pro",
"Meta": {
//"MetaServer": "http://39.100.148.168:8080",
"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