From 4e3ade94e3ffb7710e5a40c668d46745c98821b8 Mon Sep 17 00:00:00 2001 From: wanshenmean <cathay_xy@163.com> Date: 星期一, 28 十月 2024 13:23:02 +0800 Subject: [PATCH] wcs基础代码 --- Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/CellState/CellStateService.cs | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/CellState/CellStateService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/CellState/CellStateService.cs index caeb2d5..1e3aa68 100644 --- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/CellState/CellStateService.cs +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/CellState/CellStateService.cs @@ -1,4 +1,5 @@ -锘縰sing Masuit.Tools; +锘縰sing LogLibrary.Log; +using Masuit.Tools; using WIDESEA_Common; using WIDESEA_DTO; using WIDESEA_IStoragIntegrationServices; @@ -7,6 +8,8 @@ public class CellStateService : ICellStateService { + private readonly LogFactory LogFactory = new LogFactory(); + /// <summary> /// 鍗曠數鑺睘鎬ц幏鍙� /// </summary> @@ -16,12 +19,21 @@ { 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<dynamic>(null); } @@ -35,12 +47,21 @@ { 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<dynamic>(null); } -- Gitblit v1.9.3