diff --git a/ProductionSystem/Forms/HomeFormInfo.cs b/ProductionSystem/Forms/HomeFormInfo.cs
index 050916c..1f64cdb 100644
--- a/ProductionSystem/Forms/HomeFormInfo.cs
+++ b/ProductionSystem/Forms/HomeFormInfo.cs
@@ -2476,8 +2476,8 @@ namespace ProductionSystem.Forms
//Program.GastankPressData[i] = Convert.ToSingle(random.NextDouble() * 60 + 600);
//Program.XVibrateData[i] = Convert.ToSingle(random.NextDouble() * 60 + 800);
//Program.YVibrateData[i] = Convert.ToSingle(random.NextDouble() * 60 + 1000);
- var product = result2Service.QueryLatestStep(Program.ProductType, GetCode());
- var electricity = product.Electricity;
+ var sbElecttricity = result2Service.QueryLatestStep(Program.ProductType, GetCode(),GetStep());
+ var electricity = sbElecttricity.Electricity;
Program.CurrentData[i] = float.Parse(electricity);
Program.Times[i] = DateTime.Now.AddSeconds(i - 1000);
diff --git a/ProductionSystem_Service/TResult2Service.cs b/ProductionSystem_Service/TResult2Service.cs
index 0105337..43b9c66 100644
--- a/ProductionSystem_Service/TResult2Service.cs
+++ b/ProductionSystem_Service/TResult2Service.cs
@@ -37,9 +37,10 @@ namespace ProductionSystem_Service
///
///
///
- public T_Result2 QueryLatestStep(string productType,string productBarcode)
+ public T_Result2 QueryLatestStep(string productType,string productBarcode,string step)
{
- return db.Queryable().Where(m => m.ProductType == productType && m.ProductBarcode.Contains(productBarcode) && m.Electricity != "0" && m.Electricity != "0,000").First();
+ return db.Queryable().Where(m => m.ProductType == productType && m.ProductBarcode.Contains(productBarcode)
+ && m.Step == step && m.Electricity != "0" && m.Electricity != "0,000").First();
}
///