huangxiaoqiang
2 天以前 1842a682f843465dd488f6c8b9cc7635d0ad3b17
优化异常处理和日志记录功能

在 `CommonConveyorLine_After.cs` 中,更新了异常消息以提供更具体的信息。在 `CommonStackerCraneJob.cs` 中,调整了设备类型以确保代码的正确性。此外,在 `CellStateService.cs` 中添加了日志记录功能,增强了调试和监控能力,同时改进了日志信息的结构化,提升了代码的可读性和可维护性。
已修改3个文件
9 ■■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine_After.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/CellState/CellStateService.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine_After.cs
@@ -224,7 +224,7 @@
            if (devicePro == null)
            {
                throw new Exception("未找到协议信息");
                throw new Exception($"{deviceChildCode}未找到协议信息");
            }
            else
            {
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -178,7 +178,7 @@
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
                        if (device != null)
                        {
                            CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
                            CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(1815), stationinfo.stationChildCode);
                            Thread.Sleep(100);
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/CellState/CellStateService.cs
@@ -92,6 +92,8 @@
            }
            var wmsIpAddress = wmsBase + ipAddress;
            LogFactory.GetLog("整盘电芯属性获取").Info(true, $"请求数据:{JsonConvert.SerializeObject(inputJson)}");
            var result = HttpsClient.PostAsync(wmsIpAddress, inputJson).Result;
            var respone = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result.ToString());
@@ -105,8 +107,9 @@
                MoMErrorMsg.DeleteMoMErrorMsg(0, input.TrayBarcode);
            }
            LogFactory.GetLog("整盘电芯属性获取").Info(true,$"返回参数:{result}" );
            LogFactory.GetLog("整盘电芯属性获取").Info(true, $"\r\r--------------------------------------");
            LogFactory.GetLog("整盘电芯属性获取").Info(true, result);
            content.OK(data: result);
        }
        catch (Exception err)