feat(报废管理): 增强报废单功能并完善相关业务逻辑
refactor(报废单): 重构报废单DTO和实体类结构 fix(报废单): 修复审批和撤销逻辑中的问题 feat(报废单): 添加工单关联和库存操作功能 style(报废单): 优化代码格式和注释
This commit is contained in:
@@ -26,77 +26,178 @@ namespace DOAN.Model.BZFM.Dto
|
||||
/// </summary>
|
||||
public class QcScrapRecordsDto
|
||||
{
|
||||
public string WorkStation { get; set; }
|
||||
/// <summary>
|
||||
/// 主键 ID
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
public int? Version { get; set; }
|
||||
|
||||
public long? TenantId { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
public long? UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public long CreatedBy { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
public decimal CostImpact { get; set; }
|
||||
|
||||
public string QualityInspector { get; set; }
|
||||
|
||||
public string Status { get; set; }
|
||||
|
||||
public DateTime? ApprovalDate { get; set; }
|
||||
/// <summary>
|
||||
/// 报废单号
|
||||
/// </summary>
|
||||
public string ScrapOrderNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废日期
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "报废日期不能为空")]
|
||||
public DateTime? ScrapDate { get; set; }
|
||||
|
||||
public string SupervisorName { get; set; }
|
||||
|
||||
public string Operator { get; set; }
|
||||
|
||||
public long Id { get; set; }
|
||||
|
||||
public string DisposalMethod { get; set; }
|
||||
|
||||
public string ScrapType { get; set; }
|
||||
|
||||
public string ScrapReason { get; set; }
|
||||
|
||||
public string Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废数量
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "报废数量不能为空")]
|
||||
public decimal ScrapQuantity { get; set; }
|
||||
|
||||
public string BatchNo { get; set; }
|
||||
/// <summary>
|
||||
/// 计量单位
|
||||
/// </summary>
|
||||
public string Unit { get; set; }
|
||||
|
||||
public string MaterialName { get; set; }
|
||||
/// <summary>
|
||||
/// 处置方式
|
||||
/// </summary>
|
||||
public string DisposalMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废类型
|
||||
/// </summary>
|
||||
public string ScrapType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废原因说明
|
||||
/// </summary>
|
||||
public string ScrapReason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成本影响
|
||||
/// </summary>
|
||||
public decimal CostImpact { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前记录状态(如草稿/待审批/...)
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态标签(用于导出 Excel 显示)
|
||||
/// </summary>
|
||||
[ExcelColumn(Name = "状态:草稿,待审批,已批准,已拒绝")]
|
||||
public string StatusLabel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "物料编码不能为空")]
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
public string ProductName { get; set; }
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品编码
|
||||
/// </summary>
|
||||
public string ProductCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
public string ProductName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string BatchNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 炉号/批次标识
|
||||
/// </summary>
|
||||
public string StoveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 线别编码
|
||||
/// </summary>
|
||||
public string LineCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库位编码
|
||||
/// </summary>
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
public string Workorder { get; set; }
|
||||
|
||||
public string ScrapOrderNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商编码
|
||||
/// </summary>
|
||||
public string SupplierCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 供应商名称
|
||||
/// </summary>
|
||||
public string SupplierName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人
|
||||
/// </summary>
|
||||
public string Operator { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "状态:草稿,待审批,已批准,已拒绝")]
|
||||
public string StatusLabel { get; set; }
|
||||
/// <summary>
|
||||
/// 质检员
|
||||
/// </summary>
|
||||
public string QualityInspector { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 班组长/主管
|
||||
/// </summary>
|
||||
public string SupervisorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审批日期
|
||||
/// </summary>
|
||||
public DateTime? ApprovalDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 记录创建者(用户 ID)
|
||||
/// </summary>
|
||||
public long CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 记录创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近更新者(用户 ID)
|
||||
/// </summary>
|
||||
public long? UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近更新时间
|
||||
/// </summary>
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户 ID(多租户场景)
|
||||
/// </summary>
|
||||
public long? TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本号(用于并发控制)
|
||||
/// </summary>
|
||||
public int? Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产线/工位
|
||||
/// </summary>
|
||||
public string WorkStation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
namespace DOAN.Model.BZFM
|
||||
{
|
||||
/// <summary>
|
||||
@@ -7,197 +6,198 @@ namespace DOAN.Model.BZFM
|
||||
[SugarTable("qc_scrap_records")]
|
||||
public class QcScrapRecords
|
||||
{
|
||||
/// <summary>
|
||||
/// 工位
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "work_station")]
|
||||
public string WorkStation { get; set; }
|
||||
// Keep original fields and attributes; only adjusted order for clarity.
|
||||
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public int? Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "tenant_id")]
|
||||
public long? TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "updated_time")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "updated_by")]
|
||||
public long? UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "created_time")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "created_by")]
|
||||
public long CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库存编号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "location_code")]
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成本影响金额
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cost_impact")]
|
||||
public decimal CostImpact { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 质检员
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "quality_inspector")]
|
||||
public string QualityInspector { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态:草稿,待审批,已批准,已拒绝
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审批日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "approval_date")]
|
||||
public DateTime? ApprovalDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "scrap_date")]
|
||||
public DateTime? ScrapDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "supervisor_name")]
|
||||
public string SupervisorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作员
|
||||
/// </summary>
|
||||
public string Operator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主键ID
|
||||
/// 主键ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处置方式
|
||||
/// 报废单号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "disposal_method")]
|
||||
public string DisposalMethod { get; set; }
|
||||
[SugarColumn(ColumnName = "scrap_order_no")]
|
||||
public string ScrapOrderNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废类型:质量缺陷,过期,损坏,工艺错误,其他
|
||||
/// 报废日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "scrap_type")]
|
||||
public string ScrapType { get; set; }
|
||||
[SugarColumn(ColumnName = "scrap_date")]
|
||||
public DateTime? ScrapDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废原因
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "scrap_reason")]
|
||||
public string ScrapReason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public string Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废数量
|
||||
/// 报废数量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "scrap_quantity")]
|
||||
public decimal ScrapQuantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// 单位
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "batch_no")]
|
||||
public string BatchNo { get; set; }
|
||||
public string Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// 处置方式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "material_name")]
|
||||
public string MaterialName { get; set; }
|
||||
[SugarColumn(ColumnName = "disposal_method")]
|
||||
public string DisposalMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// 报废类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "scrap_type")]
|
||||
public string ScrapType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废原因
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "scrap_reason")]
|
||||
public string ScrapReason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成本影响金额
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cost_impact")]
|
||||
public decimal CostImpact { get; set; } = 0.00m;
|
||||
|
||||
/// <summary>
|
||||
/// 当前记录状态
|
||||
/// </summary>
|
||||
public string Status { get; set; } = "待审批";
|
||||
|
||||
/// <summary>
|
||||
/// 审批日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "approval_date")]
|
||||
public DateTime? ApprovalDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主管/班组长
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "supervisor_name")]
|
||||
public string SupervisorName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 质检员
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "quality_inspector")]
|
||||
public string QualityInspector { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 操作员
|
||||
/// </summary>
|
||||
public string Operator { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 库位编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "location_code")]
|
||||
public string LocationCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 工位
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "work_station")]
|
||||
public string WorkStation { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "material_code")]
|
||||
public string MaterialCode { get; set; }
|
||||
public string MaterialCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "material_name")]
|
||||
public string MaterialName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 产品编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "product_code")]
|
||||
public string ProductCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "product_name")]
|
||||
public string ProductName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品编号
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "product_code")]
|
||||
public string ProductCode { get; set; }
|
||||
[SugarColumn(ColumnName = "batch_no")]
|
||||
public string BatchNo { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 炉号
|
||||
/// 炉号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "stove_code")]
|
||||
public string StoveCode { get; set; }
|
||||
public string StoveCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 线别
|
||||
/// 线别
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "line_code")]
|
||||
public string LineCode { get; set; }
|
||||
public string LineCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
public string Workorder { get; set; }
|
||||
public string Workorder { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 报废单号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "scrap_order_no")]
|
||||
public string ScrapOrderNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商编码
|
||||
/// 供应商编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "supplier_code")]
|
||||
public string SupplierCode { get; set; }
|
||||
|
||||
public string SupplierCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 供应商名称
|
||||
/// 供应商名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "supplier_name")]
|
||||
public string SupplierName { get; set; }
|
||||
public string SupplierName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "created_by")]
|
||||
public long CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "created_time")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "updated_by")]
|
||||
public long? UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "updated_time")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "tenant_id")]
|
||||
public long? TenantId { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public int? Version { get; set; } = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user