完善编码映射
This commit is contained in:
parent
87dd6be681
commit
a78b819233
@ -100,8 +100,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData.AFN_10H
|
|||||||
if(decimal.TryParse(data[4], out decimal value))
|
if(decimal.TryParse(data[4], out decimal value))
|
||||||
meter.DataValue = value;
|
meter.DataValue = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
meter.ItemType = "10_97";
|
meter.ItemType = T37612012PacketItemCodeConst.AFN10HFN97H;
|
||||||
meter.ValidData = data[2].Equals("91") || data[2].Equals("B1");
|
meter.ValidData = data[2].Equals("91") || data[2].Equals("B1");
|
||||||
meter.FiledDesc = "电网频率";//"电网频率";
|
meter.FiledDesc = "电网频率";//"电网频率";
|
||||||
meter.FiledName = meter.ItemType.GetDataFieldByGatherDataType() ?? string.Empty;
|
meter.FiledName = meter.ItemType.GetDataFieldByGatherDataType() ?? string.Empty;
|
||||||
|
|||||||
@ -172,6 +172,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
{
|
{
|
||||||
// 新建
|
// 新建
|
||||||
var currentTime = DateTime.Now;
|
var currentTime = DateTime.Now;
|
||||||
|
//特殊编码映射
|
||||||
|
var itemCodeInfo = T37612012PacketItemCodeConst.MappingItemCodeTo645SubCodeRelationship(data.ItemType);
|
||||||
taskData = new MeterReadingTelemetryPacketInfo()
|
taskData = new MeterReadingTelemetryPacketInfo()
|
||||||
{
|
{
|
||||||
SystemName = _applicationOptions.SystemType,
|
SystemName = _applicationOptions.SystemType,
|
||||||
@ -189,8 +191,9 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
AFN = analysisBaseDto.AFN,
|
AFN = analysisBaseDto.AFN,
|
||||||
Fn = analysisBaseDto.Fn,
|
Fn = analysisBaseDto.Fn,
|
||||||
Seq = analysisBaseDto.PSEQ,
|
Seq = analysisBaseDto.PSEQ,
|
||||||
MSA = analysisBaseDto.MSA,
|
MSA = analysisBaseDto.MSA,
|
||||||
ItemCode = data.ItemType,
|
ItemCode = itemCodeInfo.Item1,
|
||||||
|
SubItemCode = itemCodeInfo.Item2,
|
||||||
TaskMark = taskMark,
|
TaskMark = taskMark,
|
||||||
IsSend = false,
|
IsSend = false,
|
||||||
ManualOrNot = false,
|
ManualOrNot = false,
|
||||||
@ -278,6 +281,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
{
|
{
|
||||||
// 新建
|
// 新建
|
||||||
var currentTime = DateTime.Now;
|
var currentTime = DateTime.Now;
|
||||||
|
//特殊编码映射
|
||||||
|
var itemCodeInfo = T37612012PacketItemCodeConst.MappingItemCodeTo645SubCodeRelationship(item.ItemType);
|
||||||
taskData = new MeterReadingTelemetryPacketInfo()
|
taskData = new MeterReadingTelemetryPacketInfo()
|
||||||
{
|
{
|
||||||
SystemName = _applicationOptions.SystemType,
|
SystemName = _applicationOptions.SystemType,
|
||||||
@ -287,7 +292,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
DataType = IOTDBDataTypeConst.Log, // 匹配不到下发记录标记为LOG
|
DataType = IOTDBDataTypeConst.Log, // 匹配不到下发记录标记为LOG
|
||||||
Timestamps = DateTime.Now.CheckTimePoint().GetDateTimeOffset().ToUnixTimeNanoseconds(),
|
Timestamps = DateTime.Now.CheckTimePoint().GetDateTimeOffset().ToUnixTimeNanoseconds(),
|
||||||
DatabaseBusiID = item.DatabaseBusiID,
|
DatabaseBusiID = item.DatabaseBusiID,
|
||||||
PendingCopyReadTime = item.TimeSpan.Value.GetFormatTime(analysisBaseDto.DensityUnit, analysisBaseDto.TimeDensity),
|
PendingCopyReadTime = item.TimeSpan.Value.GetFormatTime(analysisBaseDto.DensityUnit, analysisBaseDto.TimeDensity),
|
||||||
CreationTime = currentTime,
|
CreationTime = currentTime,
|
||||||
FocusId = item.FocusId,
|
FocusId = item.FocusId,
|
||||||
FocusAddress = analysisBaseDto.Code,
|
FocusAddress = analysisBaseDto.Code,
|
||||||
@ -295,8 +300,9 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
AFN = analysisBaseDto.AFN,
|
AFN = analysisBaseDto.AFN,
|
||||||
Fn = analysisBaseDto.Fn,
|
Fn = analysisBaseDto.Fn,
|
||||||
Seq = analysisBaseDto.PSEQ,
|
Seq = analysisBaseDto.PSEQ,
|
||||||
MSA = analysisBaseDto.MSA,
|
MSA = analysisBaseDto.MSA,
|
||||||
ItemCode = item.ItemType,
|
ItemCode = itemCodeInfo.Item1,
|
||||||
|
SubItemCode = itemCodeInfo.Item2,
|
||||||
TaskMark = taskMark,
|
TaskMark = taskMark,
|
||||||
IsSend = false,
|
IsSend = false,
|
||||||
ManualOrNot = false,
|
ManualOrNot = false,
|
||||||
@ -386,6 +392,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
// 新建
|
// 新建
|
||||||
string taskMark = CommonHelper.GetTaskMark(analysisBaseDto.AFN, analysisBaseDto.Fn, analysisBaseDto.Pn, analysisBaseDto.MSA, analysisBaseDto.PSEQ);
|
string taskMark = CommonHelper.GetTaskMark(analysisBaseDto.AFN, analysisBaseDto.Fn, analysisBaseDto.Pn, analysisBaseDto.MSA, analysisBaseDto.PSEQ);
|
||||||
var currentTime = DateTime.Now;
|
var currentTime = DateTime.Now;
|
||||||
|
//特殊编码映射
|
||||||
|
var itemCodeInfo = T37612012PacketItemCodeConst.MappingItemCodeTo645SubCodeRelationship(data.ItemType);
|
||||||
var taskData = new MeterReadingTelemetryPacketInfo()
|
var taskData = new MeterReadingTelemetryPacketInfo()
|
||||||
{
|
{
|
||||||
SystemName = _applicationOptions.SystemType,
|
SystemName = _applicationOptions.SystemType,
|
||||||
@ -404,7 +412,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
Fn = analysisBaseDto.Fn,
|
Fn = analysisBaseDto.Fn,
|
||||||
Seq = analysisBaseDto.PSEQ,
|
Seq = analysisBaseDto.PSEQ,
|
||||||
MSA = analysisBaseDto.MSA,
|
MSA = analysisBaseDto.MSA,
|
||||||
ItemCode = data.ItemType,
|
ItemCode = itemCodeInfo.Item1,
|
||||||
|
SubItemCode = itemCodeInfo.Item2,
|
||||||
TaskMark = taskMark,
|
TaskMark = taskMark,
|
||||||
IsSend = false,
|
IsSend = false,
|
||||||
ManualOrNot = false,
|
ManualOrNot = false,
|
||||||
@ -485,6 +494,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
// 新建
|
// 新建
|
||||||
string taskMark = CommonHelper.GetTaskMark(analysisBaseDto.AFN, analysisBaseDto.Fn, analysisBaseDto.Pn, analysisBaseDto.MSA, analysisBaseDto.PSEQ);
|
string taskMark = CommonHelper.GetTaskMark(analysisBaseDto.AFN, analysisBaseDto.Fn, analysisBaseDto.Pn, analysisBaseDto.MSA, analysisBaseDto.PSEQ);
|
||||||
var currentTime = DateTime.Now;
|
var currentTime = DateTime.Now;
|
||||||
|
//特殊编码映射
|
||||||
|
var itemCodeInfo = T37612012PacketItemCodeConst.MappingItemCodeTo645SubCodeRelationship(item.ItemType);
|
||||||
var taskData = new MeterReadingTelemetryPacketInfo()
|
var taskData = new MeterReadingTelemetryPacketInfo()
|
||||||
{
|
{
|
||||||
SystemName = _applicationOptions.SystemType,
|
SystemName = _applicationOptions.SystemType,
|
||||||
@ -503,7 +514,8 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData
|
|||||||
Fn = analysisBaseDto.Fn,
|
Fn = analysisBaseDto.Fn,
|
||||||
Seq = analysisBaseDto.PSEQ,
|
Seq = analysisBaseDto.PSEQ,
|
||||||
MSA = analysisBaseDto.MSA,
|
MSA = analysisBaseDto.MSA,
|
||||||
ItemCode = item.ItemType,
|
ItemCode = itemCodeInfo.Item1,
|
||||||
|
SubItemCode = itemCodeInfo.Item2,
|
||||||
TaskMark = taskMark,
|
TaskMark = taskMark,
|
||||||
IsSend = false,
|
IsSend = false,
|
||||||
ManualOrNot = false,
|
ManualOrNot = false,
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System.Reflection;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using JiShe.CollectBus.Common.BuildSendDatas;
|
using JiShe.CollectBus.Common.BuildSendDatas;
|
||||||
using JiShe.CollectBus.Common.Extensions;
|
using JiShe.CollectBus.Common.Extensions;
|
||||||
|
|
||||||
@ -100,7 +101,7 @@ namespace JiShe.CollectBus.Protocol.T6452007.SendData
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 读数据
|
#region 读数据 命名规则:C控制码_DI3
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 变量数据标识编码处理
|
/// 变量数据标识编码处理
|
||||||
@ -109,7 +110,7 @@ namespace JiShe.CollectBus.Protocol.T6452007.SendData
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Telemetry6452007PacketResponse C11_02_Send(Telemetry6452007PacketRequest request)
|
public static Telemetry6452007PacketResponse C11_02_Send(Telemetry6452007PacketRequest request)
|
||||||
{
|
{
|
||||||
var itemCodeArr = request.ItemCode.Split('_');//11_02_80_00_02
|
var itemCodeArr = request.ItemCode.Split('_');//11_02_80_00_02,控制码_DI3_DI2_DI1_DI0
|
||||||
var c_data = itemCodeArr[0];
|
var c_data = itemCodeArr[0];
|
||||||
var DI3 = itemCodeArr[1];
|
var DI3 = itemCodeArr[1];
|
||||||
var DI2 = itemCodeArr[2];
|
var DI2 = itemCodeArr[2];
|
||||||
@ -118,6 +119,8 @@ namespace JiShe.CollectBus.Protocol.T6452007.SendData
|
|||||||
|
|
||||||
var dataUnit = new List<string>() { DI3, DI2, DI1, DI0 };
|
var dataUnit = new List<string>() { DI3, DI2, DI1, DI0 };
|
||||||
|
|
||||||
|
dataUnit.Reverse();
|
||||||
|
|
||||||
var dataList = Build645SendData.Build645SendCommand(request.MeterAddress, c_data, dataUnit);
|
var dataList = Build645SendData.Build645SendCommand(request.MeterAddress, c_data, dataUnit);
|
||||||
return new Telemetry6452007PacketResponse() { Data = dataList };
|
return new Telemetry6452007PacketResponse() { Data = dataList };
|
||||||
}
|
}
|
||||||
|
|||||||
@ -169,7 +169,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
// var tempTask = await ConcentratorScheduledAutomaticGetTerminalVersion(timeDensity, data, groupIndex, timestamps);
|
// var tempTask = await ConcentratorScheduledAutomaticGetTerminalVersion(timeDensity, data, groupIndex, timestamps);
|
||||||
// if (tempTask == null || tempTask.Count <= 0)
|
// if (tempTask == null || tempTask.Count <= 0)
|
||||||
// {
|
// {
|
||||||
// _logger.LogWarning($"集中器 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
// _logger.LogWarning($"集中器终端版本信息 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
||||||
@ -186,7 +186,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
// var tempTask = await ConcentratorScheduledAutomaticGetTelematicsModule(timeDensity, data, groupIndex, timestamps);
|
// var tempTask = await ConcentratorScheduledAutomaticGetTelematicsModule(timeDensity, data, groupIndex, timestamps);
|
||||||
// if (tempTask == null || tempTask.Count <= 0)
|
// if (tempTask == null || tempTask.Count <= 0)
|
||||||
// {
|
// {
|
||||||
// _logger.LogWarning($"集中器 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
// _logger.LogWarning($"集中器SIM卡读取 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
||||||
@ -203,7 +203,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
// var tempTask = await AmmeterScheduledGetAutomaticDayFreezeData(timeDensity, data, groupIndex, timestamps);
|
// var tempTask = await AmmeterScheduledGetAutomaticDayFreezeData(timeDensity, data, groupIndex, timestamps);
|
||||||
// if (tempTask == null || tempTask.Count <= 0)
|
// if (tempTask == null || tempTask.Count <= 0)
|
||||||
// {
|
// {
|
||||||
// _logger.LogWarning($"电表 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
// _logger.LogWarning($"电表月冻结 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
||||||
@ -220,7 +220,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
// var tempTask = await AmmeterScheduledGetAutomaticMonthFreezeData(timeDensity, data, groupIndex, timestamps);
|
// var tempTask = await AmmeterScheduledGetAutomaticMonthFreezeData(timeDensity, data, groupIndex, timestamps);
|
||||||
// if (tempTask == null || tempTask.Count <= 0)
|
// if (tempTask == null || tempTask.Count <= 0)
|
||||||
// {
|
// {
|
||||||
// _logger.LogWarning($"电表 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
// _logger.LogWarning($"电表日冻结 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
||||||
@ -232,84 +232,23 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
//_ = CreateMeterPublishTask<DeviceInfo>(
|
|
||||||
// timeDensity: timeDensity,
|
|
||||||
// nextTaskTime: currentTime,
|
|
||||||
// meterType: MeterTypeEnum.Ammeter,
|
|
||||||
// taskCreateAction: async (timeDensity, data, groupIndex, timestamps) =>
|
|
||||||
// {
|
|
||||||
// var tempTask = await AmmeterScheduledAutomaticVerificationTime(timeDensity, data, groupIndex, timestamps);
|
|
||||||
|
|
||||||
// if (tempTask == null || tempTask.Count <= 0)
|
|
||||||
// {
|
|
||||||
// _logger.LogWarning($"电表自动校时 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
|
||||||
// });
|
|
||||||
|
|
||||||
_ = CreateMeterPublishTask<DeviceInfo>(
|
_ = CreateMeterPublishTask<DeviceInfo>(
|
||||||
timeDensity: timeDensity,
|
timeDensity: timeDensity,
|
||||||
nextTaskTime: currentTime,
|
nextTaskTime: currentTime,
|
||||||
meterType: MeterTypeEnum.Ammeter,
|
meterType: MeterTypeEnum.Ammeter,
|
||||||
taskCreateAction: async (timeDensity, data, groupIndex, timestamps) =>
|
taskCreateAction: async (timeDensity, data, groupIndex, timestamps) =>
|
||||||
{
|
{
|
||||||
var tempTask = await ConcentratorScheduledAutomaticGetTerminalVersion(timeDensity, data, groupIndex, timestamps);
|
var tempTask = await ConcentratorScheduledAutomaticGetTelematicsModule(timeDensity, data, groupIndex, timestamps);
|
||||||
if (tempTask == null || tempTask.Count <= 0)
|
if (tempTask == null || tempTask.Count <= 0)
|
||||||
{
|
{
|
||||||
_logger.LogWarning($"集中器 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
_logger.LogWarning($"集中器SIM卡读取 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
_ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
||||||
});
|
});
|
||||||
|
|
||||||
//_ = CreateMeterPublishTask<DeviceInfo>(
|
|
||||||
// timeDensity: timeDensity,
|
|
||||||
// nextTaskTime: currentTime,
|
|
||||||
// meterType: MeterTypeEnum.Ammeter,
|
|
||||||
// taskCreateAction: async (timeDensity, data, groupIndex, timestamps) =>
|
|
||||||
// {
|
|
||||||
// var tempTask = await ConcentratorScheduledAutomaticGetTelematicsModule(timeDensity, data, groupIndex, timestamps);
|
|
||||||
// if (tempTask == null || tempTask.Count <= 0)
|
|
||||||
// {
|
|
||||||
// _logger.LogWarning($"集中器 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
|
||||||
// });
|
|
||||||
|
|
||||||
//_ = CreateMeterPublishTask<DeviceInfo>(
|
|
||||||
// timeDensity: timeDensity,
|
|
||||||
// nextTaskTime: currentTime,
|
|
||||||
// meterType: MeterTypeEnum.Ammeter,
|
|
||||||
// taskCreateAction: async (timeDensity, data, groupIndex, timestamps) =>
|
|
||||||
// {
|
|
||||||
// var tempTask = await AmmeterScheduledGetAutomaticDayFreezeData(timeDensity, data, groupIndex, timestamps);
|
|
||||||
// if (tempTask == null || tempTask.Count <= 0)
|
|
||||||
// {
|
|
||||||
// _logger.LogWarning($"电表 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//_ = CreateMeterPublishTask<DeviceInfo>(
|
|
||||||
// timeDensity: timeDensity,
|
|
||||||
// nextTaskTime: currentTime,
|
|
||||||
// meterType: MeterTypeEnum.Ammeter,
|
|
||||||
// taskCreateAction: async (timeDensity, data, groupIndex, timestamps) =>
|
|
||||||
// {
|
|
||||||
// var tempTask = await AmmeterScheduledGetAutomaticMonthFreezeData(timeDensity, data, groupIndex, timestamps);
|
|
||||||
// if (tempTask == null || tempTask.Count <= 0)
|
|
||||||
// {
|
|
||||||
// _logger.LogWarning($"电表 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerOtherIssuedEventName, tempTask));
|
|
||||||
// });
|
|
||||||
|
|
||||||
//检查任务时间节点,由于定时任务10秒钟运行一次,需要判定当前时间是否在任务时间节点内,不在则跳过
|
//检查任务时间节点,由于定时任务10秒钟运行一次,需要判定当前时间是否在任务时间节点内,不在则跳过
|
||||||
var currentTaskTime = tasksToBeIssueModel.LastTaskTime.CalculateNextCollectionTime(timeDensity);//程序启动缓存电表的时候,NextTaskTime需要格式化到下一个采集点时间。
|
var currentTaskTime = tasksToBeIssueModel.LastTaskTime.CalculateNextCollectionTime(timeDensity);//程序启动缓存电表的时候,NextTaskTime需要格式化到下一个采集点时间。
|
||||||
if (!IsTaskTime(currentTaskTime, timeDensity))//todo 如果时间超过两个采集频率周期,就一直处理,直到追加到下一个采集频率周期。
|
if (!IsTaskTime(currentTaskTime, timeDensity))//todo 如果时间超过两个采集频率周期,就一直处理,直到追加到下一个采集频率周期。
|
||||||
@ -538,7 +477,8 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ammeter.ItemCodes = "10_97";
|
var tempItemCodeList = new List<string>() { "10_97" };
|
||||||
|
ammeter.ItemCodes = tempItemCodeList.Serialize();
|
||||||
|
|
||||||
if (!keyValuePairs.ContainsKey(ammeter.FocusAddress))
|
if (!keyValuePairs.ContainsKey(ammeter.FocusAddress))
|
||||||
{
|
{
|
||||||
@ -805,13 +745,14 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
//var aFN = (AFN)aFNStr.HexToDec();
|
//var aFN = (AFN)aFNStr.HexToDec();
|
||||||
//var fn = int.Parse(itemCodeArr[1]);
|
//var fn = int.Parse(itemCodeArr[1]);
|
||||||
|
|
||||||
|
//特殊编码映射
|
||||||
var itemCodeInfo = T37612012PacketItemCodeConst.MappingItemCodeTo645SubCodeRelationship(tempItem);
|
var itemCodeInfo = T37612012PacketItemCodeConst.MappingItemCodeTo645SubCodeRelationship(tempItem);
|
||||||
|
|
||||||
//TODO:特殊表
|
//TODO:特殊表
|
||||||
ProtocolBuildResponse builderResponse = await protocolPlugin.BuildAsync(new ProtocolBuildRequest()
|
ProtocolBuildResponse builderResponse = await protocolPlugin.BuildAsync(new ProtocolBuildRequest()
|
||||||
{
|
{
|
||||||
FocusAddress = ammeterInfo.FocusAddress,
|
FocusAddress = ammeterInfo.FocusAddress,
|
||||||
Pn = ammeterInfo.MeteringCode,
|
Pn = itemCodeInfo.Item1 == T37612012PacketItemCodeConst.AFN10HFN01H ? 0 : ammeterInfo.MeteringCode,
|
||||||
ItemCode = itemCodeInfo.Item1,
|
ItemCode = itemCodeInfo.Item1,
|
||||||
DataTimeMark = new Protocol.DataTimeMark()
|
DataTimeMark = new Protocol.DataTimeMark()
|
||||||
{
|
{
|
||||||
@ -838,8 +779,8 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
ammeterInfo: ammeterInfo,
|
ammeterInfo: ammeterInfo,
|
||||||
timestamps: DateTimeOffset.Now.ToUnixTimeNanoseconds(),
|
timestamps: DateTimeOffset.Now.ToUnixTimeNanoseconds(),
|
||||||
builderResponse: builderResponse,
|
builderResponse: builderResponse,
|
||||||
itemCode: tempItem,
|
itemCode: itemCodeInfo.Item1,
|
||||||
subItemCode: null,
|
subItemCode: itemCodeInfo.Item2,
|
||||||
pendingCopyReadTime: timestamps,
|
pendingCopyReadTime: timestamps,
|
||||||
creationTime: currentTime,
|
creationTime: currentTime,
|
||||||
packetType: (TelemetryPacketTypeEnum)timeDensity,
|
packetType: (TelemetryPacketTypeEnum)timeDensity,
|
||||||
@ -884,12 +825,16 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
#else
|
||||||
//判断是否是自动校时时间
|
//判断是否是自动校时时间
|
||||||
if (!string.Equals(currentTimeStr, _applicationOptions.AutomaticVerificationTime, StringComparison.CurrentCultureIgnoreCase))
|
if (!string.Equals(currentTimeStr, _applicationOptions.AutomaticVerificationTime, StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"{nameof(AmmeterScheduledAutomaticVerificationTime)} 电表自动校时,非自动校时时间");
|
_logger.LogInformation($"{nameof(AmmeterScheduledAutomaticVerificationTime)} 电表自动校时,非自动校时时间");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
||||||
|
|
||||||
@ -903,7 +848,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
_logger.LogError($"{nameof(AmmeterScheduledAutoValveControl)} 定时阀控运行时间{currentTime}没有找到对应的协议组件,-105");
|
_logger.LogError($"{nameof(AmmeterScheduledAutoValveControl)} 定时阀控运行时间{currentTime}没有找到对应的协议组件,-105");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProtocolBuildResponse builderResponse = await protocolPlugin.BuildAsync(new ProtocolBuildRequest()
|
ProtocolBuildResponse builderResponse = await protocolPlugin.BuildAsync(new ProtocolBuildRequest()
|
||||||
{
|
{
|
||||||
FocusAddress = ammeterInfo.FocusAddress,
|
FocusAddress = ammeterInfo.FocusAddress,
|
||||||
@ -961,12 +906,16 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//判断是否是自动校时时间
|
|
||||||
if (!string.Equals(currentTimeStr, _applicationOptions.AutomaticVerificationTime, StringComparison.CurrentCultureIgnoreCase))
|
#if DEBUG
|
||||||
|
#else
|
||||||
|
//判断是否是日冻结抄读时间
|
||||||
|
if (!string.Equals(currentTimeStr, _applicationOptions.AutomaticDayFreezeTime, StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"{nameof(AmmeterScheduledAutomaticVerificationTime)} 电表自动校时,非自动校时时间");
|
_logger.LogInformation($"{nameof(AmmeterScheduledGetAutomaticDayFreezeData)} 非电表日冻结抄读时间,暂不处理");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
||||||
|
|
||||||
@ -974,7 +923,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
var protocolPlugin = await _protocolService.GetProtocolServiceAsync(ammeterInfo.BrandType);
|
var protocolPlugin = await _protocolService.GetProtocolServiceAsync(ammeterInfo.BrandType);
|
||||||
if (protocolPlugin == null)
|
if (protocolPlugin == null)
|
||||||
{
|
{
|
||||||
_logger.LogError($"{nameof(AmmeterScheduledAutoValveControl)} 定时阀控运行时间{currentTime}没有找到对应的协议组件,-105");
|
_logger.LogError($"{nameof(AmmeterScheduledAutoValveControl)} 电表日冻结抄读运行时间{currentTime}没有找到对应的协议组件,-105");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1032,12 +981,16 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//判断是否是自动校时时间
|
|
||||||
if (!string.Equals(currentTimeStr, _applicationOptions.AutomaticVerificationTime, StringComparison.CurrentCultureIgnoreCase))
|
#if DEBUG
|
||||||
|
#else
|
||||||
|
//判断是否是月冻结数据抄读
|
||||||
|
if (!string.Equals(currentTimeStr, _applicationOptions.AutomaticMonthFreezeTime, StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"{nameof(AmmeterScheduledAutomaticVerificationTime)} 电表自动校时,非自动校时时间");
|
_logger.LogInformation($"{nameof(AmmeterScheduledAutomaticVerificationTime)} 非电表月冻结抄读时间,暂不处理");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
||||||
|
|
||||||
@ -1045,7 +998,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
var protocolPlugin = await _protocolService.GetProtocolServiceAsync(ammeterInfo.BrandType);
|
var protocolPlugin = await _protocolService.GetProtocolServiceAsync(ammeterInfo.BrandType);
|
||||||
if (protocolPlugin == null)
|
if (protocolPlugin == null)
|
||||||
{
|
{
|
||||||
_logger.LogError($"{nameof(AmmeterScheduledAutoValveControl)} 定时阀控运行时间{currentTime}没有找到对应的协议组件,-105");
|
_logger.LogError($"{nameof(AmmeterScheduledAutoValveControl)} 电表月冻结抄读时间{currentTime}没有找到对应的协议组件,-105");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1504,12 +1457,15 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
|
#else
|
||||||
//判断是否是自动获取版本号时间
|
//判断是否是自动获取版本号时间
|
||||||
if (!string.Equals(currentTimeStr, _applicationOptions.AutomaticTerminalVersionTime, StringComparison.CurrentCultureIgnoreCase))
|
if (!string.Equals(currentTimeStr, _applicationOptions.AutomaticTerminalVersionTime, StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"{nameof(ConcentratorScheduledAutomaticGetTelematicsModule)} 自动获取远程通信模块(SIM)版本信息,非自动处理时间");
|
_logger.LogInformation($"{nameof(ConcentratorScheduledAutomaticGetTelematicsModule)} 自动获取远程通信模块(SIM)版本信息,非自动处理时间");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
||||||
|
|
||||||
@ -1557,7 +1513,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 公共处理方法
|
#region 公共处理方法
|
||||||
@ -1776,6 +1732,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
Pn = ammeterInfo.MeteringCode,
|
Pn = ammeterInfo.MeteringCode,
|
||||||
IssuedMessageId = guidGenerator.Create().ToString(),
|
IssuedMessageId = guidGenerator.Create().ToString(),
|
||||||
IssuedMessageHexString = Convert.ToHexString(builderResponse.Data),
|
IssuedMessageHexString = Convert.ToHexString(builderResponse.Data),
|
||||||
|
FocusDensity = ammeterInfo.TimeDensity.GetFocusDensity(),
|
||||||
IsReceived = false,
|
IsReceived = false,
|
||||||
ScoreValue = $"{ammeterInfo.FocusAddress}.{taskMark}".Md5Fun(),
|
ScoreValue = $"{ammeterInfo.FocusAddress}.{taskMark}".Md5Fun(),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -508,7 +508,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
ProtocolBuildResponse builderResponse = await protocolPlugin.BuildAsync(new ProtocolBuildRequest()
|
ProtocolBuildResponse builderResponse = await protocolPlugin.BuildAsync(new ProtocolBuildRequest()
|
||||||
{
|
{
|
||||||
FocusAddress = ammeterInfo.FocusAddress,
|
FocusAddress = ammeterInfo.FocusAddress,
|
||||||
Pn = ammeterInfo.MeteringCode,
|
Pn = 0,//ammeterInfo.MeteringCode,现有协议里面阀控必须传0,不能根据档案的MeteringCode值走。
|
||||||
ItemCode = itemCode,
|
ItemCode = itemCode,
|
||||||
SubProtocolRequest = new SubProtocolBuildRequest()
|
SubProtocolRequest = new SubProtocolBuildRequest()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -151,6 +151,12 @@ namespace JiShe.CollectBus.IotSystems.MeterReadingRecords
|
|||||||
[FIELDColumn]
|
[FIELDColumn]
|
||||||
public string IssuedMessageId { get; set; }
|
public string IssuedMessageId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 集中器采集密度
|
||||||
|
/// </summary>
|
||||||
|
[FIELDColumn]
|
||||||
|
public int FocusDensity { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 消息上报内容
|
/// 消息上报内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -17,7 +17,7 @@ namespace JiShe.CollectBus.Common.Consts
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 透明转发
|
/// 透明转发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string AFN10HFN01H = $"10_01";
|
public const string AFN10HFN01H = $"10_1";
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -28,12 +28,12 @@ namespace JiShe.CollectBus.Common.Consts
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 读取终端信息
|
/// 读取终端信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string AFN09HFN01H = $"09_01";
|
public const string AFN09HFN01H = $"09_1";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程通信模块版本信息
|
/// 远程通信模块版本信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string AFN09HFN09H = $"09_09";
|
public const string AFN09HFN09H = $"09_9";
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user