From 5200b8b5a92b707ae7f115c7fd07cb7afc109980 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期四, 03 七月 2025 15:44:03 +0800 Subject: [PATCH] 更新配置和扩展功能,优化代码结构 修改 `http.js` 中的 `axios.defaults.baseURL` 配置,调整开发环境 URL。 - 在 `Dt_BillGroupStock_Hty.jsx` 和 `Dt_OutTime.jsx` 中添加作者信息和文档链接,增强组件扩展功能。 - 新增 `tables.js` 中的路由配置,包含 `Dt_BillGroupStock_Hty` 的路径。 - 在 `Dt_BillGroupStock_Hty.vue` 和 `Dt_OutTime.vue` 中定义表格列、编辑和搜索表单字段。 - 新增 `IStockInfoHtyRepository.cs` 和 `IStockInfoHtyService.cs` 接口定义。 - 在 `StockInfoHtyRepository.cs` 和 `StockInfoHtyService.cs` 中实现分页查询和批量删除功能。 - 更新 `appsettings.json` 中的数据库连接字符串,修改数据库名称。 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs | 61 ++++++++++++++++-------------- 1 files changed, 32 insertions(+), 29 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs index 6b3e1fa..13fd3cc 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs @@ -157,9 +157,9 @@ } else { - //return true; + return true; object? obj = null; - for (int i = 0; i < 3; i++) + for (int i = 0; i < 5; i++) { T readValue = Read<T>(address); stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, readValue, value)); @@ -169,7 +169,7 @@ stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAndReadCheckSuccess, address, value, readValue)); return true; } - else if (i < 2) + else if (i < 4) { Write(address, value); } @@ -605,39 +605,42 @@ { OperateResult operateResult = plc.WriteCustomer(address, value); stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteData, address, JsonConvert.SerializeObject(value))); + #region if (operateResult.IsSuccess) { - object? obj = null; - for (int i = 0; i < 2; i++) - { - T readValue = ReadCustomer<T>(address); - stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, address, JsonConvert.SerializeObject(readValue))); - obj = readValue; - PropertyInfo[] propertyInfos = typeof(T).GetProperties(); - for (int j = 0; j < propertyInfos.Length; j++) - { - object? writeValueItem = propertyInfos[j].GetValue(value); - object? readValueItem = propertyInfos[j].GetValue(readValue); - if (writeValueItem.Equals(readValueItem)) - { - stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAndReadCheckSuccess, address, JsonConvert.SerializeObject(value), JsonConvert.SerializeObject(readValue))); - } - else - { - break; - } - if (j == propertyInfos.Length - 1) - return true; - } - plc.WriteCustomer(address, value); - } - stringBuilder.AppendLine(string.Format(CommunicationExceptionMessage.WriteAndReadCheckFaild, address, JsonConvert.SerializeObject(value), JsonConvert.SerializeObject(obj))); - throw new CommunicationException(string.Format(CommunicationExceptionMessage.WriteAndReadCheckFaild, address, JsonConvert.SerializeObject(value), JsonConvert.SerializeObject(obj)), CommunicationErrorType.WriteFailed); + //object? obj = null; + //for (int i = 0; i < 5; i++) + //{ + // T readValue = ReadCustomer<T>(address); + // stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, address, JsonConvert.SerializeObject(readValue))); + // obj = readValue; + // PropertyInfo[] propertyInfos = typeof(T).GetProperties(); + // for (int j = 0; j < propertyInfos.Length; j++) + // { + // object? writeValueItem = propertyInfos[j].GetValue(value); + // object? readValueItem = propertyInfos[j].GetValue(readValue); + // if (writeValueItem.Equals(readValueItem)) + // { + // stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAndReadCheckSuccess, address, JsonConvert.SerializeObject(value), JsonConvert.SerializeObject(readValue))); + // } + // else + // { + // break; + // } + // if (j == propertyInfos.Length - 1) + // return true; + // } + // plc.WriteCustomer(address, value); + //} + //stringBuilder.AppendLine(string.Format(CommunicationExceptionMessage.WriteAndReadCheckFaild, address, JsonConvert.SerializeObject(value), JsonConvert.SerializeObject(obj))); + //throw new CommunicationException(string.Format(CommunicationExceptionMessage.WriteAndReadCheckFaild, address, JsonConvert.SerializeObject(value), JsonConvert.SerializeObject(obj)), CommunicationErrorType.WriteFailed); + return true; } else { throw new CommunicationException(string.Format(CommunicationExceptionMessage.WriteFailedException, typeof(T).Name, address, JsonConvert.SerializeObject(value), operateResult.Message), CommunicationErrorType.WriteFailed); } + #endregion } catch (Exception ex) { -- Gitblit v1.9.3