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

namespace MadRunFabric.Model
{
    /// <summary>
    /// 报修工单基础表
    /// </summary>
    public class Wo_Repair_Base : IBaseModel<string>
    {
        /// <summary>
        /// id 工单编号,通话标识ID,渠道来源,工单状态,省code,市code,项目id,项目类型id,楼id,楼层id,系统id,设备名称id,报修地点,报修地点,报修时间,报修人
        /// </summary>
        [Key]
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        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>
        /// 工单状态:0创建工单，1已转派（转派或者抢单），2已处理，3已评价，7挂起，8已取消，9已完成
        /// </summary>
        public int wostate { get; set; } = 0;

        /// <summary>
        /// 省code
        /// </summary>
        public string province { get; set; } = "";
        /// <summary>
        /// 市code
        /// </summary>
        public string city { get; set; } = "";
        /// <summary>
        /// 项目id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string projectid { get; set; }
        /// <summary>
        /// 项目类型id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string protypeid { get; set; }
        /// <summary>
        /// 楼id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string buildid { get; set; }
        /// <summary>
        /// 楼层id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string floorid { get; set; }
        /// <summary>
        /// 系统id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string systemid { get; set; }
        /// <summary>
        /// 设备名称id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string equipmentid { get; set; }

        /// <summary>
        /// 报修地点(楼栋，楼层名称，例如：办公楼 6层)
        /// </summary>
        public string repairreplace { get; set; } = "";
        /// <summary>
        /// 报修地点 - 房间号（例如：1006）
        /// </summary>
        public string repairoom { get; set; } = "";
        /// <summary>
        /// 报修时间
        /// </summary>
        public DateTime? repairtime { get; set; }

        /// <summary>
        /// 报修人
        /// </summary>
        public string repairman { get; set; } = "";
        /// <summary>
        /// 联系方式
        /// </summary>
        public string contactway { get; set; } = "";

        /// <summary>
        /// 故障说明 设备名称
        /// </summary>
        public string faultdescripe { get; set; } = "";
        /// <summary>
        /// 故障图片
        /// </summary>
        public List<FileBaseModel> faultpic;
        /// <summary>
        /// 预约时间
        /// </summary>
        public DateTime? appointtime { get; set; }

        /// <summary>
        /// 类型(1派单2抢单)
        /// </summary>
        public int totype { get; set; } = 0;

        /// <summary>
        /// 接单人
        /// </summary>
        public List<string> touser { get; set; }

        /// <summary>
        /// 接单人姓名
        /// </summary>
        public List<string> tousername { get; set; }

        /// <summary>
        /// 接单时间
        /// </summary>
        public DateTime? totime { get; set; }

        /// <summary>
        /// 到场时间
        /// </summary>
        public DateTime? arrivetime { get; set; }

        /// <summary>
        /// 故障类型id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string faulttypeid { get; set; }

        /// <summary>
        /// 是否使用耗材
        /// </summary>
        public int ismaterials { get; set; } = 0;

        /// <summary>
        /// 耗材信息
        /// </summary>
        public List<MaterialModel> materials { get; set; }

        /// <summary>
        /// 是否缺少耗材
        /// </summary>
        public int islosematerials { get; set; } = 0;

        /// <summary>
        /// 缺少耗材信息
        /// </summary>
        public List<MaterialModel> losematerials { get; set; }

        /// <summary>
        /// 处理人
        /// </summary>
        public List<string> dealuser { get; set; }

        /// <summary>
        /// 处理人姓名
        /// </summary>
        public List<string> dealusername { get; set; }

        /// <summary>
        /// 处理时间
        /// </summary>
        public DateTime? dealtime { get; set; }

        /// <summary>
        /// 挂起时间
        /// </summary>
        public DateTime? hanguptime { get; set; }

        /// <summary>
        /// 评价时间
        /// </summary>
        public DateTime? evaluatetime { get; set; }

        /// <summary>
        /// 分数
        /// </summary>
        public int score { get; set; } = 0;

        /// <summary>
        /// 取消时间
        /// </summary>
        public DateTime? canceltime { get; set; }

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

        /// <summary>
        /// 提交人工号
        /// </summary>
        public string createuser { get; set; } = "";
        /// <summary>
        /// 提交人姓名
        /// </summary>
        public string createusername { get; set; } = "";
        /// <summary>
        /// 是否删除
        /// </summary>
        public int isdelete { get; set; } = 0;
        /// <summary>
        /// 删除用户
        /// </summary>
        public string deleteuser { get; set; } = "";
        /// <summary>
        /// 接单班组科室
        /// </summary>
        public string  Jwocode { get; set; }
        /// <summary>
        /// 改派遣班组科室
        /// </summary>
        public string Pwcode { get; set; }
        /// <summary>
        /// 处理人来源
        /// </summary>
        public string CLpeoplefrom { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? deletetime { get; set; }


        /// <summary>
        /// 班组接单时间
        /// </summary>
        public DateTime? tobztimes { get; set; }

        /// <summary>
        /// 维修时效id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string wxtimeid { get; set; }
        ///// <summary>
        ///// 超时了多久
        ///// </summary>
        //public string wxtimecenter { get; set; }
    }
}
