|
@@ -3265,18 +3265,22 @@ namespace TeamAAS_VP.Core
|
|
|
//读取产品结果
|
|
//读取产品结果
|
|
|
Int16 resultIndex = plc.ReadNode<Int16>(string.Format(addressConfig.In_Result.Address, i));
|
|
Int16 resultIndex = plc.ReadNode<Int16>(string.Format(addressConfig.In_Result.Address, i));
|
|
|
|
|
|
|
|
- //目前只记录当前站
|
|
|
|
|
- if (i == 0)
|
|
|
|
|
- await _systemDatabaseService.RecordProductionAsync(new ProductionRecord()
|
|
|
|
|
- {
|
|
|
|
|
- ProductName = currentProduct.Name,
|
|
|
|
|
- ProductCode = ProductMainSN[i],
|
|
|
|
|
- DeviceId = i,
|
|
|
|
|
- DeviceName = "",
|
|
|
|
|
- Category = resultIndex == 1 ? "OK" : "NG",
|
|
|
|
|
- Quantity = 1,
|
|
|
|
|
- Remark = $"TotalSeconds:{serverTimeResult.Now.Subtract(_LastMesCheckTime[i]).TotalSeconds.ToString("F2")}",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (stationConfig.EnableMES)
|
|
|
|
|
+ {
|
|
|
|
|
+ //目前只记录当前站
|
|
|
|
|
+ if (i == 0)
|
|
|
|
|
+ await _systemDatabaseService.RecordProductionAsync(new ProductionRecord()
|
|
|
|
|
+ {
|
|
|
|
|
+ ProductName = currentProduct.Name,
|
|
|
|
|
+ ProductCode = ProductMainSN[i],
|
|
|
|
|
+ DeviceId = i,
|
|
|
|
|
+ DeviceName = "",
|
|
|
|
|
+ Category = resultIndex == 1 ? "OK" : "NG",
|
|
|
|
|
+ Quantity = 1,
|
|
|
|
|
+ Remark = $"TotalSeconds:{serverTimeResult.Now.Subtract(_LastMesCheckTime[i]).TotalSeconds.ToString("F2")}",
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
LogHelper.WriteLogMes($"【mes开始ADD】");
|
|
LogHelper.WriteLogMes($"【mes开始ADD】");
|
|
|
SendTaskMessage($"mes开始ADD", MessageLevel.Info);
|
|
SendTaskMessage($"mes开始ADD", MessageLevel.Info);
|