|
@@ -89,13 +89,13 @@ namespace TimedUpload.QuartzJobs
|
|
|
|
|
|
for (int k = 0; k < dtDevice.Rows.Count; k++)
|
|
|
{
|
|
|
- string table = "历史记录_" + dtDevice.Rows[k]["devId"].ToString().PadLeft(6,'0') + "_ " + DateTime.Now.Year.ToString();
|
|
|
+ string table = "历史记录_" + dtDevice.Rows[k]["devId"].ToString().PadLeft(6,'0') + "_" + DateTime.Now.Year.ToString();
|
|
|
String sql = @"SELECT TOP 2000 [id]
|
|
|
,[设备ID],[记录时间],[采集时间]
|
|
|
,[设备状态],[通讯状态],[数据来源]
|
|
|
,[表1A相电压],[表1B相电压],[表1C相电压]
|
|
|
,[表1A相电流],[表1B相电流],[表1C相电流]
|
|
|
- ,[表1电能]
|
|
|
+ ,[表1电能],[表2电能]
|
|
|
,[表2A相电压],[表2B相电压],[表2C相电压]
|
|
|
,[表2A相电流],[表2B相电流],[表2C相电流]
|
|
|
,[表3A相电压],[表3B相电压],[表3C相电压]
|
|
@@ -109,7 +109,7 @@ namespace TimedUpload.QuartzJobs
|
|
|
,[出水设定压力],[出水端实际压力]
|
|
|
,[进水设定压力],[进水端实际压力]
|
|
|
,[瞬时流量],[累计流量]
|
|
|
- FROM "+ table + " where 采集时间 > '" + Convert.ToDateTime(dtDevice.Rows[k]["uploadTime"]).ToString("yyyy-MM-dd HH:mm:ss") + "' ORDER BY 采集时间";
|
|
|
+ FROM " + table + " where 采集时间 > '" + Convert.ToDateTime(dtDevice.Rows[k]["uploadTime"]).ToString("yyyy-MM-dd HH:mm:ss") + "' ORDER BY 采集时间";
|
|
|
DataTable dtHistory = dbHelper.Fill(sql);
|
|
|
for (int i = 0; i < dtHistory.Rows.Count; i++)
|
|
|
{
|
|
@@ -134,7 +134,7 @@ namespace TimedUpload.QuartzJobs
|
|
|
string CurrentA = dr["表1A相电流"].ToString();
|
|
|
string CurrentB = dr["表1B相电流"].ToString();
|
|
|
string CurrentC = dr["表1C相电流"].ToString();
|
|
|
- string Consumption = dr["表1电能"].ToString();
|
|
|
+ string Consumption = (Convert.ToInt32(dr["表1电能"]) + Convert.ToInt32(dr["表2电能"]) + Convert.ToInt32(dr["表3电能"])).ToString();
|
|
|
string LackWater = "0";//dr["缺水报警"].ToString();
|
|
|
string OverPressure = "0";//dr["超压报警"].ToString();
|
|
|
string HouseInlet = "0";//dr["进水报警"].ToString(); // 进水报警0为正常,1为进水。
|