Compare commits
No commits in common. "d0e2a35f2265efa794b8c2fedd30a8b2fbc3709d" and "37951e9496fb9b9c212bb64a7bb2bd8270a9b334" have entirely different histories.
d0e2a35f22
...
37951e9496
@ -9,15 +9,12 @@ using Volo.Abp;
|
||||
using System.Reflection;
|
||||
using JiShe.CollectBus.FreeSql;
|
||||
using System;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using Volo.Abp.AspNetCore.Mvc.AntiForgery;
|
||||
using JiShe.CollectBus.FreeRedisProvider;
|
||||
using JiShe.CollectBus.Workers;
|
||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
using JiShe.CollectBus.MongoDB;
|
||||
using JiShe.CollectBus.ScheduledMeterReading;
|
||||
using AutoMapper.Configuration.Annotations;
|
||||
using JiShe.CollectBus.Common.Attributes;
|
||||
|
||||
namespace JiShe.CollectBus;
|
||||
|
||||
@ -52,6 +49,7 @@ public class CollectBusApplicationModule : AbpModule
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var types = assembly.GetTypes().Where(t => typeof(ICollectWorker).IsAssignableFrom(t) && !t.IsInterface).ToList();
|
||||
|
||||
foreach (var type in types)
|
||||
{
|
||||
context.AddBackgroundWorkerAsync(type);
|
||||
|
||||
@ -14,6 +14,11 @@ namespace JiShe.CollectBus.EnergySystem
|
||||
{
|
||||
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();
|
||||
@ -22,7 +27,16 @@ namespace JiShe.CollectBus.EnergySystem
|
||||
|
||||
foreach (var group in groupData)
|
||||
{
|
||||
await FreeRedisProvider.Instance.HSetAsync($"{RedisConst.CacheAmmeterFocusKey}:{group.Key}", group.ToDictionary(a => $"{a.ID}_{a.Address}", b => b));
|
||||
try
|
||||
{
|
||||
var aa = group.ToDictionary(a => $"{a.ID}_{a.Address}" , b => b);
|
||||
await FreeRedisProvider.Instance.HSetAsync($"{RedisConst.CacheAmmeterFocusKey}:{group.Key}", aa);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Hangfire;
|
||||
using JiShe.CollectBus.Common.Attributes;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
@ -10,7 +8,6 @@ using Volo.Abp.Uow;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
[IgnoreJob]
|
||||
public class EpiCollectWorker : HangfireBackgroundWorkerBase, ITransientDependency,ICollectWorker
|
||||
{
|
||||
private readonly ILogger<EpiCollectWorker> _logger;
|
||||
@ -24,7 +21,6 @@ namespace JiShe.CollectBus.Workers
|
||||
_logger = logger;
|
||||
RecurringJobId = nameof(EpiCollectWorker);
|
||||
CronExpression = Cron.Daily();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JiShe.CollectBus.Common.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
|
||||
public class IgnoreJobAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user