diff --git a/src/JiShe.CollectBus.Application/EnergySystem/CacheAppService.cs b/src/JiShe.CollectBus.Application/EnergySystem/CacheAppService.cs index 2a038a6..314c267 100644 --- a/src/JiShe.CollectBus.Application/EnergySystem/CacheAppService.cs +++ b/src/JiShe.CollectBus.Application/EnergySystem/CacheAppService.cs @@ -4,12 +4,32 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using JiShe.CollectBus.EnergySystems.TableViews; +using JiShe.CollectBus.FreeSql; using Volo.Abp.Domain.Repositories; +using JiShe.CollectBus.IotSystems.PrepayModel; namespace JiShe.CollectBus.EnergySystem { - public class CacheAppService: CollectBusAppService,ICacheAppService + public class CacheAppService : CollectBusAppService, ICacheAppService { + //public async Task GetHashByKey(string key) + //{ + // await FreeRedisProvider.Instance.HGetAsync(key,); + //} + public async Task SetHashByKey(string key) + { + var data = await SqlProvider.Instance.Change(DbEnum.EnergyDB).Select().ToListAsync(); + + var groupData = data.GroupBy(a => $"{a.FocusAreaCode}{a.FocusAddress}").ToList(); + + foreach (var group in groupData) + { + var aa = data.ToDictionary(a => a.Address, b => b); + await FreeRedisProvider.Instance.HSetAsync(group.Key, aa); + } + + } } } diff --git a/src/JiShe.CollectBus.Domain/EnergySystems/Entities/TB_AmmeterInfo.cs b/src/JiShe.CollectBus.Domain/EnergySystems/Entities/TB_AmmeterInfo.cs index a194d38..e324535 100644 --- a/src/JiShe.CollectBus.Domain/EnergySystems/Entities/TB_AmmeterInfo.cs +++ b/src/JiShe.CollectBus.Domain/EnergySystems/Entities/TB_AmmeterInfo.cs @@ -1,4 +1,5 @@ using System; +using FreeSql.DataAnnotations; namespace JiShe.CollectBus.EnergySystems.Entities { @@ -22,6 +23,7 @@ namespace JiShe.CollectBus.EnergySystems.Entities /// /// 区域名 /// + [Column(IsIgnore = true)] public string AreaName { get; set; } /// @@ -146,6 +148,7 @@ namespace JiShe.CollectBus.EnergySystems.Entities /// /// 集中器名称(扩展字段) /// + [Column(IsIgnore = true)] public string FocusName { get; set; } /// @@ -168,11 +171,13 @@ namespace JiShe.CollectBus.EnergySystems.Entities /// 机械表1(德力西机械电表-Code) /// (原有数据都默认:电子电表) /// + [Column(IsIgnore = true)] public int MeterKind { get; set; } /// /// 采集方案ID /// + [Column(IsIgnore = true)] public int GatherPlanID { get; set; } /// diff --git a/src/JiShe.CollectBus.Domain/JiShe.CollectBus.Domain.csproj b/src/JiShe.CollectBus.Domain/JiShe.CollectBus.Domain.csproj index 09edef1..20068a5 100644 --- a/src/JiShe.CollectBus.Domain/JiShe.CollectBus.Domain.csproj +++ b/src/JiShe.CollectBus.Domain/JiShe.CollectBus.Domain.csproj @@ -23,6 +23,7 @@ + diff --git a/src/JiShe.CollectBus.Host/appsettings.json b/src/JiShe.CollectBus.Host/appsettings.json index 4a166da..5894f33 100644 --- a/src/JiShe.CollectBus.Host/appsettings.json +++ b/src/JiShe.CollectBus.Host/appsettings.json @@ -40,7 +40,7 @@ "EnergyDB": "server=118.190.144.92;database=db_energy;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False" }, "Redis": { - "Configuration": "118.190.144.92:6379,syncTimeout=30000,abortConnect=false,connectTimeout=30000,allowAdmin=true", + "Configuration": "192.168.111.248:6379,password=123456abcD,syncTimeout=30000,abortConnect=false,connectTimeout=30000,allowAdmin=true", "DefaultDB": "14", "HangfireDB": "15" },