KWD 3 months ago
parent
commit
60d902831f
1 changed files with 16 additions and 15 deletions
  1. 16 15
      TeamAAS-VM/Core/Management.cs

+ 16 - 15
TeamAAS-VM/Core/Management.cs

@@ -2706,7 +2706,7 @@ namespace TeamAAS_VP.Core
                                 {
                                     return;
                                 }
-                                if (i==1)
+                                if (i == 1)
                                 {
                                     SendTaskMessage($"收到人工站请求不处理", MessageLevel.Debug);
                                     return;
@@ -2914,20 +2914,21 @@ namespace TeamAAS_VP.Core
                                         CTtime = ct;
                                     }
 
-
-
-                                    //目前只记录当前站
-                                    if (i == 0)
-                                        await _systemDatabaseService.RecordProductionAsync(new ProductionRecord()
-                                        {
-                                            ProductName = currentProduct.Name,
-                                            ProductCode = ProductMainSN,
-                                            DeviceId = i,
-                                            DeviceName = "",
-                                            Category = resultIndex == 1 ? "OK" : "NG",
-                                            Quantity = 1,
-                                            Remark = $"TotalSeconds:{DateTime.UtcNow.Subtract(_LastMesCheckTime[i]).TotalSeconds.ToString("F2")}",
-                                        });
+                                    if (stationConfig.EnableMES)
+                                    {
+                                        //目前只记录当前站
+                                        if (i == 0)
+                                            await _systemDatabaseService.RecordProductionAsync(new ProductionRecord()
+                                            {
+                                                ProductName = currentProduct.Name,
+                                                ProductCode = ProductMainSN,
+                                                DeviceId = i,
+                                                DeviceName = "",
+                                                Category = resultIndex == 1 ? "OK" : "NG",
+                                                Quantity = 1,
+                                                Remark = $"TotalSeconds:{DateTime.UtcNow.Subtract(_LastMesCheckTime[i]).TotalSeconds.ToString("F2")}",
+                                            });
+                                    }
 
                                     LogHelper.WriteLogMes($"【mes开始ADD】");
                                     SendTaskMessage($"mes开始ADD", MessageLevel.Info);