From 455089454433314eb647d0ba7bfe788d7cad9487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E7=9D=BF?= <774114798@qq.com> Date: Tue, 10 Dec 2024 15:17:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=9D=BF=E5=8D=A1=E5=B1=A5?= =?UTF-8?q?=E5=8E=86=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BoardCardInfoAppService.cs | 81 +++-- .../ProtectionDeviceAppService.cs | 305 ++++++++++++++---- .../YunDa.ISAS.Application.xml | 25 ++ .../EditProtectionDeviceInfoInput.cs | 4 + .../HistoryData/BoardCardHistoryOutput.cs | 35 +- .../ProtectionDeviceHistoryOutput.cs | 30 +- .../YunDa.ISAS.DataTransferObject.xml | 86 ++++- src/YunDa.Quick/MigratorForDB/Program.cs | 4 - 8 files changed, 459 insertions(+), 111 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 152bf53..b72ef86 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 @@ -1,6 +1,7 @@ using Abp.Auditing; using Abp.Authorization; using Abp.Collections.Extensions; +using Abp.Domain.Entities; using Abp.Domain.Repositories; using Abp.Domain.Uow; using Amazon.Runtime.Internal.Transform; @@ -167,7 +168,7 @@ namespace YunDa.ISAS.Application.GeneralInformation ContentJson = json, CreationTime = DateTime.Now, CreatorUserId = base.GetCurrentUser().Id, - Name = protectionDevice.Name, + Name = deviceBoardCard.BoardId, RecodeDate = DateTime.Now, BoardId = input.BoardId, BoardCardInfoId = deviceBoardCard.Id, @@ -323,22 +324,7 @@ namespace YunDa.ISAS.Application.GeneralInformation if (protectionDevice != null) { var boards = _boardCardHistoryRepository.GetAll().Where(t => t.ProtectionDeviceInfoId == protectionDevice.Id); - - - foreach (var board in boards) - { - BoardCardInfo boardCardInfo1 = JsonConvert.DeserializeObject(board.ContentJson); - BoardCardInfo boardCardInfo2 = JsonConvert.DeserializeObject(board.ContentNewJson); - BoardCardHistoryOutput boardCardHistoryOutput1 = new BoardCardHistoryOutput() - { - RecodeDate = board.RecodeDate, - BoardId = board.BoardId, - PostUpdate = ObjectMapper.Map(boardCardInfo2), - PrioUpdate = ObjectMapper.Map(boardCardInfo1), - SeqNo = board.SeqNo, - }; - historys.Add(boardCardHistoryOutput1); - } + historys = ObjectMapper.Map>(boards); rst.Flag = true; rst.ResultData = historys; rst.TotalCount = historys.Count; @@ -535,10 +521,25 @@ namespace YunDa.ISAS.Application.GeneralInformation boardCardInfo.VerificationPerson = "贺严玲"; boardCardInfo.VerificationDate = "2024-01-01"; boardCardInfo.VerificationRecords = "全部通过"; + boardCardInfo.CreationTime = DateTime.Now; } - // 模拟插入数据库 - _boardCardInfoRepository.Insert(boardCardInfo); + var entity = _boardCardInfoRepository.Insert(boardCardInfo); + var boardHistory = new BoardCardHistory + { + ContentJson = JsonConvert.SerializeObject(entity), + CreationTime = DateTime.Now, + CreatorUserId = base.GetCurrentUser().Id, + Name = entity.BoardId, + RecodeDate = DateTime.Now, + BoardId = entity.BoardId, + BoardCardInfoId = entity.Id, + ProtectionDeviceInfoId = device.Id, + EventDescription ="建立板卡信息台账", + EventRecordType = EventRecordTypeEnum.Board, + SeqNo = 1 + }; + _boardCardHistoryRepository.Insert(boardHistory); } } @@ -699,7 +700,6 @@ namespace YunDa.ISAS.Application.GeneralInformation } return rst; } -#if DEBUG /// @@ -803,7 +803,46 @@ namespace YunDa.ISAS.Application.GeneralInformation return rst; } -#endif + /// + /// 生成初始的历史记录 + /// + /// + [ShowApi] + [AbpAllowAnonymous] + [HttpGet] + public RequestEasyResult SpawnBoardHistory() + { + var rst = new RequestEasyResult(); + try + { + var boards = _boardCardInfoRepository.GetAllIncluding(t=>t.ProtectionDeviceInfo).ToList(); + // 模拟插入数据库 + foreach (var board in boards) + { + var boardHistory = new BoardCardHistory + { + ContentJson = JsonConvert.SerializeObject(board), + CreationTime = DateTime.Now, + CreatorUserId = base.GetCurrentUser().Id, + Name = board.BoardId, + RecodeDate = board.CreationTime, + BoardId = board.BoardId, + BoardCardInfoId = board.Id, + EventRecordType = EventRecordTypeEnum.Board, + EventDescription = "创建板卡信息台账", + ProtectionDeviceInfoId = board.ProtectionDeviceInfoId, + SeqNo = 1 + }; + _boardCardHistoryRepository.Insert(boardHistory); + } + rst.Flag = true; + } + catch (Exception e) + { + throw; + } + return rst; + } } } 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 e073980..37466d9 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs @@ -1,8 +1,10 @@ using Abp.Auditing; using Abp.Authorization; using Abp.Collections.Extensions; +using Abp.Domain.Entities; using Abp.Domain.Repositories; using Abp.Domain.Uow; +using Abp.EntityFrameworkCore.Repositories; using Microsoft.AspNetCore.Mvc; using MongoDB.Driver.Linq; using Newtonsoft.Json; @@ -29,6 +31,7 @@ using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto.S using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionSettingDto; using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport; using YunDa.SOMS.Entities.GeneralInformation; +using static NetMQ.NetMQSelector; namespace YunDa.ISAS.Application.GeneralInformation { @@ -114,33 +117,8 @@ namespace YunDa.ISAS.Application.GeneralInformation { if (input.Id.HasValue) { - var entity = _protectionDeviceInfoRepository.GetAllIncluding(t=>t.EquipmentInfo).FirstOrDefault(t => t.Id == input.Id); - if (entity != null) - { - entity.LastModificationTime = DateTime.Now; - entity.LastModifierUserId = base.GetCurrentUser().Id; - entity.SeqNo = input.SeqNo; - // 逐字段赋值 - entity.Name = input.Name; - entity.Specification = input.Specification; - entity.DeviceAddress = input.DeviceAddress; - entity.BaselineBoardVersion = input.BaselineBoardVersion; - entity.HardwareVersion = input.HardwareVersion; - entity.IsActive = input.IsActive; - // 设备信息赋值 - if (entity.EquipmentInfo != null) - { - entity.EquipmentInfo.ManufacturerInfoId = input.ManufacturerInfoId; - entity.EquipmentInfo.Name = input.Name; - entity.EquipmentInfo.InstallationDate = input.InstallationDate; - entity.EquipmentInfo.ProductionDate = input.ProductionDate; - entity.EquipmentInfo.FactorySerialNumber = input.FactorySerialNumber; - entity.EquipmentInfo.VerificationPerson = input.VerificationPerson; - entity.EquipmentInfo.VerificationDate = input.VerificationDate; - entity.EquipmentInfo.VerificationRecords = input.VerificationRecords; - entity.EquipmentInfo.ManufacturerInfoId = input.ManufacturerInfoId; - } - } + InsertUpdateRecord(input); + } else { @@ -166,9 +144,24 @@ namespace YunDa.ISAS.Application.GeneralInformation entity.EquipmentInfo.VerificationDate = input.VerificationDate; entity.EquipmentInfo.VerificationRecords = input.VerificationRecords; entity.EquipmentInfo.ManufacturerInfoId = input.ManufacturerInfoId; + entity.EquipmentInfo.MaintenanceRecord = input.MaintenanceRecord; var equipmentInfoId =await _equipmentInfoRepository.InsertAndGetIdAsync(entity.EquipmentInfo); entity.EquipmentInfoId = equipmentInfoId; - await _protectionDeviceInfoRepository.InsertAsync(entity); + var protectionDeviceInfo = await _protectionDeviceInfoRepository.InsertAsync(entity); + // 记录历史数据 + var protectionDeviceHistory = new ProtectionDeviceHistory + { + Name = input.Name, + ProtectionDeviceInfoId = protectionDeviceInfo.Id, + RecodeDate = DateTime.Now, + ContentJson = "", // 原始数据 + ContentNewJson = JsonConvert.SerializeObject(entity), // 新数据 + EventDescription = "设备台账建立", + EventRecordType = EventRecordTypeEnum.Device, + IsSend = false // 默认未发送 + }; + // 插入历史记录 + _protectionDeviceHistoryRepository.Insert(protectionDeviceHistory); } rst.Flag = true; } @@ -182,6 +175,148 @@ namespace YunDa.ISAS.Application.GeneralInformation return rst; } + + private void InsertUpdateRecord(EditProtectionDeviceInfoInput input) + { + if (input.Id.HasValue) + { + var entity = _protectionDeviceInfoRepository.GetAllIncluding(t => t.EquipmentInfo) + .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.Name != input.Name) + { + eventDescription.Append($"设备名称更新为'{input.Name}', "); + entity.Name = input.Name; + } + + if (entity.Specification != input.Specification) + { + eventDescription.Append($"规格更新为'{input.Specification}', "); + entity.Specification = input.Specification; + } + + if (entity.DeviceAddress != input.DeviceAddress) + { + eventDescription.Append($"设备地址更新为'{input.DeviceAddress}', "); + entity.DeviceAddress = input.DeviceAddress; + } + + if (entity.BaselineBoardVersion != input.BaselineBoardVersion) + { + eventDescription.Append($"基板版本更新为'{input.BaselineBoardVersion}', "); + entity.BaselineBoardVersion = input.BaselineBoardVersion; + } + + if (entity.HardwareVersion != input.HardwareVersion) + { + eventDescription.Append($"硬件版本更新为'{input.HardwareVersion}', "); + entity.HardwareVersion = input.HardwareVersion; + } + + if (entity.IsActive != input.IsActive) + { + eventDescription.Append($"启用状态更新为'{input.IsActive}', "); + entity.IsActive = input.IsActive; + } + + // 设备信息赋值 + if (entity.EquipmentInfo != null) + { + if (entity.EquipmentInfo.ManufacturerInfoId != input.ManufacturerInfoId) + { + eventDescription.Append($"制造商ID更新为'{input.ManufacturerInfoId}', "); + entity.EquipmentInfo.ManufacturerInfoId = input.ManufacturerInfoId; + } + + if (entity.EquipmentInfo.Name != input.Name) + { + eventDescription.Append($"设备名称更新为'{input.Name}', "); + entity.EquipmentInfo.Name = input.Name; + } + + if (entity.EquipmentInfo.InstallationDate != input.InstallationDate) + { + eventDescription.Append($"安装日期更新为'{input.InstallationDate}', "); + entity.EquipmentInfo.InstallationDate = input.InstallationDate; + } + + if (entity.EquipmentInfo.ProductionDate != input.ProductionDate) + { + eventDescription.Append($"生产日期更新为'{input.ProductionDate}', "); + entity.EquipmentInfo.ProductionDate = input.ProductionDate; + } + + if (entity.EquipmentInfo.FactorySerialNumber != input.FactorySerialNumber) + { + eventDescription.Append($"出厂序列号更新为'{input.FactorySerialNumber}', "); + entity.EquipmentInfo.FactorySerialNumber = input.FactorySerialNumber; + } + + if (entity.EquipmentInfo.VerificationPerson != input.VerificationPerson) + { + eventDescription.Append($"验证人更新为'{input.VerificationPerson}', "); + entity.EquipmentInfo.VerificationPerson = input.VerificationPerson; + } + + if (entity.EquipmentInfo.VerificationDate != input.VerificationDate) + { + eventDescription.Append($"验证日期更新为'{input.VerificationDate}', "); + entity.EquipmentInfo.VerificationDate = input.VerificationDate; + } + + if (entity.EquipmentInfo.VerificationRecords != input.VerificationRecords) + { + eventDescription.Append($"验证记录更新为'{input.VerificationRecords}', "); + entity.EquipmentInfo.VerificationRecords = input.VerificationRecords; + } + + if (entity.EquipmentInfo.MaintenanceRecord != input.MaintenanceRecord) + { + eventDescription.Append($"维护记录更新为'{input.MaintenanceRecord}', "); + entity.EquipmentInfo.MaintenanceRecord = input.MaintenanceRecord; + } + } + + // 检查是否有变化并记录历史 + var updatedContent = JsonConvert.SerializeObject(entity); + + // 如果数据发生了变化,则记录历史 + if (originalContent != updatedContent) + { + var history = new ProtectionDeviceHistory + { + ProtectionDeviceInfoId = entity.Id, + RecodeDate = DateTime.Now, + ContentJson = originalContent, // 记录更新前的内容 + ContentNewJson = updatedContent, // 记录更新后的内容 + EventDescription = eventDescription.ToString().TrimEnd(','), + EventRecordType = EventRecordTypeEnum.Device, // 假设更新为事件类型 + Remark = "自动记录设备信息更新", + IsSend = false // 如果不需要立即发送给主站 + }; + + // 保存历史记录 + _protectionDeviceHistoryRepository.Insert(history); + } + } + } + + } /// /// 扫码枪输入设备信息 /// @@ -444,40 +579,7 @@ namespace YunDa.ISAS.Application.GeneralInformation if (protectionDevice != null) { var entitys = _protectionDeviceHistoryRepository.GetAll().Where(t => t.ProtectionDeviceInfoId == protectionDevice.Id); - foreach (var entity in entitys) - { - ProtectionDeviceInfo protectionDevice1= JsonConvert.DeserializeObject(entity.ContentJson); - ProtectionDeviceInfo protectionDevice2 = JsonConvert.DeserializeObject(entity.ContentNewJson); - ProtectionDeviceHistoryOutput historyOutput = new ProtectionDeviceHistoryOutput - { - SeqNo = entity.SeqNo, - RecodeDate = entity.RecodeDate, - PostUpdate = new ProtectionDeviceHistoryViewOutput - { - BaselineBoardVersion = protectionDevice1.BaselineBoardVersion, - FactorySerialNumber = protectionDevice1.EquipmentInfo.FactorySerialNumber, - ProductionDate = protectionDevice1.EquipmentInfo.ProductionDate, - HardwareVersion = protectionDevice1.HardwareVersion, - Specification = protectionDevice1.Specification, - VerificationDate = protectionDevice1.EquipmentInfo.VerificationDate, - VerificationPerson = protectionDevice1.EquipmentInfo.VerificationPerson, - VerificationRecords = protectionDevice1.EquipmentInfo.VerificationRecords, - }, - PrioUpdate = new ProtectionDeviceHistoryViewOutput - { - BaselineBoardVersion = protectionDevice2.BaselineBoardVersion, - FactorySerialNumber = protectionDevice2.EquipmentInfo.FactorySerialNumber, - ProductionDate = protectionDevice2.EquipmentInfo.ProductionDate, - HardwareVersion = protectionDevice2.HardwareVersion, - Specification = protectionDevice2.Specification, - VerificationDate = protectionDevice2.EquipmentInfo.VerificationDate, - VerificationPerson = protectionDevice2.EquipmentInfo.VerificationPerson, - VerificationRecords = protectionDevice2.EquipmentInfo.VerificationRecords, - }, - }; - historys.Add(historyOutput); - - } + ObjectMapper.Map>(entitys); rst.Flag = true; rst.ResultData = historys; } @@ -749,6 +851,20 @@ namespace YunDa.ISAS.Application.GeneralInformation TransformerSubstationId = transformerSubstation.Id, }; _protectionDeviceInfoRepository.Insert(protectionDeviceInfo); + // 记录历史数据 + var protectionDeviceHistory = new ProtectionDeviceHistory + { + Name = item, + ProtectionDeviceInfoId = protectionDeviceInfo.Id, + RecodeDate = DateTime.Now, + ContentJson = "", // 原始数据 + ContentNewJson = JsonConvert.SerializeObject(protectionDeviceInfo), // 新数据 + EventDescription = "设备台账建立", + EventRecordType = EventRecordTypeEnum.Device, + IsSend = false // 默认未发送 + }; + // 插入历史记录 + _protectionDeviceHistoryRepository.Insert(protectionDeviceHistory); } else { @@ -796,13 +912,25 @@ namespace YunDa.ISAS.Application.GeneralInformation } using (var unitOfWork = _unitOfWorkManager.Begin()) { + // 提前获取已经存在的保护设备类型名称,避免每次循环都查询 + var existingProtectionDeviceTypes = _protectionDeviceTypeyRepository + .GetAll() + .Where(t => imPuCtgies.Select(im => im.PuctgyName).Contains(t.Name)) + .ToDictionary(t => t.Name, t => t); + + // 创建一个 ProtectionDeviceType 的集合来批量插入 + var protectionDeviceTypesToInsert = new List(); + foreach (var imPuCtgie in imPuCtgies) { - if (protectionDeviceTypes.ContainsKey(imPuCtgie.PuctgyName)) + // 检查该类型是否已经存在 + if (existingProtectionDeviceTypes.ContainsKey(imPuCtgie.PuctgyName)) { continue; } - ProtectionDeviceType protectionDeviceType = new ProtectionDeviceType + + // 创建新的 ProtectionDeviceType 对象 + var protectionDeviceType = new ProtectionDeviceType { CanSwitchDZZone = false, CreationTime = DateTime.Now, @@ -820,12 +948,22 @@ namespace YunDa.ISAS.Application.GeneralInformation Name = imPuCtgie.PuctgyName, Generation = imPuCtgie.Generation, }; - _protectionDeviceTypeyRepository.Insert(protectionDeviceType); - } - unitOfWork.Complete(); + // 添加到集合中,准备批量插入 + protectionDeviceTypesToInsert.Add(protectionDeviceType); + } + + // 批量插入新记录 + if (protectionDeviceTypesToInsert.Any()) + { + _protectionDeviceTypeyRepository.InsertRange(protectionDeviceTypesToInsert); + } + + // 提交事务 + unitOfWork.Complete(); } - rst.Flag = true; + + rst.Flag = true; } catch (Exception ex) @@ -1221,6 +1359,37 @@ namespace YunDa.ISAS.Application.GeneralInformation } #endif + /// + /// 生成装置的初始历史记录 + /// + /// + [ShowApi] + [AbpAllowAnonymous] + [HttpGet] + public RequestEasyResult SpawnDeviceinfoHistory() + { + RequestEasyResult rst = new(); + var protectionDevices = _protectionDeviceInfoRepository.GetAllIncluding(t => t.EquipmentInfo).ToList(); + foreach (var protectionDevice in protectionDevices) + { + // 记录历史数据 + var protectionDeviceHistory = new ProtectionDeviceHistory + { + Name = protectionDevice.Name, + ProtectionDeviceInfoId = protectionDevice.Id, + RecodeDate = protectionDevice.CreationTime, + ContentJson = "", // 原始数据 + ContentNewJson = JsonConvert.SerializeObject(protectionDevice), // 新数据 + EventDescription = "保护设备台账建立", + EventRecordType = EventRecordTypeEnum.Device, + IsSend = false // 默认未发送 + }; + // 插入历史记录 + _protectionDeviceHistoryRepository.Insert(protectionDeviceHistory); + } + rst.Flag = true; + return rst; + } } } diff --git a/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml b/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml index 0f536d4..c4122b0 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml +++ b/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml @@ -3465,6 +3465,12 @@ + + + 生成初始的历史记录 + + + 查询板卡历史记录 @@ -3480,6 +3486,19 @@ + + + 扫码枪输入设备信息 + + + + + + + 更新版本信息 + + + 查询保护设备信息 @@ -3628,6 +3647,12 @@ + + + 生成装置的初始历史记录 + + + 装置履历 diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/EditProtectionDeviceInfoInput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/EditProtectionDeviceInfoInput.cs index 9052287..7c679e4 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/EditProtectionDeviceInfoInput.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/EditProtectionDeviceInfoInput.cs @@ -72,6 +72,10 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// 检验记录 /// public virtual string VerificationRecords { get; set; } + /// + /// 维修记录,用字符串来表示,可记录关于维修相关的文字描述等信息 + /// + public virtual string MaintenanceRecord { get; set; } } public class EditProtectionQrCodeDeviceInfoInput diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/BoardCardHistoryOutput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/BoardCardHistoryOutput.cs index 101dc80..f00868d 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/BoardCardHistoryOutput.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/BoardCardHistoryOutput.cs @@ -1,12 +1,15 @@ -using System; +using Abp.AutoMapper; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using YunDa.ISAS.Entities.AuditCommon; +using YunDa.SOMS.Entities.GeneralInformation; namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto.HistoryData { + [AutoMapFrom(typeof( BoardCardHistory))] public class BoardCardHistoryOutput { /// @@ -14,6 +17,14 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// public virtual int SeqNo { get; set; } /// + /// 设备名称 + /// + public virtual string Name { get; set; } + /// + /// 板卡id + /// + public virtual Guid? BoardCardInfoId { get; set; } + /// /// 板卡号 /// public virtual string BoardId { get; set; } @@ -22,13 +33,27 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// 记录时间 /// public virtual DateTime? RecodeDate { get; set; } + /// - /// 历史数据 + /// 事件描述 /// - public virtual BoardCardHistoryViewOutput PrioUpdate { get; set; } + public virtual string EventDescription { get; set; } /// - /// 更换后数据 + /// 事件类型 /// - public virtual BoardCardHistoryViewOutput PostUpdate { get; set; } + public virtual EventRecordTypeEnum EventRecordType { get; set; } + /// + /// 备注 + /// + public virtual string Remark { get; set; } + /// + /// 是否已经发送给主站 + /// + public virtual bool IsSend { get; set; } + /// + /// 保护装置 ID + /// + + public virtual Guid? ProtectionDeviceInfoId { 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 7f9e49e..13d19ba 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 @@ -11,24 +11,44 @@ using YunDa.SOMS.Entities.GeneralInformation; namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto.HistoryData { + [AutoMapFrom(typeof(ProtectionDeviceHistory))] public class ProtectionDeviceHistoryOutput { /// /// 顺序号 /// public virtual int SeqNo { get; set; } - + /// + /// 设备名称 + /// + public virtual string Name { get; set; } + /// + /// 保护装置Id + /// + public virtual Guid? ProtectionDeviceInfoId { get; set; } + [ForeignKey(nameof(ProtectionDeviceInfoId))] + public virtual ProtectionDeviceInfo ProtectionDeviceInfo { get; set; } /// /// 记录时间 /// public virtual DateTime? RecodeDate { get; set; } + /// - /// 更新前数据 + /// 事件描述 /// - public virtual ProtectionDeviceHistoryViewOutput PrioUpdate { get; set; } + public virtual string EventDescription { get; set; } /// - /// 更换后数据 + /// 事件类型 /// - public virtual ProtectionDeviceHistoryViewOutput PostUpdate { get; set; } + public virtual EventRecordTypeEnum EventRecordType { get; set; } + /// + /// 备注 + /// + public virtual string Remark { get; set; } + /// + /// 是否已经发送给主站 + /// + public virtual bool IsSend { 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 2808e64..bf3128b 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml @@ -14577,6 +14577,16 @@ 检验记录 + + + 维修记录,用字符串来表示,可记录关于维修相关的文字描述等信息 + + + + + 备注 + + 保护装置 @@ -14833,6 +14843,11 @@ + + + 维修记录,用字符串来表示,可记录关于维修相关的文字描述等信息 + + 装置名称 @@ -14873,6 +14888,16 @@ 检验记录 + + + 维修记录 + + + + + 备注 + + 装置名称 @@ -14918,6 +14943,16 @@ 顺序号 + + + 设备名称 + + + + + 板卡id + + 板卡号 @@ -14928,14 +14963,29 @@ 记录时间 - + - 历史数据 + 事件描述 - + - 更换后数据 + 事件类型 + + + + + 备注 + + + + + 是否已经发送给主站 + + + + + 保护装置 ID @@ -14973,19 +15023,39 @@ 顺序号 + + + 设备名称 + + + + + 保护装置Id + + 记录时间 - + - 更新前数据 + 事件描述 - + - 更换后数据 + 事件类型 + + + + + 备注 + + + + + 是否已经发送给主站 diff --git a/src/YunDa.Quick/MigratorForDB/Program.cs b/src/YunDa.Quick/MigratorForDB/Program.cs index ff766fb..8010b06 100644 --- a/src/YunDa.Quick/MigratorForDB/Program.cs +++ b/src/YunDa.Quick/MigratorForDB/Program.cs @@ -28,13 +28,9 @@ namespace MigratorForDB AppDomain currentDomain = AppDomain.CurrentDomain; Console.WriteLine("**********************************"); Console.WriteLine("**********开始升级*********"); - Console.WriteLine($"软件版本 ----- {AppVersionHelper.Version}"); Console.WriteLine("**********************************"); - - ParseArgs(args); - using (var bootstrapper = AbpBootstrapper.Create()) { bootstrapper.IocManager.IocContainer