2025-08-29 13:09:14 +08:00

149 lines
7.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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