using System.Collections.Generic;

namespace Siger.Middlelayer.QmsRepository.Response
{
    public class ResponseStatisticalChart
    {
        public List<string> X1 { get; set; } = new List<string>();

        /// <summary>
        /// 良率
        /// </summary>
        public List<double> Y1 { get; set; } = new List<double>();

        public List<string> X2 { get; set; } = new List<string>();

        /// <summary>
        /// 不良次数
        /// </summary>
        public List<int> Y2 { get; set; } = new List<int>();

        /// <summary>
        /// 不良pareto累计
        /// </summary>
        public List<double> Y3 { get; set; } = new List<double>();
    }

    public class axis
    {
        public string x { get; set; }

        public double y { get; set; }

        public double y1 { get; set; }

        public int y2 { get; set; }

        public double y3 { get; set; }
    }

    public class ResponseGetTestRoomCheckReport
    {
        public List<int> qualified { get; set; } = new List<int>();

        public List<int> deviationrelease { get; set; } = new List<int>();

        public List<int> unqualified { get; set; } = new List<int>();

        public List<string> date { get; set; } = new List<string>();
    }

    public class ResponseGetTestRoomQualifiedReport
    {
        public List<FactoryTestRoomData> FactoryData { get; set; } = new List<FactoryTestRoomData>();
    }

    public class FactoryTestRoomData
    {
        public string factory { get; set; }

        public List<string> x { get; set; } = new List<string>();

        /// <summary>
        /// 合格
        /// </summary>
        public List<int> y { get; set; } = new List<int>();
        /// <summary>
        /// 不合格
        /// </summary>
        public List<int> y1 { get; set; } = new List<int>();
        /// <summary>
        /// 良率
        /// </summary>
        public List<double> y2 { get; set; } = new List<double>();

        public List<ChannelTestRoomData> ChannelData { get; set; } = new List<ChannelTestRoomData>();
    }

    public class ChannelTestRoomData
    {
        public string channel { get; set; }

        public List<string> x { get; set; } = new List<string>();
        /// <summary>
        /// 合格
        /// </summary>
        public List<int> y { get; set; } = new List<int>();
        /// <summary>
        /// 不合格
        /// </summary>
        public List<int> y1 { get; set; } = new List<int>();
        /// <summary>
        /// 良率
        /// </summary>
        public List<double> y2 { get; set; } = new List<double>();
    }

    public class ResponseGetConcessionReceptionReport
    {
        public List<string> X1 { get; set; } = new List<string>();
        /// <summary>
        /// 放行产品数量
        /// </summary>
        public List<int> Y1 { get; set; } = new List<int>();

        public List<string> X2 { get; set; } = new List<string>();
        /// <summary>
        /// 放行次数
        /// </summary>
        public List<int> Y2 { get; set; } = new List<int>();
        /// <summary>
        /// 放行次数累计比例
        /// </summary>
        public List<double> Y3 { get; set; } = new List<double>();
    }

    public class ImcomingAxis
    {
        public string x { get; set; }

        public int y1 { get; set; }

        public int y2 { get; set; }
    }

    public class ReponseGetIncomingChekType
    {
        public int QalifiedNum { get; set; }
        public int ReworkNum { get; set; }
        public int ConcessionReceptionNum { get; set; }
        public int RejectionNum { get; set; }

        public double QalifiedRate { get; set; }
        public double ReworkRate { get; set; }
        public double ConcessionReceptionRate { get; set; }
        public double RejectionRate { get; set; }
    }

    public class ReponseGetDeviationReleaseQuantity
    {
        public List<string> x1 { get; set; } = new List<string>();

        public List<string> x2 { get; set; } = new List<string>();

        public List<int> y1 { get; set; } = new List<int>();

        public List<int> y2 { get; set; } = new List<int>();

        public List<double> z1 { get; set; } = new List<double>();        

        public List<double> z2 { get; set; } = new List<double>();        

