This commit is contained in:
郭睿 2024-12-13 11:05:05 +08:00
parent 6cc3a0b2e8
commit 5cae5a7652
5 changed files with 34 additions and 16 deletions

View File

@ -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;

View File

@ -27,7 +27,8 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD
/// </summary>
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; } // 硬件版本

View File

@ -21,7 +21,8 @@ namespace YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoD
/// </summary>
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
/// 维修记录,用字符串来表示,可记录关于维修相关的文字描述等信息
/// </summary>
public virtual string MaintenanceRecord { get; set; }
public string ProgramVersion { get; set; }//程序版本
public string ProgramVersionCrc { get; set; }//程序版本校验码
/// <summary>
/// 备注
/// </summary>

View File

@ -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; } // 保护程序校验码

View File

@ -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; } // 硬件版本