From 07042901ec38eada8c8936b8c1801d75341c08a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E7=9D=BFAMD7950X?= <774114798@qq.com> Date: Wed, 11 Dec 2024 11:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A3=85=E7=BD=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AFBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BoardCardInfoAppService.cs | 203 +++++++++++++++++- .../ProtectionDeviceAppService.cs | 47 ++-- .../BoardCardInfoDto/BoardCardInfoOutput.cs | 19 +- .../BoardCardInfoDto/EditBoardCardInput.cs | 14 +- .../ProtectionDeviceHistoryOutput.cs | 3 +- .../YunDa.ISAS.DataTransferObject.xml | 35 +++ .../ProtectionDevice.cshtml | 11 +- .../GeneralInformation/ProtectionDevice.js | 41 ++-- 8 files changed, 319 insertions(+), 54 deletions(-) diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/BoardCardDevice/BoardCardInfoAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/BoardCardDevice/BoardCardInfoAppService.cs index 378b041..57c05b2 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/BoardCardDevice/BoardCardInfoAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/BoardCardDevice/BoardCardInfoAppService.cs @@ -104,20 +104,29 @@ namespace YunDa.ISAS.Application.GeneralInformation } if (input.Id.HasValue) { - var entity = _boardCardInfoRepository.GetAll().FirstOrDefault(t => t.Id == input.Id); - if (entity!=null) - { - entity.LastModificationTime = DateTime.Now; - entity.LastModifierUserId = base.GetCurrentUser().Id; - ObjectMapper.Map(input, entity); - } + InsertBoadHistory(input); } else { var entity = ObjectMapper.Map(input); entity.CreatorUserId = base.GetCurrentUser().Id; entity.CreationTime = DateTime.Now; - await _boardCardInfoRepository.InsertAsync(entity); + entity = await _boardCardInfoRepository.InsertAsync(entity); + var boardHistory = new BoardCardHistory + { + ContentJson = JsonConvert.SerializeObject(entity), + CreationTime = DateTime.Now, + CreatorUserId = base.GetCurrentUser().Id, + Name = entity.BoardId, + RecodeDate = DateTime.Now, + BoardId = input.BoardId, + BoardCardInfoId = entity.Id, + ProtectionDeviceInfoId = input.ProtectionDeviceInfoId, + EventDescription ="新建板卡信息台账", + EventRecordType = EventRecordTypeEnum.Board, + SeqNo = 1 + }; + await _boardCardHistoryRepository.InsertAsync(boardHistory); } rst.Flag = true; } @@ -131,6 +140,184 @@ namespace YunDa.ISAS.Application.GeneralInformation return rst; } + + private void InsertBoadHistory(EditBoardCardInput input) + { + if (input.BoardId != null) + { + var entity = _boardCardInfoRepository.GetAllIncluding(t => t.ProtectionDeviceInfo) + .FirstOrDefault(t => t.Id == input.Id ); + + if (entity != null) + { + // 记录更新前的数据 + var originalContent = JsonConvert.SerializeObject(entity); + + // 初始化事件描述 + StringBuilder eventDescription = new StringBuilder("板卡信息更新: "); + + // 比较并更新字段 + if (entity.SeqNo != input.SeqNo) + { + eventDescription.Append("顺序号更新, "); + entity.SeqNo = input.SeqNo; + } + + if (entity.BoardType != input.BoardType) + { + eventDescription.Append($"板卡类型更新为'{input.BoardType}', "); + entity.BoardType = input.BoardType; + } + + if (entity.HardwareVersion != input.HardwareVersion) + { + eventDescription.Append($"硬件版本更新为'{input.HardwareVersion}', "); + entity.HardwareVersion = input.HardwareVersion; + } + + if (entity.InterfaceVersion != input.InterfaceVersion) + { + eventDescription.Append($"接口程序版本更新为'{input.InterfaceVersion}', "); + entity.InterfaceVersion = input.InterfaceVersion; + } + + if (entity.InterfaceChecksum != input.InterfaceChecksum) + { + eventDescription.Append($"接口程序校验码更新为'{input.InterfaceChecksum}', "); + entity.InterfaceChecksum = input.InterfaceChecksum; + } + + if (entity.ProtectionDatabaseVersion != input.ProtectionDatabaseVersion) + { + eventDescription.Append($"保护数据库版本更新为'{input.InterfaceDatabaseVersion}', "); + entity.ProtectionDatabaseVersion = input.ProtectionDatabaseVersion; + } + if (entity.InterfaceDatabaseVersion != input.InterfaceDatabaseVersion) + { + eventDescription.Append($"接口数据库版本更新为'{input.InterfaceDatabaseVersion}', "); + entity.InterfaceDatabaseVersion = input.InterfaceDatabaseVersion; + } + + + if (entity.ProtectionVersion != input.ProtectionVersion) + { + eventDescription.Append($"保护程序版本更新为'{input.ProtectionVersion}', "); + entity.ProtectionVersion = input.ProtectionVersion; + } + + if (entity.ProtectionChecksum != input.ProtectionChecksum) + { + eventDescription.Append($"保护程序校验码更新为'{input.ProtectionChecksum}', "); + entity.ProtectionChecksum = input.ProtectionChecksum; + } + + if (entity.BootVersion != input.BootVersion) + { + eventDescription.Append($"BOOT 版本更新为'{input.BootVersion}', "); + entity.BootVersion = input.BootVersion; + } + + if (entity.Iec61850Version != input.Iec61850Version) + { + eventDescription.Append($"IEC 61850 版本更新为'{input.Iec61850Version}', "); + entity.Iec61850Version = input.Iec61850Version; + } + + if (entity.FpgaVersion != input.FpgaVersion) + { + eventDescription.Append($"FPGA 版本更新为'{input.FpgaVersion}', "); + entity.FpgaVersion = input.FpgaVersion; + } + + if (entity.CidChecksum != input.CidChecksum) + { + eventDescription.Append($"CID 校验码更新为'{input.CidChecksum}', "); + entity.CidChecksum = input.CidChecksum; + } + + if (entity.CcdChecksum != input.CcdChecksum) + { + eventDescription.Append($"CCD 校验码更新为'{input.CcdChecksum}', "); + entity.CcdChecksum = input.CcdChecksum; + } + + if (entity.InstallationDate != input.InstallationDate) + { + eventDescription.Append($"安装时间更新为'{input.InstallationDate?.ToString()}', "); + entity.InstallationDate = input.InstallationDate; + } + + if (entity.ProductionDate != input.ProductionDate) + { + eventDescription.Append($"生产日期更新为'{input.ProductionDate?.ToString()}', "); + entity.ProductionDate = input.ProductionDate; + } + + if (entity.SerialNumber != input.SerialNumber) + { + eventDescription.Append($"出厂编号更新为'{input.SerialNumber}', "); + entity.SerialNumber = input.SerialNumber; + } + + if (entity.VerificationPerson != input.VerificationPerson) + { + eventDescription.Append($"检验人员更新为'{input.VerificationPerson}', "); + entity.VerificationPerson = input.VerificationPerson; + } + + if (entity.VerificationDate != input.VerificationDate) + { + eventDescription.Append($"检验日期更新为'{input.VerificationDate}', "); + entity.VerificationDate = input.VerificationDate; + } + + if (entity.VerificationRecords != input.VerificationRecords) + { + eventDescription.Append($"检验记录更新为'{input.VerificationRecords}', "); + entity.VerificationRecords = input.VerificationRecords; + } + if (entity.MaintenanceRecord != input.MaintenanceRecord) + { + eventDescription.Append($"维修记录更新为'{input.MaintenanceRecord}', "); + entity.MaintenanceRecord = input.MaintenanceRecord; + } + if (entity.IsActive != input.IsActive) + { + eventDescription.Append($"是否在用更新为'{input.IsActive}', "); + entity.IsActive = input.IsActive; + } + + // 检查是否有变化并记录历史 + var updatedContent = JsonConvert.SerializeObject(entity); + + // 如果数据发生了变化,则记录历史 + if (originalContent != updatedContent) + { + var history = new BoardCardHistory + { + ProtectionDeviceInfoId = entity.ProtectionDeviceInfoId, + CreationTime = DateTime.Now, + BoardId = entity.BoardId, + SeqNo = 1, + Name = entity.BoardId, + BoardCardInfoId = entity.Id, + RecodeDate = DateTime.Now, + ContentJson = originalContent, // 记录更新前的内容 + ContentNewJson = updatedContent, // 记录更新后的内容 + EventDescription = eventDescription.ToString().TrimEnd(','), + EventRecordType = EventRecordTypeEnum.Board, // 假设更新为事件类型 + Remark = "自动记录板卡信息更新", + IsSend = false // 如果不需要立即发送给主站 + }; + + // 保存历史记录 + _boardCardHistoryRepository.Insert(history); + } + } + } + + } + /// /// 扫码枪输入设备信息 /// diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs index fae1aea..b735fb2 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs @@ -200,37 +200,37 @@ namespace YunDa.ISAS.Application.GeneralInformation if (entity.Name != input.Name) { - eventDescription.Append($"设备名称更新为'{input.Name}', "); + eventDescription.Append($"设备名称更新:'{input.Name}', "); entity.Name = input.Name; } if (entity.Specification != input.Specification) { - eventDescription.Append($"规格更新为'{input.Specification}', "); + eventDescription.Append($"规格更新:'{input.Specification}', "); entity.Specification = input.Specification; } if (entity.DeviceAddress != input.DeviceAddress) { - eventDescription.Append($"设备地址更新为'{input.DeviceAddress}', "); + eventDescription.Append($"设备地址更新:'{input.DeviceAddress}', "); entity.DeviceAddress = input.DeviceAddress; } if (entity.BaselineBoardVersion != input.BaselineBoardVersion) { - eventDescription.Append($"基板版本更新为'{input.BaselineBoardVersion}', "); + eventDescription.Append($"基板版本更新:'{input.BaselineBoardVersion}', "); entity.BaselineBoardVersion = input.BaselineBoardVersion; } if (entity.HardwareVersion != input.HardwareVersion) { - eventDescription.Append($"硬件版本更新为'{input.HardwareVersion}', "); + eventDescription.Append($"硬件版本更新:'{input.HardwareVersion}', "); entity.HardwareVersion = input.HardwareVersion; } if (entity.IsActive != input.IsActive) { - eventDescription.Append($"启用状态更新为'{input.IsActive}', "); + eventDescription.Append($"启用状态更新:'{input.IsActive}', "); entity.IsActive = input.IsActive; } @@ -239,55 +239,55 @@ namespace YunDa.ISAS.Application.GeneralInformation { if (entity.EquipmentInfo.ManufacturerInfoId != input.ManufacturerInfoId) { - eventDescription.Append($"制造商ID更新为'{input.ManufacturerInfoId}', "); + eventDescription.Append($"制造商ID更新:'{input.ManufacturerInfoId}', "); entity.EquipmentInfo.ManufacturerInfoId = input.ManufacturerInfoId; } if (entity.EquipmentInfo.Name != input.Name) { - eventDescription.Append($"设备名称更新为'{input.Name}', "); + eventDescription.Append($"设备名称更新:'{input.Name}', "); entity.EquipmentInfo.Name = input.Name; } if (entity.EquipmentInfo.InstallationDate != input.InstallationDate) { - eventDescription.Append($"安装日期更新为'{input.InstallationDate}', "); + eventDescription.Append($"安装日期更新:'{input.InstallationDate}', "); entity.EquipmentInfo.InstallationDate = input.InstallationDate; } if (entity.EquipmentInfo.ProductionDate != input.ProductionDate) { - eventDescription.Append($"生产日期更新为'{input.ProductionDate}', "); + eventDescription.Append($"生产日期更新:'{input.ProductionDate}', "); entity.EquipmentInfo.ProductionDate = input.ProductionDate; } if (entity.EquipmentInfo.FactorySerialNumber != input.FactorySerialNumber) { - eventDescription.Append($"出厂序列号更新为'{input.FactorySerialNumber}', "); + eventDescription.Append($"出厂序列号更新:'{input.FactorySerialNumber}', "); entity.EquipmentInfo.FactorySerialNumber = input.FactorySerialNumber; } if (entity.EquipmentInfo.VerificationPerson != input.VerificationPerson) { - eventDescription.Append($"验证人更新为'{input.VerificationPerson}', "); + eventDescription.Append($"验证人更新:'{input.VerificationPerson}', "); entity.EquipmentInfo.VerificationPerson = input.VerificationPerson; } if (entity.EquipmentInfo.VerificationDate != input.VerificationDate) { - eventDescription.Append($"验证日期更新为'{input.VerificationDate}', "); + eventDescription.Append($"验证日期更新:'{input.VerificationDate}', "); entity.EquipmentInfo.VerificationDate = input.VerificationDate; } if (entity.EquipmentInfo.VerificationRecords != input.VerificationRecords) { - eventDescription.Append($"验证记录更新为'{input.VerificationRecords}', "); + eventDescription.Append($"验证记录更新:'{input.VerificationRecords}', "); entity.EquipmentInfo.VerificationRecords = input.VerificationRecords; } if (entity.EquipmentInfo.MaintenanceRecord != input.MaintenanceRecord) { - eventDescription.Append($"维护记录更新为'{input.MaintenanceRecord}', "); + eventDescription.Append($"维修记录更新:'{input.MaintenanceRecord}', "); entity.EquipmentInfo.MaintenanceRecord = input.MaintenanceRecord; } } @@ -305,7 +305,7 @@ namespace YunDa.ISAS.Application.GeneralInformation ContentJson = originalContent, // 记录更新前的内容 ContentNewJson = updatedContent, // 记录更新后的内容 EventDescription = eventDescription.ToString().TrimEnd(','), - EventRecordType = EventRecordTypeEnum.Device, // 假设更新为事件类型 + EventRecordType = EventRecordTypeEnum.Device, // 假设更新:事件类型 Remark = "自动记录设备信息更新", IsSend = false // 如果不需要立即发送给主站 }; @@ -393,6 +393,7 @@ namespace YunDa.ISAS.Application.GeneralInformation { eventDescription.AppendLine($"更改了设备的生产日期: {protectionDevice.EquipmentInfo.ProductionDate} -> {input.ProductionDate}"); } + deviceHistory.Name = protectionDevice.Name; deviceHistory.EventDescription = eventDescription.ToString(); deviceHistory.EventRecordType = EventRecordTypeEnum.Device; deviceHistory.Remark = input.Remark; @@ -582,7 +583,7 @@ namespace YunDa.ISAS.Application.GeneralInformation .Where(t => t.ProtectionDeviceInfoId == protectionDevice.Id) .OrderByDescending(t=>t.RecodeDate) ; - ObjectMapper.Map>(entitys); + historys = ObjectMapper.Map>(entitys); rst.Flag = true; rst.ResultData = historys; } @@ -1290,12 +1291,12 @@ namespace YunDa.ISAS.Application.GeneralInformation data.BaselineBoardVersion = "v1.100.001"; data.Specification = "110V 1A"; data.EquipmentInfo.FactorySerialNumber = "210"+ random.Next(100000, 1000000).ToString(); - // 设置出厂时间为当前日期的前一天(您可以根据需求调整时间) + // 设置出厂时间:当前日期的前一天(您可以根据需求调整时间) data.EquipmentInfo.ProductionDate = DateTime.Now.AddDays(-100); // 设置检验人员 - data.EquipmentInfo.VerificationPerson = "贺严玲"; // 请替换为实际人员名称 - // 设置检验日期为当前日期 - data.EquipmentInfo.VerificationDate = DateTime.Now.AddDays(0).ToString("yyyy-MM-dd"); // 日期格式为 "yyyy-MM-dd" + data.EquipmentInfo.VerificationPerson = "贺严玲"; // 请替换:实际人员名称 + // 设置检验日期:当前日期 + data.EquipmentInfo.VerificationDate = DateTime.Now.AddDays(0).ToString("yyyy-MM-dd"); // 日期格式: "yyyy-MM-dd" // 设置检验记录内容 data.EquipmentInfo.VerificationRecords = "检验装置外观及功能,均符合要求"; @@ -1334,10 +1335,10 @@ namespace YunDa.ISAS.Application.GeneralInformation EditProtectionQrCodeDeviceInfoInput deviceInfo = new EditProtectionQrCodeDeviceInfoInput { Name = data.Name, // 示例装置名称 - SerialNumber = "210" + random.Next(100000, 1000000).ToString(), // 出厂编号设为 "210" 开头 + 6 位随机数 + SerialNumber = "210" + random.Next(100000, 1000000).ToString(), // 出厂编号设: "210" 开头 + 6 位随机数 ProductionDate = new DateTime(2023, 5, 15), // 示例生产日期 VerificationPerson = "贺严玲", // 示例检验人员 - VerificationDate = DateTime.Now.AddDays(-100+i).ToString("yyyy-MM-dd"), // 检验日期设为当前日期 + VerificationDate = DateTime.Now.AddDays(-100+i).ToString("yyyy-MM-dd"), // 检验日期设:当前日期 VerificationRecords = "检验装置外观及功能,均符合要求" // 示例检验记录 }; using (var unitOfWork = _unitOfWorkManager.Begin()) diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/BoardCardInfoDto/BoardCardInfoOutput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/BoardCardInfoDto/BoardCardInfoOutput.cs index 54591d8..dd1df7b 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/BoardCardInfoDto/BoardCardInfoOutput.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/BoardCardInfoDto/BoardCardInfoOutput.cs @@ -36,8 +36,14 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD public string InterfaceChecksum { get; set; } // 接口程序校验码 - public string DatabaseVersion { get; set; } // 数据库版本 - + /// + /// 接口数据库版本 + /// + public string InterfaceDatabaseVersion { get; set; } // 数据库版本 + /// + /// 保护数据库版本 + /// + public string ProtectionDatabaseVersion { get; set; } // 数据库版本 public string ProtectionVersion { get; set; } // 保护程序版本 public string ProtectionChecksum { get; set; } // 保护程序校验码 @@ -64,6 +70,15 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// public virtual string VerificationDate { get; set; } /// + /// 安装时间 + /// + public virtual DateTime? InstallationDate { get; set; } + + /// + /// 出厂时间 + /// + public virtual DateTime? ProductionDate { get; set; } + /// /// 检验记录 /// public virtual string VerificationRecords { get; set; } diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/BoardCardInfoDto/EditBoardCardInput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/BoardCardInfoDto/EditBoardCardInput.cs index 31dbc24..9374f64 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/BoardCardInfoDto/EditBoardCardInput.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/BoardCardInfoDto/EditBoardCardInput.cs @@ -31,7 +31,14 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD public string InterfaceChecksum { get; set; } // 接口程序校验码 - public string DatabaseVersion { get; set; } // 数据库版本 + /// + /// 接口数据库版本 + /// + public string InterfaceDatabaseVersion { get; set; } // 数据库版本 + /// + /// 保护数据库版本 + /// + public string ProtectionDatabaseVersion { get; set; } // 数据库版本 public string ProtectionVersion { get; set; } // 保护程序版本 @@ -71,7 +78,10 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// 检验记录 /// public virtual string VerificationRecords { get; set; } - + /// + /// 维修记录 + /// + public virtual string MaintenanceRecord { get; set; } /// /// 备注 /// diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/ProtectionDeviceHistoryOutput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/ProtectionDeviceHistoryOutput.cs index 13d19ba..a2c1d73 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/ProtectionDeviceHistoryOutput.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/ProtectionDeviceHistoryOutput.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; +using System.Text.Json.Serialization; using System.Threading.Tasks; using YunDa.ISAS.Entities.AuditCommon; using YunDa.SOMS.Entities.GeneralInformation; @@ -27,7 +28,7 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// public virtual Guid? ProtectionDeviceInfoId { get; set; } [ForeignKey(nameof(ProtectionDeviceInfoId))] - public virtual ProtectionDeviceInfo ProtectionDeviceInfo { get; set; } + [JsonIgnore]public virtual ProtectionDeviceInfo ProtectionDeviceInfo { get; set; } /// /// 记录时间 /// diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml index 627dfe8..d3e7b2e 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml @@ -14467,6 +14467,16 @@ 顺序号 + + + 接口数据库版本 + + + + + 保护数据库版本 + + 出厂编号 @@ -14482,6 +14492,16 @@ 检验日期 + + + 安装时间 + + + + + 出厂时间 + + 检验记录 @@ -14512,6 +14532,16 @@ 顺序号 + + + 接口数据库版本 + + + + + 保护数据库版本 + + 安装时间 @@ -14542,6 +14572,11 @@ 检验记录 + + + 维修记录 + + 备注 diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/Views/GeneralInformation/ProtectionDevice.cshtml b/src/YunDa.Web/YunDa.SOMS.Web.MVC/Views/GeneralInformation/ProtectionDevice.cshtml index f96f4d0..3bd89b6 100644 --- a/src/YunDa.Web/YunDa.SOMS.Web.MVC/Views/GeneralInformation/ProtectionDevice.cshtml +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/Views/GeneralInformation/ProtectionDevice.cshtml @@ -310,11 +310,18 @@
- +
- +
+
+ +
+ +
+
+
diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/Views/GeneralInformation/ProtectionDevice.js b/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/Views/GeneralInformation/ProtectionDevice.js index 8876371..5c048c0 100644 --- a/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/Views/GeneralInformation/ProtectionDevice.js +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/Views/GeneralInformation/ProtectionDevice.js @@ -1,5 +1,6 @@ $(document).ready(function () { protectionDeviceList.initListFunc(); + boardCardInfoList.initEditModalValue(); substationTree.isShowEquipment = false; substationTree.initTree(subTreeChanged); protectionDeviceList.boardCardItemHtml = $('#boardCardItemDetail').html(); @@ -431,6 +432,7 @@ var protectionDeviceList = { protectionDeviceList.editModalVue.verificationPerson = rowData.equipmentInfo.verificationPerson; protectionDeviceList.editModalVue.verificationDate = (new Date(rowData.equipmentInfo.verificationDate)).Format("yyyy-MM-dd"); protectionDeviceList.editModalVue.verificationRecords = rowData.equipmentInfo.verificationRecords; + protectionDeviceList.editModalVue.maintenanceRecord = rowData.equipmentInfo.maintenanceRecord; } else { protectionDeviceList.editModalVue.id =null; @@ -490,7 +492,7 @@ var boardCardInfoList = { //初始化任务单 initboardCardInfoList: function () { boardCardInfoList.initComponent(); - boardCardInfoList.initEditModalValue(); + }, //初始化任务单个按钮事件 initComponent: function () { @@ -498,6 +500,7 @@ var boardCardInfoList = { boardCardInfoList.refreshTable(); }); $("#addItemBtn").click(function () { + //boardCardInfoList.initEditModalValue(); boardCardInfoList.initEditFormValidate(); boardCardInfoList.initEditModalValues(); $('#' + boardCardInfoList.editModalId).modal('show'); @@ -592,12 +595,20 @@ var boardCardInfoList = { visible: false }, { - field: 'databaseVersion', // 数据库版本 - title: '数据库版本', + field: 'interfaceDatabaseVersion', // 数据库版本 + title: '接口数据库版本', align: 'center', valign: 'middle', visible: false }, + { + field: 'protectionDatabaseVersion', // 数据库版本 + title: '接口数据库版本', + align: 'center', + valign: 'middle', + visible: false + }, + { field: 'protectionVersion', // 保护程序版本 title: '保护程序版本', @@ -678,9 +689,7 @@ var boardCardInfoList = { align: 'center', valign: 'middle', visible: true, - formatter: function (value, row, index) { - return value ? value : "-"; - } + }, { field: 'maintenanceRecord', // 检验记录 @@ -688,9 +697,7 @@ var boardCardInfoList = { align: 'center', valign: 'middle', visible: true, - formatter: function (value, row, index) { - return value ? value : "-"; - } + }, { field: 'remark', // 备注 @@ -698,9 +705,7 @@ var boardCardInfoList = { align: 'center', valign: 'middle', visible: true, - formatter: function (value, row, index) { - return value ? value : "-"; - } + }, { field: 'operation', // 操作 @@ -731,7 +736,9 @@ var boardCardInfoList = { hardwareVersion: '', interfaceVersion: '', interfaceChecksum: '', - databaseVersion: '', + interfaceVersion: '', + protectionDatabaseVersion: '', + interfaceDatabaseVersion:'', protectionVersion: '', protectionChecksum: '', bootVersion: '', @@ -767,8 +774,8 @@ var boardCardInfoList = { hardwareVersion: this.hardwareVersion, interfaceVersion: this.interfaceVersion, interfaceChecksum: this.interfaceChecksum, - databaseVersion: this.databaseVersion, - protectionVersion: this.protectionVersion, + interfaceDatabaseVersion: this.interfaceDatabaseVersion, + protectionDatabaseVersion: this.protectionDatabaseVersion, protectionChecksum: this.protectionChecksum, bootVersion: this.bootVersion, iec61850Version: this.iec61850Version, @@ -834,7 +841,8 @@ var boardCardInfoList = { boardCardInfoList.editModalVue.hardwareVersion = rowData.hardwareVersion; boardCardInfoList.editModalVue.interfaceVersion = rowData.interfaceVersion; boardCardInfoList.editModalVue.interfaceChecksum = rowData.interfaceChecksum; - boardCardInfoList.editModalVue.databaseVersion = rowData.databaseVersion; + boardCardInfoList.editModalVue.interfaceDatabaseVersion = rowData.interfaceDatabaseVersion; + boardCardInfoList.editModalVue.protectionDatabaseVersion = rowData.protectionDatabaseVersion; boardCardInfoList.editModalVue.protectionVersion = rowData.protectionVersion; boardCardInfoList.editModalVue.protectionChecksum = rowData.protectionChecksum; boardCardInfoList.editModalVue.bootVersion = rowData.bootVersion; @@ -851,6 +859,7 @@ var boardCardInfoList = { boardCardInfoList.editModalVue.remark = rowData.remark; boardCardInfoList.editModalVue.isActive = rowData.isActive; boardCardInfoList.editModalVue.protectionDeviceInfoId = rowData.protectionDeviceInfoId; + boardCardInfoList.editModalVue.maintenanceRecord = rowData.maintenanceRecord; } else { boardCardInfoList.editModalVue.id = null;