namespace BPA.MES.Base.Application.Services
{
    /// <summary>
    /// 名    称 ：工单状态  
    /// 创 建 人 ：yangxiao  
    /// 创建时间 ：2023/7/20 14:29:39 
    /// 描    述 ：  
    /// </summary>
    public class WorkInfoStatusDto
    {
        /// <summary>
        /// 工单Id
        /// </summary>
        public string WorkId { get; set; }
        /// <summary>
        /// 工单状态
        /// </summary>
        public WorkOrderStatusEnum Status { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 备注
        /// </summary>

        public string Remark { get; set; }
    }
    /// <summary>
    /// 增加
    /// </summary>
    public class WorkInfoStatusAddInput : WorkInfoStatusDto
    {

    }
    /// <summary>
    /// 更新
    /// </summary>
    public class WorkInfoStatusUpdateInput 
    {
        /// <summary>
        /// 工单Id
        /// </summary>
        public string WorkId { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public WorkOrderStatusEnum Status { get; set; }
        /// <summary>
        /// 备注
        /// </summary>

        public string Remark { get; set; }
    }
    /// <summary>
    /// 删除
    /// </summary>
    public class WorkInfoStatusDelInput
    {
        /// <summary>
        /// 主键
        /// </summary>
        public string Id { get; set; }
    }
    /// <summary>
    /// 分页
    /// </summary>
    public class WorkInfoStatusQueryPageInput : RequestPage
    {
       
    }

    /// <summary>
    /// 批次下发
    /// </summary>
    public class BatchInput
    {
        public string BatchId { get; set; }
    }

    /// <summary>
    /// 下发
    /// </summary>
    public class PublishInput
    {
        /// <summary>
        /// 工单ID
        /// </summary>
        public string WorkId { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public string? DeviceId { get; set; }
    }
    /// <summary>
    /// 输出
    /// </summary>
    public class WorkInfoStatusOutput : WorkInfoStatusDto
    {
        /// <summary>
        /// 主键
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 状态名称
        /// </summary>
        public string StatusName { get {

                switch (Status)
                {
                    case WorkOrderStatusEnum.Unkown:
                        return "未知";
                    case WorkOrderStatusEnum.Draft:
                        return "草稿";
                    case WorkOrderStatusEnum.Issued:
                        return "已下发";
                    case WorkOrderStatusEnum.Receive:
                        return "已接受";
                    case WorkOrderStatusEnum.Started:
                        return "已启动";
                    case WorkOrderStatusEnum.Completed:
                        return "已完成";
                    case WorkOrderStatusEnum.Obsolete:
                        return "废弃";
                    default:
                        return "错误";
                }
            } }
    }
}
