wanghan 6 meses atrás
pai
commit
7c183cddd0
2 arquivos alterados com 35 adições e 1 exclusões
  1. 34 0
      TeamAAS-VM/Core/Management.cs
  2. 1 1
      TeamAAS-VM/Services/MesService.cs

+ 34 - 0
TeamAAS-VM/Core/Management.cs

@@ -2407,6 +2407,40 @@ 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)

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

@@ -729,7 +729,7 @@ namespace TeamAAS_VP.Services
                 return (false, "Missing MES station LogUrl");
             }
 
-            string url = $"{device.LogUrl}?db=mysql&ApiKey={device.ApiKey}&jsondata={{\"SN\":\"{sn}\",\"LINE\":\"{device.Line}\",\"STATION\":\"{device.Station}\",\"TESTRESULT\":\"PASS\",\"FIXTUREID\":\"{device.FixtureId}\",\"TESTDATETIME\":\"{DateTime.Now.ToString()}\",\"LOGFILENAME\":\"{name}.zip\"}}";
+            string url = $"{device.LogUrl}?db=mysql&ApiKey={device.ApiKey}&jsondata={{\"SN\":\"{sn}\",\"LINE\":\"{device.Line}\",\"STATION\":\"{device.Station}\",\"TESTRESULT\":\"PASS\",\"FIXTUREID\":\"{device.FixtureId}\",\"TESTDATETIME\":\"{DateTime.Now.ToString()}\",\"LOGFILENAME\":\"{name}.zip\",\"STATIONTYPE\":\"AE\"}}";
            
             LogHelper.WriteLogMes($"¡¾ÉÏ´«LogDataµÄURL¡¿{url}");
             SendTaskMessage($"¡¾ÉÏ´«LogDataµÄURL¡¿{url}", MessageLevel.Info);