|
|
|
@ -39,7 +39,7 @@ namespace Ems.CollectService.Analysis
|
|
|
|
|
|
|
|
|
|
private BufferAnalysis()
|
|
|
|
|
{
|
|
|
|
|
logger.Info($"添加校时指令下发");
|
|
|
|
|
logger.Info($"添加数据校验:当前数据与前一条相差4000不保存");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -522,34 +522,8 @@ namespace Ems.CollectService.Analysis
|
|
|
|
|
recordDnbInstant.collectType = collectType;
|
|
|
|
|
recordDnbInstant.recordTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
if (appConfig.virtualFlag)
|
|
|
|
|
{
|
|
|
|
|
if (recordDnbInstant.zxyg != appConfig.virtualValue)
|
|
|
|
|
{
|
|
|
|
|
var info = SqlSugarHelper.Db.Insertable<RecordDnbInstant>(recordDnbInstant).ExecuteCommand();
|
|
|
|
|
if (info > 0)
|
|
|
|
|
{
|
|
|
|
|
logger.Info($"仪表:{recordDnbInstant.monitorId}数据保存成功");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
logger.Info($"仪表:{recordDnbInstant.monitorId}存在FFFF值不保存该条数据");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
recordDnbInstant.zxyg = recordDnbInstant.zxyg == appConfig.virtualValue ? 0 : recordDnbInstant.zxyg;
|
|
|
|
|
Save_DnbInstant(recordDnbInstant);
|
|
|
|
|
|
|
|
|
|
var info = SqlSugarHelper.Db.Insertable<RecordDnbInstant>(recordDnbInstant).ExecuteCommand();
|
|
|
|
|
if (info > 0)
|
|
|
|
|
{
|
|
|
|
|
logger.Info($"仪表:{recordDnbInstant.monitorId}数据保存成功");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
iFirstMeterID += 70;
|
|
|
|
|
}//end for
|
|
|
|
@ -563,6 +537,46 @@ namespace Ems.CollectService.Analysis
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="recordDnbInstant"></param>
|
|
|
|
|
private void Save_DnbInstant(RecordDnbInstant recordDnbInstant)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (appConfig.virtualFlag)
|
|
|
|
|
{
|
|
|
|
|
if (recordDnbInstant.zxyg != appConfig.virtualValue)
|
|
|
|
|
{
|
|
|
|
|
var info = SqlSugarHelper.Db.Insertable<RecordDnbInstant>(recordDnbInstant).ExecuteCommand();
|
|
|
|
|
if (info > 0)
|
|
|
|
|
{
|
|
|
|
|
logger.Info($"仪表:{recordDnbInstant.monitorId}数据保存成功");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
logger.Info($"仪表:{recordDnbInstant.monitorId}存在FFFF值不保存该条数据");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
recordDnbInstant.zxyg = recordDnbInstant.zxyg == appConfig.virtualValue ? 0 : recordDnbInstant.zxyg;
|
|
|
|
|
|
|
|
|
|
var info = SqlSugarHelper.Db.Insertable<RecordDnbInstant>(recordDnbInstant).ExecuteCommand();
|
|
|
|
|
if (info > 0)
|
|
|
|
|
{
|
|
|
|
|
logger.Info($"仪表:{recordDnbInstant.monitorId}数据保存成功");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logger.Error($"仪表:{recordDnbInstant.monitorId}数据保存异常:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 水表数据
|
|
|
|
|
/// </summary>
|
|
|
|
|