设备管理模块方法转换为DTO模式,修复long类型接收雪花ID丢失精度的问题

This commit is contained in:
2026-08-28 14:05:16 +08:00
parent 2306fbd36b
commit 24d67baf65
15 changed files with 422 additions and 85 deletions
@@ -15,7 +15,7 @@ namespace Model.Entity.Asset
/// <summary>
/// 文件名称
/// </summary>
[SugarColumn(Length = 200)]
[SugarColumn(Length = 200, IsNullable = true)]
public string? FileName { get; set; }
/// <summary>
@@ -26,13 +26,13 @@ namespace Model.Entity.Asset
/// <summary>
/// 文件扩展名(如 .pdf、.jpg
/// </summary>
[SugarColumn(Length = 20)]
[SugarColumn(Length = 20, IsNullable = true)]
public string? FileExt { get; set; }
/// <summary>
/// 文件存储地址(上传后存储的相对路径)
/// </summary>
[SugarColumn(Length = 200)]
[SugarColumn(Length = 200, IsNullable = true)]
public string? FileUrl { get; set; }
/// <summary>
@@ -43,13 +43,13 @@ namespace Model.Entity.Asset
/// <summary>
/// 上传人
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? Uploader { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(Length = 500)]
[SugarColumn(Length = 500, IsNullable = true)]
public string? Remark { get; set; }
}
}
@@ -15,13 +15,13 @@ namespace Model.Entity.Asset
/// <summary>
/// 分类名称
/// </summary>
[SugarColumn(Length = 100)]
[SugarColumn(Length = 100, IsNullable = true)]
public string? Name { get; set; }
/// <summary>
/// 分类编码
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? Code { get; set; }
/// <summary>
@@ -37,7 +37,7 @@ namespace Model.Entity.Asset
/// <summary>
/// 备注
/// </summary>
[SugarColumn(Length = 500)]
[SugarColumn(Length = 500, IsNullable = true)]
public string? Remark { get; set; }
}
}
+33 -20
View File
@@ -11,13 +11,13 @@ namespace Model.Entity.Asset
/// <summary>
/// 设备编号(唯一)
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? Code { get; set; }
/// <summary>
/// 设备名称
/// </summary>
[SugarColumn(Length = 100)]
[SugarColumn(Length = 100, IsNullable = true)]
public string? Name { get; set; }
/// <summary>
@@ -28,55 +28,55 @@ namespace Model.Entity.Asset
/// <summary>
/// 设备类型(实验室/楼层/部门/位置/产品/自定义等分类维度下的类型名称,冗余便于展示)
/// </summary>
[SugarColumn(Length = 100)]
[SugarColumn(Length = 100, IsNullable = true)]
public string? Type { get; set; }
/// <summary>
/// 设备品牌
/// </summary>
[SugarColumn(Length = 100)]
[SugarColumn(Length = 100, IsNullable = true)]
public string? Brand { get; set; }
/// <summary>
/// 设备型号
/// </summary>
[SugarColumn(Length = 100)]
[SugarColumn(Length = 100, IsNullable = true)]
public string? Model { get; set; }
/// <summary>
/// 规格参数
/// </summary>
[SugarColumn(Length = 200)]
[SugarColumn(Length = 200, IsNullable = true)]
public string? Specifications { get; set; }
/// <summary>
/// 制造商(设备制造商)
/// </summary>
[SugarColumn(Length = 100)]
[SugarColumn(Length = 100, IsNullable = true)]
public string? Manufacturer { get; set; }
/// <summary>
/// 供应商(资产供应商)
/// </summary>
[SugarColumn(Length = 100)]
[SugarColumn(Length = 100, IsNullable = true)]
public string? Supplier { get; set; }
/// <summary>
/// 设备图片地址(图片上传后存储的相对路径)
/// </summary>
[SugarColumn(Length = 200)]
[SugarColumn(Length = 200, IsNullable = true)]
public string? ImageUrl { get; set; }
/// <summary>
/// 二维码编号(一物一码)
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? QrCode { get; set; }
/// <summary>
/// 设备描述
/// </summary>
[SugarColumn(ColumnDataType = "text")]
[SugarColumn(ColumnDataType = "text", IsNullable = true)]
public string? Description { get; set; }
#endregion
@@ -84,31 +84,31 @@ namespace Model.Entity.Asset
/// <summary>
/// 使用部门名称(资产使用部门)
/// </summary>
[SugarColumn(Length = 100)]
[SugarColumn(Length = 100, IsNullable = true)]
public string? Department { get; set; }
/// <summary>
/// 存放位置(实验室/楼层/房间等位置信息)
/// </summary>
[SugarColumn(Length = 200)]
[SugarColumn(Length = 200, IsNullable = true)]
public string? Location { get; set; }
/// <summary>
/// 责任人(资产责任人)
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? ResponsiblePerson { get; set; }
/// <summary>
/// 责任人联系电话(资产责任人电话)
/// </summary>
[SugarColumn(Length = 30)]
[SugarColumn(Length = 30, IsNullable = true)]
public string? ContactPhone { get; set; }
/// <summary>
/// 保管人
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? Custodian { get; set; }
#endregion
@@ -116,17 +116,19 @@ namespace Model.Entity.Asset
/// <summary>
/// 购置日期
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? PurchaseDate { get; set; }
/// <summary>
/// 购置价格(资产购置价格)
/// </summary>
[SugarColumn(DecimalDigits = 2, Length = 18)]
[SugarColumn(DecimalDigits = 2, Length = 18, IsNullable = true)]
public decimal? PurchasePrice { get; set; }
/// <summary>
/// 保修到期日期(资产保修到期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? WarrantyExpireDate { get; set; }
#endregion
@@ -134,21 +136,25 @@ namespace Model.Entity.Asset
/// <summary>
/// 验收日期(资产验收日期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? AcceptanceDate { get; set; }
/// <summary>
/// 启用日期(资产启用日期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? EnableDate { get; set; }
/// <summary>
/// 使用年限(资产使用年限,单位:年)
/// </summary>
[SugarColumn(IsNullable = true)]
public int? ServiceLifeYears { get; set; }
/// <summary>
/// 报废日期(资产报废日期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? ScrapDate { get; set; }
#endregion
@@ -168,21 +174,25 @@ namespace Model.Entity.Asset
/// <summary>
/// 上次校准日期(校准日期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? LastCalibrationDate { get; set; }
/// <summary>
/// 下次校准到期日期(用于判断是否超期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? NextCalibrationDate { get; set; }
/// <summary>
/// 检定日期
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? InspectionDate { get; set; }
/// <summary>
/// 下次检定到期日期(用于判断是否超期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? NextInspectionDate { get; set; }
/// <summary>
@@ -193,11 +203,13 @@ namespace Model.Entity.Asset
/// <summary>
/// 上次保养日期(保养日期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? LastMaintenanceDate { get; set; }
/// <summary>
/// 下次保养到期日期(保养周期到期,用于判断是否超期)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? NextMaintenanceDate { get; set; }
#endregion
@@ -205,24 +217,25 @@ namespace Model.Entity.Asset
/// <summary>
/// 备注
/// </summary>
[SugarColumn(Length = 500)]
[SugarColumn(Length = 500, IsNullable = true)]
public string? Remark { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? CreateBy { get; set; }
/// <summary>
/// 更新人(修改人)
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? UpdateBy { get; set; }
/// <summary>
/// 更新时间(修改时间)
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? UpdateTime { get; set; }
#endregion
}
@@ -30,13 +30,13 @@ namespace Model.Entity.Asset
/// <summary>
/// 操作人
/// </summary>
[SugarColumn(Length = 50)]
[SugarColumn(Length = 50, IsNullable = true)]
public string? Operator { get; set; }
/// <summary>
/// 变更原因/备注
/// </summary>
[SugarColumn(Length = 500)]
[SugarColumn(Length = 500, IsNullable = true)]
public string? Remark { get; set; }
}
}