using System;
using System.Collections.Generic;
using System.Text;

namespace WCS.Model.WebSocketModel
{
    public class WebSocketMessageModel
    {
        public bool IsWarning { get; set; } = true;
        public Guid Guid { get; set; } = Guid.NewGuid();
        public WarningTypeEnum WarningType { get; set; }
        public int StoreId { get; set; }
        public string StoreCode { get; set; }
        public int ModuleId { get; set; }
        public string ModuleCode { get; set; }
        public int ShelfId { get; set; }
        public string ShelfCode { get; set; }
        public string WarningMessage { get; set; }
        /// <summary>
        /// 发送到前端的地址
        /// </summary>
        public string ClientIp { get; set; }
        public DateTime LastSendTime { get; set; }
        /// <summary>
        /// 消息创建时间 跟消息时效性有关
        /// </summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;
        public bool ClientIsReceived { get; set; }

        //恢复正常需要消除的报警guid
        public List<Guid> SolvedGuids { get; set; }


        /// <summary>
        /// 异常处理人
        /// </summary>
        public string SolvedUser { get; set; }
    }

    public enum WarningTypeEnum
    {
        进入入库未响应 = 0,
        入库自检丢失 = 1,
        入库自检未扫描上架 = 2,
        入库中异常取出 = 3,
        入库中未扫描上架 = 4,
        退出入库未响应 = 5,

        进入出库未响应 = 6,
        出库自检丢失 = 7,
        出库自检未扫描上架 = 8,
        出库中丢失 = 9,
        出库中未扫描上架 = 10,
        退出出库未响应 = 11,

        进入盘点未响应 = 12,
        确认盘点未响应 = 13,
        退出盘点未响应 = 14,

        自检丢失 = 15,
        自检未扫描上架 = 16,
        自检未响应 = 17,

        //通知类
        恢复正常 = 50,
        通知刷新出库 = 51,
        通知刷新盘点 = 52,
        通知刷新盟讯盘点 = 53,
        通知前台结束入库 = 54,
        通知刷新出库单列表 = 55,
        通知自检进度 = 56,
    }
}
