|
@@ -652,10 +652,29 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
RunTimeStr = $"{points.Count} S",
|
|
|
};
|
|
|
|
|
|
- if (rfidInfo.Barcode != null && rfidInfo.Barcode != "" && product.ProcessDatas.Count > 0 &&
|
|
|
+ Env.DAL.Insert(product);
|
|
|
+ foreach (var item in points)
|
|
|
+ {
|
|
|
+ item.ReportId = product.ID;
|
|
|
+ }
|
|
|
+ Env.DAL.Insert(points);
|
|
|
+
|
|
|
+ Log.Info($"RFID{uid},产品条码{rfidInfo.Barcode},收到{product?.ProcessDatas?.Count}");
|
|
|
+ TestFinish?.Invoke(this, new TestFinishEventArgs() { Product = product });
|
|
|
+
|
|
|
+ if (rfidInfo.Barcode != null && rfidInfo.Barcode != "" && product.ProcessDatas.Count > 0 && CustomerEnv.MESAPITokenExpired > DateTime.Now &&
|
|
|
CustomerEnv.MESServerConnectStatus && CustomerEnv.MESAPIToken != null && CustomerEnv.CustomerConfig.SetPower.MESUpload)
|
|
|
{
|
|
|
- var result = CustomerEnv.MESUploadProductData(product);
|
|
|
+ MESResultMsg result;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ result = CustomerEnv.MESUploadProductData(product);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+
|
|
|
+ throw;
|
|
|
+ }
|
|
|
if (result.IsError)
|
|
|
{
|
|
|
Log.Info($"产品{product.Barcode}过程数据上传MES失败,报错信息:{result.Message}");
|
|
@@ -666,16 +685,6 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
Log.Info($"产品{product.Barcode}过程数据上传成功");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- Env.DAL.Insert(product);
|
|
|
- foreach (var item in points)
|
|
|
- {
|
|
|
- item.ReportId = product.ID;
|
|
|
- }
|
|
|
- Env.DAL.Insert(points);
|
|
|
-
|
|
|
- Log.Info($"RFID{uid},产品条码{rfidInfo.Barcode},收到{product?.ProcessDatas?.Count}");
|
|
|
- TestFinish?.Invoke(this, new TestFinishEventArgs() { Product = product });
|
|
|
}
|
|
|
}
|
|
|
else
|