Ver código fonte

水厂添加无数据验证

jochu_liu 2 anos atrás
pai
commit
9f76ef5ceb

+ 4 - 0
TimedUpload/QuartzJobs/WaterFactoryDataUploadJob.cs

@@ -149,6 +149,10 @@ namespace TimedUpload.QuartzJobs
                             }
                             string meterDataSql = "select " + queryCol + " from " + tableName + " where 更新时间 = '" + id + "'";
                             DataTable data = dbHelper.Fill(meterDataSql);
+                            if (data == null || data.Rows.Count == 0)
+                            {
+                                continue;
+                            }
                             foreach (string col in queryColArr)
                             {
                                 meterMap[col] = data.Rows[0][col];