|
@@ -154,9 +154,8 @@ namespace TimedUpload.QuartzJobs
|
|
|
/// <param name="channel"></param>
|
|
|
private void SendQualityMeterUserHis(Dictionary<string, IModel> channels, Dictionary<string, IBasicProperties> properties)
|
|
|
{
|
|
|
- string changLeWaterQualityHisId = Constants.changLeWaterQualityHisId;
|
|
|
log.Info("水质设备抄表数据同步任务开始执行.................\r\n");
|
|
|
- String sqlMeter = "SELECT top 100 * FROM [历史记录_zhsw] WHERE HistoryRecordID > " + changLeWaterQualityHisId + " ORDER BY HistoryRecordID";
|
|
|
+ String sqlMeter = "SELECT top 200 * FROM [历史记录_zhsw] ORDER BY HistoryRecordID";
|
|
|
DataTable dtMeterHis = dbHelper.Fill(sqlMeter);
|
|
|
|
|
|
StringBuilder message = new StringBuilder();
|
|
@@ -189,7 +188,9 @@ namespace TimedUpload.QuartzJobs
|
|
|
IBasicProperties property = properties[key];
|
|
|
channel.BasicPublish("zone.deviceHis", "", property, Encoding.UTF8.GetBytes(message.ToString())); //生产消息
|
|
|
}
|
|
|
- changLeWaterQualityHisId = drMeterHis["HistoryRecordID"].ToString();
|
|
|
+
|
|
|
+ sqlMeter = "DELETE FROM [历史记录_zhsw] WHERE HistoryRecordID = " + drMeterHis["HistoryRecordID"].ToString();
|
|
|
+ dbHelper.ExecuteNonQuery(sqlMeter);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -198,7 +199,6 @@ namespace TimedUpload.QuartzJobs
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- UpdateAppConfig("ChangLeWaterQualityHisId", changLeWaterQualityHisId);
|
|
|
log.Info("水质设备历史记录同步任务执行结束.................\r\n");
|
|
|
}
|
|
|
|