From 5cae5a7652304a455cffae617af8304c65f23106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E7=9D=BF?= <774114798@qq.com> Date: Fri, 13 Dec 2024 11:05:05 +0800 Subject: [PATCH] 2 --- .../BoardCardInfoAppService.cs | 37 ++++++++++++------- .../BoardCardInfoDto/BoardCardInfoOutput.cs | 3 +- .../BoardCardInfoDto/EditBoardCardInput.cs | 6 ++- .../BoardCardSolftVersionOutput.cs | 2 + .../GeneralInformation/BoardCardInfo.cs | 2 + 5 files changed, 34 insertions(+), 16 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 c4f3f2f..719e0e3 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 @@ -156,18 +156,9 @@ namespace YunDa.ISAS.Application.GeneralInformation // 初始化事件描述 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) { @@ -281,11 +272,17 @@ namespace YunDa.ISAS.Application.GeneralInformation eventDescription.Append($"维修记录更新为'{input.MaintenanceRecord}', "); entity.MaintenanceRecord = input.MaintenanceRecord; } - if (entity.IsActive != input.IsActive) + if (entity.ProgramVersion != input.ProgramVersion) { - eventDescription.Append($"是否在用更新为'{input.IsActive}', "); - entity.IsActive = input.IsActive; + eventDescription.Append($"程序版本更新为'{input.ProgramVersion}', "); + entity.ProgramVersion = input.ProgramVersion; } + if (entity.ProgramVersion != input.ProgramVersionCrc) + { + eventDescription.Append($"程序版本校验码更新为'{input.ProgramVersionCrc}', "); + entity.ProgramVersionCrc = input.ProgramVersionCrc; + } + // 检查是否有变化并记录历史 var updatedContent = JsonConvert.SerializeObject(entity); @@ -345,6 +342,8 @@ namespace YunDa.ISAS.Application.GeneralInformation || deviceBoardCard.VerificationDate != input.VerificationDate || deviceBoardCard.VerificationPerson != input.VerificationPerson || deviceBoardCard.ProductionDate != input.ProductionDate + || deviceBoardCard.ProductionDate != input.ProductionDate + ) { var deviceBoardCardHistory = _boardCardHistoryRepository.GetAll().Where(t => t.BoardCardInfoId == deviceBoardCard.Id).ToList(); @@ -396,6 +395,16 @@ namespace YunDa.ISAS.Application.GeneralInformation { eventDescription.AppendLine($"更改了设备的生产日期: {deviceBoardCard.ProductionDate} -> {input.ProductionDate}"); } + if (deviceBoardCard.ProgramVersion != input.ProgramVersion) + { + eventDescription.Append($"程序版本更新为'{input.ProgramVersion}', "); + deviceBoardCard.ProgramVersion = input.ProgramVersion; + } + if (deviceBoardCard.ProgramVersion != input.ProgramVersionCrc) + { + eventDescription.Append($"程序版本校验码更新为'{input.ProgramVersionCrc}', "); + deviceBoardCard.ProgramVersionCrc = input.ProgramVersionCrc; + } boardHistory.EventDescription = eventDescription.ToString().TrimEnd(','); boardHistory.EventRecordType = EventRecordTypeEnum.Board; boardHistory.Remark = input.Remark; 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 dd1df7b..0be2214 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 @@ -27,7 +27,8 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// public virtual int SeqNo { get; set; } public string BoardId { get; set; } // 板卡号 - + public string ProgramVersion { get; set; }//程序版本 + public string ProgramVersionCrc { get; set; }//程序版本校验码 public string BoardType { get; set; } // 板卡类型 public string BoardTypeId { get; set; } // 厂家板卡类型 public string HardwareVersion { 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 9374f64..716d379 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 @@ -21,7 +21,8 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// public virtual int SeqNo { get; set; } public string BoardId { get; set; } // 板卡号 - + public string ProgramVersion { get; set; }//程序版本 + public string ProgramVersionCrc { get; set; }//程序版本校验码 public string BoardType { get; set; } // 板卡类型 public string BoardTypeId { get; set; } // 板卡类型 @@ -132,6 +133,9 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD /// 维修记录,用字符串来表示,可记录关于维修相关的文字描述等信息 /// public virtual string MaintenanceRecord { get; set; } + + public string ProgramVersion { get; set; }//程序版本 + public string ProgramVersionCrc { get; set; }//程序版本校验码 /// /// 备注 /// diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/BoardCardSolftVersionOutput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/BoardCardSolftVersionOutput.cs index 405ffa3..5102008 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/BoardCardSolftVersionOutput.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/ProtectionDeviceInfoDto/HistoryData/BoardCardSolftVersionOutput.cs @@ -23,6 +23,8 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD public string DatabaseVersion { get; set; } // 数据库版本 + public string ProgramVersion { get; set; }//程序版本 + public string ProgramVersionCrc { get; set; }//程序版本校验码 public string ProtectionVersion { get; set; } // 保护程序版本 public string ProtectionChecksum { get; set; } // 保护程序校验码 diff --git a/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/BoardCardInfo.cs b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/BoardCardInfo.cs index e22266f..8836fad 100644 --- a/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/BoardCardInfo.cs +++ b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/BoardCardInfo.cs @@ -24,6 +24,8 @@ namespace YunDa.SOMS.Entities.GeneralInformation public string BoardType { get; set; } // 板卡类型 public string BoardTypeId { get; set; } // 厂家板卡类型 + public string ProgramVersion { get; set; }//程序版本 + public string ProgramVersionCrc { get; set; }//程序版本校验码 public string HardwareVersion { get; set; } // 硬件版本