wanghan hai 6 meses
pai
achega
bf3377b3ea
Modificáronse 2 ficheiros con 3 adicións e 36 borrados
  1. 2 35
      TeamAAS-VM/Core/Management.cs
  2. 1 1
      TeamAAS-VM/Services/MesService.cs

+ 2 - 35
TeamAAS-VM/Core/Management.cs

@@ -2407,40 +2407,7 @@ namespace TeamAAS_VP.Core
                                         string torque = string.Join(",", torqueList);
                                         string pressure = string.Join(",", pressureList);
                                         string turn = string.Join(",", turnList);
-                                        //
-                                        //try
-                                        //{
-                                        //    DateTime dt = DateTime.Now;
-                                        //    string filename = ProductMainSN[i] + "_" + dt.ToString("yyyyMMddHHmmss");
-                                        //    var device = _configService.GetDeviceInfo();
-                                        //    (bool isSuc, string resp) = await _mesService.SendFtpFileAsync(ProductMainSN[i], filename);
-                                        //    if (isSuc)
-                                        //    {
-                                        //        LogHelper.WriteLogMes($"上传数据成功");
-                                        //        SendTaskMessage($"上传数据成功", MessageLevel.Debug);
-                                        //        string filePath = $"D:\\image\\Recored\\{dt.ToString("yyyy-MM")}\\{dt.ToString("MM-dd")}\\{currentProduct.Name}\\{ProductMainSN[i]}";
-                                        //        //复制csv
-                                        //        string source_csv = $"{stationConfig.SaveCsvPath}\\{dt.ToString("yyyy-MM")}\\{i}_{stationConfig.DataInfo.PROCESS_NAME}_{dt.ToString("yyyy-MM-dd")}.csv";
-                                        //        string target_csv = Path.Combine(filePath, Path.GetFileName(source_csv)); ;
-                                        //        File.Copy(source_csv, target_csv, true);
-                                        //        //复制log
-                                        //        string source_log = $"..\\Log\\LogInfo\\{dt.ToString("yyyy-MM")}\\{dt.ToString("yyyy-MM-dd")}.txt";
-                                        //        string target_log = Path.Combine(filePath, Path.GetFileName(source_log));
-                                        //        File.Copy(source_log, target_log, true);
-                                        //        CompressionImage(filePath, filename, device.FixtureId);
-                                        //    }
-                                        //    else
-                                        //    {
-                                        //        LogHelper.WriteLogMes($"上传数据失败");
-                                        //        SendTaskMessage($"上传数据失败", MessageLevel.Error);
-                                        //    }
-                                        //}
-                                        //catch (Exception ex)
-                                        //{
-                                        //    SendTaskMessage($"上传数据时出错:{ex.Message}", MessageLevel.Error);
-                                        //    LogHelper.WriteLogError($"上传数据时出错", ex);
-                                        //}
-                                        //
+                                        
                                         //这里现在上传的结果都是锁付站的,如果存在其他附属站的数据需要上传时,将不适用,要根据实际情况进行调整
                                         (bool isSuccess, string response) = await _mesService.SubmitGetAsync(ProductMainSN[i], "", torque, pressure, turn, resultIndex == 1 ? true : false, _LastMesCheckTime[i], serverTimeResult.Now);
                                         if (isSuccess)
@@ -2555,7 +2522,7 @@ namespace TeamAAS_VP.Core
                                                     try
                                                     {
                                                         DateTime dt = DateTime.Now;
-                                                        string filename = ProductMainSN[i] + "_" + dt.ToString("yyyyMMddHHmmss");
+                                                        string filename = $"{currentProduct.Name}_{dt.ToString("yyyyMMdd")}_{ProductMainSN[i]}_{dt.ToString("yyyyMMddHHmmss")}";
                                                         var device = _configService.GetDeviceInfo();
                                                         (bool isSuc, string resp) = await _mesService.SendFtpFileAsync(ProductMainSN[i], filename);
                                                         if (isSuc)

+ 1 - 1
TeamAAS-VM/Services/MesService.cs

@@ -745,7 +745,7 @@ namespace TeamAAS_VP.Services
                         LogHelper.WriteLogMes($"【上传LogData的HTTP接收】{text}");
                         SendTaskMessage($"【上传LogData的HTTP接收】{text}", MessageLevel.Info);
                         // "SFC_OK" 代表和 MES 连接成功
-                        if (text.Contains("SFC_OK"))
+                        if (text.Contains("\"Code\":1"))
                         {
                             return (true, text);
                         }