using MadRunFabric.Common;
using MadRunFabric.Model;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DistributionApi.Models.Input
{
    public class DistriWorkOrderInput
    {
        /// <summary>
        /// 自增id
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 紧急程度 - 1一般 2紧急
        /// </summary>
        public int emergencyid { get; set; }
        /// <summary>
        /// 计划工单Id
        /// </summary>
        public string plantaskid { get; set; }
        /// <summary>
        /// 工单分类(1随机工单,2计划工单)
        /// </summary>
        public int wosorts { get; set; } = 1;

        /// <summary>
        /// 渠道来源 1表示PC 2表示安卓 3表示IOS 4表示微信
        /// </summary>
        public int channel { get; set; } = 1;
        /// <summary>
        /// 项目名称id
        /// </summary>
        public string projectid { get; set; }
        /// <summary>
        /// 工单编号 -------------------------------------------
        /// </summary>
        public string wocode { get; set; }
        /// <summary>
        /// 配送工单状态:0创建工单，1转派或者抢单（待取货）,2已取货（配送中）,3货物异常（异常），4已完结/待评价，5已取消，6挂起 ，9已评价 
        /// </summary>
        public int wostate { get; set; } = 0;
        /// <summary>
        /// 电梯岗 - 工单状态(0无操作，1已接单（待取货），2已取货（待配送）) -------------------------------------------
        /// </summary>
        public int wostate_elevator { get; set; } = 0;
        /// <summary>
        /// 处理内容
        /// </summary>
        public string detail { get; set; }

        /// <summary>
        /// 配送物品 -------------------------------------------
        /// </summary>
        public List<DistributionGoodsList> goodslist { get; set; }
        /// <summary>
        /// 配送物品 - 拆单参数
        /// </summary>
        public List<DistributionGoodsLists> goodslist_chaidan { get; set; }

        /// <summary>
        /// 收件（地址，科室，联系） ------------------------------------------- 把收/发地址信息保存起来，保证地址的独立性
        /// </summary>
        public List<DistributionDddressModel> receiverlist { get; set; }
        /// <summary>
        /// 发货（地址，科室，联系）
        /// </summary>
        public List<DistributionDddressModel> deliverylist { get; set; }
        /// <summary>
        /// 发货人
        /// </summary>
        public string deliveryname { get; set; }
        /// <summary>
        /// 发货电话
        /// </summary>
        public string deliverytel { get; set; }

        /// <summary>
        /// 转派人 -------------------------------------------
        /// </summary>
        public string touser { get; set; }
        /// <summary>
        /// 处理人
        /// </summary>
        public string dealby { get; set; }
        /// <summary>
        /// 处理时间
        /// </summary>
        public DateTime dealtime { get; set; }
        /// <summary>
        /// 是否最后一步 0否 1是
        /// </summary>
        public int islast { get; set; } = 0;


        /// <summary>
        /// 收货人签字 -------------------------------------------
        /// </summary>
        public List<FileBaseModel> signbypic { get; set; }
        /// <summary>
        /// 是否送达（0否1是） - 异常上报
        /// </summary>
        public string sended { get; set; }
        /// <summary>
        /// 异常说明
        /// </summary>
        public string exceptions { get; set; }

        ///// <summary>
        ///// 是否同意修改(0无操作，1不同意，2同意) -------------------------------------------申请 - 修改取消
        ///// </summary>
        //public int isagree { get; set; }

    }

    #region 字段 model
    /// <summary>
    /// 配送物品
    /// </summary>
    public class DistributionGoodsLists
    {
        /// <summary>
        /// 物品id
        /// </summary>
        public string goodsid { get; set; }
        /// <summary>
        /// 物品名称
        /// </summary>
        public string goodsname { get; set; }
        /// <summary>
        /// 紧急程度 - 1一般 2紧急
        /// </summary>
        public int typeid { get; set; }
        /// <summary>
        /// 是否提醒 - 提醒（关联工单，即将提醒内填写的内容展示在该物品下单成功后的物品种类后面）
        /// </summary>
        public bool isremind { get; set; }
        /// <summary>
        /// 提醒备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public int num { get; set; }

        /// <summary>
        /// 楼宇名称id ---------------------------------------------关联科室
        /// </summary>
        public string buildingid { get; set; }
        /// <summary>
        /// 楼宇
        /// </summary>
        public string building_name { get; set; }
        /// <summary>
        /// 层数id
        /// </summary>
        public string floorid { get; set; }
        /// <summary>
        /// 层数
        /// </summary>
        public string floor_name { get; set; }
        /// <summary>
        /// 科室(例如：内科|消化科[一级|二级|三级]) - 原因：科室可能是一级二级三级...不确定，所以用"|"隔开
        /// </summary>
        public string department_name { get; set; }
    }
    #endregion

}
