优化解析保存到IotDB
This commit is contained in:
parent
b80d894f6c
commit
35febf6a99
@ -169,7 +169,7 @@ namespace JiShe.CollectBus.Kafka.Consumer
|
||||
// 检查 Header 是否符合条件
|
||||
if (!headersFilter.Match(result.Message.Headers))
|
||||
{
|
||||
//consumer.Commit(result); // 提交偏移量
|
||||
consumer.Commit(result); // 提交偏移量
|
||||
// 跳过消息
|
||||
continue;
|
||||
}
|
||||
@ -252,7 +252,7 @@ namespace JiShe.CollectBus.Kafka.Consumer
|
||||
// 检查 Header 是否符合条件
|
||||
if (!headersFilter.Match(result.Message.Headers))
|
||||
{
|
||||
//consumer.Commit(result); // 提交偏移量
|
||||
consumer.Commit(result); // 提交偏移量
|
||||
// 跳过消息
|
||||
continue;
|
||||
}
|
||||
@ -356,7 +356,7 @@ namespace JiShe.CollectBus.Kafka.Consumer
|
||||
// 检查 Header 是否符合条件
|
||||
if (!headersFilter.Match(result.Message.Headers))
|
||||
{
|
||||
//consumer.Commit(result); // 提交偏移量
|
||||
consumer.Commit(result); // 提交偏移量
|
||||
// 跳过消息
|
||||
continue;
|
||||
}
|
||||
@ -493,7 +493,7 @@ namespace JiShe.CollectBus.Kafka.Consumer
|
||||
// 检查 Header 是否符合条件
|
||||
if (!headersFilter.Match(result.Message.Headers))
|
||||
{
|
||||
//consumer.Commit(result); // 提交偏移量
|
||||
consumer.Commit(result); // 提交偏移量
|
||||
// 跳过消息
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -46,21 +46,6 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
MSA= input.A.A3.D1_D7,
|
||||
PSEQ= input.SEQ.PSEQ,
|
||||
};
|
||||
string taskMark = CommonHelper.GetTaskMark(unitDataAnalysis.AFN, unitDataAnalysis.Fn, unitDataAnalysis.Pn, unitDataAnalysis.MSA, unitDataAnalysis.PSEQ);
|
||||
string scoreValue = $"{unitDataAnalysis.Code}.{taskMark}".Md5Fun();
|
||||
|
||||
var conditions = new List<QueryCondition>();
|
||||
conditions.Add(new QueryCondition()
|
||||
{
|
||||
Field = "ScoreValue",
|
||||
Operator = "=",
|
||||
IsNumber = false,
|
||||
Value = scoreValue
|
||||
});
|
||||
var taskSendInfo = await _dbProvider.QueryAsync<MeterReadingTelemetryPacketInfo>(new IoTDBQueryOptions() { TableNameOrTreePath = DevicePathBuilder.GetTableName<MeterReadingTelemetryPacketInfo>(), Conditions = conditions,PageIndex=0,PageSize=1});
|
||||
|
||||
|
||||
|
||||
List<string> datas = await AnalysisDataUnitAsync(input.UnitData.HexMessageList);
|
||||
List<AFN12_F129_AnalysisDto> list = GenerateFinalResult(2, datas, "正向有功电能示值", input.AFN_FC.AFN, input.DT.Fn);
|
||||
unitDataAnalysis.Data= list;
|
||||
|
||||
@ -37,10 +37,9 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
ArgumentNullException.ThrowIfNull(input);
|
||||
ArgumentNullException.ThrowIfNull(input.UnitData?.HexMessageList);
|
||||
List<string> datas = await AnalysisDataUnit(input.UnitData.HexMessageList);
|
||||
AnalysisBaseDto<decimal> data = GenerateFinalResult(2, datas, "上月(上一结算日)正向有功最大需量及发生时间");
|
||||
data.DataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
data.FiledDesc = "上月(上一结算日)正向有功最大需量及发生时间";
|
||||
data.FiledName = data.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
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.MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
@ -105,7 +104,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
}
|
||||
return values;
|
||||
}
|
||||
public AnalysisBaseDto<decimal> GenerateFinalResult(int index, List<string> data, string remark = "")
|
||||
public AnalysisBaseDto<decimal> GenerateFinalResult(List<string> data,string dataType, string filedDesc = "")
|
||||
{
|
||||
AnalysisBaseDto<decimal> dto = new AnalysisBaseDto<decimal>();
|
||||
|
||||
@ -121,7 +120,10 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
//TODO:最大需量发生时间
|
||||
errorCodeInfo = data[3].CheckErrorCode();
|
||||
if (data[3].Length != 8 && errorCodeInfo != null)
|
||||
{
|
||||
dto.ValidData = false;
|
||||
dto.ErrorCodeMsg = errorCodeInfo.Item2;
|
||||
}
|
||||
else
|
||||
{
|
||||
string timeSpan = $"{DateTime.Now.Year}-{data[3].Substring(0, 2)}-{data[3].Substring(2, 2)} {data[3].Substring(4, 2)}:{data[3].Substring(6, 2)}:00";
|
||||
@ -137,6 +139,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AFN_0CH
|
||||
dto.TimeSpan= dto.DataTime;
|
||||
}
|
||||
|
||||
dto.FiledDesc = "上月(上一结算日)正向有功最大需量及发生时间";
|
||||
dto.FiledName = dataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
@ -45,15 +45,22 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "反向无功总电能量");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -68,7 +75,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
@ -39,16 +40,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "正向有功总电能示值");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +69,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
@ -40,15 +41,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "正向无功总电能示值");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +70,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
@ -40,15 +41,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "反向有功总电能示值");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +70,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
@ -40,15 +41,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "反向无功总电能示值");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +70,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -9,6 +9,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -40,15 +41,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "功率因数");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +70,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -9,6 +9,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -40,15 +41,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "A相功率因数");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +70,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "B相功率因数");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
@ -40,15 +41,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "C相功率因数");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +70,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
using JiShe.CollectBus.Common.Enums;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Protocol.Contracts;
|
||||
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
|
||||
using JiShe.CollectBus.Protocol.Dto;
|
||||
@ -40,15 +42,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
List<AnalysisBaseDto<decimal>> data = GenerateFinalResult(datas,3, dataType, "抄表日冻结电能表正向有功最大需量及发生时间");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +71,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -110,7 +118,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
return values;
|
||||
}
|
||||
|
||||
public List<AnalysisBaseDto<decimal>> GenerateFinalResult(List<string> data, int index, string dataType, string remark = "")
|
||||
public List<AnalysisBaseDto<decimal>> GenerateFinalResult(List<string> data, int index, string dataType, string filedDesc = "")
|
||||
{
|
||||
List<AnalysisBaseDto<decimal>> list = new List<AnalysisBaseDto<decimal>>();
|
||||
int fCount = Convert.ToInt32(data[2]) + 1;
|
||||
@ -140,7 +148,10 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
meter.TimeSpan = readingDate;
|
||||
}
|
||||
meter.DataType = i == 1 ? dataType : $"{dataType}_{ i - 1}";
|
||||
remark = i == 1 ? remark : remark.Replace("有功", "无功");
|
||||
filedDesc = i == 1 ? filedDesc : filedDesc.Replace("有功", "无功");
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
|
||||
list.Add(meter);
|
||||
}
|
||||
return list;
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "一象限无功电能示值");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "四象限无功电能示值");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "二象限无功电能示值");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,15 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "三象限无功电能示值");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -8,6 +8,7 @@ using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using System;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -39,15 +40,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType,timeSpan, "正向有功总电能示值").IsValidData(new List<string>() { "0D_161", "0D_161_1", "0D_161_2", "0D_161_3", "0D_161_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +69,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType, timeSpan, "正向无功(组合无功 1)电能示值").IsValidData(new List<string>() { "0D_162", "0D_162_1", "0D_162_2", "0D_162_3", "0D_162_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,15 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType, timeSpan, "反向有功总电能示值").IsValidData(new List<string>() { "0D_163", "0D_163_1", "0D_163_2", "0D_163_3", "0D_163_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType, timeSpan, "日冻结反向无功(组合无功 1)电能示值").IsValidData(new List<string>() { "0D_164", "0D_164_1", "0D_164_2", "0D_164_3", "0D_164_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType, timeSpan, "日冻结一象限无功电能示值").IsValidData(new List<string>() { "0D_165", "0D_165_1", "0D_165_2", "0D_165_3", "0D_165_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Protocol.Interfaces;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType, timeSpan, "日冻结二象限无功电能示值").IsValidData(new List<string>() { "0D_166", "0D_166_1", "0D_166_2", "0D_166_3", "0D_166_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType, timeSpan, "日冻结三象限无功电能示值").IsValidData(new List<string>() { "0D_167", "0D_167_1", "0D_167_2", "0D_167_3", "0D_167_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType, timeSpan, "日冻结四象限无功电能示值").IsValidData(new List<string>() { "0D_168", "0D_168_1", "0D_168_2", "0D_168_3", "0D_168_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +37,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
string timeSpan = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-01 00:00:00";
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_m(3, dataType, timeSpan, "月冻结正向有功电能示值").IsValidData(new List<string>() { "0D_177", "0D_177_1", "0D_177_2", "0D_177_3", "0D_177_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +37,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
string timeSpan = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-01 00:00:00";
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_m(3, dataType, timeSpan, "月冻结正向无功(组合无功 1)电能示值").IsValidData(new List<string>() { "0D_178", "0D_178_1", "0D_178_2", "0D_178_3", "0D_178_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +37,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
string timeSpan = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-01 00:00:00";
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_m(3, dataType, timeSpan, "反向有功总电能示值").IsValidData(new List<string>() { "0D_179", "0D_179_1", "0D_179_2", "0D_179_3", "0D_179_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +37,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
string timeSpan = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-01 00:00:00";
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_m(3, dataType, timeSpan, "月冻结反向无功(组合无功 1)电能示值").IsValidData(new List<string>() { "0D_180", "0D_180_1", "0D_180_2", "0D_180_3", "0D_180_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +37,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
string timeSpan = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-01 00:00:00";
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_m(3, dataType, timeSpan, "月冻结一象限无功电能示值(总、费率 1~M)").IsValidData(new List<string>() { "0D_181", "0D_181_1", "0D_181_2", "0D_181_3", "0D_181_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +37,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
string timeSpan = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-01 00:00:00";
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_m(3, dataType, timeSpan, "月冻结二象限无功电能示值(总、费率 1~M)").IsValidData(new List<string>() { "0D_182", "0D_182_1", "0D_182_2", "0D_182_3", "0D_182_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +37,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
string timeSpan = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-01 00:00:00";
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_m(3, dataType, timeSpan, "月冻结三象限无功电能示值(总、费率 1~M)").IsValidData(new List<string>() { "0D_183", "0D_183_1", "0D_183_2", "0D_183_3", "0D_183_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +37,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
string timeSpan = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-01 00:00:00";
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_m(3, dataType, timeSpan, "月冻结四象限无功电能示值(总、费率 1~M)").IsValidData(new List<string>() { "0D_184", "0D_184_1", "0D_184_2", "0D_184_3", "0D_184_4" });
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +66,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_d(3, dataType, timeSpan, "抄表日冻结正向有功最大需量及发生时间");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -8,6 +8,8 @@ using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using System.Data;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -39,14 +41,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
data.DataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
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<AnalysisBaseDto<decimal>> unitDataAnalysis = new UnitDataAnalysis<AnalysisBaseDto<decimal>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -61,7 +63,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -108,7 +110,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
return values;
|
||||
}
|
||||
|
||||
public AnalysisBaseDto<decimal> GenerateFinalResult(List<string> data, string remark = "")
|
||||
public AnalysisBaseDto<decimal> GenerateFinalResult(List<string> data, string filedDesc = "")
|
||||
{
|
||||
List<AnalysisBaseDto<decimal>> list = new List<AnalysisBaseDto<decimal>>();
|
||||
AnalysisBaseDto<decimal> meter = new AnalysisBaseDto<decimal>
|
||||
@ -133,6 +135,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
meter.TimeSpan = readingDate;
|
||||
}
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
return meter;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,14 +39,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
AnalysisBaseDto<decimal> data = GenerateFinalResult(datas, "月冻结正向有功最大需量及发生时间");
|
||||
data.DataType= $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
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<AnalysisBaseDto<decimal>> unitDataAnalysis = new UnitDataAnalysis<AnalysisBaseDto<decimal>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -59,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -98,7 +100,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
}
|
||||
return values;
|
||||
}
|
||||
public AnalysisBaseDto<decimal> GenerateFinalResult(List<string> data, string remark = "")
|
||||
public AnalysisBaseDto<decimal> GenerateFinalResult(List<string> data, string filedDesc = "")
|
||||
{
|
||||
AnalysisBaseDto<decimal> meter = new AnalysisBaseDto<decimal>
|
||||
{
|
||||
@ -122,6 +124,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
meter.TimeSpan = readingDate;
|
||||
}
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
return meter;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -37,14 +39,14 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
AnalysisBaseDto<decimal> data = GenerateFinalResult(datas, "月冻结反向有功最大需量及发生时间");
|
||||
data.DataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
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<AnalysisBaseDto<decimal>> unitDataAnalysis = new UnitDataAnalysis<AnalysisBaseDto<decimal>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -59,7 +61,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Month
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -98,7 +100,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
}
|
||||
return values;
|
||||
}
|
||||
public AnalysisBaseDto<decimal> GenerateFinalResult(List<string> data, string remark = "")
|
||||
public AnalysisBaseDto<decimal> GenerateFinalResult(List<string> data, string filedDesc = "")
|
||||
{
|
||||
AnalysisBaseDto<decimal> meter = new AnalysisBaseDto<decimal>
|
||||
{
|
||||
@ -122,6 +124,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
meter.TimeSpan = readingDate;
|
||||
}
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
return meter;
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@ using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using System.Data;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -36,16 +38,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
List<string> datas = await AnalysisDataUnitAsync(input.UnitData.HexMessageList);
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
List<AnalysisBaseDto<decimal>> data = GenerateFinalResult(datas, dataType, "月冻结电能表正向有功最大需量及发生时间");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -60,7 +67,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -107,7 +114,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
return values;
|
||||
}
|
||||
|
||||
public List<AnalysisBaseDto<decimal>> GenerateFinalResult(List<string> data, string dataType,string remark = "")
|
||||
public List<AnalysisBaseDto<decimal>> GenerateFinalResult(List<string> data, string dataType,string filedDesc = "")
|
||||
{
|
||||
List<AnalysisBaseDto<decimal>> list = new List<AnalysisBaseDto<decimal>>();
|
||||
int fCount = Convert.ToInt32(data[2]) + 1;
|
||||
@ -135,7 +142,9 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
}
|
||||
meter.DataType = i == 1 ? dataType : $"{dataType}_{ i - 1}";
|
||||
|
||||
remark = i == 1 ? remark : remark.Replace("有功", "无功");
|
||||
filedDesc = i == 1 ? filedDesc : filedDesc.Replace("有功", "无功");
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
list.Add(meter);
|
||||
}
|
||||
return list;
|
||||
|
||||
@ -9,6 +9,8 @@ using System.Data;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using Volo.Abp.Domain.Entities;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -40,16 +42,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
var time = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-{datas[0].Substring(6, 2)} 00:00:00";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = GenerateFinalResult(datas,dataType, "日冻结正向有/无功最大需量及发生时间");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -64,7 +71,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -112,7 +119,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
return values;
|
||||
}
|
||||
|
||||
public List<AnalysisBaseDto<decimal>> GenerateFinalResult(List<string> data,string dataType, string remark = "")
|
||||
public List<AnalysisBaseDto<decimal>> GenerateFinalResult(List<string> data,string dataType, string filedDesc = "")
|
||||
{
|
||||
List<AnalysisBaseDto<decimal>> list = new List<AnalysisBaseDto<decimal>>();
|
||||
int fCount = Convert.ToInt32(data[2]) + 1;
|
||||
@ -155,7 +162,9 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
}
|
||||
|
||||
meter.DataType = i == 1 ? dataType : $"{dataType}_{ i - 1}";
|
||||
remark = i == 1 ? remark : remark.Replace("有功", "无功");
|
||||
filedDesc = i == 1 ? filedDesc : filedDesc.Replace("有功", "无功");
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
list.Add(meter);
|
||||
}
|
||||
catch
|
||||
|
||||
@ -8,6 +8,8 @@ using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using AutoMapper.Internal.Mappers;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -39,16 +41,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
var time = $"{datas[0].Substring(0, 4)}-{datas[0].Substring(4, 2)}-{datas[0].Substring(6, 2)} 00:00:00";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = GenerateFinalResult(datas, dataType, "日冻结反向有/无功最大需量及发生时间");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -63,7 +70,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = 1,//密度-间隔,
|
||||
DensityUnit = DensityUnit.Day
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -111,13 +118,11 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
return values;
|
||||
}
|
||||
|
||||
public List<AnalysisBaseDto<decimal>> GenerateFinalResult(List<string> data,string dataType, string remark = "")
|
||||
public List<AnalysisBaseDto<decimal>> GenerateFinalResult(List<string> data,string dataType, string filedDesc = "")
|
||||
{
|
||||
List<AnalysisBaseDto<decimal>> list = new List<AnalysisBaseDto<decimal>>();
|
||||
int fCount = Convert.ToInt32(data[2]) + 1;
|
||||
for (int i = 1; i <= 2; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
AnalysisBaseDto<decimal> meter = new AnalysisBaseDto<decimal>
|
||||
{
|
||||
@ -156,16 +161,12 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
meter.TimeSpan = tsField;
|
||||
}
|
||||
meter.DataType = i == 1 ? dataType : $"{dataType}_{ i - 1}";
|
||||
remark = i == 1 ? remark : remark.Replace("有功", "无功");
|
||||
filedDesc = i == 1 ? filedDesc : filedDesc.Replace("有功", "无功");
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
list.Add(meter);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
if (list.Count == 0)
|
||||
throw new Exception("错误数据");
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "有功功率曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "A相有功功率曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "B相有功功率曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "C相有功功率曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "无功功率曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "A相无功功率曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "B相无功功率曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "C相无功功率曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "A相电压曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "B相电压曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "C相电压曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "A相电流曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "B相电流曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "C相电流曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "测量点零序电流曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "正向有功总电能量曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "正向无功总电能量曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -7,6 +7,7 @@ using JiShe.CollectBus.Protocol3761;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using JiShe.CollectBus.Protocol.T37612012.AnalysisData.Appendix;
|
||||
using JiShe.CollectBus.Common.Extensions;
|
||||
using JiShe.CollectBus.IotSystems.Ammeters;
|
||||
|
||||
namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
{
|
||||
@ -38,16 +39,21 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
string dataType = $"{input.AFN_FC.AFN.HexToDecStr().PadLeft(2, '0')}_{input.DT.Fn}";
|
||||
|
||||
List<AnalysisBaseDto<decimal>> data = datas.GenerateFinalResultTd_c(3, density, dataType, "反向有功总电能量曲线");
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
// 查询电表信息
|
||||
//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;
|
||||
//}
|
||||
AmmeterInfo ammeterInfo = await _dataStorage.GetMeterInfoAsync(data[0].MeterType.ToString(), "15");
|
||||
if (ammeterInfo != null)
|
||||
{
|
||||
data.ForEach(item =>
|
||||
{
|
||||
item.ProjectId = ammeterInfo.ProjectID;
|
||||
item.MeterId = ammeterInfo.MeterId;
|
||||
item.DatabaseBusiID = ammeterInfo.DatabaseBusiID;
|
||||
item.MeterAddress = ammeterInfo.AmmerterAddress;
|
||||
});
|
||||
}
|
||||
}
|
||||
UnitDataAnalysis<List<AnalysisBaseDto<decimal>>> unitDataAnalysis = new UnitDataAnalysis<List<AnalysisBaseDto<decimal>>>
|
||||
{
|
||||
Code = input.A.Code!,
|
||||
@ -62,7 +68,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_0DH
|
||||
TimeDensity = density,//密度-间隔分钟数,
|
||||
DensityUnit = DensityUnit.Minute
|
||||
};
|
||||
//await _dataStorage.SaveDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
await _dataStorage.SaveMultipleDataToIotDbAsync<decimal>(unitDataAnalysis);
|
||||
return await Task.FromResult(unitDataAnalysis);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -142,5 +142,106 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据到IotDb
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="analysisBaseDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> SaveMultipleDataToIotDbAsync<T>(UnitDataAnalysis<List<AnalysisBaseDto<T>>> analysisBaseDto)
|
||||
{
|
||||
var data = analysisBaseDto.Data!;
|
||||
foreach (var item in data)
|
||||
{
|
||||
string taskMark = CommonHelper.GetTaskMark(analysisBaseDto.AFN, analysisBaseDto.Fn, analysisBaseDto.Pn, analysisBaseDto.MSA, analysisBaseDto.PSEQ);
|
||||
string scoreValue = $"{analysisBaseDto.Code}.{taskMark}".Md5Fun();
|
||||
|
||||
var conditions = new List<QueryCondition>();
|
||||
conditions.Add(new QueryCondition()
|
||||
{
|
||||
Field = "ScoreValue",
|
||||
Operator = "=",
|
||||
IsNumber = false,
|
||||
Value = scoreValue
|
||||
});
|
||||
conditions.Add(new QueryCondition()
|
||||
{
|
||||
Field = "TaskMark",
|
||||
Operator = "=",
|
||||
IsNumber = false,
|
||||
Value = taskMark
|
||||
});
|
||||
conditions.Add(new QueryCondition()
|
||||
{
|
||||
Field = "IsReceived",
|
||||
Operator = "=",
|
||||
IsNumber = false,
|
||||
Value = false
|
||||
});
|
||||
var meter = new TreeModelSingleMeasuringEntity<T>()
|
||||
{
|
||||
SystemName = _applicationOptions.SystemType,
|
||||
DeviceId = $"{item.MeterId}",
|
||||
DeviceType = $"{item.MeterType}",
|
||||
ProjectId = $"{item.ProjectId}",
|
||||
Timestamps = item.TimeSpan.GetDateTimeOffset().ToUnixTimeMilliseconds(),
|
||||
SingleMeasuring = new Tuple<string, T>(item.FiledName ?? string.Empty, item.DataValue ?? default)
|
||||
};
|
||||
_runtimeContext.UseTableSessionPool = true; // 使用表模型池
|
||||
var taskSendInfo = await _dbProvider.QueryAsync<MeterReadingTelemetryPacketInfo>(new IoTDBQueryOptions() { TableNameOrTreePath = DevicePathBuilder.GetTableName<MeterReadingTelemetryPacketInfo>(), Conditions = conditions, PageIndex = 0, PageSize = 1 });
|
||||
var taskData = taskSendInfo?.Items.FirstOrDefault();
|
||||
if (taskData != null)
|
||||
{
|
||||
// 更新
|
||||
meter.Timestamps = taskData.Timestamps;
|
||||
taskData.IsReceived = true;
|
||||
taskData.ReceivedMessageHexString = analysisBaseDto.HexMessage;
|
||||
taskData.ReceivedMessageId = analysisBaseDto.MessageId ?? string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 新建
|
||||
var currentTime = DateTime.Now;
|
||||
taskData = new MeterReadingTelemetryPacketInfo()
|
||||
{
|
||||
SystemName = _applicationOptions.SystemType,
|
||||
ProjectId = $"{item.ProjectId}",
|
||||
DeviceType = $"{item.MeterType}",
|
||||
DeviceId = $"{item.MeterId}",
|
||||
Timestamps = DateTime.Now.CheckTimePoint().GetDateTimeOffset().ToUnixTimeNanoseconds(),
|
||||
DatabaseBusiID = item.DatabaseBusiID,
|
||||
PendingCopyReadTime = item.DataTime.CheckTimePoint(),
|
||||
CreationTime = currentTime,
|
||||
MeterAddress = item.MeterAddress,
|
||||
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.HexMessage,
|
||||
IsReceived = true,
|
||||
ReceivedRemark = item.ErrorCodeMsg ?? string.Empty,
|
||||
ScoreValue = $"{analysisBaseDto.Code}.{taskMark}".Md5Fun(),
|
||||
};
|
||||
}
|
||||
|
||||
await _dbProvider.InsertAsync(taskData);
|
||||
//如果无字段名,则不保存数据
|
||||
if (string.IsNullOrWhiteSpace(item.FiledName))
|
||||
{
|
||||
_runtimeContext.UseTableSessionPool = false; // 使树模型池
|
||||
await _dbProvider.InsertAsync(meter);
|
||||
}
|
||||
}
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public static List<AnalysisBaseDto<decimal>> GenerateFinalResultTd_c(this List<string> data, int index,int density,string dataType, string remark = "")
|
||||
public static List<AnalysisBaseDto<decimal>> GenerateFinalResultTd_c(this List<string> data, int index,int density,string dataType, string filedDesc = "")
|
||||
{
|
||||
List<AnalysisBaseDto<decimal>> list = new List<AnalysisBaseDto<decimal>>();
|
||||
for (int i = index; i < data.Count; i++)
|
||||
@ -223,7 +223,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
||||
decimal.TryParse(data[i], out value);
|
||||
meter.DataValue = value;
|
||||
meter.DataType = dataType;
|
||||
meter.FiledDesc = remark;
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
if (DateTime.TryParse(CalculateTimeSpan(i - 3, data[0], density), out DateTime readingDate))
|
||||
meter.TimeSpan = readingDate;
|
||||
@ -241,7 +241,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
||||
/// <param name="timeSpan"></param>
|
||||
/// <param name="remark"></param>
|
||||
/// <returns></returns>
|
||||
public static List<AnalysisBaseDto<decimal>> GenerateFinalResultTd_m(this List<string> data, int index,string dataType,string timeSpan, string remark = "")
|
||||
public static List<AnalysisBaseDto<decimal>> GenerateFinalResultTd_m(this List<string> data, int index,string dataType,string timeSpan, string filedDesc = "")
|
||||
{
|
||||
List<AnalysisBaseDto<decimal>> list = new List<AnalysisBaseDto<decimal>>();
|
||||
for (int i = index; i < data.Count; i++)
|
||||
@ -263,7 +263,8 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
||||
meter.TimeSpan = readingDate;
|
||||
}
|
||||
meter.DataType = i - index == 0 ? dataType : $"{dataType}_{i - index}";
|
||||
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
list.Add(meter);
|
||||
}
|
||||
return list;
|
||||
@ -276,7 +277,7 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
||||
/// <param name="data"></param>
|
||||
/// <param name="remark"></param>
|
||||
/// <returns></returns>
|
||||
public static List<AnalysisBaseDto<decimal>> GenerateFinalResultTd_d(this List<string> data, int index,string dataType, string timeSpan, string remark = "")
|
||||
public static List<AnalysisBaseDto<decimal>> GenerateFinalResultTd_d(this List<string> data, int index,string dataType, string timeSpan, string filedDesc = "")
|
||||
{
|
||||
List<AnalysisBaseDto<decimal>> list = new List<AnalysisBaseDto<decimal>>();
|
||||
int typeIndex = 0;
|
||||
@ -301,6 +302,8 @@ namespace JiShe.CollectBus.Protocol.T37612012
|
||||
meter.TimeSpan = readingDate;
|
||||
}
|
||||
meter.DataType = i - index == 0 ? dataType : $"{dataType}_{i - index}";
|
||||
meter.FiledDesc = filedDesc;
|
||||
meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||
list.Add(meter);
|
||||
typeIndex++;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ namespace JiShe.CollectBus.Protocol.Contracts.Protocol.Dto
|
||||
/// <summary>
|
||||
/// 数据类型
|
||||
/// </summary>
|
||||
public string DataType { get; set; }
|
||||
public string DataType { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 错误码信息
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user