using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExternalDataSync.MOM
{
    public class OnlineCheckData
    {
        /// <summary>
        /// MsgId
        /// </summary>
        public string MsgId { get; set; } = "";
        /// <summary>
        /// OpCode
        /// </summary>
        public string OpCode { get; set; } = "";
        /// <summary>
        /// ProductionCode
        /// </summary>
        public string ProductionCode { get; set; } = "";
        /// <summary>
        /// CheckTime
        /// </summary>
        public string ScanTime { get; set; } = "";

        /// <summary>
        /// EndTime
        /// </summary>
        public string EndTime { get; set; } = "";

        /// <summary>
        /// CheckPerson
        /// </summary>
        public string CheckPerson { get; set; } = "";

        /// <summary>
        /// Powerused
        /// </summary>
        public string Powerused { get; set; } = "";


        /// <summary>
        /// QualityMark
        /// </summary>
        public int QualityMark { get; set; } = 1;

        public List<OnlineCheckData_CheckData> CheckData { get; set; } = new List<OnlineCheckData_CheckData>();
    }

    public class OnlineCheckData_CheckData
    {
        /// <summary>
        /// CheckCode
        /// </summary>
        public string CheckCode { get; set; } = "";
        /// <summary>
        /// CheckName
        /// </summary>
        public string CheckName { get; set; } = "";
        /// <summary>
        /// ProductionCode
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// StandardValue
        /// </summary>
        public string StandardValue { get; set; } = "";
        /// <summary>
        /// MinValue
        /// </summary>
        public string MinValue { get; set; } = "";
        /// <summary>
        /// MaxValue
        /// </summary>
        public string MaxValue { get; set; } = "";
        /// <summary>
        /// CheckValue
        /// </summary>
        public string CheckValue { get; set; } = "";
        /// <summary>
        /// QualityMark
        /// </summary>
        public int QualityMark { get; set; } = 1;
    }

    /// <summary>
    /// 测试数据上传接口响应类
    /// </summary>
    public class OnlineCheckDataResponse
    {
        /// <summary>
        /// 响应码 200正常、500失败
        /// </summary>
        public string Code { get; set; } = "";

        /// <summary>
        /// 响应消息，出错时返回接口调用失败原因
        /// </summary>
        public string Message { get; set; } = "";

        /// <summary>
        /// 请求编号，响应结果带回请求编号
        /// </summary>
        public string MsgId { get; set; } = "";

        /// <summary>
        /// 携带数据，JSON格式字符串数据
        /// </summary>
        public string Data { get; set; } = "";
    }
    public class PrintTaskData
    {
        ///       string msg = $"MARK|{printTemplete}|{productCode},{printDate}";

        /// <summary>
        /// printTemplete
        /// </summary>
        public string printTemplete { get; set; } = "";
        /// <summary>
        /// productCode
        /// </summary>
        public string productCode { get; set; } = "";
        /// <summary>
        /// printDate
        /// </summary>
        public string printDate { get; set; } = "";

    }

    /// <summary>
    /// 设备状态数据上传
    /// </summary>
    public class OnlineStatusData
    {
        /// <summary>
        /// 消息ID
        /// </summary>
        public string MsgId { get; set; } = "";

        /// <summary>
        /// 设备编码
        /// </summary>
        public string DeviceCode { get; set; } = "";

        /// <summary>
        /// 数据类型: Status-设备状态, Use-使用情况
        /// </summary>
        public string DataType { get; set; } = "";

        /// <summary>
        /// 状态数据列表
        /// </summary>
        public List<OnlineStatusData_CheckData> CheckData { get; set; } = new List<OnlineStatusData_CheckData>();
    }

    /// <summary>
    /// 设备状态数据明细
    /// </summary>
    public class OnlineStatusData_CheckData
    {
        /// <summary>
        /// 状态代码
        /// </summary>
        public string StatuCode { get; set; } = "";

        /// <summary>
        /// 状态名称
        /// </summary>
        public string StatuName { get; set; } = "";

        /// <summary>
        /// 状态值
        /// </summary>
        public string StatuValue { get; set; } = "";
    }

    /// <summary>
    /// 获取位置待测试产品信息 - 请求类
    /// </summary>
    public class GetWaitCheckProductDataRequest
    {
        /// <summary>
        /// 请求编号 GUID
        /// </summary>
        public string MsgId { get; set; } = "";

        /// <summary>
        /// 位置号 AC1104-1, AC1104-2等
        /// </summary>
        public string OpCode { get; set; } = "";
    }

    /// <summary>
    /// 获取位置待测试产品信息 - 响应类
    /// </summary>
    public class GetWaitCheckProductDataResponse
    {
        /// <summary>
        /// 响应码 200正常、500失败
        /// </summary>
        public string Code { get; set; } = "";

        /// <summary>
        /// 响应消息，出错时返回接口调用失败原因
        /// </summary>
        public string Message { get; set; } = "";

        /// <summary>
        /// 请求编号，响应结果带回请求编号
        /// </summary>
        public string MsgId { get; set; } = "";

        /// <summary>
        /// 响应数据
        /// </summary>
        public GetWaitCheckProductDataResult Data { get; set; } = new GetWaitCheckProductDataResult();
    }

    /// <summary>
    /// 获取位置待测试产品信息 - 响应数据
    /// </summary>
    public class GetWaitCheckProductDataResult
    {
        /// <summary>
        /// 产品编号，唯一产品编码，若无待测产品则空
        /// </summary>
        public string ProductionCode { get; set; } = "";

        /// <summary>
        /// 产品型号，待测产品型号
        /// </summary>
        public string ProductModel { get; set; } = "";

        /// <summary>
        /// 产品型号代码，机型对应数字类型编号
        /// </summary>
        public int ProductModelCode { get; set; } = 0;
    }
}
