.net7需要这样写

This commit is contained in:
qianhao.xu 2024-10-12 15:33:15 +08:00
parent 15cb064758
commit ba1b8393ef
4 changed files with 68 additions and 4 deletions

View File

@ -8,8 +8,8 @@
},
"dbConfigs": [
{
//"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=GXAssembly;Port=3308",
"Conn": "Data Source=192.168.0.58;User ID=root;Password=123456;Initial Catalog=GXAssembly;Port=3306;AllowLoadLocalInfile=true",
"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=GXAssembly;Port=3308",
//"Conn": "Data Source=192.168.0.58;User ID=root;Password=123456;Initial Catalog=GXAssembly;Port=3306;AllowLoadLocalInfile=true",
// "Conn": "Data Source=127.0.0.1;User ID=root;Password=123456;Initial Catalog=GXAssembly;Port=3306",
//"Conn": "Data Source=192.168.50.163;User ID=root;Password=123456;Initial Catalog=GXAssembly;Port=3306",
"DbType": 0, // MySql = 0, SqlServer = 1, Oracle = 3PgSql = 4
@ -50,7 +50,7 @@
"DemoMode": false, //
"SingleLogin": false, //
"Upload": {
"rootDirectory": "E:/git仓库/上海干巷/MES/file",
"rootDirectory": "F:\\MES\\file",
"uploadUrl": "http://127.0.0.1:7000", //访
"localSavePath": "", // wwwroot+localSavePath
"maxSize": 15, // 15M

View File

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DOAN.Model.MES.quality
{
/// <summary>
/// 成品缺陷
/// </summary>
[SugarTable("qc_finishedproduct_defect_collection")]
public class QcFinishedproductDefectCollection
{
/// <summary>
/// 雪花
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
public string Id { get; set; }
/// <summary>
/// 工单号
/// </summary>
public string Workorder { get; set; }
/// <summary>
/// 缺陷描述
/// </summary>
[SugarColumn(ColumnName = "defect_describe")]
public string DefectDescribe { get; set; }
/// <summary>
/// 数量
/// </summary>
public int? Number { get; set; }
/// <summary>
/// CreatedBy
/// </summary>
[SugarColumn(ColumnName = "created_by")]
public string CreatedBy { get; set; }
/// <summary>
/// CreatedTime
/// </summary>
[SugarColumn(ColumnName = "created_time")]
public DateTime? CreatedTime { get; set; }
/// <summary>
/// UpdatedBy
/// </summary>
[SugarColumn(ColumnName = "updated_by")]
public string UpdatedBy { get; set; }
/// <summary>
/// UpdatedTime
/// </summary>
[SugarColumn(ColumnName = "updated_time")]
public DateTime? UpdatedTime { get; set; }
}
}

View File

@ -195,6 +195,7 @@ namespace DOAN.ServiceCore.SqlSugar
{
IsAutoRemoveDataCache = true
};
//TODO???
db.GetConnectionScope(configId).CurrentConnectionConfig.ConfigureExternalServices = new ConfigureExternalServices()
{
DataInfoCacheService = cache,

View File

@ -132,9 +132,10 @@ namespace DOAN.Common
const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
//var entries = Cache.GetType().GetField("_entries", flags).GetValue(Cache);
//TODO ???
//.net7需要这样写
var coherentState = Cache.GetType().GetField("_coherentState", flags).GetValue(Cache);
var entries = coherentState.GetType().GetField("_entries", flags).GetValue(coherentState);
var entries = coherentState.GetType()?.GetField("_entries", flags)?.GetValue(coherentState);
var keys = new List<string>();
if (entries is not IDictionary cacheItems) return keys;