dev #2
@ -4,12 +4,32 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using JiShe.CollectBus.EnergySystems.TableViews;
|
||||||
|
using JiShe.CollectBus.FreeSql;
|
||||||
using Volo.Abp.Domain.Repositories;
|
using Volo.Abp.Domain.Repositories;
|
||||||
|
using JiShe.CollectBus.IotSystems.PrepayModel;
|
||||||
|
|
||||||
namespace JiShe.CollectBus.EnergySystem
|
namespace JiShe.CollectBus.EnergySystem
|
||||||
{
|
{
|
||||||
public class CacheAppService: CollectBusAppService,ICacheAppService
|
public class CacheAppService : CollectBusAppService, ICacheAppService
|
||||||
{
|
{
|
||||||
|
//public async Task<V_FocusAmmeter> GetHashByKey(string key)
|
||||||
|
//{
|
||||||
|
// await FreeRedisProvider.Instance.HGetAsync<V_FocusAmmeter>(key,);
|
||||||
|
//}
|
||||||
|
|
||||||
|
public async Task SetHashByKey(string key)
|
||||||
|
{
|
||||||
|
var data = await SqlProvider.Instance.Change(DbEnum.EnergyDB).Select<V_FocusAmmeter>().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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using FreeSql.DataAnnotations;
|
||||||
|
|
||||||
namespace JiShe.CollectBus.EnergySystems.Entities
|
namespace JiShe.CollectBus.EnergySystems.Entities
|
||||||
{
|
{
|
||||||
@ -22,6 +23,7 @@ namespace JiShe.CollectBus.EnergySystems.Entities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 区域名
|
/// 区域名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column(IsIgnore = true)]
|
||||||
public string AreaName { get; set; }
|
public string AreaName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -146,6 +148,7 @@ namespace JiShe.CollectBus.EnergySystems.Entities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 集中器名称(扩展字段)
|
/// 集中器名称(扩展字段)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column(IsIgnore = true)]
|
||||||
public string FocusName { get; set; }
|
public string FocusName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -168,11 +171,13 @@ namespace JiShe.CollectBus.EnergySystems.Entities
|
|||||||
/// 机械表1(德力西机械电表-Code)
|
/// 机械表1(德力西机械电表-Code)
|
||||||
/// (原有数据都默认:电子电表)
|
/// (原有数据都默认:电子电表)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column(IsIgnore = true)]
|
||||||
public int MeterKind { get; set; }
|
public int MeterKind { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 采集方案ID
|
/// 采集方案ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column(IsIgnore = true)]
|
||||||
public int GatherPlanID { get; set; }
|
public int GatherPlanID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\JiShe.CollectBus.Common\JiShe.CollectBus.Common.csproj" />
|
<ProjectReference Include="..\JiShe.CollectBus.Common\JiShe.CollectBus.Common.csproj" />
|
||||||
<ProjectReference Include="..\JiShe.CollectBus.Domain.Shared\JiShe.CollectBus.Domain.Shared.csproj" />
|
<ProjectReference Include="..\JiShe.CollectBus.Domain.Shared\JiShe.CollectBus.Domain.Shared.csproj" />
|
||||||
|
<ProjectReference Include="..\JiShe.CollectBus.FreeSql\JiShe.CollectBus.FreeSql.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
"EnergyDB": "server=118.190.144.92;database=db_energy;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False"
|
"EnergyDB": "server=118.190.144.92;database=db_energy;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False"
|
||||||
},
|
},
|
||||||
"Redis": {
|
"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",
|
"DefaultDB": "14",
|
||||||
"HangfireDB": "15"
|
"HangfireDB": "15"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user