Bläddra i källkod

优化上传数据

zly 5 månader sedan
förälder
incheckning
386bf32dbe

+ 1 - 1
TeamAAS-VM/Core/Management.cs

@@ -3270,7 +3270,7 @@ namespace TeamAAS_VP.Core
                                                         var device = _configService.GetDeviceInfo(i);
                                                         var systemConfig = _configService.GetSystemConfiguration();
                                                         var pressureSensorConfig = systemConfig.PressureSensorConfig.FirstOrDefault();
-                                                        (bool isSuc, string resp) = await _mesService.SendFtpFileAsync(ProductMainSN[i], filename);
+                                                        (bool isSuc, string resp) = await _mesService.SendFtpFileAsync(ProductMainSN[i], filename, device);
                                                         if (isSuc)
                                                         {
                                                             LogHelper.WriteLogMes($"上传数据成功");

+ 2 - 1
TeamAAS-VM/Interfaces/IMesService.cs

@@ -2,6 +2,7 @@ using System;
 using System.Collections.Generic;
 using System.Threading;
 using System.Threading.Tasks;
+using TeamAAS_VP.Models;
 
 namespace TeamAAS_VP.Interfaces
 {
@@ -128,6 +129,6 @@ namespace TeamAAS_VP.Interfaces
         /// <param name="name"></param>
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
-        Task<(bool IsSuccess, string Response)> SendFtpFileAsync(string sn, string name, CancellationToken cancellationToken = default);
+        Task<(bool IsSuccess, string Response)> SendFtpFileAsync(string sn, string name,DeviceInfo device, CancellationToken cancellationToken = default);
     }
 }

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

@@ -10,6 +10,7 @@ using System.Threading.Tasks;
 using TeamAAS_VP.Enums;
 using TeamAAS_VP.Events;
 using TeamAAS_VP.Interfaces;
+using TeamAAS_VP.Models;
 
 namespace TeamAAS_VP.Services
 {
@@ -637,12 +638,12 @@ 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,DeviceInfo device, CancellationToken cancellationToken = default)
         {
             // 如果已经释放,则抛出异常,防止在已释放资源上继续操作。
             if (_disposed) throw new ObjectDisposedException(nameof(MesService));
 
-            var device = _configService.GetDeviceInfo();
+            //var device = _configService.GetDeviceInfo();
             if (device == null || !device.EnableMES)
             {
                 return (true, "MES功能未启用!");