namespace BPA.MES.Base.Application.Services
{
    /// <summary>
    /// 名    称 ：  
    /// 创 建 人 ：yangxiao  
    /// 创建时间 ：  2023/7/20 14:29:09 
    /// 描    述 ：  
    /// </summary>
    public class WorkInfoDto : IMessage
    {
        /// <summary>
        /// 工单名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 生产计划Id
        /// </summary>
        public string PlanId { get; set; }
        /// <summary>
        /// 产线Id
        /// </summary>
        public string LineId { get; set; }
        /// <summary>
        /// 成品Id
        /// </summary>
        public string FinalId { get; set; }
        /// <summary>
        /// 产量
        /// </summary>
        public string Number { get; set; }
        /// <summary>
        /// 批次号
        /// </summary>
        public string BatchId { get; set; }
        /// <summary>
        /// 设备id
        /// </summary>
        public string DeviceId { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        public int MessageId { get; set; }

        public Version MsgVersion { get; set; }
    }
    /// <summary>
    /// 增加
    /// </summary>
    public class WorkInfoAddInput : WorkInfoDto
    {
        /// <summary>
        /// 产线工序Id
        /// </summary>
        public List<WorkDeviceAddInput> WorkDevices { get; set; } = new();

    }

    public class WorkDeviceAddInput
    {
        /// <summary>
        /// 产线工序Id
        /// </summary>
        public string ProcessId { get; set; }
        /// <summary>
        /// 设备
        /// </summary>
        public string DeviceId { get; set; }
    }
    /// <summary>
    /// 更新
    /// </summary>
    public class WorkInfoUpdateInput : WorkInfoDto
    {
        /// <summary>
        /// 主键
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 产线工序Id
        /// </summary>
        public List<WorkDeviceAddInput> WorkDevices { get; set; } = new();
    }
    /// <summary>
    /// 删除
    /// </summary>
    public class WorkInfoDelInput
    {
        /// <summary>
        /// 主键
        /// </summary>
        public string Id { get; set; }
    }

    /// <summary>
    /// 不分页查询条件
    /// </summary>
    public class WorkInfoQueryInput
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 主键
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 工单状态
        /// </summary>
        public WorkOrderStatusEnum?[] Status { get; set; }
        /// <summary>
        /// 起始时间
        /// </summary>
        public DateTime? StartTime { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }
        /// <summary>
        /// 批次计划Id
        /// </summary>
        public string BatchId { get; set; }
    }
    /// <summary>
    /// 分页
    /// </summary>
    public class WorkInfoQueryPageInput : RequestPage
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 工单状态
        /// </summary>
        public WorkOrderStatusEnum?[] Status { get; set; }
        /// <summary>
        /// 批次计划Id
        /// </summary>

        public string BatchId { get; set; }
        /// <summary>
        /// 起始时间
        /// </summary>
        public DateTime? StartTime { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }
    }
    /// <summary>
    /// 工单下发
    /// </summary>
    public class WorkPublishInput
    {

    }
    /// <summary>
    /// 输出
    /// </summary>
    public class WorkInfoOutput : WorkInfoDto
    {
        /// <summary>
        /// 主键
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string FinalName { get; set; }
        /// <summary>
        /// 线名称
        /// </summary>
        public string LineName { get; set; }
        /// <summary>
        /// 设备编码
        /// </summary>
        public string DeviceCode { get; set; }
        /// <summary>
        /// 设备名称
        /// </summary>
        public string DeviceName { get; set; }
        /// <summary>
        /// 工单状态
        /// </summary>
        public WorkOrderStatusEnum? Status { get; set; }



    }
    /// <summary>
    /// 详情输出
    /// </summary>
    public class WorkInfoDetailOutput : WorkInfoOutput
    {
        public WorkInfoDetailOutput()
        {

            CraftList = new();
            MaterialList = new();
        }
        /// <summary>
        /// 工艺状态
        /// </summary>
        public RecipeStatus? CraftStatus { get; set; }
        /// <summary>
        /// 配方状态
        /// </summary>
        public EBatchingStatus? MaterialStatus { get; set; }
        /// <summary>
        /// 工艺步骤
        /// </summary>
        public List<WorkInfoCraftstepRecordEntity> CraftList { get; set; }
        /// <summary>
        /// 物料信息
        /// </summary>
        public List<WorkInfoMaterialsRecordOutput> MaterialList { get; set; }
    }

    /// <summary>
    /// 编辑页面
    /// </summary>
    /// <returns></returns>
    public class WorkInfoEditDetailOutput
    {
        /// <summary>
        /// 生产计划Id
        /// </summary>
        public string PlanId { get; set; }
        /// <summary>
        /// 成品名称
        /// </summary>
        public string FinalName { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public string Quantity { get; set; }
        /// <summary>
        /// 产线Id
        /// </summary>
        public string LineId { get; set; }
        /// <summary>
        /// 产线工序Id
        /// </summary>
        public List<WorkDeviceAddInput> WorkDevices { get; set; } = new();
    }
}
