using MadRunFabric.Common;
using MongoDB.Bson.Serialization.Attributes;
using System.ComponentModel.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Text;

namespace MadRunFabric.Model
{
    /// <summary>
    /// 保养计划表
    /// </summary>
    [BsonIgnoreExtraElements]
    public class Wo_Maintain_Plan : IBaseModel<string>
    {
        /// <summary>
        /// id
        /// </summary>
        [Key]
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string id { get; set; }
        /// <summary>
        /// 项目名称
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string projectid { get; set; } = "";
        /// <summary>
        /// 检查事项
        /// </summary>
        public string[] matterids { get; set; }
        ///// <summary>
        ///// 系统名称
        ///// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        //public string systemid { get; set; } = "";
        ///// <summary>
        ///// 设备名称
        ///// </summary>
        //public string[] equipmentid { get; set; }
        /// <summary>
        /// 保养计划名称
        /// </summary>
        public string planname { get; set; } = "";
        /// <summary>
        /// 保养计划内容
        /// </summary>
        public string plancontent { get; set; } = "";
        /// <summary>
        /// 保养计划要求
        /// </summary>
        public string planclaim { get; set; } = "";
        /// <summary>
        /// 计划状态：0开始，1结束
        /// </summary>
        public int planstate { get; set; } = 0;
        /// <summary>
        /// 保养类别
        /// </summary>
        public List<string> maintaintype { get; set; } = null;
        /// <summary>
        /// 扩展字段 - 自定义
        /// </summary>
        public List<ExtensionFileModel> extensionlist { get; set; } = null;
        /// <summary>
        /// 附件
        /// </summary>
        public List<FileBaseModel> maintainfile { get; set; } = null;
        /// <summary>
        /// 计划类型 0临时 1定时
        /// </summary>
        public int plantype { get; set; }
        /// <summary>
        /// 计划ID
        /// </summary>
        public string hangfireid { get; set; } = "";
        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime startdate { get; set; }
        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime enddate { get; set; }
        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime createtime { get; set; }
        /// <summary>
        /// 提交人
        /// </summary>
        public string createby { get; set; } = "";
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool isdelete { get; set; } = false;
        /// <summary>
        /// 删除人
        /// </summary>
        public string deleteby { get; set; } = "";
        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime deletetime { get; set; }
        #region
        ///// <summary>
        ///// 项目名称
        ///// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        //public string proname { get; set; } = "";
        ///// <summary>
        ///// 系统名称
        ///// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        //public string sysname { get; set; } = "";
        ///// <summary>
        ///// 设备名称
        ///// </summary>
        //public string[] equipname { get; set; }
        ///// <summary>
        ///// 保养计划名称
        ///// </summary>
        //public string planname { get; set; } = "";
        ///// <summary>
        ///// 保养计划内容
        ///// </summary>
        //public string plancontent { get; set; } = "";
        ///// <summary>
        ///// 保养类别
        ///// </summary>
        //public List<string> maintaintype { get; set; } = null;
        ///// <summary>
        ///// 附件
        ///// </summary>
        //public List<FileBaseModel> maintainfile { get; set; } = null;

        ///// <summary>
        ///// 到期时间
        ///// 计算超时需要使用
        ///// </summary>
        //public DateTime expirytime { get; set; }
        ///// <summary>
        ///// 提前展示时长（分钟）
        ///// </summary>
        //public int advancelong { get; set; } = 0;

        ///// <summary>
        ///// 计划ID
        ///// </summary>
        //public string planid { get; set; } = "";
        //#region 计划任务
        ///// <summary>
        ///// 计划类型：1定时任务，2临时任务
        ///// </summary>
        //public int plantype { get; set; } = 0;

        ///// <summary>
        ///// 定时周期：1每天，2每周，3每月 
        ///// </summary>
        //public int plancycle { get; set; } = 0;

        ///// <summary>
        ///// 执行计划日：如每周第几天，每月第几天
        ///// </summary>
        //public int plandate { get; set; } = 0;

        ///// <summary>
        ///// 执行计划时间：几点执行
        ///// 0-23
        ///// </summary>
        //public int planhour { get; set; } = 0;

        ///// <summary>
        ///// 执行间隔 
        ///// 小时：0-23
        ///// 分钟：0-59
        ///// </summary>
        //public int planinterval { get; set; } = 0;

        ///// <summary>
        ///// 计划状态 0开始 1结束 2挂起
        ///// </summary>
        //public int planstate { get; set; } = 0;

        /////// <summary>
        /////// 开始执行时间
        /////// </summary>
        ////public DateTime planstart { get; set; }

        /////// <summary>
        /////// 计划结束时间
        /////// </summary>
        ////public DateTime planend { get; set; }

        //#endregion

        ///// <summary>
        ///// 提交时间
        ///// </summary>
        //public DateTime createtime { get; set; }

        ///// <summary>
        ///// 提交人
        ///// </summary>
        //public string createby { get; set; } = "";
        ///// <summary>
        ///// 是否删除
        ///// </summary>
        //public bool isdelete { get; set; } = false;
        #endregion
    }
    /// <summary>
    /// 保养计划类型 0临时 1定时
    /// </summary>
    public enum enummainplantype
    {
        /// <summary>
        /// 临时
        /// </summary>
        temporary = 0,
        /// <summary>
        /// 定时
        /// </summary>
        timing = 1
    }
}
