/*************************************************************************************
 *
 * 文 件 名:   TaskApply
 * 描    述:   任务申请
 * 备    注:
 * 创 建 者：  Du
 * 创建时间：  2022/8/1 8:30:48
*************************************************************************************/

using System.Collections.Generic;

namespace RGD.HaiRouAPI.HaiRouModel
{
    public class TaskApply
    {
        private string TaskType;
        private string BusinessType;
        private string TaskGroupCode;
        private int GroupPriority;
        private List<task> taskss;

        /// <summary>
        /// 任务类型
        /// tote_outbound：容器出库;
        /// tote_inbound：容器入库
        /// </summary>
        public string taskType { get => TaskType; set => TaskType = value; }

        /// <summary>
        /// 业务类型,非必填,当任务类型是出库时，可选填业务类型
        /// </summary>
        public string businessType { get => BusinessType; set => BusinessType = value; }

        /// <summary>
        /// 任务组号,非必填,任务组，若不传则系统自动生成
        /// </summary>
        public string taskGroupCode { get => TaskGroupCode; set => TaskGroupCode = value; }

        /// <summary>
        /// 组优先级,非必填
        /// 0代表不区分优先级；从1开始，数值越大，优先级越高；系统会优先执行高优先级组的任务
        /// </summary>
        public int groupPriority { get => GroupPriority; set => GroupPriority = value; }

        /// <summary>
        /// 任务列表
        /// </summary>
        public List<task> tasks { get => taskss; set => taskss = value; }
    }

    public class task
    {
        private string TaskCode;
        private int TaskPriority;
        private taskDescribe TaskDescribe;

        /// <summary>
        /// 任务号
        /// </summary>
        public string taskCode { get => TaskCode; set => TaskCode = value; }

        /// <summary>
        /// 任务优先级,非必填项,0代表不区分优先级；从1开始，数值越大，优先级越高；系统会优先分配优先级高的任务
        /// </summary>
        public int taskPriority { get => TaskPriority; set => TaskPriority = value; }

        /// <summary>
        /// 任务描述
        /// </summary>
        public taskDescribe taskDescribe { get => TaskDescribe; set => TaskDescribe = value; }
    }

    public class taskDescribe
    {
    }

    /// <summary>
    /// 入库任务描述
    /// </summary>
    public class InTaskDescribe : taskDescribe
    {
        private string ContainerCode;
        private string ContainerType;
        private string StorageTag;
        private string FromLocationCode;
        private string LocationCode;

        /// <summary>
        /// 容器编码,必填项
        /// </summary>
        public string containerCode { get => ContainerCode; set => ContainerCode = value; }

        /// <summary>
        /// 容器型号,入库任务必填项,必须指定一个型号才能入库
        /// </summary>
        public string containerType { get => ContainerType; set => ContainerType = value; }

        /// <summary>
        /// 工作位标签,入库任务非必填项
        /// </summary>
        public string storageTag { get => StorageTag; set => StorageTag = value; }

        /// <summary>
        /// 起始工作位,非必填项
        /// </summary>
        public string fromLocationCode { get => FromLocationCode; set => FromLocationCode = value; }

        /// <summary>
        /// 目标工作位,入库任务非必填项
        /// </summary>
        public string locationCode { get => LocationCode; set => LocationCode = value; }
    }

    /// <summary>
    /// 出库任务描述
    /// </summary>
    public class OutTaskDescribe : taskDescribe
    {
        private long Deadline;
        private string ContainerCode;
        private string FromLocationCode;
        private List<string> ToStationCode;
        private string ToLocationCode;
        private int Specifiedtrunk;

        /// <summary>
        /// 时间戳,ms,出库任务非必填项,若临近截单时间N（N可配置），则任务优先级会提高，会优先执行
        /// </summary>
        public long deadLine { get => Deadline; set => Deadline = value; }

        /// <summary>
        /// 容器编码,必填项
        /// </summary>
        public string containerCode { get => ContainerCode; set => ContainerCode = value; }

        /// <summary>
        /// 起始工作位,非必填项
        /// </summary>
        public string fromLocationCode { get => FromLocationCode; set => FromLocationCode = value; }

        /// <summary>
        /// 目标工作站编码,出库任务必填项,支持传多个工作站，系统均衡分配
        /// </summary>
        public List<string> toStationCode { get => ToStationCode; set => ToStationCode = value; }

        /// <summary>
        /// 目标工作站工作位,出库任务非必填项
        /// </summary>
        public string toLocationCode { get => ToLocationCode; set => ToLocationCode = value; }

        /// <summary>
        /// 指定背篓
        /// </summary>
        public int specifiedTrunk { get => Specifiedtrunk; set => Specifiedtrunk = value; }
    }
}