844184169 6 months ago
parent
commit
6df03e8232
2 changed files with 5 additions and 17 deletions
  1. 2 14
      TeamAAS-VM/Core/Management.cs
  2. 3 3
      TeamAAS-VM/Services/MesService.cs

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

@@ -81,9 +81,6 @@ namespace TeamAAS_VP.Core
         List<LockResult> lockResultsAll = new List<LockResult>();//一个产品的总结果
         string productSn = "";//产品sn
         DateTime StartScrewTime = DateTime.Now;//开始锁附的时间
-        //List<string> torqueList = new List<string>();//扭力数据集合
-        //List<string> pressureList = new List<string>();//压力数据集合
-        //List<string> turnList = new List<string>();//圈数数据集合
         #endregion
 
         #region 属性
@@ -1879,15 +1876,10 @@ namespace TeamAAS_VP.Core
                             }
                             if (lockResult.Number == 1)
                             {
-                                //torqueList.Clear();
-                                //pressureList.Clear();
-                                //turnList.Clear();
                                 dataToMes.Clear();
                                 lockResultsAll.Clear();
                             }
-                            //torqueList.Add($"{lockResult.Number}-{lockResult.LockTorque:F2}");
-                            //pressureList.Add($"{lockResult.Number}-{lockResult.Pressure:F2}");
-                            //turnList.Add($"{lockResult.Number}-{lockResult.LockTurns:F2}");
+
                             //基于当前的锁付结果和产品的规格参数判断锁付结果是否合格
                             var stationConfig = _configService.GetDeviceInfo(0);
                             bool torqueRes = false, turnRes = false, pressureRes = false;
@@ -1912,7 +1904,7 @@ namespace TeamAAS_VP.Core
                             dataToMes.Add($"Turn{lockResult.Number}", $"{lockResult.LockTurns:F2}");
                             dataToMes.Add($"Pressure{lockResult.Number}", $"{lockResult.Pressure:F2}");
                             dataToMes.Add($"LastResult{lockResult.Number}", $"{lastRes}");
-                            SendTaskMessage($"螺丝序号:{lockResult.Number},扭力:{lockResult.LockTorque},压力:{lockResult.Pressure},圈数:{lockResult.LockTurns}", MessageLevel.Info);
+                            SendTaskMessage($"螺丝序号:{lockResult.Number},扭力:{lockResult.LockTorque},压力:{lockResult.Pressure},圈数:{lockResult.LockTurns},结果:{lastRes}", MessageLevel.Info);
 
                             lockResultsAll.Add(lockResult);
                             App.Current.Dispatcher.Invoke(() =>
@@ -2475,10 +2467,6 @@ namespace TeamAAS_VP.Core
                                         LogHelper.WriteLogMes($"【mes开始ADD】");
                                         SendTaskMessage($"mes开始ADD", MessageLevel.Info);
                                         //上传mes
-                                        //string torque = string.Join(",", torqueList);
-                                        //string pressure = string.Join(",", pressureList);
-                                        //string turn = string.Join(",", turnList);
-
                                         //这里现在上传的结果都是锁付站的,如果存在其他附属站的数据需要上传时,将不适用,要根据实际情况进行调整
                                         (bool isSuccess, string response) = await _mesService.SubmitGetAsync(ProductMainSN[i], "", dataToMes, resultIndex == 1 ? true : false, _LastMesCheckTime[i], serverTimeResult.Now);
                                         if (isSuccess)

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

@@ -653,7 +653,7 @@ namespace TeamAAS_VP.Services
         {
             using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(timeoutInSeconds)))
             {
-                return await SubmitGetAsync(deviceNo,sn, comp, torque, pressure, turn, isSuccess, start_time, stop_time, cts.Token);
+                return await SubmitGetAsync(deviceNo, sn, comp, torque, pressure, turn, isSuccess, start_time, stop_time, cts.Token);
             }
         }
 
@@ -735,7 +735,7 @@ namespace TeamAAS_VP.Services
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
         /// <exception cref="ObjectDisposedException"></exception>
-        public async Task<(bool IsSuccess, string Response)> SendFtpFileAsync(string sn,string name,CancellationToken cancellationToken = default)
+        public async Task<(bool IsSuccess, string Response)> SendFtpFileAsync(string sn, string name, CancellationToken cancellationToken = default)
         {
             // 如果已经释放,则抛出异常,防止在已释放资源上继续操作。
             if (_disposed) throw new ObjectDisposedException(nameof(MesService));
@@ -751,7 +751,7 @@ namespace TeamAAS_VP.Services
             }
 
             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);
             (bool IsSuccess, string Response) result = (false, string.Empty);