using MadRunFabric.Common;
using System;
using System.Collections.Generic;
using System.Text;

namespace EquipmentApi.Model.Dto
{
    public class Wo_Repair_ItemsDto
    {
        /// <summary>
        /// id
        /// </summary>
        public string id { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        public string wocode { get; set; } = "";

        /// <summary>
        /// 通话标识ID
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string callid { get; set; } = "";

        /// <summary>
        /// 渠道来源 1表示PC 2表示安卓 3表示IOS 4表示微信
        /// </summary>
        public int channel { get; set; } = 1;

        /// <summary>
        /// 渠道来源 1表示PC 2表示安卓 3表示IOS 4表示微信
        /// </summary>
        public string channelname { get; set; } = "";

        #region 报修信息
        /// <summary>
        /// 省
        /// </summary>
        public string province { get; set; } = "";
        public string provinceid { get; set; } = "";
        /// <summary>
        /// 市
        /// </summary>
        public string city { get; set; } = "";
        public string cityid { get; set; } = "";
        /// <summary>
        /// 项目名称
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string proname { get; set; } = "";
        public string pronameid { get; set; } = "";
        /// <summary>
        /// 项目类型
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string protype { get; set; } = "";
        public string protypeid { get; set; } = "";
        /// <summary>
        /// 报修地点
        /// </summary>
        public string repairreplace { get; set; } = "";
        public string repairreplaceid { get; set; } = "";
        /// <summary>
        /// 报修时间
        /// </summary>
        public DateTime repairtime
        {
            get
            {
                return _repairtime.ToLocalTime();
            }
            set
            {
                _repairtime = value.ToLocalTime();
            }
        }

        private DateTime _repairtime;

        /// <summary>
        /// 报修人
        /// </summary>
        public string repairman { get; set; } = "";
        public string repairmanid { get; set; } = "";
        /// <summary>
        /// 联系方式
        /// </summary>
        public string contactway { get; set; } = "";
        /// <summary>
        /// 系统名称
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string sysname { get; set; } = "";
        public string sysnameid { get; set; } = "";
        /// <summary>
        /// 设备名称
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string equipname { get; set; } = "";
        public string equipnameid { get; set; } = "";
        /// <summary>
        /// 故障类型
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string faulttype { get; set; } = "";
        public string faulttypeid { get; set; } = "";
        /// <summary>
        /// 故障说明
        /// </summary>
        public string faultdescripe { get; set; } = "";
        /// <summary>
        /// 故障图片
        /// </summary>
        public List<FileBaseModel> faultpic
        {
            get
            {
                if (_faultpic != null)
                    return _faultpic;
                else
                    return new List<FileBaseModel>(0);
            }
            set
            {
                _faultpic = value;
            }

        }
        private List<FileBaseModel> _faultpic;
        /// <summary>
        /// 预约时间
        /// </summary>
        public DateTime appointtime
        {
            get
            {
                return _appointtime.ToLocalTime();
            }
            set
            {
                _appointtime = value.ToLocalTime();
            }
        }

        private DateTime _appointtime;

        /// <summary>
        /// 允许延迟
        /// </summary>
        public string perdelay { get; set; } = "";
        /// <summary>
        /// 延迟后时间
        /// </summary>
        public DateTime perdelaytime
        {
            get
            {
                return _perdelaytime.ToLocalTime();
            }
            set
            {
                _perdelaytime = value.ToLocalTime();
            }
        }

        private DateTime _perdelaytime;

        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime createtime
        {
            get
            {
                return _createtime.ToLocalTime();
            }
            set
            {
                _createtime = value.ToLocalTime();
            }
        }

        private DateTime _createtime;

        /// <summary>
        /// 提交人
        /// </summary>
        public string createby { get; set; } = "";
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool isdelete { get; set; } = false;
        #endregion

        #region 未指定维修人且未抢单且未指派的任务，默认为公共任务
        /// <summary>
        /// 是否指定维修人 0否,1是
        /// </summary>
        public int isappoint { get; set; } = 0;
        /// <summary>
        /// 指定维修人
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string appointman { get; set; } = "";
        public string appointmanid { get; set; } = "";
        /// <summary>
        /// 是否抢单 0否,1是
        /// </summary>
        public int isgrab { get; set; } = 0;
        /// <summary>
        /// 抢单人
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string grabman { get; set; } = "";
        public string grabmanid { get; set; } = "";
        /// <summary>
        /// 抢单时间
        /// </summary>
        public DateTime grabtime
        {
            get
            {
                return _grabtime.ToLocalTime();
            }
            set
            {
                _grabtime = value.ToLocalTime();
            }
        }

        private DateTime _grabtime;
        #endregion

        #region 处理信息
        /// <summary>
        /// 维修班组
        /// </summary>
        public string serviceteam { get; set; } = "";
        /// <summary>
        /// 维修人
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string serviceman { get; set; } = "";
        public string servicemanid { get; set; } = "";
        /// <summary>
        /// 到场时间
        /// </summary>
        public DateTime arrivaltime
        {
            get
            {
                return _arrivaltime.ToLocalTime();
            }
            set
            {
                _arrivaltime = value.ToLocalTime();
            }
        }

        private DateTime _arrivaltime;

        /// <summary>
        /// 到场照片
        /// </summary>
        public List<FileBaseModel> arrivalpic { get; set; }
        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime finishtime
        {
            get
            {
                return _finishtime.ToLocalTime();
            }
            set
            {
                _finishtime = value.ToLocalTime();
            }
        }

        private DateTime _finishtime;

        /// <summary>
        /// 是否使用耗材：1是，0否
        /// </summary>
        public int isusematerial { get; set; } = 0;
        /// <summary>
        /// 耗材名称
        /// </summary>
        public string material { get; set; } = "";
        /// <summary>
        /// 处理完成照片
        /// </summary>
        public List<FileBaseModel> finishpic { get; set; }
        /// <summary>
        /// 异常说明
        /// </summary>
        public string exceptiondes { get; set; } = "";
        /// <summary>
        /// 工单状态:0创建工单，1已转派，2已抢单，3已处理，4已评价，5已取消 ,6挂起
        /// 注释：已转派和已抢单均为已接单，已评价和已取消的均为完结工单
        /// </summary>
        public int wostate { get; set; } = 0;
        #endregion
    }
}
