解析所有日志保存到iotdb
This commit is contained in:
parent
acd0a5c155
commit
529623a232
@ -157,7 +157,7 @@ public class AdminClientService : IAdminClientService, IDisposable, ISingletonDe
|
||||
adminClientConfig.SecurityProtocol = SecurityProtocol.SaslPlaintext;
|
||||
adminClientConfig.SaslMechanism = SaslMechanism.Plain;
|
||||
adminClientConfig.SaslUsername = _kafkaOptionConfig.SaslUserName;
|
||||
adminClientConfig.SaslPassword = _kafkaOptionConfig.SaslUserName;
|
||||
adminClientConfig.SaslPassword = _kafkaOptionConfig.SaslPassword;
|
||||
}
|
||||
return new AdminClientBuilder(adminClientConfig).Build();
|
||||
}
|
||||
|
||||
@ -21,6 +21,10 @@ namespace JiShe.CollectBus.Kafka
|
||||
public static class KafkaSubscribeExtensions
|
||||
{
|
||||
|
||||
private static long _threadCount = 0;
|
||||
private static long _topicSubscribeCount = 0;
|
||||
private static long _threadStartCount = 0;
|
||||
|
||||
public static void UseInitKafkaTopic(this IServiceProvider provider)
|
||||
{
|
||||
//初始化主题信息
|
||||
@ -46,12 +50,12 @@ namespace JiShe.CollectBus.Kafka
|
||||
lifetime.ApplicationStarted.Register(() =>
|
||||
{
|
||||
var logger = provider.GetRequiredService<ILogger<CollectBusKafkaModule>>();
|
||||
var threadCount = 0;
|
||||
var topicCount = 0;
|
||||
//var threadCount = 0;
|
||||
//var topicCount = 0;
|
||||
var assemblyPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
||||
if (string.IsNullOrWhiteSpace(assemblyPath))
|
||||
{
|
||||
logger.LogInformation($"kafka订阅未能找到程序路径");
|
||||
logger.LogWarning($"kafka订阅未能找到程序路径");
|
||||
return;
|
||||
}
|
||||
var dllFiles = Directory.GetFiles(assemblyPath, "*.dll");
|
||||
@ -69,21 +73,35 @@ namespace JiShe.CollectBus.Kafka
|
||||
if (subscribeTypes.Count == 0)
|
||||
continue;
|
||||
|
||||
foreach (var subscribeType in subscribeTypes)
|
||||
// 并行处理
|
||||
Parallel.ForEach(subscribeTypes, subscribeType =>
|
||||
{
|
||||
var subscribes = provider.GetServices(subscribeType).ToList();
|
||||
subscribes.ForEach(subscribe =>
|
||||
Parallel.ForEach(subscribes,subscribe =>
|
||||
{
|
||||
if (subscribe != null)
|
||||
{
|
||||
Tuple<int, int> tuple = BuildKafkaSubscribe(subscribe, provider, logger, kafkaOptions.Value);
|
||||
threadCount += tuple.Item1;
|
||||
topicCount += tuple.Item2;
|
||||
//threadCount += tuple.Item1;
|
||||
//topicCount += tuple.Item2;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//foreach (var subscribeType in subscribeTypes)
|
||||
//{
|
||||
// var subscribes = provider.GetServices(subscribeType).ToList();
|
||||
// subscribes.ForEach(subscribe =>
|
||||
// {
|
||||
// if (subscribe != null)
|
||||
// {
|
||||
// Tuple<int, int> tuple = BuildKafkaSubscribe(subscribe, provider, logger, kafkaOptions.Value);
|
||||
// threadCount += tuple.Item1;
|
||||
// topicCount += tuple.Item2;
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
}
|
||||
logger.LogInformation($"kafka订阅主题:{topicCount}数,共启动:{threadCount}线程");
|
||||
logger.LogWarning($"kafka订阅主题:{_topicSubscribeCount}数,共启动:{_threadCount}线程");
|
||||
});
|
||||
}
|
||||
|
||||
@ -135,26 +153,50 @@ namespace JiShe.CollectBus.Kafka
|
||||
//var configuration = provider.GetRequiredService<IConfiguration>();
|
||||
int threadCount = 0;
|
||||
|
||||
foreach (var sub in subscribedMethods)
|
||||
Parallel.ForEach(subscribedMethods, sub =>
|
||||
{
|
||||
//int partitionCount = sub.Attribute!.TaskCount==-1?3: sub.Attribute!.TaskCount;// kafkaOptionConfig.NumPartitions;
|
||||
Interlocked.Increment(ref _topicSubscribeCount);
|
||||
int partitionCount = sub.Attribute!.TaskCount == -1 ? 3 : sub.Attribute!.TaskCount;// kafkaOptionConfig.NumPartitions;
|
||||
var adminClientService = provider.GetRequiredService<IAdminClientService>();
|
||||
|
||||
int topicCount = adminClientService.GetTopicPartitionsNum(sub.Attribute!.Topic);
|
||||
|
||||
int partitionCount = sub.Attribute!.TaskCount == -1 ? topicCount : sub.Attribute!.TaskCount;// kafkaOptionConfig.NumPartitions;
|
||||
//int partitionCount = sub.Attribute!.TaskCount == -1 ? topicCount : sub.Attribute!.TaskCount;// kafkaOptionConfig.NumPartitions;
|
||||
|
||||
partitionCount = partitionCount > topicCount ? topicCount : partitionCount;
|
||||
//partitionCount = sub.Attribute!.TaskCount == -1 ? adminClientService.GetTopicPartitionsNum(sub.Attribute!.Topic) : sub.Attribute!.TaskCount;
|
||||
if (partitionCount <= 0)
|
||||
partitionCount = 1;
|
||||
for (int i = 0; i < partitionCount; i++)
|
||||
Parallel.For(0,partitionCount, async (partition) =>
|
||||
{
|
||||
//if (sub.Attribute!.Topic == ProtocolConst.SubscriberLoginReceivedEventName)
|
||||
Task.Run(() => StartConsumerAsync(provider, sub.Attribute!, sub.Method, subscribe, logger));
|
||||
threadCount++;
|
||||
}
|
||||
}
|
||||
Interlocked.Increment(ref _threadCount);
|
||||
//Task.Run(() => StartConsumerAsync(provider, sub.Attribute!, sub.Method, subscribe, logger));
|
||||
//threadCount++;
|
||||
await StartConsumerAsync(provider, sub.Attribute!, sub.Method, subscribe, logger);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//foreach (var sub in subscribedMethods)
|
||||
//{
|
||||
// //int partitionCount = sub.Attribute!.TaskCount==-1?3: sub.Attribute!.TaskCount;// kafkaOptionConfig.NumPartitions;
|
||||
// var adminClientService = provider.GetRequiredService<IAdminClientService>();
|
||||
|
||||
// int topicCount = adminClientService.GetTopicPartitionsNum(sub.Attribute!.Topic);
|
||||
|
||||
// int partitionCount = sub.Attribute!.TaskCount == -1 ? topicCount : sub.Attribute!.TaskCount;// kafkaOptionConfig.NumPartitions;
|
||||
|
||||
// partitionCount = partitionCount > topicCount ? topicCount : partitionCount;
|
||||
// //partitionCount = sub.Attribute!.TaskCount == -1 ? adminClientService.GetTopicPartitionsNum(sub.Attribute!.Topic) : sub.Attribute!.TaskCount;
|
||||
// if (partitionCount <= 0)
|
||||
// partitionCount = 1;
|
||||
// for (int i = 0; i < partitionCount; i++)
|
||||
// {
|
||||
// //if (sub.Attribute!.Topic == ProtocolConst.SubscriberLoginReceivedEventName)
|
||||
// Task.Run(() => StartConsumerAsync(provider, sub.Attribute!, sub.Method, subscribe, logger));
|
||||
// threadCount++;
|
||||
// }
|
||||
//}
|
||||
return Tuple.Create(threadCount, subscribedMethods.Length);
|
||||
}
|
||||
|
||||
@ -167,6 +209,8 @@ namespace JiShe.CollectBus.Kafka
|
||||
|
||||
if (attr.EnableBatch)
|
||||
{
|
||||
Interlocked.Increment(ref _threadStartCount);
|
||||
logger.LogInformation($"kafka开启线程消费:{_threadStartCount}");
|
||||
await consumerService.SubscribeBatchAsync<dynamic>(attr.Topic, async (message) =>
|
||||
{
|
||||
try
|
||||
@ -187,6 +231,8 @@ namespace JiShe.CollectBus.Kafka
|
||||
}
|
||||
else
|
||||
{
|
||||
Interlocked.Increment(ref _threadStartCount);
|
||||
logger.LogInformation($"kafka开启线程消费:{_threadStartCount}");
|
||||
await consumerService.SubscribeAsync<dynamic>(attr.Topic, async (message) =>
|
||||
{
|
||||
try
|
||||
|
||||
@ -13,6 +13,7 @@ using JiShe.CollectBus.IotSystems.MessageIssueds;
|
||||
using Volo.Abp.Data;
|
||||
using Volo.Abp.MongoDB;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
using JiShe.CollectBus.IotSystems.LogRecord;
|
||||
|
||||
namespace JiShe.CollectBus.MongoDB;
|
||||
|
||||
@ -32,7 +33,6 @@ public class CollectBusMongoDbContext : AbpMongoDbContext, ICollectBusMongoDbCon
|
||||
|
||||
public IMongoCollection<MessageIssued> MessageIssueds => Collection<MessageIssued>();
|
||||
|
||||
|
||||
|
||||
protected override void CreateModel(IMongoModelBuilder modelBuilder)
|
||||
{
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
using JiShe.CollectBus.IotSystems.MeterReadingRecords;
|
||||
using JiShe.CollectBus.IotSystems.LogRecord;
|
||||
using JiShe.CollectBus.IotSystems.MeterReadingRecords;
|
||||
using JiShe.CollectBus.Repository;
|
||||
using JiShe.CollectBus.Repository.LogRecord;
|
||||
using JiShe.CollectBus.Repository.MeterReadingRecord;
|
||||
using JiShe.CollectBus.ShardingStrategy;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@ -35,10 +37,14 @@ public class CollectBusMongoDbModule : AbpModule
|
||||
typeof(IShardingStrategy<>),
|
||||
typeof(DayShardingStrategy<>));
|
||||
|
||||
|
||||
context.Services.AddTransient(typeof(HourShardingStrategy<>));
|
||||
|
||||
//// 分表策略仓储 替换默认仓储
|
||||
//options.AddRepository<MeterReadingRecords, MeterReadingRecordRepository>();
|
||||
});
|
||||
|
||||
options.AddRepository<LogRecords, LogRecordRepository>();
|
||||
});
|
||||
context.Services.AddAlwaysDisableUnitOfWorkTransaction();
|
||||
Configure<AbpUnitOfWorkDefaultOptions>(options =>
|
||||
{
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
using JiShe.CollectBus.IotSystems.LogRecord;
|
||||
using JiShe.CollectBus.IotSystems.MeterReadingRecords;
|
||||
using MongoDB.Driver;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Domain.Repositories;
|
||||
|
||||
namespace JiShe.CollectBus.Repository.LogRecord
|
||||
{
|
||||
public interface ILogRecordRepository : IRepository<LogRecords, Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 批量插入
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
Task InsertManyAsync(List<LogRecords> entities,
|
||||
DateTime? dateTime);
|
||||
|
||||
/// <summary>
|
||||
/// 单个插入
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
Task<LogRecords> InsertAsync(LogRecords entity, DateTime? dateTime);
|
||||
|
||||
/// <summary>
|
||||
/// 单条更新
|
||||
/// </summary>
|
||||
/// <param name="filter">过滤条件,示例:Builders<LogRecords>.Filter.Eq(x => x.Id, filter.Id)</param>
|
||||
/// <param name="update">包含待更新的内容,示例:Builders<LogRecords>.Update.Set(x => x.SendHexMessage, SendHexMessage).Set(x => x.MessageId, MessageId)</param>
|
||||
/// <param name="entity">数据实体,用于获取对应的分片库</param>
|
||||
/// <returns></returns>
|
||||
Task<LogRecords> UpdateOneAsync(FilterDefinition<LogRecords> filter, UpdateDefinition<LogRecords> update, LogRecords entity);
|
||||
|
||||
/// <summary>
|
||||
/// 单个获取
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
Task<LogRecords> FirOrDefaultAsync(LogRecords entity, DateTime dateTime);
|
||||
|
||||
/// <summary>
|
||||
/// 多集合数据查询
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<LogRecords>> ParallelQueryAsync(DateTime startTime, DateTime endTime);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,166 @@
|
||||
using JiShe.CollectBus.IotSystems.LogRecord;
|
||||
using JiShe.CollectBus.IotSystems.MeterReadingRecords;
|
||||
using JiShe.CollectBus.MongoDB;
|
||||
using JiShe.CollectBus.Repository.MeterReadingRecord;
|
||||
using JiShe.CollectBus.ShardingStrategy;
|
||||
using MongoDB.Driver;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Domain.Repositories.MongoDB;
|
||||
using Volo.Abp.MongoDB;
|
||||
|
||||
namespace JiShe.CollectBus.Repository.LogRecord
|
||||
{
|
||||
public class LogRecordRepository : MongoDbRepository<CollectBusMongoDbContext, LogRecords, Guid>, ILogRecordRepository
|
||||
{
|
||||
|
||||
private readonly HourShardingStrategy<LogRecords> _hourShardingStrategy;
|
||||
private readonly IMongoDbContextProvider<CollectBusMongoDbContext> _dbContextProvider;
|
||||
|
||||
public LogRecordRepository(
|
||||
IMongoDbContextProvider<CollectBusMongoDbContext> dbContextProvider,
|
||||
HourShardingStrategy<LogRecords> hourShardingStrategy
|
||||
)
|
||||
: base(dbContextProvider)
|
||||
{
|
||||
_dbContextProvider = dbContextProvider;
|
||||
_hourShardingStrategy = hourShardingStrategy;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量插入
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<IEnumerable<LogRecords>> InsertManyAsync(IEnumerable<LogRecords> entities, bool autoSave = false, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
var collection = await GetShardedCollection(DateTime.Now);
|
||||
await collection.InsertManyAsync(entities);
|
||||
|
||||
return entities;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量插入
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
public async Task InsertManyAsync(List<LogRecords> entities, DateTime? dateTime)
|
||||
{
|
||||
var collection = await GetShardedCollection(dateTime);
|
||||
await collection.InsertManyAsync(entities);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 单条插入
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<LogRecords> InsertAsync(LogRecords entity, bool autoSave = false, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
var collection = await GetShardedCollection(DateTime.Now);
|
||||
await collection.InsertOneAsync(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 单条插入
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<LogRecords> InsertAsync(LogRecords entity, DateTime? dateTime)
|
||||
{
|
||||
var collection = await GetShardedCollection(dateTime);
|
||||
await collection.InsertOneAsync(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单条更新
|
||||
/// </summary>
|
||||
/// <param name="filter">过滤条件,示例:Builders<LogRecords>.Filter.Eq(x => x.Id, filter.Id)</param>
|
||||
/// <param name="update">包含待更新的内容,示例:Builders<LogRecords>.Update.Set(x => x.SendHexMessage, SendHexMessage).Set(x => x.MessageId, MessageId)</param>
|
||||
/// <param name="entity">数据实体,用于获取对应的分片库</param>
|
||||
/// <returns></returns>
|
||||
public async Task<LogRecords> UpdateOneAsync(FilterDefinition<LogRecords> filter, UpdateDefinition<LogRecords> update, LogRecords entity)
|
||||
{
|
||||
var collection = await GetShardedCollection(entity.CreationTime);
|
||||
|
||||
await collection.UpdateOneAsync(filter, update);
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 单个获取
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<LogRecords> FirOrDefaultAsync(LogRecords entity, DateTime dateTime)
|
||||
{
|
||||
var collection = await GetShardedCollection(dateTime);
|
||||
var query = await collection.FindAsync(d => d.CreationTime == dateTime && d.AFN == entity.AFN && d.Fn == entity.Fn && d.Code == entity.Code);
|
||||
return await query.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 多集合数据查询
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<LogRecords>> ParallelQueryAsync(DateTime startTime, DateTime endTime)
|
||||
{
|
||||
var collectionNames = _hourShardingStrategy.GetQueryCollectionNames(startTime, endTime);
|
||||
|
||||
var dbContext = await DbContextProvider.GetDbContextAsync();
|
||||
|
||||
var tasks = collectionNames.Select(async name =>
|
||||
{
|
||||
var collection = dbContext.Database.GetCollection<LogRecords>(name);
|
||||
var filter = Builders<LogRecords>.Filter.And(
|
||||
Builders<LogRecords>.Filter.Gte(x => x.CreationTime, startTime),
|
||||
Builders<LogRecords>.Filter.Lte(x => x.CreationTime, endTime)
|
||||
);
|
||||
return await collection.Find(filter).ToListAsync();
|
||||
});
|
||||
|
||||
var results = await Task.WhenAll(tasks);
|
||||
return results.SelectMany(r => r).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得分片集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task<IMongoCollection<LogRecords>> GetShardedCollection(DateTime? dateTime)
|
||||
{
|
||||
var dbContext = await DbContextProvider.GetDbContextAsync();
|
||||
string collectionName = string.Empty;
|
||||
|
||||
if (dateTime != null)
|
||||
{
|
||||
collectionName = _hourShardingStrategy.GetCollectionName(dateTime.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
collectionName = _hourShardingStrategy.GetCurrentCollectionName();
|
||||
}
|
||||
|
||||
return dbContext.Database.GetCollection<LogRecords>(collectionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -22,7 +23,7 @@ namespace JiShe.CollectBus.ShardingStrategy
|
||||
public string GetCollectionName(DateTime dateTime)
|
||||
{
|
||||
var baseName = typeof(TEntity).Name;
|
||||
return $"{baseName}_{dateTime.GetDataTableShardingStrategy()}";
|
||||
return $"{baseName}_{dateTime.GetDataTableShardingStrategy(TableTimeStrategyEnum.DayShardingStrategy)}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -32,7 +33,7 @@ namespace JiShe.CollectBus.ShardingStrategy
|
||||
public string GetCurrentCollectionName()
|
||||
{
|
||||
var baseName = typeof(TEntity).Name;
|
||||
return $"{baseName}_{DateTime.Now.GetDataTableShardingStrategy()}";
|
||||
return $"{baseName}_{DateTime.Now.GetDataTableShardingStrategy(TableTimeStrategyEnum.DayShardingStrategy)}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -50,7 +51,7 @@ namespace JiShe.CollectBus.ShardingStrategy
|
||||
|
||||
while (current <= end)
|
||||
{
|
||||
months.Add($"{baseName}_{current.GetDataTableShardingStrategy()}");
|
||||
months.Add($"{baseName}_{current.GetDataTableShardingStrategy(TableTimeStrategyEnum.DayShardingStrategy)}");
|
||||
current = current.AddMonths(1);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace JiShe.CollectBus.ShardingStrategy
|
||||
{
|
||||
/// <summary>
|
||||
/// 按小时分表
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
public class HourShardingStrategy<TEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取指定时间对应的集合名
|
||||
/// </summary>
|
||||
/// <param name="dateTime"></param>
|
||||
/// <returns></returns>
|
||||
public string GetCollectionName(DateTime dateTime)
|
||||
{
|
||||
var baseName = typeof(TEntity).Name;
|
||||
return $"{baseName}_{dateTime.GetDataTableShardingStrategy(TableTimeStrategyEnum.HourShardingStrategy)}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前时间对应的集合名
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetCurrentCollectionName()
|
||||
{
|
||||
var baseName = typeof(TEntity).Name;
|
||||
return $"{baseName}_{DateTime.Now.GetDataTableShardingStrategy(TableTimeStrategyEnum.HourShardingStrategy)}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用于查询时确定目标集合
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<string> GetQueryCollectionNames(DateTime? startTime, DateTime? endTime)
|
||||
{
|
||||
var list = new List<string>();
|
||||
var current = startTime ?? DateTime.MinValue;
|
||||
var end = endTime ?? DateTime.MaxValue;
|
||||
var baseName = typeof(TEntity).Name;
|
||||
|
||||
while (current <= end)
|
||||
{
|
||||
list.Add($"{baseName}_{current.GetDataTableShardingStrategy(TableTimeStrategyEnum.HourShardingStrategy)}");
|
||||
current = current.AddHours(1);
|
||||
}
|
||||
|
||||
return list.Distinct();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JiShe.CollectBus.ShardingStrategy
|
||||
{
|
||||
public interface IHourShardingStrategy<TEntity> : IShardingStrategy<TEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
@ -12,39 +14,57 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_00H
|
||||
public class AFN0_F1_Analysis: IAnalysisStrategy<TB3761>
|
||||
{
|
||||
private readonly ILogger<AFN0_F1_Analysis> _logger;
|
||||
private readonly DataStorage _dataStorage;
|
||||
|
||||
public AFN0_F1_Analysis(ILogger<AFN0_F1_Analysis> logger)
|
||||
public AFN0_F1_Analysis(ILogger<AFN0_F1_Analysis> logger, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_dataStorage= dataStorage;
|
||||
}
|
||||
|
||||
public Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.A.Code);
|
||||
UnitDataAnalysis<bool> dto = new UnitDataAnalysis<bool>
|
||||
var data = new AnalysisBaseDto<bool?>()
|
||||
{
|
||||
FiledDesc = "全部确认",
|
||||
DataValue = true
|
||||
};
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(MeterTypeEnum.Focus.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.FocusId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.Address;
|
||||
data.DeviceType = MeterTypeEnum.Focus;
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<bool?>> dto = new UnitDataAnalysis<AnalysisBaseDto<bool?>>
|
||||
{
|
||||
Code = input.A.Code,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = true,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
Data = data,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
TimeDensity = -1
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
return Task.FromResult(true);
|
||||
await _dataStorage.SaveDataToIotDbAsync<bool?>(dto);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"00_1解析失败:{input.A.Code}-{input.DT.Fn}-{input.BaseHexMessage.HexMessageString},{ex.Message}");
|
||||
}
|
||||
return Task.FromResult(false);
|
||||
return await Task.FromResult(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
@ -12,25 +14,41 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_00H
|
||||
public class AFN0_F2_Analysis : IAnalysisStrategy<TB3761>
|
||||
{
|
||||
private readonly ILogger<AFN0_F2_Analysis> _logger;
|
||||
|
||||
public AFN0_F2_Analysis(ILogger<AFN0_F2_Analysis> logger)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN0_F2_Analysis(ILogger<AFN0_F2_Analysis> logger, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
public Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.A.Code);
|
||||
UnitDataAnalysis<bool> dto = new UnitDataAnalysis<bool>
|
||||
var data = new AnalysisBaseDto<bool?>()
|
||||
{
|
||||
FiledDesc = "全部否认",
|
||||
DataValue = false
|
||||
};
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(MeterTypeEnum.Focus.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.FocusId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.Address;
|
||||
data.DeviceType = MeterTypeEnum.Focus;
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<bool?>> dto = new UnitDataAnalysis<AnalysisBaseDto<bool?>>
|
||||
{
|
||||
Code = input.A.Code,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = false,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
Data = data,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime =input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
@ -40,13 +58,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_00H
|
||||
#if DEBUG
|
||||
_logger.LogWarning($"全部否认:{input.A.Code}-{input.DT.Fn}-{input.BaseHexMessage.HexMessageString}");
|
||||
#endif
|
||||
return Task.FromResult(true);
|
||||
await _dataStorage.SaveDataToIotDbAsync<bool?>(dto);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"00_2解析失败:{input.A.Code}-{input.DT.Fn}-{input.BaseHexMessage.HexMessageString},{ex.Message}");
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
return await Task.FromResult(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,16 +3,8 @@ using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_00H;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static FreeSql.Internal.GlobalFilter;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_02H
|
||||
{
|
||||
@ -58,7 +50,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_02H
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
|
||||
@ -5,11 +5,6 @@ using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_02H
|
||||
{
|
||||
@ -55,7 +50,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_02H
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
|
||||
@ -5,11 +5,6 @@ using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_02H
|
||||
{
|
||||
@ -55,7 +50,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_02H
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
using System.Text;
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
@ -16,41 +18,60 @@ namespace JiShe.CollectBus.Protocol.AnalysisData.AFN_09H
|
||||
{
|
||||
private readonly ILogger<AFN9_F1_Analysis> _logger;
|
||||
|
||||
public AFN9_F1_Analysis(ILogger<AFN9_F1_Analysis> logger)
|
||||
private readonly DataStorage _dataStorage;
|
||||
|
||||
public AFN9_F1_Analysis(ILogger<AFN9_F1_Analysis> logger, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData.HexMessageList);
|
||||
var data = AnalysisDataUnit(input.UnitData.HexMessageList);
|
||||
data.AreaCode = input.A.Code?.Substring(0, 4);
|
||||
data.Address = input.A.Code?.Substring(4, 5);
|
||||
UnitDataAnalysis<AFN9_F1_AnalysisDto> dto = new UnitDataAnalysis<AFN9_F1_AnalysisDto>
|
||||
var version = AnalysisDataUnit(input.UnitData.HexMessageList);
|
||||
version.AreaCode = input.A.Code?.Substring(0, 4);
|
||||
version.Address = input.A.Code?.Substring(4, 5);
|
||||
var data = new AnalysisBaseDto<AFN9_F1_AnalysisDto?>()
|
||||
{
|
||||
FiledDesc = "终端版本信息",
|
||||
DataValue = version
|
||||
};
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(MeterTypeEnum.Focus.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.FocusId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.Address;
|
||||
data.DeviceType = MeterTypeEnum.Focus;
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<AFN9_F1_AnalysisDto?>> dto = new UnitDataAnalysis<AnalysisBaseDto<AFN9_F1_AnalysisDto?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
TimeDensity = -1
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
return Task.FromResult(true);
|
||||
await _dataStorage.SaveDataToIotDbAsync(dto);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"09_1解析失败:{input.A?.Code}-{input.DT?.Fn ?? 0}-{input?.BaseHexMessage?.HexMessageString},{ex.Message}");
|
||||
}
|
||||
return Task.FromResult(false);
|
||||
return await Task.FromResult(false);
|
||||
}
|
||||
|
||||
private AFN9_F1_AnalysisDto AnalysisDataUnit(List<string> hexMessageList)
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
using System.Text;
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
@ -14,39 +16,57 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_09H
|
||||
public class AFN9_F9_Analysis : IAnalysisStrategy<TB3761>
|
||||
{
|
||||
private readonly ILogger<AFN9_F9_Analysis> _logger;
|
||||
|
||||
public AFN9_F9_Analysis(ILogger<AFN9_F9_Analysis> logger)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN9_F9_Analysis(ILogger<AFN9_F9_Analysis> logger, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData.HexMessageList);
|
||||
UnitDataAnalysis<string> dto = new UnitDataAnalysis<string>
|
||||
var data = new AnalysisBaseDto<string?>()
|
||||
{
|
||||
FiledDesc = "远程通信模块版本信息",
|
||||
DataValue = Encoding.ASCII.GetString(string.Join("", input.UnitData.HexMessageList.Skip(30).Take(20).ToList()).HexToByte()).Replace("\0", "")
|
||||
};
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(MeterTypeEnum.Focus.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.FocusId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.Address;
|
||||
data.DeviceType = MeterTypeEnum.Focus;
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<string?>> dto = new UnitDataAnalysis<AnalysisBaseDto<string?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = Encoding.ASCII.GetString(string.Join("", input.UnitData.HexMessageList.Skip(30).Take(20).ToList()).HexToByte()).Replace("\0", ""), //SIM卡
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
Data = data, //SIM卡
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
TimeDensity = -1
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
return Task.FromResult(true);
|
||||
await _dataStorage.SaveDataToIotDbAsync(dto);
|
||||
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"00_1解析失败:{input.A?.Code}-{input.DT?.Fn ?? 0}-{input?.BaseHexMessage?.HexMessageString},{ex.Message}");
|
||||
}
|
||||
return Task.FromResult(false);
|
||||
return await Task.FromResult(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
@ -15,42 +16,61 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0AH
|
||||
{
|
||||
private readonly ILogger<AFN10_F10_Analysis> _logger;
|
||||
|
||||
public AFN10_F10_Analysis(ILogger<AFN10_F10_Analysis> logger)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN10_F10_Analysis(ILogger<AFN10_F10_Analysis> logger, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
public Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData.HexMessageList);
|
||||
Tuple<int, List<AFN10F10Entity>> tuple = AFN10F10EntityAnalysis(input.UnitData.HexMessageList);
|
||||
UnitDataAnalysis<AFN10_F10_AnalysisDto> dto = new UnitDataAnalysis<AFN10_F10_AnalysisDto>
|
||||
|
||||
var data = new AnalysisBaseDto<AFN10_F10_AnalysisDto?>()
|
||||
{
|
||||
FiledDesc = "终端电能表/交流采样装置配置参数",
|
||||
DataValue = new AFN10_F10_AnalysisDto()
|
||||
{
|
||||
AFN10F10Entitys = tuple.Item2,
|
||||
ConfigNum = tuple.Item1
|
||||
}
|
||||
};
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(MeterTypeEnum.Focus.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.FocusId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.Address;
|
||||
data.DeviceType = MeterTypeEnum.Focus;
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<AFN10_F10_AnalysisDto?>> dto = new UnitDataAnalysis<AnalysisBaseDto<AFN10_F10_AnalysisDto?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = new AFN10_F10_AnalysisDto()
|
||||
{
|
||||
AFN10F10Entitys = tuple.Item2,
|
||||
ConfigNum = tuple.Item1
|
||||
},
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
Data = data,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
TimeDensity = -1
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
return Task.FromResult(true);
|
||||
await _dataStorage.SaveDataToIotDbAsync<AFN10_F10_AnalysisDto?>(dto);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"0A_10解析失败:{input.A?.Code}-{input.DT?.Fn ?? 0}-{input?.BaseHexMessage?.HexMessageString},{ex.Message}");
|
||||
}
|
||||
return Task.FromResult(false);
|
||||
return await Task.FromResult(false);
|
||||
}
|
||||
|
||||
public Tuple<int, List<AFN10F10Entity>> AFN10F10EntityAnalysis(List<string> hexMessageList)
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.Appendix;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0AH
|
||||
{
|
||||
@ -16,11 +18,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0AH
|
||||
{
|
||||
private readonly ILogger<AFN10_F66_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN10_F66_Analysis(ILogger<AFN10_F66_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN10_F66_Analysis(ILogger<AFN10_F66_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext= analysisStrategyContext;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
@ -29,22 +32,38 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0AH
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData.HexMessageList);
|
||||
var data = await GenerateFinalResult(input.UnitData.HexMessageList);
|
||||
data.Pn = input.DA.Pn;
|
||||
UnitDataAnalysis<AFN10_F66_AnalysisDto> dto = new UnitDataAnalysis<AFN10_F66_AnalysisDto>
|
||||
|
||||
var data = new AnalysisBaseDto<AFN10_F66_AnalysisDto?>()
|
||||
{
|
||||
FiledDesc = "终端电能表/交流采样装置配置参数",
|
||||
DataValue = await GenerateFinalResult(input.UnitData.HexMessageList)
|
||||
};
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(MeterTypeEnum.Focus.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.FocusId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.Address;
|
||||
data.DeviceType = MeterTypeEnum.Focus;
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<AFN10_F66_AnalysisDto?>> dto = new UnitDataAnalysis<AnalysisBaseDto<AFN10_F66_AnalysisDto?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
TimeDensity = -1
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
await _dataStorage.SaveDataToIotDbAsync<AFN10_F66_AnalysisDto?>(dto);
|
||||
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
@ -12,39 +14,57 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0AH
|
||||
public class AFN10_F68_Analysis : IAnalysisStrategy<TB3761>
|
||||
{
|
||||
private readonly ILogger<AFN10_F68_Analysis> _logger;
|
||||
|
||||
public AFN10_F68_Analysis(ILogger<AFN10_F68_Analysis> logger)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN10_F68_Analysis(ILogger<AFN10_F68_Analysis> logger, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData.HexMessageList);
|
||||
UnitDataAnalysis<bool> dto = new UnitDataAnalysis<bool>
|
||||
var data = new AnalysisBaseDto<bool?>()
|
||||
{
|
||||
FiledDesc = "终端电能表/交流采样装置配置参数",
|
||||
DataValue = input.UnitData.HexMessageList[4].Equals("55")
|
||||
};
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(MeterTypeEnum.Focus.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.FocusId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.Address;
|
||||
data.DeviceType = MeterTypeEnum.Focus;
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<bool?>> dto = new UnitDataAnalysis<AnalysisBaseDto<bool?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = input.UnitData.HexMessageList[4].Equals("55"),
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
Data = data,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
TimeDensity = -1
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
return Task.FromResult(true);
|
||||
await _dataStorage.SaveDataToIotDbAsync<bool?>(dto);
|
||||
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"0A_68解析失败:{input.A?.Code}-{input.DT?.Fn ?? 0}-{input?.BaseHexMessage?.HexMessageString},{ex.Message}");
|
||||
}
|
||||
return Task.FromResult(false);
|
||||
return await Task.FromResult(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Helpers;
|
||||
using JiShe.CollectBus.IoTDB.Interface;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.Appendix;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
{
|
||||
@ -17,13 +19,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
{
|
||||
private readonly ILogger<AFN12_F129_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
private readonly IIoTDbProvider _dbProvider;
|
||||
|
||||
public AFN12_F129_Analysis(ILogger<AFN12_F129_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, IIoTDbProvider dbProvider)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F129_Analysis(ILogger<AFN12_F129_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dbProvider= dbProvider;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
@ -41,7 +42,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
Pn = input.DA.Pn,
|
||||
MSA = input.A.A3.D1_D7,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
@ -49,8 +50,24 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
};
|
||||
List<string> datas = await AnalysisDataUnitAsync(input.UnitData.HexMessageList);
|
||||
List<AnalysisBaseDto<decimal?>> list = GenerateFinalResult(2, datas, "正向有功电能示值", input.AFN_FC.AFN, input.DT.Fn);
|
||||
if (list.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(list[0].DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
list.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.DeviceId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
unitDataAnalysis.Data= list;
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Helpers;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
@ -17,11 +18,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
|
||||
private readonly ILogger<AFN12_F130_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F130_Analysis(ILogger<AFN12_F130_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F130_Analysis(ILogger<AFN12_F130_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
@ -32,6 +34,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData?.HexMessageList);
|
||||
List<string> datas = await AnalysisDataUnitAsync(input.UnitData.HexMessageList);
|
||||
List<AnalysisBaseDto<decimal?>> list = GenerateFinalResult(2, datas, "正向无功电能示值", input.AFN_FC.AFN, input.DT.Fn);
|
||||
if (list.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(list[0].DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
list.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.DeviceId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -39,13 +56,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = list,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Helpers;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
@ -18,11 +19,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
{
|
||||
private readonly ILogger<AFN12_F131_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F131_Analysis(ILogger<AFN12_F131_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F131_Analysis(ILogger<AFN12_F131_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
@ -33,6 +35,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData?.HexMessageList);
|
||||
List<string> datas = await AnalysisDataUnitAsync(input.UnitData.HexMessageList);
|
||||
List<AnalysisBaseDto<decimal?>> list = GenerateFinalResult(2, datas, "反向有功总电能示值", input.AFN_FC.AFN, input.DT.Fn);
|
||||
if (list.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(list[0].DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
list.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.DeviceId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -40,13 +57,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = list,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Common.Helpers;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
@ -19,11 +20,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
|
||||
private readonly ILogger<AFN12_F132_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F132_Analysis(ILogger<AFN12_F132_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F132_Analysis(ILogger<AFN12_F132_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
|
||||
@ -36,6 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
List<string> datas = await AnalysisDataUnitAsync(input.UnitData.HexMessageList);
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
List<AnalysisBaseDto<decimal?>> list = GenerateFinalResult(2, datas, "反向无功电能示值", dataType);
|
||||
if (list.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(list[0].DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
list.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.DeviceId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -43,13 +60,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
Fn = input.DT.Fn ,
|
||||
Pn = input.DA.Pn,
|
||||
Data = list,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Common.Helpers;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.Appendix;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Metrics;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
@ -18,11 +20,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
{
|
||||
private readonly ILogger<AFN12_F145_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F145_Analysis(ILogger<AFN12_F145_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F145_Analysis(ILogger<AFN12_F145_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
|
||||
@ -36,6 +39,17 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
AnalysisBaseDto<decimal?> data = GenerateFinalResult(datas, "当月正向有功最大需量及发生时间", dataType);
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data.DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.MeterId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
|
||||
}
|
||||
|
||||
UnitDataAnalysis<AnalysisBaseDto<decimal?>> unitDataAnalysis = new UnitDataAnalysis<AnalysisBaseDto<decimal?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -43,13 +57,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0CH
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -57,7 +57,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
MSA=input.A.A3!.D1_D7!,
|
||||
PSEQ=input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage=input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage=input.BaseHexMessage.HexMessageString,
|
||||
MessageId=input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Common.Helpers;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using YamlDotNet.Core.Tokens;
|
||||
@ -18,11 +20,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
|
||||
private readonly ILogger<AFN12_F188_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F188_Analysis(ILogger<AFN12_F188_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F188_Analysis(ILogger<AFN12_F188_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
@ -36,6 +39,16 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
ArgumentNullException.ThrowIfNull(input.DT.Fn);
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
AnalysisBaseDto<decimal?> data = GenerateFinalResult(input.UnitData.HexMessageList, dataType);
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data.DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.MeterId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<decimal?>> dto = new UnitDataAnalysis<AnalysisBaseDto<decimal?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -43,13 +56,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
await _dataStorage.SaveDataToIotDbAsync(dto);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Common.Helpers;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
using JiShe.CollectBus.Protocol.T37612012.Appendix;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@ -19,11 +21,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
{
|
||||
private readonly ILogger<AFN12_F25_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F25_Analysis(ILogger<AFN12_F25_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F25_Analysis(ILogger<AFN12_F25_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public List<string> DataType { get; set; } = new List<string>() { "YGGL", "YGGL_A", "YGGL_B", "YGGL_C", "WGGL", "WGGL_A", "WGGL_B", "WGGL_C", "GLYS", "GLYS_A", "GLYS_B", "GLYS_C", "DY_A", "DY_B", "DY_C", "DL_A", "DL_B", "DL_C", "LXDL", "SZGL", "SZGL_A", "SZGL_B", "SZGL_C" };
|
||||
@ -62,6 +65,22 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
dto.FiledDesc = remarks[i - 1];
|
||||
list.Add(dto);
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(list[0].DataType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
list.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.DeviceId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -69,13 +88,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = list,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -8,6 +8,8 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
using System.Diagnostics.Metrics;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
{
|
||||
@ -18,11 +20,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
{
|
||||
private readonly ILogger<AFN12_F2_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F2_Analysis(ILogger<AFN12_F2_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F2_Analysis(ILogger<AFN12_F2_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
@ -35,6 +38,16 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
var data = await GenerateFinalResultAsync(input.UnitData.HexMessageList, dataType);
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data.DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.MeterId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<string>> dto = new UnitDataAnalysis<AnalysisBaseDto<string>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -42,13 +55,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
await _dataStorage.SaveDataToIotDbAsync(dto);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
using JiShe.CollectBus.Protocol.T37612012.Appendix;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
{
|
||||
@ -16,11 +19,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
private List<string> DataUnitHexList { get; set; }=new List<string>();
|
||||
private readonly ILogger<AFN12_F33_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F33_Analysis(ILogger<AFN12_F33_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F33_Analysis(ILogger<AFN12_F33_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
|
||||
@ -34,20 +38,36 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
|
||||
DataUnitHexList = input.UnitData.HexMessageList.GetRange(24, (5 * (rationgCount + 1)) + (4 * (rationgCount + 1)) * 3);
|
||||
GetDataUnitHexString(input.UnitData.HexMessageList, rationgCount);
|
||||
UnitDataAnalysis<AFN12_F33_AnalysisDto> unitDataAnalysis = new UnitDataAnalysis<AFN12_F33_AnalysisDto>
|
||||
var data = new AnalysisBaseDto<AFN12_F33_AnalysisDto?>()
|
||||
{
|
||||
FiledDesc = "当前正向有/无功电能示值、一/四象限无功电能示值",
|
||||
DataValue = await AnalysisDataUnit(input.UnitData.HexMessageList, rationgCount)
|
||||
};
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data.DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.MeterId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<AFN12_F33_AnalysisDto?>> unitDataAnalysis = new UnitDataAnalysis<AnalysisBaseDto<AFN12_F33_AnalysisDto?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = await AnalysisDataUnit(input.UnitData.HexMessageList, rationgCount),
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
Data = data,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Common.Helpers;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
using JiShe.CollectBus.Protocol.T37612012.Appendix;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@ -18,11 +20,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
{
|
||||
private readonly ILogger<AFN12_F49_Analysis> _logger;
|
||||
private readonly AnalysisStrategyContext _analysisStrategyContext;
|
||||
|
||||
public AFN12_F49_Analysis(ILogger<AFN12_F49_Analysis> logger, AnalysisStrategyContext analysisStrategyContext)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN12_F49_Analysis(ILogger<AFN12_F49_Analysis> logger, AnalysisStrategyContext analysisStrategyContext, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_analysisStrategyContext = analysisStrategyContext;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public List<string> DataType { get; set; } = new List<string>() { "Uab_Ua", "Ub", "Ucb_Uc", "Ia", "Ib", "Ic" };
|
||||
@ -58,6 +61,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
dto.FiledDesc= remarks[i];
|
||||
list.Add(dto);
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(list[0].DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
list.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.DeviceId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal?>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -65,13 +83,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data= list,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.Second,
|
||||
TimeDensity = 0
|
||||
};
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -65,7 +65,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度,注意这里会兼容存储做判断
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -62,7 +62,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度,注意这里会兼容存储做判断
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度,注意这里会兼容存储做判断
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度,注意这里会兼容存储做判断
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度,注意这里会兼容存储做判断
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度,注意这里会兼容存储做判断
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度,注意这里会兼容存储做判断
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -62,7 +62,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度,注意这里会兼容存储做判断
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -62,7 +62,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -62,7 +62,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -62,7 +62,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -62,7 +62,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -62,7 +62,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -60,7 +60,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -60,7 +60,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -60,7 +60,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -62,7 +62,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -55,7 +55,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -56,7 +56,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -56,7 +56,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -66,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -65,7 +65,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -63,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -64,7 +64,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute,
|
||||
|
||||
@ -65,7 +65,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0EH
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Text;
|
||||
|
||||
namespace GatherService.WattMeter.AnalysisData.AFN_10H
|
||||
{
|
||||
@ -13,40 +16,47 @@ namespace GatherService.WattMeter.AnalysisData.AFN_10H
|
||||
public class AFN16_F101_Analysis : IAnalysisStrategy<TB3761>
|
||||
{
|
||||
private readonly ILogger<AFN16_F101_Analysis> _logger;
|
||||
|
||||
public AFN16_F101_Analysis(ILogger<AFN16_F101_Analysis> logger)
|
||||
private readonly DataStorage _dataStorage;
|
||||
public AFN16_F101_Analysis(ILogger<AFN16_F101_Analysis> logger, DataStorage dataStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_dataStorage = dataStorage;
|
||||
}
|
||||
|
||||
public Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
public async Task<bool> ExecuteAsync(TB3761 input, Action<dynamic>? result = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData.HexMessageList);
|
||||
UnitDataAnalysis<string> dto = new UnitDataAnalysis<string>
|
||||
var data = new AnalysisBaseDto<string?>()
|
||||
{
|
||||
FiledDesc = "透读取SIM卡信息",
|
||||
DataValue = AnalysisDataUnit(input.UnitData.HexMessageList)
|
||||
};
|
||||
UnitDataAnalysis<AnalysisBaseDto<string?>> dto = new UnitDataAnalysis<AnalysisBaseDto<string?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
Fn = input.DT.Fn,
|
||||
Pn = input.DA.Pn,
|
||||
Data = AnalysisDataUnit(input.UnitData.HexMessageList), //SIM卡
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
Data = data, //SIM卡
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
TimeDensity = -1
|
||||
};
|
||||
result?.Invoke(dto);
|
||||
return Task.FromResult(true);
|
||||
await _dataStorage.SaveDataToIotDbAsync<string?>(dto);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"10_101解析失败:{input.A?.Code}-{input.DT?.Fn ?? 0}-{input?.BaseHexMessage?.HexMessageString},{ex.Message}");
|
||||
|
||||
}
|
||||
return Task.FromResult(false);
|
||||
return await Task.FromResult(false);
|
||||
}
|
||||
private string AnalysisDataUnit(List<string> hexMessageList)
|
||||
{
|
||||
|
||||
@ -59,14 +59,15 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_10H
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = data,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Hour,
|
||||
ReceivedTime = input.ReceivedTime
|
||||
};
|
||||
await _dataStorage.SaveDataToIotDbAsync<decimal?>(unitDataAnalysis);
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveDataToIotDbAsync<decimal?>(unitDataAnalysis);
|
||||
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
@ -33,17 +35,23 @@ namespace GatherService.WattMeter.AnalysisData.AFN_10H
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData?.HexMessageList);
|
||||
|
||||
List<string> datas = AnalysisDataUnit(input.UnitData.HexMessageList);
|
||||
|
||||
|
||||
var data = new AnalysisBaseDto<bool?>()
|
||||
{
|
||||
FiledDesc = "跳合闸",
|
||||
DataValue = (datas[2].Equals("9C") || datas[2].Equals("94")) ? true : false
|
||||
};
|
||||
|
||||
// 查询电表信息
|
||||
//AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data.MeterType.ToString(), "15");
|
||||
//if (ammeterInfo != null)
|
||||
//{
|
||||
// data.ProjectId = ammeterInfo.ProjectID;
|
||||
// data.MeterId = ammeterInfo.MeterId;
|
||||
// data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
// data.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
//}
|
||||
UnitDataAnalysis<bool> unitDataAnalysis = new UnitDataAnalysis<bool>
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data.DeviceType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ProjectId = ammeterInfo.ProjectID;
|
||||
data.DeviceId = ammeterInfo.MeterId;
|
||||
data.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
data.DeviceAddress = ammeterInfo.AmmerterAddress;
|
||||
}
|
||||
UnitDataAnalysis<AnalysisBaseDto<bool?>> unitDataAnalysis = new UnitDataAnalysis<AnalysisBaseDto<bool?>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
AFN = input.AFN_FC.AFN,
|
||||
@ -51,15 +59,15 @@ namespace GatherService.WattMeter.AnalysisData.AFN_10H
|
||||
Pn = input.DA.Pn,
|
||||
MSA = input.A.A3!.D1_D7!,
|
||||
PSEQ = input.SEQ.PSEQ,
|
||||
Data = (datas[2].Equals("9C") || datas[2].Equals("94")) ? true : false,
|
||||
HexMessage = input.BaseHexMessage.HexMessageString,
|
||||
Data = data,
|
||||
ReceivedHexMessage = input.BaseHexMessage.HexMessageString,
|
||||
MessageId = input.MessageId,
|
||||
ReceivedTime = input.ReceivedTime,
|
||||
DensityUnit = DensityUnit.None,
|
||||
TimeDensity = -1
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
result?.Invoke(unitDataAnalysis);
|
||||
await _dataStorage.SaveDataToIotDbAsync(unitDataAnalysis);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -10,11 +10,15 @@ using JiShe.CollectBus.IoTDB.Model;
|
||||
using JiShe.CollectBus.IoTDB.Options;
|
||||
using JiShe.CollectBus.IoTDB.Provider;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.IotSystems.LogRecord;
|
||||
using JiShe.CollectBus.IotSystems.MeterReadingRecords;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.Metrics;
|
||||
using System.Threading.Channels;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Guids;
|
||||
using static FreeSql.Internal.GlobalFilter;
|
||||
@ -28,12 +32,36 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
private readonly IIoTDbProvider _dbProvider;
|
||||
private readonly ServerApplicationOptions _applicationOptions;
|
||||
private readonly IoTDBRuntimeContext _runtimeContext;
|
||||
public DataStorage(IIoTDbProvider dbProvider, IOptions<ServerApplicationOptions> applicationOptions, IGuidGenerator guidGenerator, IoTDBRuntimeContext runtimeContext)
|
||||
private readonly ILogger<DataStorage> _logger;
|
||||
|
||||
public DataStorage(IIoTDbProvider dbProvider, IOptions<ServerApplicationOptions> applicationOptions,
|
||||
IGuidGenerator guidGenerator, IoTDBRuntimeContext runtimeContext, ILogger<DataStorage> logger)
|
||||
{
|
||||
_dbProvider= dbProvider;
|
||||
_applicationOptions = applicationOptions.Value;
|
||||
_guidGenerator= guidGenerator;
|
||||
_runtimeContext= runtimeContext;
|
||||
_logger= logger;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 日志保存通道写入
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task LogSaveWriterAsync(ChannelWriter<object> channelWriter, dynamic dataItems)
|
||||
{
|
||||
await channelWriter.WriteAsync(dataItems);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 日志刷新通道写入
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task LogRefreshSaveWriterAsync(ChannelWriter<object> channelWriter, dynamic dataItems)
|
||||
{
|
||||
await channelWriter.WriteAsync(dataItems);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -107,7 +135,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
// 更新
|
||||
meter.Timestamps = taskData.PendingCopyReadTime.GetDateTimeOffset().ToUnixTimeNanoseconds();
|
||||
taskData.IsReceived=true;
|
||||
taskData.ReceivedMessageHexString= analysisBaseDto.HexMessage;
|
||||
taskData.ReceivedMessageHexString= analysisBaseDto.ReceivedHexMessage;
|
||||
taskData.ReceivedMessageId= analysisBaseDto.MessageId ?? string.Empty;
|
||||
}
|
||||
else
|
||||
@ -135,10 +163,11 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
ManualOrNot = false,
|
||||
Pn = analysisBaseDto.Pn,
|
||||
ReceivedMessageId = analysisBaseDto.MessageId?? string.Empty,
|
||||
ReceivedMessageHexString = analysisBaseDto.HexMessage,
|
||||
ReceivedMessageHexString = analysisBaseDto.ReceivedHexMessage,
|
||||
IsReceived = true,
|
||||
ReceivedRemark = data.ErrorCodeMsg ?? string.Empty,
|
||||
ScoreValue = $"{analysisBaseDto.Code}.{taskMark}".Md5Fun(),
|
||||
ReceivedTime = analysisBaseDto.ReceivedTime,
|
||||
};
|
||||
}
|
||||
|
||||
@ -158,12 +187,13 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="analysisBaseDto"></param>
|
||||
/// <param name="saveData"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> SaveMultipleDataToIotDbAsync<T>(UnitDataAnalysis<List<AnalysisBaseDto<T>>> analysisBaseDto)
|
||||
{
|
||||
var data = analysisBaseDto.Data!;
|
||||
List<MeterReadingTelemetryPacketInfo> meterReadingTelemetryPacketInfos = new List<MeterReadingTelemetryPacketInfo>();
|
||||
List< TreeModelSingleMeasuringEntity<T>> treeModelSingleMeasuringEntities = new List<TreeModelSingleMeasuringEntity<T>>();
|
||||
List<TreeModelSingleMeasuringEntity<T>> treeModelSingleMeasuringEntities = new List<TreeModelSingleMeasuringEntity<T>>();
|
||||
foreach (var item in data)
|
||||
{
|
||||
if(!item.TimeSpan.HasValue)
|
||||
@ -211,7 +241,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
// 更新
|
||||
meter.Timestamps = taskData.PendingCopyReadTime.GetDateTimeOffset().ToUnixTimeNanoseconds();
|
||||
taskData.IsReceived = true;
|
||||
taskData.ReceivedMessageHexString = analysisBaseDto.HexMessage;
|
||||
taskData.ReceivedMessageHexString = analysisBaseDto.ReceivedHexMessage;
|
||||
taskData.ReceivedMessageId = analysisBaseDto.MessageId ?? string.Empty;
|
||||
}
|
||||
else
|
||||
@ -239,20 +269,22 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
ManualOrNot = false,
|
||||
Pn = analysisBaseDto.Pn,
|
||||
ReceivedMessageId = analysisBaseDto.MessageId ?? string.Empty,
|
||||
ReceivedMessageHexString = analysisBaseDto.HexMessage,
|
||||
ReceivedMessageHexString = analysisBaseDto.ReceivedHexMessage,
|
||||
IsReceived = true,
|
||||
ReceivedRemark = item.ErrorCodeMsg ?? string.Empty,
|
||||
ScoreValue = $"{analysisBaseDto.Code}.{taskMark}".Md5Fun(),
|
||||
ReceivedTime = analysisBaseDto.ReceivedTime,
|
||||
};
|
||||
}
|
||||
meterReadingTelemetryPacketInfos.Add(taskData);
|
||||
//如果无字段名,则不保存数据
|
||||
//如果无字段名,则不保存数据,如saveData=false 也不保存数据
|
||||
if (!string.IsNullOrWhiteSpace(item.FiledName))
|
||||
{
|
||||
treeModelSingleMeasuringEntities.Add(meter);
|
||||
}
|
||||
}
|
||||
// 批量保存数据
|
||||
_runtimeContext.UseTableSessionPool = true; // 使树模型池
|
||||
await _dbProvider.BatchInsertAsync(meterReadingTelemetryPacketInfos);
|
||||
if (treeModelSingleMeasuringEntities.Count > 0)
|
||||
{
|
||||
@ -273,6 +305,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
ArgumentNullException.ThrowIfNull(nameof(analysisBaseDto.Data));
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(nameof(analysisBaseDto.Data.FiledName));
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(nameof(analysisBaseDto.Data.DataValue));
|
||||
List<TreeModelSingleMeasuringEntity<T>> treeModelSingleMeasuringEntities = new List<TreeModelSingleMeasuringEntity<T>>();
|
||||
|
||||
var data = analysisBaseDto.Data!;
|
||||
if (!data.TimeSpan.HasValue)
|
||||
data.TimeSpan = analysisBaseDto.ReceivedTime;
|
||||
@ -299,7 +333,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
ProjectId = $"{data.ProjectId}",
|
||||
DataType = IOTDBDataTypeConst.Status,
|
||||
Timestamps = timestamps,
|
||||
SingleMeasuring = (ConcentratorStatusFieldConst.FrameData, analysisBaseDto.HexMessage ?? string.Empty)
|
||||
SingleMeasuring = (ConcentratorStatusFieldConst.FrameData, analysisBaseDto.ReceivedHexMessage ?? string.Empty)
|
||||
};
|
||||
|
||||
_runtimeContext.UseTableSessionPool = false; // 使树模型池
|
||||
@ -318,20 +352,40 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
};
|
||||
_runtimeContext.UseTableSessionPool = false; // 使树模型池
|
||||
await _dbProvider.InsertAsync(treeRecordingTimeData);
|
||||
// 备注
|
||||
var treeRemarkData = new TreeModelSingleMeasuringEntity<string>()
|
||||
|
||||
// 新建
|
||||
string taskMark = CommonHelper.GetTaskMark(analysisBaseDto.AFN, analysisBaseDto.Fn, analysisBaseDto.Pn, analysisBaseDto.MSA, analysisBaseDto.PSEQ);
|
||||
var currentTime = DateTime.Now;
|
||||
var taskData = new MeterReadingTelemetryPacketInfo()
|
||||
{
|
||||
SystemName = _applicationOptions.SystemType,
|
||||
DeviceId = $"{data.DeviceId}",
|
||||
DeviceType = $"{data.DeviceType}",
|
||||
ProjectId = $"{data.ProjectId}",
|
||||
DataType = IOTDBDataTypeConst.Status,
|
||||
Timestamps = timestamps,
|
||||
SingleMeasuring = (ConcentratorStatusFieldConst.Remark, data.FiledDesc ?? string.Empty)
|
||||
DeviceType = $"{data.DeviceType}",
|
||||
DeviceId = $"{data.DeviceId}",
|
||||
Timestamps = DateTime.Now.GetDateTimeOffset().ToUnixTimeNanoseconds(),
|
||||
DatabaseBusiID = data.DatabaseBusiID,
|
||||
PendingCopyReadTime = data.TimeSpan!.Value.GetFormatTime(analysisBaseDto.DensityUnit, analysisBaseDto.TimeDensity),
|
||||
CreationTime = currentTime,
|
||||
MeterAddress = data.DeviceAddress,
|
||||
AFN = analysisBaseDto.AFN,
|
||||
Fn = analysisBaseDto.Fn,
|
||||
Seq = analysisBaseDto.PSEQ,
|
||||
MSA = analysisBaseDto.MSA,
|
||||
ItemCode = data.DataType,
|
||||
TaskMark = taskMark,
|
||||
IsSend = false,
|
||||
ManualOrNot = false,
|
||||
Pn = analysisBaseDto.Pn,
|
||||
ReceivedMessageId = analysisBaseDto.MessageId ?? string.Empty,
|
||||
ReceivedMessageHexString = analysisBaseDto.ReceivedHexMessage,
|
||||
IsReceived = true,
|
||||
ReceivedRemark = data.ErrorCodeMsg ?? string.Empty,
|
||||
ScoreValue = $"{analysisBaseDto.Code}.{taskMark}".Md5Fun(),
|
||||
ReceivedTime=analysisBaseDto.ReceivedTime,
|
||||
};
|
||||
_runtimeContext.UseTableSessionPool = false; // 使树模型池
|
||||
await _dbProvider.InsertAsync(treeRemarkData);
|
||||
|
||||
_runtimeContext.UseTableSessionPool = true; // 使表模型池
|
||||
await _dbProvider.InsertAsync(taskData);
|
||||
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
@ -344,7 +398,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
public async Task<bool> SaveMultipleStatusToIotDbAsync<T>(UnitDataAnalysis<List<AnalysisBaseDto<T>>> analysisBaseDto)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(nameof(analysisBaseDto.Data));
|
||||
|
||||
List<MeterReadingTelemetryPacketInfo> meterReadingTelemetryPacketInfos = new List<MeterReadingTelemetryPacketInfo>();
|
||||
|
||||
var data = analysisBaseDto.Data!;
|
||||
foreach (var item in data)
|
||||
{
|
||||
@ -375,7 +430,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
ProjectId = $"{item.ProjectId}",
|
||||
DataType = IOTDBDataTypeConst.Status,
|
||||
Timestamps = timestamps,
|
||||
SingleMeasuring = (ConcentratorStatusFieldConst.FrameData, analysisBaseDto.HexMessage ?? string.Empty)
|
||||
SingleMeasuring = (ConcentratorStatusFieldConst.FrameData, analysisBaseDto.ReceivedHexMessage ?? string.Empty)
|
||||
};
|
||||
|
||||
_runtimeContext.UseTableSessionPool = false; // 使树模型池
|
||||
@ -393,21 +448,48 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
};
|
||||
_runtimeContext.UseTableSessionPool = false; // 使树模型池
|
||||
await _dbProvider.InsertAsync(treeRecordingTimeData);
|
||||
// 备注
|
||||
var treeRemarkData = new TreeModelSingleMeasuringEntity<string>()
|
||||
|
||||
// 新建
|
||||
string taskMark = CommonHelper.GetTaskMark(analysisBaseDto.AFN, analysisBaseDto.Fn, analysisBaseDto.Pn, analysisBaseDto.MSA, analysisBaseDto.PSEQ);
|
||||
var currentTime = DateTime.Now;
|
||||
var taskData = new MeterReadingTelemetryPacketInfo()
|
||||
{
|
||||
SystemName = _applicationOptions.SystemType,
|
||||
DeviceType = $"{item.DeviceType}",
|
||||
ProjectId = $"{item.ProjectId}",
|
||||
DataType = IOTDBDataTypeConst.Status,
|
||||
Timestamps = timestamps,
|
||||
SingleMeasuring =(ConcentratorStatusFieldConst.Remark, item.FiledDesc ?? string.Empty)
|
||||
DeviceType = $"{item.DeviceType}",
|
||||
DeviceId = $"{item.DeviceId}",
|
||||
Timestamps = DateTime.Now.GetDateTimeOffset().ToUnixTimeNanoseconds(),
|
||||
DatabaseBusiID = item.DatabaseBusiID,
|
||||
PendingCopyReadTime = item.TimeSpan!.Value.GetFormatTime(analysisBaseDto.DensityUnit, analysisBaseDto.TimeDensity),
|
||||
CreationTime = currentTime,
|
||||
MeterAddress = item.DeviceAddress,
|
||||
AFN = analysisBaseDto.AFN,
|
||||
Fn = analysisBaseDto.Fn,
|
||||
Seq = analysisBaseDto.PSEQ,
|
||||
MSA = analysisBaseDto.MSA,
|
||||
ItemCode = item.DataType,
|
||||
TaskMark = taskMark,
|
||||
IsSend = false,
|
||||
ManualOrNot = false,
|
||||
Pn = analysisBaseDto.Pn,
|
||||
ReceivedMessageId = analysisBaseDto.MessageId ?? string.Empty,
|
||||
ReceivedMessageHexString = analysisBaseDto.ReceivedHexMessage,
|
||||
IsReceived = true,
|
||||
ReceivedRemark = item.ErrorCodeMsg ?? string.Empty,
|
||||
ScoreValue = $"{analysisBaseDto.Code}.{taskMark}".Md5Fun(),
|
||||
ReceivedTime = analysisBaseDto.ReceivedTime,
|
||||
};
|
||||
_runtimeContext.UseTableSessionPool = false; // 使树模型池
|
||||
await _dbProvider.InsertAsync(treeRemarkData);
|
||||
|
||||
meterReadingTelemetryPacketInfos.Add(taskData);
|
||||
}
|
||||
if (meterReadingTelemetryPacketInfos.Count > 0)
|
||||
{
|
||||
_runtimeContext.UseTableSessionPool = true; // 使表模型池
|
||||
await _dbProvider.BatchInsertAsync(meterReadingTelemetryPacketInfos);
|
||||
}
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
using System.Reflection;
|
||||
using System.Threading.Channels;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Volo.Abp;
|
||||
|
||||
@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Channels;
|
||||
using System.Threading.Tasks;
|
||||
using Cassandra.Mapping;
|
||||
using Cassandra.Mapping;
|
||||
using JiShe.CollectBus.Cassandra;
|
||||
using JiShe.CollectBus.DataChannels;
|
||||
using JiShe.CollectBus.DataMigration.Options;
|
||||
using JiShe.CollectBus.FreeRedis;
|
||||
using JiShe.CollectBus.FreeSql;
|
||||
using JiShe.CollectBus.Interceptors;
|
||||
@ -16,9 +9,14 @@ using JiShe.CollectBus.IotSystems.MeterReadingRecords;
|
||||
using JiShe.CollectBus.Kafka;
|
||||
using JiShe.CollectBus.Mappers;
|
||||
using JiShe.CollectBus.Protocol;
|
||||
using JiShe.CollectBus.Protocol.Contracts;
|
||||
using JiShe.CollectBus.ScheduledMeterReading;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Channels;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.Application;
|
||||
using Volo.Abp.Autofac;
|
||||
@ -83,6 +81,17 @@ public class CollectBusApplicationModule : AbpModule
|
||||
//下发任务通道构建
|
||||
DataChannelManage.TaskDataChannel = Channel.CreateUnbounded<ValueTuple<string, List<MeterReadingTelemetryPacketInfo>>>();
|
||||
|
||||
|
||||
// 日志存储通道构建
|
||||
DataChannelManage.LogSaveChannel = Channel.CreateUnbounded<object>();
|
||||
|
||||
// 日志刷新通道构建
|
||||
DataChannelManage.LogRefreshChannel = Channel.CreateUnbounded<object>();
|
||||
|
||||
// 启动通道任务
|
||||
var _dataChannelManage = context.ServiceProvider.GetRequiredService<DataChannelManageService>();
|
||||
_ = _dataChannelManage.LogSaveAsync(DataChannelManage.LogSaveChannel.Reader);
|
||||
|
||||
//默认初始化表计信息
|
||||
var dbContext = context.ServiceProvider.GetRequiredService<EnergySystemScheduledMeterReadingService>();
|
||||
_= dbContext.InitAmmeterCacheData();
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using JiShe.CollectBus.IotSystems.MeterReadingRecords;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -14,5 +15,16 @@ namespace JiShe.CollectBus.DataChannels
|
||||
/// 下发任务通道
|
||||
/// </summary>
|
||||
public static Channel<ValueTuple<string, List<MeterReadingTelemetryPacketInfo>>> TaskDataChannel;
|
||||
|
||||
/// <summary>
|
||||
/// 日志保存管道
|
||||
/// </summary>
|
||||
public static Channel<object> LogSaveChannel;
|
||||
|
||||
/// <summary>
|
||||
/// 日志刷新管道
|
||||
/// </summary>
|
||||
public static Channel<object> LogRefreshChannel;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,24 @@
|
||||
using JiShe.CollectBus.Common;
|
||||
using Amazon.Runtime.Internal.Transform;
|
||||
using DnsClient.Protocol;
|
||||
using JiShe.CollectBus.Common;
|
||||
using JiShe.CollectBus.Common.DeviceBalanceControl;
|
||||
using JiShe.CollectBus.IoTDB.Context;
|
||||
using JiShe.CollectBus.IoTDB.Interface;
|
||||
using JiShe.CollectBus.IotSystems.LogRecord;
|
||||
using JiShe.CollectBus.IotSystems.MeterReadingRecords;
|
||||
using JiShe.CollectBus.Kafka.Internal;
|
||||
using JiShe.CollectBus.Kafka.Producer;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Models;
|
||||
using JiShe.CollectBus.Repository.LogRecord;
|
||||
using Mapster;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Channels;
|
||||
using System.Threading.Tasks;
|
||||
@ -28,6 +37,7 @@ namespace JiShe.CollectBus.DataChannels
|
||||
private readonly KafkaOptionConfig _kafkaOptions;
|
||||
private readonly ServerApplicationOptions _applicationOptions;
|
||||
private readonly IoTDBRuntimeContext _runtimeContext;
|
||||
private readonly ILogRecordRepository _logRecordRepository;
|
||||
|
||||
public DataChannelManageService(
|
||||
ILogger<DataChannelManageService> logger,
|
||||
@ -35,7 +45,8 @@ namespace JiShe.CollectBus.DataChannels
|
||||
IoTDBRuntimeContext runtimeContext,
|
||||
IProducerService producerService,
|
||||
IOptions<KafkaOptionConfig> kafkaOptions,
|
||||
IOptions<ServerApplicationOptions> applicationOptions)
|
||||
IOptions<ServerApplicationOptions> applicationOptions,
|
||||
ILogRecordRepository logRecordRepository)
|
||||
{
|
||||
_logger = logger;
|
||||
_dbProvider = dbProvider;
|
||||
@ -44,6 +55,7 @@ namespace JiShe.CollectBus.DataChannels
|
||||
_kafkaOptions = kafkaOptions.Value;
|
||||
_applicationOptions = applicationOptions.Value;
|
||||
_runtimeContext.UseTableSessionPool = true;
|
||||
_logRecordRepository= logRecordRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -54,9 +66,6 @@ namespace JiShe.CollectBus.DataChannels
|
||||
{
|
||||
await _telemetryPacketInfoWriter.WriteAsync(dataItems);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 定时任务数据入库和Kafka推送通道
|
||||
/// </summary>
|
||||
@ -200,5 +209,127 @@ namespace JiShe.CollectBus.DataChannels
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 日志保存
|
||||
/// </summary>
|
||||
/// <param name="channelReader"></param>
|
||||
/// <returns></returns>
|
||||
public async Task LogSaveAsync(ChannelReader<object> channelReader)
|
||||
{
|
||||
const int BatchSize = 1000;
|
||||
const int EmptyWaitMilliseconds = 1000;
|
||||
var timeout = TimeSpan.FromSeconds(2);
|
||||
var timer = Stopwatch.StartNew();
|
||||
long timeoutMilliseconds = 0;
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
var batch = new List<object>();
|
||||
var canRead = channelReader.Count;
|
||||
if (canRead <= 0)
|
||||
{
|
||||
if (timeoutMilliseconds > 0)
|
||||
{
|
||||
_logger.LogError($"{nameof(LogSaveAsync)} 通道处理数据耗时{timeoutMilliseconds}毫秒");
|
||||
}
|
||||
timeoutMilliseconds = 0;
|
||||
//无消息时短等待1秒
|
||||
await Task.Delay(EmptyWaitMilliseconds);
|
||||
continue;
|
||||
}
|
||||
|
||||
timer.Restart();
|
||||
var startTime = DateTime.Now;
|
||||
|
||||
try
|
||||
{
|
||||
// 异步批量读取数据
|
||||
while (batch != null && batch.Count < BatchSize && (DateTime.Now - startTime) < timeout)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (channelReader.TryRead(out var dataItem))
|
||||
{
|
||||
batch.Add(dataItem);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
if (batch == null || batch.Count == 0)
|
||||
{
|
||||
await Task.Delay(EmptyWaitMilliseconds);
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
// 按小时分组
|
||||
var hourGroups = new Dictionary<DateTime, List<LogRecords>>();
|
||||
DateTime? dateTime = null;
|
||||
List<LogRecords> batchList = new List<LogRecords>();
|
||||
int index = 1;
|
||||
foreach (var item in batch)
|
||||
{
|
||||
var records = item.Adapt<LogRecords>();
|
||||
|
||||
if (!records.ReceivedTime.HasValue)
|
||||
records.ReceivedTime = DateTime.Now;
|
||||
var curDateTime = new DateTime(records.ReceivedTime.Value.Year, records.ReceivedTime.Value.Month, records.ReceivedTime.Value.Hour, records.ReceivedTime.Value.Day, records.ReceivedTime.Value.Hour, 0, 0);
|
||||
if (!dateTime.HasValue || curDateTime != dateTime)
|
||||
{
|
||||
dateTime = curDateTime;
|
||||
if (batchList.Count > 0)
|
||||
{
|
||||
var immutableList = ImmutableList.CreateRange(batchList);
|
||||
hourGroups.Add(dateTime.Value, immutableList.ToList());
|
||||
batchList.Clear();
|
||||
}
|
||||
}
|
||||
batchList.Add(records);
|
||||
// 最后一批
|
||||
if(index== batch.Count)
|
||||
{
|
||||
var immutableList = ImmutableList.CreateRange(batchList);
|
||||
hourGroups.Add(dateTime.Value, immutableList.ToList());
|
||||
batchList.Clear();
|
||||
}
|
||||
index++;
|
||||
}
|
||||
foreach (var (time, records) in hourGroups)
|
||||
{
|
||||
// 批量写入数据库
|
||||
await _logRecordRepository.InsertManyAsync(records, time);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "数据通道处理日志数据时发生异常");
|
||||
}
|
||||
batch.Clear();
|
||||
timer.Stop();
|
||||
|
||||
timeoutMilliseconds = timeoutMilliseconds + timer.ElapsedMilliseconds;
|
||||
|
||||
startTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical(ex, "日志处理发生致命错误");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,43 +1,43 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Hangfire;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
using JiShe.CollectBus.ScheduledMeterReading;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Uow;
|
||||
//using System;
|
||||
//using System.Threading;
|
||||
//using System.Threading.Tasks;
|
||||
//using Hangfire;
|
||||
//using JiShe.CollectBus.Common.Consts;
|
||||
//using JiShe.CollectBus.ScheduledMeterReading;
|
||||
//using Microsoft.Extensions.Logging;
|
||||
//using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
//using Volo.Abp.DependencyInjection;
|
||||
//using Volo.Abp.Uow;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
/// <summary>
|
||||
/// 构建待处理的下发指令任务处理
|
||||
/// </summary>
|
||||
public class CreateToBeIssueTaskWorker : HangfireBackgroundWorkerBase, ITransientDependency, ICollectWorker
|
||||
{
|
||||
private readonly ILogger<CreateToBeIssueTaskWorker> _logger;
|
||||
private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
//namespace JiShe.CollectBus.Workers
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 构建待处理的下发指令任务处理
|
||||
// /// </summary>
|
||||
// public class CreateToBeIssueTaskWorker : HangfireBackgroundWorkerBase, ITransientDependency, ICollectWorker
|
||||
// {
|
||||
// private readonly ILogger<CreateToBeIssueTaskWorker> _logger;
|
||||
// private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CreateToBeIssueTaskWorker"/> class.
|
||||
/// </summary>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="scheduledMeterReadingService">定时任务</param>
|
||||
public CreateToBeIssueTaskWorker(ILogger<CreateToBeIssueTaskWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
{
|
||||
_logger = logger;
|
||||
RecurringJobId = nameof(CreateToBeIssueTaskWorker);
|
||||
CronExpression = "0 0/1 * * * *";
|
||||
TimeZone = TimeZoneInfo.Local;
|
||||
this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Initializes a new instance of the <see cref="CreateToBeIssueTaskWorker"/> class.
|
||||
// /// </summary>
|
||||
// /// <param name="logger">The logger.</param>
|
||||
// /// <param name="scheduledMeterReadingService">定时任务</param>
|
||||
// public CreateToBeIssueTaskWorker(ILogger<CreateToBeIssueTaskWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
// {
|
||||
// _logger = logger;
|
||||
// RecurringJobId = nameof(CreateToBeIssueTaskWorker);
|
||||
// CronExpression = "0 0/1 * * * *";
|
||||
// TimeZone = TimeZoneInfo.Local;
|
||||
// this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
// }
|
||||
|
||||
|
||||
public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
{
|
||||
_logger.LogError($"{DateTime.Now}");
|
||||
// await _scheduledMeterReadingService.CreateToBeIssueTasks();
|
||||
}
|
||||
}
|
||||
}
|
||||
// public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
// {
|
||||
// _logger.LogError($"{DateTime.Now}");
|
||||
// // await _scheduledMeterReadingService.CreateToBeIssueTasks();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@ -1,39 +1,39 @@
|
||||
using JiShe.CollectBus.ScheduledMeterReading;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
//using JiShe.CollectBus.ScheduledMeterReading;
|
||||
//using Microsoft.Extensions.Logging;
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading;
|
||||
//using System.Threading.Tasks;
|
||||
//using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
//using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
/// <summary>
|
||||
/// 定时数据检测1小时一次
|
||||
/// </summary>
|
||||
public class DataDetectionFifteenMinuteWorker : HangfireBackgroundWorkerBase, ITransientDependency, ICollectWorker
|
||||
{
|
||||
//namespace JiShe.CollectBus.Workers
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 定时数据检测1小时一次
|
||||
// /// </summary>
|
||||
// public class DataDetectionFifteenMinuteWorker : HangfireBackgroundWorkerBase, ITransientDependency, ICollectWorker
|
||||
// {
|
||||
|
||||
private readonly ILogger<CreateToBeIssueTaskWorker> _logger;
|
||||
private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
// private readonly ILogger<CreateToBeIssueTaskWorker> _logger;
|
||||
// private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
|
||||
public DataDetectionFifteenMinuteWorker(ILogger<CreateToBeIssueTaskWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
{
|
||||
_logger = logger;
|
||||
RecurringJobId = nameof(CreateToBeIssueTaskWorker);
|
||||
CronExpression = "0 0 0/1 * * ?";
|
||||
TimeZone = TimeZoneInfo.Local;
|
||||
this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
}
|
||||
// public DataDetectionFifteenMinuteWorker(ILogger<CreateToBeIssueTaskWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
// {
|
||||
// _logger = logger;
|
||||
// RecurringJobId = nameof(CreateToBeIssueTaskWorker);
|
||||
// CronExpression = "0 0 0/1 * * ?";
|
||||
// TimeZone = TimeZoneInfo.Local;
|
||||
// this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
// }
|
||||
|
||||
|
||||
public override Task DoWorkAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
//throw new NotImplementedException();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
// public override Task DoWorkAsync(CancellationToken cancellationToken = default)
|
||||
// {
|
||||
// //throw new NotImplementedException();
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@ -1,39 +1,39 @@
|
||||
using System;
|
||||
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;
|
||||
using Volo.Abp.Uow;
|
||||
//using System;
|
||||
//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;
|
||||
//using Volo.Abp.Uow;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
public class EpiCollectWorker : HangfireBackgroundWorkerBase, ITransientDependency,ICollectWorker
|
||||
{
|
||||
private readonly ILogger<EpiCollectWorker> _logger;
|
||||
//namespace JiShe.CollectBus.Workers
|
||||
//{
|
||||
// public class EpiCollectWorker : HangfireBackgroundWorkerBase, ITransientDependency,ICollectWorker
|
||||
// {
|
||||
// private readonly ILogger<EpiCollectWorker> _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EpiCollectWorker"/> class.
|
||||
/// </summary>
|
||||
/// <param name="logger">The logger.</param>
|
||||
public EpiCollectWorker(ILogger<EpiCollectWorker> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
RecurringJobId = nameof(EpiCollectWorker);
|
||||
CronExpression = Cron.Daily();
|
||||
// /// <summary>
|
||||
// /// Initializes a new instance of the <see cref="EpiCollectWorker"/> class.
|
||||
// /// </summary>
|
||||
// /// <param name="logger">The logger.</param>
|
||||
// public EpiCollectWorker(ILogger<EpiCollectWorker> logger)
|
||||
// {
|
||||
// _logger = logger;
|
||||
// RecurringJobId = nameof(EpiCollectWorker);
|
||||
// CronExpression = Cron.Daily();
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
public override Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
{
|
||||
using (var uow = LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>().Begin())
|
||||
{
|
||||
Logger.LogInformation("Executed MyLogWorker..!");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// public override Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
// {
|
||||
// using (var uow = LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>().Begin())
|
||||
// {
|
||||
// Logger.LogInformation("Executed MyLogWorker..!");
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@ -1,48 +1,48 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Hangfire;
|
||||
using JiShe.CollectBus.ScheduledMeterReading;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Uow;
|
||||
//using System;
|
||||
//using System.Threading;
|
||||
//using System.Threading.Tasks;
|
||||
//using Hangfire;
|
||||
//using JiShe.CollectBus.ScheduledMeterReading;
|
||||
//using Microsoft.Extensions.Logging;
|
||||
//using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
//using Volo.Abp.DependencyInjection;
|
||||
//using Volo.Abp.Uow;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
/// <summary>
|
||||
/// 15分钟采集数据
|
||||
/// </summary>
|
||||
public class SubscriberFifteenMinuteWorker : HangfireBackgroundWorkerBase, ITransientDependency, ICollectWorker
|
||||
{
|
||||
private readonly ILogger<SubscriberFifteenMinuteWorker> _logger;
|
||||
private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
//namespace JiShe.CollectBus.Workers
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 15分钟采集数据
|
||||
// /// </summary>
|
||||
// public class SubscriberFifteenMinuteWorker : HangfireBackgroundWorkerBase, ITransientDependency, ICollectWorker
|
||||
// {
|
||||
// private readonly ILogger<SubscriberFifteenMinuteWorker> _logger;
|
||||
// private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SubscriberFifteenMinuteWorker"/> class.
|
||||
/// </summary>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="scheduledMeterReadingService">定时任务</param>
|
||||
public SubscriberFifteenMinuteWorker(ILogger<SubscriberFifteenMinuteWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
{
|
||||
_logger = logger;
|
||||
RecurringJobId = nameof(SubscriberFifteenMinuteWorker);
|
||||
CronExpression = "0 0/15 * * * *";
|
||||
TimeZone = TimeZoneInfo.Local;
|
||||
this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Initializes a new instance of the <see cref="SubscriberFifteenMinuteWorker"/> class.
|
||||
// /// </summary>
|
||||
// /// <param name="logger">The logger.</param>
|
||||
// /// <param name="scheduledMeterReadingService">定时任务</param>
|
||||
// public SubscriberFifteenMinuteWorker(ILogger<SubscriberFifteenMinuteWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
// {
|
||||
// _logger = logger;
|
||||
// RecurringJobId = nameof(SubscriberFifteenMinuteWorker);
|
||||
// CronExpression = "0 0/15 * * * *";
|
||||
// TimeZone = TimeZoneInfo.Local;
|
||||
// this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
// }
|
||||
|
||||
|
||||
public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
{
|
||||
//await _scheduledMeterReadingService.AmmeterScheduledMeterFifteenMinuteReading();
|
||||
//await _scheduledMeterReadingService.WatermeterScheduledMeterFifteenMinuteReading();
|
||||
// public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
// {
|
||||
// //await _scheduledMeterReadingService.AmmeterScheduledMeterFifteenMinuteReading();
|
||||
// //await _scheduledMeterReadingService.WatermeterScheduledMeterFifteenMinuteReading();
|
||||
|
||||
//using (var uow = LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>().Begin())
|
||||
//{
|
||||
// Logger.LogInformation("Executed MyLogWorker..!");
|
||||
// return Task.CompletedTask;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
// //using (var uow = LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>().Begin())
|
||||
// //{
|
||||
// // Logger.LogInformation("Executed MyLogWorker..!");
|
||||
// // return Task.CompletedTask;
|
||||
// //}
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@ -1,42 +1,42 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Hangfire;
|
||||
using JiShe.CollectBus.ScheduledMeterReading;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Uow;
|
||||
//using System;
|
||||
//using System.Threading;
|
||||
//using System.Threading.Tasks;
|
||||
//using Hangfire;
|
||||
//using JiShe.CollectBus.ScheduledMeterReading;
|
||||
//using Microsoft.Extensions.Logging;
|
||||
//using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
//using Volo.Abp.DependencyInjection;
|
||||
//using Volo.Abp.Uow;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
/// <summary>
|
||||
/// 5分钟采集数据
|
||||
/// </summary>
|
||||
public class SubscriberFiveMinuteWorker : HangfireBackgroundWorkerBase, ITransientDependency,ICollectWorker
|
||||
{
|
||||
private readonly ILogger<SubscriberFiveMinuteWorker> _logger;
|
||||
private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
//namespace JiShe.CollectBus.Workers
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 5分钟采集数据
|
||||
// /// </summary>
|
||||
// public class SubscriberFiveMinuteWorker : HangfireBackgroundWorkerBase, ITransientDependency,ICollectWorker
|
||||
// {
|
||||
// private readonly ILogger<SubscriberFiveMinuteWorker> _logger;
|
||||
// private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SubscriberFiveMinuteWorker"/> class.
|
||||
/// </summary>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="scheduledMeterReadingService">定时任务</param>
|
||||
public SubscriberFiveMinuteWorker(ILogger<SubscriberFiveMinuteWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
{
|
||||
_logger = logger;
|
||||
RecurringJobId = nameof(SubscriberFiveMinuteWorker);
|
||||
CronExpression = "0 0/5 * * * *";
|
||||
TimeZone = TimeZoneInfo.Local;
|
||||
this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Initializes a new instance of the <see cref="SubscriberFiveMinuteWorker"/> class.
|
||||
// /// </summary>
|
||||
// /// <param name="logger">The logger.</param>
|
||||
// /// <param name="scheduledMeterReadingService">定时任务</param>
|
||||
// public SubscriberFiveMinuteWorker(ILogger<SubscriberFiveMinuteWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
// {
|
||||
// _logger = logger;
|
||||
// RecurringJobId = nameof(SubscriberFiveMinuteWorker);
|
||||
// CronExpression = "0 0/5 * * * *";
|
||||
// TimeZone = TimeZoneInfo.Local;
|
||||
// this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
// }
|
||||
|
||||
|
||||
public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
{
|
||||
//await _scheduledMeterReadingService.AmmeterScheduledMeterFiveMinuteReading();
|
||||
//await _scheduledMeterReadingService.WatermeterScheduledMeterFiveMinuteReading();
|
||||
}
|
||||
}
|
||||
}
|
||||
// public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
// {
|
||||
// //await _scheduledMeterReadingService.AmmeterScheduledMeterFiveMinuteReading();
|
||||
// //await _scheduledMeterReadingService.WatermeterScheduledMeterFiveMinuteReading();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@ -1,44 +1,44 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Hangfire;
|
||||
using JiShe.CollectBus.ScheduledMeterReading;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Uow;
|
||||
//using System;
|
||||
//using System.Threading;
|
||||
//using System.Threading.Tasks;
|
||||
//using Hangfire;
|
||||
//using JiShe.CollectBus.ScheduledMeterReading;
|
||||
//using Microsoft.Extensions.Logging;
|
||||
//using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
//using Volo.Abp.DependencyInjection;
|
||||
//using Volo.Abp.Uow;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
/// <summary>
|
||||
/// 1分钟采集数据
|
||||
/// </summary>
|
||||
public class SubscriberOneMinuteWorker : HangfireBackgroundWorkerBase, ITransientDependency,ICollectWorker
|
||||
{
|
||||
private readonly ILogger<SubscriberOneMinuteWorker> _logger;
|
||||
private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
//namespace JiShe.CollectBus.Workers
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 1分钟采集数据
|
||||
// /// </summary>
|
||||
// public class SubscriberOneMinuteWorker : HangfireBackgroundWorkerBase, ITransientDependency,ICollectWorker
|
||||
// {
|
||||
// private readonly ILogger<SubscriberOneMinuteWorker> _logger;
|
||||
// private readonly IScheduledMeterReadingService _scheduledMeterReadingService;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SubscriberOneMinuteWorker"/> class.
|
||||
/// </summary>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="scheduledMeterReadingService">定时任务</param>
|
||||
public SubscriberOneMinuteWorker(ILogger<SubscriberOneMinuteWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
{
|
||||
_logger = logger;
|
||||
RecurringJobId = nameof(SubscriberOneMinuteWorker);
|
||||
CronExpression = "0 0/1 * * * *";
|
||||
TimeZone = TimeZoneInfo.Local;
|
||||
this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Initializes a new instance of the <see cref="SubscriberOneMinuteWorker"/> class.
|
||||
// /// </summary>
|
||||
// /// <param name="logger">The logger.</param>
|
||||
// /// <param name="scheduledMeterReadingService">定时任务</param>
|
||||
// public SubscriberOneMinuteWorker(ILogger<SubscriberOneMinuteWorker> logger, IScheduledMeterReadingService scheduledMeterReadingService)
|
||||
// {
|
||||
// _logger = logger;
|
||||
// RecurringJobId = nameof(SubscriberOneMinuteWorker);
|
||||
// CronExpression = "0 0/1 * * * *";
|
||||
// TimeZone = TimeZoneInfo.Local;
|
||||
// this._scheduledMeterReadingService = scheduledMeterReadingService;
|
||||
// }
|
||||
|
||||
|
||||
public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
{
|
||||
//await _scheduledMeterReadingService.AmmeterScheduledMeterOneMinuteReading();
|
||||
// public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
// {
|
||||
// //await _scheduledMeterReadingService.AmmeterScheduledMeterOneMinuteReading();
|
||||
|
||||
//await _scheduledMeterReadingService.WatermeterScheduledMeterOneMinuteReading();
|
||||
// //await _scheduledMeterReadingService.WatermeterScheduledMeterOneMinuteReading();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user