jochu_liu 1 vuosi sitten
vanhempi
commit
79480bf9c9

+ 4 - 4
TimedUpload/QuartzJobs/ChangleSecondPumpDataJob.cs

@@ -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为进水。

+ 1 - 1
TimedUpload/QuartzJobs/ChangleWorkmanshipDataUploadJob.cs

@@ -93,7 +93,7 @@ namespace TimedUpload.QuartzJobs
 
 
                 string factorySql = @"SELECT top 1 1 rid,
-                    1 Type,CONVERT(varchar(100),采集时间,111) 日期,CONVERT(varchar(100),采集时间,108) 时间  
+                    1 Type,CONVERT(varchar(100),采集时间,111) 日期,CONVERT(varchar(100),采集时间,108) 时间 ,
                     CONVERT(varchar(100),采集时间,111) + ' ' + CONVERT(varchar(100),采集时间,108) ReadTime,CONVERT(varchar(100),采集时间,111) + ' ' + CONVERT(varchar(5),采集时间,108) 更新时间,
                     " + ph + " PH," + chlorine + " 余氯, " + turbidity + @" 浊度,13.9 温度,'南流泉泵站' 编号,'second001' 编码,'second001' DeviceCode,0 水箱液位,0 爆管报警,'' 电源故障,
                     '' 真空报警,瞬时流量,'' 硬件超压,'' 系统电压,0 缺水报警,0 网络状态,0 超压报警,'' 软件超压,0 进水报警, 累计流量 净累计流量,'' 正累计流量,'' 负累计流量,