        public List<DeviationReleaseQuantity> datalist = new List<DeviationReleaseQuantity>();
    }

    public class DeviationReleaseQuantity
    {
        public string channel { get; set; }

        public int quantity { get; set; }

        public double quantity_rate { get; set; }

        public int batch_quantity { get; set; }

        public double batch_quantity_rate { get; set; }
    }

    public class ReponseGetSendTestInspectionTime
    {
        public List<string> x { get; set; } = new List<string>();

        public List<double> y { get; set; } = new List<double>();

        public List<double> y1 { get; set; } = new List<double>();

        public List<double> y2 { get; set; } = new List<double>();

        public List<SendTestInspectionTime> datalist = new List<SendTestInspectionTime>();
    }

    public class SendTestInspectionTime
    {
        public string section { get; set; }
        /// <summary>
        /// 送检到接收时间
        /// </summary>
        public double time { get; set; }
        /// <summary>
        /// 接收到开始时间
        /// </summary>
        public double time1 { get; set; }
        /// <summary>
        /// 开始到检验时间
        /// </summary>
        public double time2 { get; set; }
    }

    public class ResponseGetSPCMonitor
    {
        public List<int> x = new List<int>();

        public List<double> y = new List<double>();

        public List<int> xr = new List<int>();

        public List<double> yr = new List<double>();

        public double ucl { get; set; } = 0;

        public double lcl { get; set; } = 0;

        public double sl { get; set; } = 0;

        public double uclr { get; set; } = 0;

        public double lclr { get; set; } = 0;

        public double slr { get; set; } = 0;

        public List<AbnormalData> abnormalDatas = new List<AbnormalData>();

        public string SampleSize { get; set; } = "";

        public string SampleMean { get; set; } = "";

        public string SampleStd { get; set; } = "";

        public string UpperLimit { get; set; } = "";

        public string LowerLimit { get; set; } = "";
        /// <summary>
        /// 规格上限
        /// </summary>
        public string USL { get; set; } = "";
        /// <summary>
        /// 规格下限
        /// </summary>
        public string LSL { get; set; } = "";

        public string MidLine { get; set; } = "";

        public string Cp { get; set; } = "";

        public string Cpk { get; set; } = "";

        public string Cpu { get; set; } = "";

        public string Cpl { get; set; } = "";

        public int checktype_count { get; set; }

        public List<SpcData> spcdata { get; set; } = new List<SpcData>();

        public List<string> sample_x { get; set; } = new List<string>();

        public List<int> sample_y { get; set; } = new List<int>();

        /// <summary>
        /// 这两个Std不是标准差，是(UCL+LCL)/6
        /// </summary>
        public double Std { get; set; }
        public double Stdr { get; set; }

        public List<double> std1 { get; set; } = new List<double>();

        public List<double> std2 { get; set; } = new List<double>();

        public List<double> std3 { get; set; } = new List<double>();

        public List<double> std4 { get; set; } = new List<double>();

        public List<double> std5 { get; set; } = new List<double>();

        public List<double> std6 { get; set; } = new List<double>();

        public List<double> stdr1 { get; set; } = new List<double>();

        public List<double> stdr2 { get; set; } = new List<double>();

        public List<double> stdr3 { get; set; } = new List<double>();

        public List<double> stdr4 { get; set; } = new List<double>();

        public List<double> stdr5 { get; set; } = new List<double>();

        public List<double> stdr6 { get; set; } = new List<double>();

        public string Cp_mouth { get; set; } = "";

        public string Cpk_mouth { get; set; } = "";

        public string Cpu_mouth { get; set; } = "";

        public string Cpl_mouth { get; set; } = "";
    }

    public class AbnormalData
    {
        public double value { get; set; }

        public string rule { get; set; }

        public string time { get; set; }
    }

    public class SpcData
    {
        public double value { get; set; }

        public int isexception { get; set; }
    }
}
