149 lines
7.6 KiB
C#
149 lines
7.6 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel.DataAnnotations;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace DOAN.Model.MES.product
|
||
{
|
||
/// <summary>
|
||
/// 车间生产日执行表(关联周计划,记录每日计划分解、变更记录、实际完成及报废数据)
|
||
/// </summary>
|
||
[SugarTable("pro_weekly_date_plan")]
|
||
public class ProWeeklyDatePlan
|
||
{
|
||
/// <summary>
|
||
/// 主键ID,自增唯一标识
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "bigint(20) UNSIGNED", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键ID,自增唯一标识")]
|
||
public ulong Id { get; set; }
|
||
|
||
/// <summary>
|
||
/// 关联周计划表ID(外键,关联pro_weekly_plan.id)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "bigint(20) UNSIGNED", IsNullable = false, ColumnDescription = "关联周计划表ID(外键,关联pro_weekly_plan.id)")]
|
||
[Required(ErrorMessage = "关联周计划表ID不能为空")]
|
||
public ulong FkWeeklyPlanId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 周计划编号(冗余存储,如WP202535001,加速查询)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(64)", IsNullable = false, ColumnDescription = "周计划编号(冗余存储,如WP202535001,加速查询)")]
|
||
[Required(ErrorMessage = "周计划编号不能为空")]
|
||
public string PlanCode { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 生产日期(如2025-08-25,对应周计划内的具体日期)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "date", IsNullable = false, ColumnDescription = "生产日期(如2025-08-25,对应周计划内的具体日期)")]
|
||
[Required(ErrorMessage = "生产日期不能为空")]
|
||
public DateTime ProductionDate { get; set; }
|
||
|
||
/// <summary>
|
||
/// 班次(如白班、夜班,或班组名:杨惠红班组)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(32)", IsNullable = false, ColumnDescription = "班次(如白班、夜班,或班组名:杨惠红班组)")]
|
||
[Required(ErrorMessage = "班次不能为空")]
|
||
public string Shift { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 产品类型(如车型:Purple,用于分类识别)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(64)", IsNullable = false, ColumnDescription = "产品类型(如车型:Purple,用于分类识别)")]
|
||
[Required(ErrorMessage = "产品类型不能为空")]
|
||
public string ProductType { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 产品编码(如60103250-Y71-16,唯一标识零部件)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(64)", IsNullable = false, ColumnDescription = "产品编码(如60103250-Y71-16,唯一标识零部件)")]
|
||
[Required(ErrorMessage = "产品编码不能为空")]
|
||
public string ProductCode { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 产品名称(冗余存储,如左外后视镜总成)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true, ColumnDescription = "产品名称(冗余存储,如左外后视镜总成)")]
|
||
public string ProductName { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 当日计划生产数量(从周计划分解,或因变更调整)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "int(11)", IsNullable = false, ColumnDescription = "当日计划生产数量(从周计划分解,或因变更调整)")]
|
||
[Required(ErrorMessage = "当日计划生产数量不能为空")]
|
||
public int DailyPlanQty { get; set; }
|
||
|
||
/// <summary>
|
||
/// 计划是否变更(0:未变更;1:已变更)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "tinyint(1)", IsNullable = false, DefaultValue = 0, ColumnDescription = "计划是否变更(0:未变更;1:已变更)")]
|
||
[Required(ErrorMessage = "计划是否变更不能为空")]
|
||
public bool IsChanged { get; set; } = false;
|
||
|
||
/// <summary>
|
||
/// 变更原因(如插单、工艺调整、物料异常)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(255)", IsNullable = true, ColumnDescription = "变更原因(如插单、工艺调整、物料异常)")]
|
||
public string ChangeReason { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 当日实际完成数量(实时同步自生产报工)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "int(11)", IsNullable = false, DefaultValue = 0, ColumnDescription = "当日实际完成数量(实时同步自生产报工)")]
|
||
public int ActualQty { get; set; } = 0;
|
||
|
||
/// <summary>
|
||
/// 当日报废数量(含过程报废和检验报废,用于质量分析)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "int(11)", IsNullable = false, DefaultValue = 0, ColumnDescription = "当日报废数量(含过程报废和检验报废,用于质量分析)")]
|
||
public int ScrapQty { get; set; } = 0;
|
||
|
||
/// <summary>
|
||
/// 生产状态(0:未开始;1:执行中;2:已完成;3:暂停)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "tinyint(4)", IsNullable = false, ColumnDescription = "生产状态(0:未开始;1:执行中;2:已完成;3:暂停)")]
|
||
[Required(ErrorMessage = "生产状态不能为空")]
|
||
public byte ProductionStatus { get; set; }
|
||
|
||
/// <summary>
|
||
/// 操作员(工号/姓名,如杨惠红,用于责任追溯)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(64)", IsNullable = true, ColumnDescription = "操作员(工号/姓名,如杨惠红,用于责任追溯)")]
|
||
public string Operator { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 当日计划执行排序号,决定同日期同班次内的生产先后顺序
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "int(11)", IsNullable = false, ColumnDescription = "当日计划执行排序号,决定同日期同班次内的生产先后顺序")]
|
||
[Required(ErrorMessage = "执行排序号不能为空")]
|
||
public int Sort { get; set; }
|
||
|
||
/// <summary>
|
||
/// 创建人(计划员工号)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(64)", IsNullable = false, ColumnDescription = "创建人(计划员工号)")]
|
||
[Required(ErrorMessage = "创建人不能为空")]
|
||
public string CreatedBy { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 创建时间
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "datetime", IsNullable = false, DefaultValue = "CURRENT_TIMESTAMP", ColumnDescription = "创建时间")]
|
||
[Required(ErrorMessage = "创建时间不能为空")]
|
||
public DateTime CreatedTime { get; set; } = DateTime.Now;
|
||
|
||
/// <summary>
|
||
/// 更新人(工号)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "varchar(64)", IsNullable = true, ColumnDescription = "更新人(工号)")]
|
||
public string UpdatedBy { get; set; }
|
||
|
||
/// <summary>
|
||
/// 最后更新时间(自动触发)
|
||
/// </summary>
|
||
[SugarColumn(ColumnDataType = "datetime", IsNullable = true, DefaultValue = "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", ColumnDescription = "最后更新时间(自动触发)")]
|
||
public DateTime? UpdatedTime { get; set; }
|
||
}
|
||
}
|