设备管理模块Entity添加和controller
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Model.Entity.Asset
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备附件(资产附件管理:文件上传,支持按文件类型筛选与预览)
|
||||
/// </summary>
|
||||
public class EquipmentAttachmentEntity : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备Id(关联 EquipmentEntity.Id)
|
||||
/// </summary>
|
||||
public long EquipmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 200)]
|
||||
public string? FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件类型(使用说明书/合格证明/校准证书/保养卡/合同扫描件/验收照片等)
|
||||
/// </summary>
|
||||
public AttachmentTypeEnum FileType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件扩展名(如 .pdf、.jpg)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 20)]
|
||||
public string? FileExt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件存储地址(上传后存储的相对路径)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 200)]
|
||||
public string? FileUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小(字节)
|
||||
/// </summary>
|
||||
public long FileSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上传人
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? Uploader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 500)]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Model.Entity.Asset
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备分类(资产分类:支持按实验室/楼层/部门/位置/产品等多级树形分类,可按类型筛选展示)
|
||||
/// </summary>
|
||||
public class EquipmentCategoryEntity : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 父级分类Id(0表示顶级)
|
||||
/// </summary>
|
||||
public long ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类编码
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 层级(1级、2级……,便于树形展示与筛选)
|
||||
/// </summary>
|
||||
public int Level { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 排序号
|
||||
/// </summary>
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 500)]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Model.Entity.Asset
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备台账(资产台账)
|
||||
/// </summary>
|
||||
public class EquipmentEntity : BaseEntity
|
||||
{
|
||||
#region 基础信息(设备信息录入)
|
||||
/// <summary>
|
||||
/// 设备编号(唯一)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备分类Id(关联 EquipmentCategoryEntity.Id)
|
||||
/// </summary>
|
||||
public long CategoryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备类型(实验室/楼层/部门/位置/产品/自定义等分类维度下的类型名称,冗余便于展示)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备品牌
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string? Brand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备型号
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string? Model { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格参数
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 200)]
|
||||
public string? Specifications { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 制造商(设备制造商)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string? Manufacturer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商(资产供应商)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string? Supplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备图片地址(图片上传后存储的相对路径)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 200)]
|
||||
public string? ImageUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 二维码编号(一物一码)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? QrCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备描述
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "text")]
|
||||
public string? Description { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 权属与使用信息(设备分类管理:实验室/楼层/部门/位置)
|
||||
/// <summary>
|
||||
/// 使用部门名称(资产使用部门)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string? Department { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 存放位置(实验室/楼层/房间等位置信息)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 200)]
|
||||
public string? Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 责任人(资产责任人)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? ResponsiblePerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 责任人联系电话(资产责任人电话)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 30)]
|
||||
public string? ContactPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保管人
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? Custodian { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 购置与财务信息(资产全生命周期:采购阶段)
|
||||
/// <summary>
|
||||
/// 购置日期
|
||||
/// </summary>
|
||||
public DateTime? PurchaseDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 购置价格(资产购置价格)
|
||||
/// </summary>
|
||||
[SugarColumn(DecimalDigits = 2, Length = 18)]
|
||||
public decimal? PurchasePrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保修到期日期(资产保修到期)
|
||||
/// </summary>
|
||||
public DateTime? WarrantyExpireDate { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 生命周期信息(资产全生命周期:验收/使用/报废阶段)
|
||||
/// <summary>
|
||||
/// 验收日期(资产验收日期)
|
||||
/// </summary>
|
||||
public DateTime? AcceptanceDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用日期(资产启用日期)
|
||||
/// </summary>
|
||||
public DateTime? EnableDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 使用年限(资产使用年限,单位:年)
|
||||
/// </summary>
|
||||
public int? ServiceLifeYears { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废日期(资产报废日期)
|
||||
/// </summary>
|
||||
public DateTime? ScrapDate { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 状态信息(设备状态管理:待验收→使用中→已借出→闲置→维修中→已停用→待处置→已处置→入库)
|
||||
/// <summary>
|
||||
/// 设备当前状态(状态流转记录见 EquipmentStatusRecordEntity)
|
||||
/// </summary>
|
||||
public EquipmentStatusEnum Status { get; set; } = EquipmentStatusEnum.PendingAcceptance;
|
||||
#endregion
|
||||
|
||||
#region 合规信息(设备合规管理:校准/检定/保养)
|
||||
/// <summary>
|
||||
/// 校准状态(正常/超期)
|
||||
/// </summary>
|
||||
public ComplianceStatusEnum CalibrationStatus { get; set; } = ComplianceStatusEnum.Normal;
|
||||
|
||||
/// <summary>
|
||||
/// 上次校准日期(校准日期)
|
||||
/// </summary>
|
||||
public DateTime? LastCalibrationDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下次校准到期日期(用于判断是否超期)
|
||||
/// </summary>
|
||||
public DateTime? NextCalibrationDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检定日期
|
||||
/// </summary>
|
||||
public DateTime? InspectionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下次检定到期日期(用于判断是否超期)
|
||||
/// </summary>
|
||||
public DateTime? NextInspectionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保养状态(正常/超期)
|
||||
/// </summary>
|
||||
public ComplianceStatusEnum MaintenanceStatus { get; set; } = ComplianceStatusEnum.Normal;
|
||||
|
||||
/// <summary>
|
||||
/// 上次保养日期(保养日期)
|
||||
/// </summary>
|
||||
public DateTime? LastMaintenanceDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下次保养到期日期(保养周期到期,用于判断是否超期)
|
||||
/// </summary>
|
||||
public DateTime? NextMaintenanceDate { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 审计信息
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 500)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? CreateBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人(修改人)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? UpdateBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间(修改时间)
|
||||
/// </summary>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
namespace Model.Entity.Asset
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备状态(设备状态管理:待验收 → 使用中 → 已借出 → 闲置 → 维修中 → 已停用 → 待处置 → 已处置 → 入库)
|
||||
/// </summary>
|
||||
public enum EquipmentStatusEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 待验收
|
||||
/// </summary>
|
||||
PendingAcceptance = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 使用中
|
||||
/// </summary>
|
||||
InUse = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 已借出
|
||||
/// </summary>
|
||||
Borrowed = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 闲置
|
||||
/// </summary>
|
||||
Idle = 4,
|
||||
|
||||
/// <summary>
|
||||
/// 维修中
|
||||
/// </summary>
|
||||
Repairing = 5,
|
||||
|
||||
/// <summary>
|
||||
/// 已停用
|
||||
/// </summary>
|
||||
Suspended = 6,
|
||||
|
||||
/// <summary>
|
||||
/// 待处置
|
||||
/// </summary>
|
||||
PendingDisposal = 7,
|
||||
|
||||
/// <summary>
|
||||
/// 已处置
|
||||
/// </summary>
|
||||
Disposed = 8,
|
||||
|
||||
/// <summary>
|
||||
/// 入库
|
||||
/// </summary>
|
||||
InStorage = 9
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合规状态(设备合规管理:校准状态、保养状态)
|
||||
/// </summary>
|
||||
public enum ComplianceStatusEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 正常
|
||||
/// </summary>
|
||||
Normal = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 超期
|
||||
/// </summary>
|
||||
Overdue = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 附件文件类型(设备附件管理:文件类型筛选)
|
||||
/// </summary>
|
||||
public enum AttachmentTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 使用说明书
|
||||
/// </summary>
|
||||
UserManual = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 合格证明
|
||||
/// </summary>
|
||||
Certificate = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 校准证书
|
||||
/// </summary>
|
||||
CalibrationCertificate = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 保养卡
|
||||
/// </summary>
|
||||
MaintenanceCard = 4,
|
||||
|
||||
/// <summary>
|
||||
/// 合同扫描件
|
||||
/// </summary>
|
||||
Contract = 5,
|
||||
|
||||
/// <summary>
|
||||
/// 验收照片
|
||||
/// </summary>
|
||||
AcceptancePhoto = 6,
|
||||
|
||||
/// <summary>
|
||||
/// 其他
|
||||
/// </summary>
|
||||
Other = 99
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Model.Entity.Asset
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备台账状态记录(设备状态管理:状态变更历史记录,并可按时间筛选查询)
|
||||
/// </summary>
|
||||
public class EquipmentStatusRecordEntity : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备Id(关联 EquipmentEntity.Id)
|
||||
/// </summary>
|
||||
public long EquipmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 变更前状态
|
||||
/// </summary>
|
||||
public EquipmentStatusEnum FromStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 变更后状态
|
||||
/// </summary>
|
||||
public EquipmentStatusEnum ToStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态变更时间
|
||||
/// </summary>
|
||||
public DateTime ChangeTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string? Operator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 变更原因/备注
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 500)]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user