using LogLibrary.Log; using Masuit.Tools; using WIDESEA_Common; using WIDESEA_DTO; using WIDESEA_IStoragIntegrationServices; namespace WIDESEA_StoragIntegrationServices; public class CellStateService : ICellStateService { private readonly LogFactory LogFactory = new LogFactory(); /// /// 单电芯属性获取 /// /// 电芯数据 /// public async Task GetCellStateAsync(CellStateDto input) { try { input.SessionId = Guid.NewGuid().ToString(); input.Software = "陈化机"; input.EquipmentCode = "P1K10040"; input.EmployeeNo = "T00001"; input.RequestTime = DateTime.UtcNow.ToString(); var inputJson = input.ToDictionary(); var x = await HttpsClient.PostAsync("https://localhost:7251/api/CellState/GetCellState", inputJson); LogFactory.GetLog("单电芯属性获取").Info(true, $"\r\r--------------------------------------"); LogFactory.GetLog("单电芯属性获取").Info(true, x); } catch (Exception err) { Console.WriteLine(err.Message.ToString()); LogFactory.GetLog("单电芯属性获取").Error(true, $"\r\r--------------------------------------"); LogFactory.GetLog("单电芯属性获取").Error(true, err.StackTrace); } return Task.FromResult(null); } /// /// 整盘电芯属性获取 /// /// 电芯数据 /// public async Task GetTrayCellStatusAsync(TrayCellsStatusDto input) { try { input.SessionId = Guid.NewGuid().ToString(); input.Software = "陈化机"; input.EquipmentCode = "P1K10040"; input.EmployeeNo = "T00001"; input.RequestTime = DateTime.UtcNow.ToString(); var inputJson = input.ToDictionary(); var x = await HttpsClient.PostAsync("https://localhost:7251/api/CellState/GetCellState", inputJson); LogFactory.GetLog("整盘电芯属性获取").Info(true, $"\r\r--------------------------------------"); LogFactory.GetLog("整盘电芯属性获取").Info(true, x); } catch (Exception err) { Console.WriteLine(err.Message.ToString()); LogFactory.GetLog("整盘电芯属性获取").Error(true, $"\r\r--------------------------------------"); LogFactory.GetLog("整盘电芯属性获取").Error(true, err.StackTrace); } return Task.FromResult(null); } }