using System.ComponentModel;

namespace WCS.WorkEngineering.WebApi.Models.WMS.Response
{
    /// <summary>
    ///  WCS上传信息接口返回
    /// </summary>
    public class SRes
    {
        /// <summary>
        /// 返回状态码
        /// </summary>
        public ResponseStatusCodeEnum ResCode { get; set; }

        /// <summary>
        /// 返回描述信息
        /// </summary>
        public string ResMsg { get; set; } = "成功";

        /// <summary>
        /// 备用
        /// </summary>
        public string Memo1 { get; set; }

        /// <summary>
        /// 备用
        /// </summary>
        public string Memo2 { get; set; }

        /// <summary>
        /// 备用
        /// </summary>
        public string Memo3 { get; set; }
    }

    /// <summary>
    ///  WMS返回DTO
    /// </summary>
    /// <typeparam name="T">泛型</typeparam>
    public class SRes<T> : SRes
    {
        /// <summary>
        /// 数据实体
        /// </summary>
        public T ResData { get; set; }

        /// <summary>
        ///  集合数据实体
        /// </summary>
        public List<T> ResDataList { get; set; }
    }

    public enum ResponseStatusCodeEnum
    {
        /// <summary>
        /// 成功
        /// </summary>
        [Description("成功")]
        Sucess = 200,

        /// <summary>
        /// 已存在
        /// </summary>
        [Description("已存在")]
        Exist = 201,

        /// <summary>
        /// 执行成功但未取得任何数据
        /// </summary>
        [Description("执行成功但未取得任何数据")]
        NoResult = 202,

        /// <summary>
        /// 参数错误
        /// </summary>
        [Description("参数错误")]
        ErrParam = 203,

        /// <summary>
        /// 语法异常
        /// </summary>
        [Description("语法异常")]
        InnerServerErr = 204,

        /// <summary>
        /// 参数不可为空
        /// </summary>
        [Description("参数不可为空")]
        ErrParamNotNull = 205,

        /// <summary>
        /// 失败
        /// </summary>
        [Description("失败")]
        Fail = 206,

        /// <summary>
        /// 参数错误
        /// </summary>
        [Description("参数错误")]
        AccountError = 1001,

        /// <summary>
        /// 业务逻辑错误
        /// </summary>
        [Description("业务逻辑错误")]
        DataSaveErr = 1002,

        /// <summary>
        /// 没有传过账凭证号
        /// </summary>
        [Description("没有传过账凭证号")]
        NotReqId = 1003,

        /// <summary>
        /// 仓库编码不存在
        /// </summary>
        [Description("仓库编码不存在")]
        WarehouseCodeNotExist = 2001,

        /// <summary>
        /// 容器码不能为空
        /// </summary>
        [Description("容器码不能为空")]
        ContainerCodeNotEmpty = 2002,

        /// <summary>
        /// 该托盘号已在库中，请检查托盘号是否贴重复
        /// </summary>
        [Description("该托盘号已在库中，请检查托盘号是否贴重复")]
        BarcodeContainerRepeat = 2003,

        /// <summary>
        /// 物料条码重复组盘
        /// </summary>
        [Description("物料条码重复组盘")]
        GroupStockDetailMaterialBarCodeExist = 2004,

        /// <summary>
        /// 物料编码信息不存在
        /// </summary>
        [Description("物料编码信息不存在")]
        MaterInfoNotExist = 2005,

        /// <summary>
        /// 不存在该任务
        /// </summary>
        [Description("不存在该任务")]
        WcsTaskNotExist = 2006,

        /// <summary>
        /// 组盘信息不存在
        /// </summary>
        [Description("组盘信息不存在")]
        StockNotExist = 2007,

        /// <summary>
        /// 没有可用库位
        /// </summary>
        [Description("没有可用库位")]
        NotEnoughLocation = 2008,

        /// <summary>
        /// 库区编码不存在
        /// </summary>
        [Description("库区编码不存在")]
        WareZoneCodeNotExist = 2009,

        /// <summary>
        /// 货位编码不存在
        /// </summary>
        [Description("货位编码不存在")]
        WareLocationCodeNotExist = 2010,

        /// <summary>
        /// 物料编码不存在
        /// </summary>
        [Description("物料编码不存在")]
        BaseMaterCodeNotExist = 2011,

        /// <summary>
        /// 单位编码不存在
        /// </summary>
        [Description("单位编码不存在")]
        BaseUnitCodeNotExist = 2012,

        /// <summary>
        /// 条码不存在
        /// </summary>
        [Description("条码不存在")]
        BaseBarcodeNotExist = 2013,

        /// <summary>
        /// 明细数据必须传参
        /// </summary>
        [Description("明细数据必须传参")]
        DocDetailNotExist = 2014,

        /// <summary>
        /// 当前组盘状态不是已组盘，不允许取消
        /// </summary>
        [Description("当前组盘状态不是已组盘，不允许取消")]
        StockStateNotBuildUp = 2015,

        /// <summary>
        /// 当前任务是已完成或已取消状态
        /// </summary>
        [Description("当前任务是已完成或已取消状态")]
        WcsTaskStateIsComplete = 2016,

        /// <summary>
        /// 组盘状态是已出库或已入库
        /// </summary>
        [Description("组盘状态是已出库或已入库")]
        StockStateFail = 2017,

        /// <summary>
        /// 当前入库任务还未分配货位，不允许完成
        /// </summary>
        [Description("当前入库任务还未分配货位，不允许完成")]
        InTaskNotLocation = 2018,

        /// <summary>
        /// 当前任务不是新建状态，只能取消新建状态的任务
        /// </summary>
        [Description("当前任务不是新建状态，只能取消新建状态的任务")]
        WcsTaskStateNotCreate = 2019,

        /// <summary>
        /// 单据不存在
        /// </summary>
        [Description("单据不存在")]
        DocNoCodeNotExist = 2019,

        /// <summary>
        /// 单据状态不是新增或执行，不允许结单
        /// </summary>
        [Description("单据状态不是新增或执行，不允许结单")]
        DocumentStateNotFinish = 2020,

        /// <summary>
        /// 单据存在新建或执行中的任务，不允许结单
        /// </summary>
        [Description("单据存在新建或执行中的任务，不允许结单")]
        IsTaskNotFinish = 2021,

        /// <summary>
        /// 存在进行中任务，不允许解绑
        /// </summary>
        [Description("存在进行中任务，不允许解绑")]
        IsTaskNotUnbounding = 2022,

        /// <summary>
        /// 没有当前设备信息，请进行维护
        /// </summary>
        [Description("没有当前设备信息，请进行维护")]
        EquipInfoNotExist = 2023,

        /// <summary>
        /// 存在当前任务
        /// </summary>
        [Description("存在当前任务")]
        WcsTaskExist = 2024,

        /// <summary>
        /// 组盘状态不对，请检查当前的组盘状态
        /// </summary>
        [Description("组盘状态不对，请检查当前的组盘状态")]
        RFIDStockStateFail = 2025,
    }
}
