示例#1
0
        public static List <BITestData> RetrieveProjectTestDataByWafer(string pjkey, string wafer)
        {
            var ret = new List <BITestData>();
            var sql = string.Empty;

            if (!string.IsNullOrEmpty(pjkey))
            {
                sql = "select ProjectKey,DataID,ModuleSerialNum,WhichTest,ModuleType,ErrAbbr,TestTimeStamp,TestStation,PN,Wafer,Waferpn from BITestData where ProjectKey = '<ProjectKey>' and Wafer = '<Wafer>' order by ModuleSerialNum,TestTimeStamp DESC";
                sql = sql.Replace("<ProjectKey>", pjkey).Replace("<Wafer>", wafer);
            }
            else
            {
                sql = "select ProjectKey,DataID,ModuleSerialNum,WhichTest,ModuleType,ErrAbbr,TestTimeStamp,TestStation,PN,Wafer,Waferpn from BITestData where Wafer = '<Wafer>' order by ModuleSerialNum,TestTimeStamp DESC";
                sql = sql.Replace("<Wafer>", wafer);
            }

            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var item in dbret)
            {
                var tempdata = new BITestData(Convert.ToString(item[0]), Convert.ToString(item[1]), Convert.ToString(item[2])
                                              , Convert.ToString(item[3]), Convert.ToString(item[4]), Convert.ToString(item[5])
                                              , Convert.ToString(item[6]), Convert.ToString(item[7]), Convert.ToString(item[8]), Convert.ToString(item[9]), Convert.ToString(item[10]));
                ret.Add(tempdata);
            }
            return(ret);
        }
示例#2
0
        public static void PrePareLatestData(Controller ctrl, string projectkey)
        {
            if (UpdatePJLockUsing(projectkey))
            {
                return;
            }

            try
            {
                var vm = ProjectViewModels.RetrieveOneProject(projectkey);
                if (vm.PNList.Count > 0)
                {
                    string lastupdatetime = BITestData.RetrieveLatestTimeOfLocalBI(projectkey);
                    if (!string.IsNullOrEmpty(lastupdatetime))
                    {
                        var vlast = DateTime.Parse(lastupdatetime);
                        vlast = vlast.AddMinutes(18);
                        if (vlast < DateTime.Now)
                        {
                            BIDataUtility.UpdateProjectData(ctrl, vm);
                        }
                    }
                    else
                    {
                        BIDataUtility.UpdateProjectData(ctrl, vm);
                    }
                }

                ResetUpdatePJLock(projectkey);
            }
            catch (Exception ex)
            {
                ResetUpdatePJLock(projectkey);
            }
        }
示例#3
0
        public static List <ProjectFAViewModules> RetrieveFADataWithSN(string ProjectKey, string SN, Controller ctrl)
        {
            var ret     = new List <ProjectFAViewModules>();
            var pjdata  = ProjectTestData.RetrieveProjectTestDataWithSN(100000, ProjectKey, SN);
            var pjdata1 = BITestData.RetrieveProjectTestDataWithSN(100000, ProjectKey, SN);

            if (pjdata1.Count > 0)
            {
                pjdata.AddRange(pjdata1);
            }

            //if (pjdata.Count == 0)
            //{
            //    pjdata = BITestData.RetrieveProjectTestDataWithSN(100000, ProjectKey, SN);
            //}

            foreach (var d in pjdata)
            {
                var im = IssueViewModels.RetrieveIssueByIssueKey(d.DataID, ctrl);
                if (im != null)
                {
                    ret.Add(new ProjectFAViewModules(im, d));
                }
            }
            return(ret);
        }
示例#4
0
        public static List <BITestData> RetrieveProjectTestData(string projectkey, string startdate, string enddate, bool firstyield)
        {
            var ret = new List <BITestData>();
            var sql = "";

            if (firstyield)
            {
                sql = "select ProjectKey,DataID,ModuleSerialNum,WhichTest,ModuleType,ErrAbbr,TestTimeStamp,TestStation,PN,Wafer,Waferpn from BITestData where ProjectKey = '<ProjectKey>' and TestTimeStamp > '<StartDate>' and TestTimeStamp < '<EndDate>' order by ModuleSerialNum,TestTimeStamp ASC";
            }
            else
            {
                sql = "select ProjectKey,DataID,ModuleSerialNum,WhichTest,ModuleType,ErrAbbr,TestTimeStamp,TestStation,PN,Wafer,Waferpn from BITestData where ProjectKey = '<ProjectKey>' and TestTimeStamp > '<StartDate>' and TestTimeStamp < '<EndDate>' order by ModuleSerialNum,TestTimeStamp DESC";
            }

            sql = sql.Replace("<ProjectKey>", projectkey).Replace("<StartDate>", startdate).Replace("<EndDate>", enddate);

            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var item in dbret)
            {
                var tempdata = new BITestData(Convert.ToString(item[0]), Convert.ToString(item[1]), Convert.ToString(item[2])
                                              , Convert.ToString(item[3]), Convert.ToString(item[4]), Convert.ToString(item[5])
                                              , Convert.ToString(item[6]), Convert.ToString(item[7]), Convert.ToString(item[8]), Convert.ToString(item[9]), Convert.ToString(item[10]));
                ret.Add(tempdata);
            }
            return(ret);
        }
示例#5
0
        public static List <ProjectFAViewModules> RetrieveDoneFAData(string pjkey, Controller ctrl)
        {
            var ret = new List <ProjectFAViewModules>();

            var issuedict = IssueViewModels.RRetrieveFAByPjkey(pjkey, Resolute.Done, 2000, ctrl);

            foreach (var d in issuedict)
            {
                if (d.CommentList.Count == 2)
                {
                    bool sameas = false;
                    foreach (var com in d.CommentList)
                    {
                        if (com.Comment.Contains("<p>Issue Same As <a"))
                        {
                            sameas = true;
                            break;
                        }

                        if (com.Comment.Contains("passed") &&
                            string.Compare(com.Reporter, "System", true) == 0)
                        {
                            sameas = true;
                            break;
                        }
                    }
                    if (sameas)
                    {
                        continue;
                    }
                }

                if (d.Summary.Contains("@Burn-In Step"))
                {
                    var pjdata = BITestData.RetrieveProjectTestDataByDataID(d.IssueKey);
                    if (pjdata.Count > 0)
                    {
                        var pd = new ProjectTestData();
                        pd.ModuleSerialNum = pjdata[0].ModuleSerialNum;
                        pd.ErrAbbr         = pjdata[0].ErrAbbr;
                        pd.ProjectKey      = d.ProjectKey;
                        ret.Add(new ProjectFAViewModules(d, pd));
                    }
                }
                else
                {
                    var pjdata = ProjectTestData.RetrieveProjectTestData(d.IssueKey);
                    if (pjdata.Count > 0)
                    {
                        ret.Add(new ProjectFAViewModules(d, pjdata[0]));
                    }
                }
            }

            return(ret);
        }
示例#6
0
        public static ProjectBIYieldViewModule GetYieldByWafer(string pjkey, string wafer)
        {
            var ret = new ProjectBIYieldViewModule();

            ret.ProjectKey = pjkey;
            ret.StartDate  = DateTime.Now;
            ret.EndDate    = DateTime.Now;

            var plist = BITestData.RetrieveProjectTestDataByWafer(pjkey, wafer);

            RetrieveCummYield(ret, plist);

            return(ret);
        }
示例#7
0
        public static ProjectBIYieldViewModule GetYieldByDateRange(string pjkey, string sdate, string edate, ProjectViewModels pvm)
        {
            var ret = new ProjectBIYieldViewModule();

            ret.ProjectKey = pjkey;
            ret.StartDate  = DateTime.Parse(sdate);
            ret.EndDate    = DateTime.Parse(edate);

            var startdate = DateTime.Parse(DateTime.Parse(sdate).ToString("yyyy-MM-dd") + " 07:30:00").ToString();
            var enddate   = DateTime.Parse(DateTime.Parse(edate).ToString("yyyy-MM-dd") + " 07:30:00").ToString();

            if (startdate == enddate)
            {
                return(ret);
            }

            var plist        = BITestData.RetrieveProjectTestData(pjkey, startdate, enddate, true);
            var snlist       = BITestData.RetrieveSNBeforeDate(pjkey, startdate);
            var validatedict = new Dictionary <string, bool>();

            foreach (var item in plist)
            {
                if (!snlist.ContainsKey(item.ModuleSerialNum + "-" + item.WhichTest))
                {
                    if (!validatedict.ContainsKey(item.ModuleSerialNum))
                    {
                        validatedict.Add(item.ModuleSerialNum, true);
                    }
                }
            }

            plist = BITestData.RetrieveProjectTestData(pjkey, startdate, DateTime.Parse(enddate).AddYears(5).ToString(), false);
            var filteredPjData2 = new List <BITestData>();

            foreach (var item in plist)
            {
                if (validatedict.ContainsKey(item.ModuleSerialNum))
                {
                    filteredPjData2.Add(item);
                }
            }

            RetrieveCummYield(ret, filteredPjData2);

            return(ret);
        }
示例#8
0
        public static List <ProjectFAViewModules> RetrieveFADataWithErrAbbr(string ProjectKey, string ErrAbbr, Controller ctrl)
        {
            var ret    = new List <ProjectFAViewModules>();
            var pjdata = ProjectTestData.RetrieveProjectTestDataWithErrAbbr(100000, ProjectKey, ErrAbbr);

            if (pjdata.Count == 0)
            {
                pjdata = BITestData.RetrieveProjectTestDataWithErrAbbr(100000, ProjectKey, ErrAbbr);
            }


            foreach (var d in pjdata)
            {
                var im = IssueViewModels.RetrieveIssueByIssueKey(d.DataID, ctrl);
                if (im != null && im.Resolution != Resolute.AutoClose)
                {
                    ret.Add(new ProjectFAViewModules(im, d));
                }
            }
            return(ret);
        }
示例#9
0
        public static void RetrievePjWaferAllData(Controller ctrl, ProjectViewModels vm)
        {
            var vtab = new List <string>();

            vtab.Add("dbo.PRLL_VcselInfoSummary_2016");
            vtab.Add("dbo.PRLL_VcselInfoSummary_2017");
            foreach (var vt in vtab)
            {
                try
                {
                    var wafers = BITestData.RetrieveAllWafer(vm.ProjectKey);
                    if (vm.PNList.Count > 0 && wafers.Count > 0)
                    {
                        var failurelist = new List <BITestData>();
                        var failuredict = new Dictionary <string, bool>();
                        var passlist    = new List <BITestData>();

                        var starttime = vm.StartDate.ToString();

                        var sql    = "select ModuleSerialNum,Step,ModuleType,ErrAbbr,TestTimeStamp,TestStation,ModulePartNum,wafer,waferpn from  " + vt + "(nolock) where wafer in <WAFERCOND> and waferpn  <> 'NULL' and ErrAbbr  <> 'NULL' and ModulePartNum in <PNCOND> and TestTimeStamp <= '<TIMECOND>' order by TestTimeStamp Desc,ModuleSerialNum";
                        var pncond = PNCondition(vm.PNList);
                        if (string.IsNullOrEmpty(pncond))
                        {
                            return;
                        }
                        var wafercond = "('";
                        foreach (var w in wafers)
                        {
                            wafercond = wafercond + w + "','";
                        }
                        wafercond = wafercond.Substring(0, wafercond.Length - 2) + ")";

                        sql = sql.Replace("<PNCOND>", pncond).Replace("<TIMECOND>", starttime).Replace("<WAFERCOND>", wafercond);

                        var dbret = DBUtility.ExePRLSqlWithRes(ctrl, sql);
                        if (dbret.Count > 0)
                        {
                            var bondeddatadict = BITestData.RetrieveAllDataIDASC(vm.ProjectKey);
                            var tempdataiddict = new Dictionary <string, BITestData>();

                            foreach (var line in dbret)
                            {
                                var tempid = ConvertString(line[0]) + "_" + ConvertString(line[1]);

                                if (!bondeddatadict.ContainsKey(tempid))
                                {
                                    if (tempdataiddict.ContainsKey(tempid))
                                    {
                                        if (DateTime.Parse(ConvertString(line[4])) == tempdataiddict[tempid].TestTimeStamp)
                                        {
                                            if (string.Compare(ConvertString(line[3]), "Pass", true) != 0)
                                            {
                                                tempdataiddict[tempid].ErrAbbr = ConvertString(line[3]);

                                                if (!failuredict.ContainsKey(tempdataiddict[tempid].ModuleSerialNum))
                                                {
                                                    failuredict.Add(tempdataiddict[tempid].ModuleSerialNum, true);
                                                    failurelist.Add(tempdataiddict[tempid]);

                                                    var ekey    = ProjectErrorViewModels.GetUniqKey();
                                                    var pjerror = new ProjectErrorViewModels(ProjectErrorViewModels.BURNIN, ekey, ConvertString(line[3]), "", 1);
                                                    pjerror.Reporter    = "System";
                                                    pjerror.Description = "";
                                                    pjerror.AddandUpdateProjectError();
                                                }
                                            }
                                        }    //same time
                                    }
                                    else
                                    {
                                        var tempdata = new BITestData();
                                        tempdata.DataID          = GetUniqKey();
                                        tempdata.ProjectKey      = vm.ProjectKey;
                                        tempdata.ModuleSerialNum = ConvertString(line[0]);
                                        tempdata.WhichTest       = ConvertString(line[1]);
                                        tempdata.ModuleType      = ConvertString(line[2]);
                                        tempdata.ErrAbbr         = ConvertString(line[3]);
                                        tempdata.TestTimeStamp   = DateTime.Parse(ConvertString(line[4]));
                                        tempdata.TestStation     = ConvertString(line[5]);
                                        tempdata.PN      = ConvertString(line[6]);
                                        tempdata.Wafer   = ConvertString(line[7]);
                                        tempdata.Waferpn = ConvertString(line[8]);

                                        tempdataiddict.Add(tempid, tempdata);
                                    }
                                } //end if (!bondeddatadict.ContainsKey(tempid))
                            }     //end foreach

                            foreach (var kv in tempdataiddict)
                            {
                                kv.Value.StoreBIData();
                            } //end foreach
                        }     //end if (dbret.Count > 0)
                    }         //end if pn > 0
                }
                catch (Exception ex)
                {
                }
            }
        }
示例#10
0
        public static void StartProjectBonding(Controller ctrl, ProjectViewModels vm)
        {
            var vtab = new List <string>();

            vtab.Add("dbo.PRLL_VcselInfoSummary_2016");
            vtab.Add("dbo.PRLL_VcselInfoSummary_2017");
            foreach (var vt in vtab)
            {
                try
                {
                    if (BITestData.UpdatePJLockUsing(vm.ProjectKey))
                    {
                        return;
                    }

                    if (vm.PNList.Count > 0)
                    {
                        var bondeddatadict = BITestData.RetrieveAllDataID(vm.ProjectKey);

                        //var failurelist = new List<BITestData>();
                        var sql    = "select ModuleSerialNum,Step,ModuleType,ErrAbbr,TestTimeStamp,TestStation,ModulePartNum,wafer,waferpn from  " + vt + "(nolock) where wafer <> 'NULL' and waferpn  <> 'NULL' and ErrAbbr  <> 'NULL' and ModulePartNum in <PNCOND> and TestTimeStamp > '<TIMECOND>'  and TestTimeStamp < '" + DateTime.Now.ToString() + "' order by TestTimeStamp Desc,ModuleSerialNum";
                        var pncond = PNCondition(vm.PNList);

                        if (string.IsNullOrEmpty(pncond))
                        {
                            BITestData.ResetUpdatePJLock(vm.ProjectKey);
                            return;
                        }

                        sql = sql.Replace("<PNCOND>", pncond).Replace("<TIMECOND>", vm.StartDate.ToString());

                        var tempdataiddict = new Dictionary <string, BITestData>();
                        var dbret          = DBUtility.ExePRLSqlWithRes(ctrl, sql);
                        foreach (var line in dbret)
                        {
                            var tempid = ConvertString(line[0]) + "_" + ConvertString(line[1]);

                            if (bondeddatadict.ContainsKey(tempid))
                            {
                                if (DateTime.Parse(ConvertString(line[4])) <= bondeddatadict[tempid])
                                {
                                    continue;
                                }
                            }

                            if (tempdataiddict.ContainsKey(tempid))
                            {
                                if (DateTime.Parse(ConvertString(line[4])) == tempdataiddict[tempid].TestTimeStamp)
                                {
                                    if (string.Compare(ConvertString(line[3]), "Pass", true) != 0)
                                    {
                                        tempdataiddict[tempid].ErrAbbr = ConvertString(line[3]);

                                        var ekey    = ProjectErrorViewModels.GetUniqKey();
                                        var pjerror = new ProjectErrorViewModels(ProjectErrorViewModels.BURNIN, ekey, ConvertString(line[3]), "", 1);
                                        pjerror.Reporter    = "System";
                                        pjerror.Description = "";
                                        pjerror.AddandUpdateProjectError();
                                    }
                                }    //same time
                            }
                            else
                            {
                                var tempdata = new BITestData();
                                tempdata.DataID          = GetUniqKey();
                                tempdata.ProjectKey      = vm.ProjectKey;
                                tempdata.ModuleSerialNum = ConvertString(line[0]);
                                tempdata.WhichTest       = ConvertString(line[1]);
                                tempdata.ModuleType      = ConvertString(line[2]);
                                tempdata.ErrAbbr         = ConvertString(line[3]);
                                tempdata.TestTimeStamp   = DateTime.Parse(ConvertString(line[4]));
                                tempdata.TestStation     = ConvertString(line[5]);
                                tempdata.PN      = ConvertString(line[6]);
                                tempdata.Wafer   = ConvertString(line[7]);
                                tempdata.Waferpn = ConvertString(line[8]);

                                tempdataiddict.Add(tempid, tempdata);
                            }
                        }    //end foreach

                        foreach (var kv in tempdataiddict)
                        {
                            kv.Value.StoreBIData();
                        }    //end foreach
                    }

                    BITestData.ResetUpdatePJLock(vm.ProjectKey);
                }
                catch (Exception ex)
                {
                    BITestData.ResetUpdatePJLock(vm.ProjectKey);
                }
            }
        }
示例#11
0
        public static List <ProjectFAViewModules> RetrievePendingFAData(string pjkey, Controller ctrl)
        {
            var ret        = new List <ProjectFAViewModules>();
            var issuedict  = IssueViewModels.RRetrieveFAByPjkey(pjkey, Resolute.Working, 50, ctrl);
            var issuedict2 = IssueViewModels.RRetrieveFAByPjkey(pjkey, Resolute.Pending, 500, ctrl);

            issuedict.AddRange(issuedict2);

            var bisndict = new Dictionary <string, string>();
            var fasndict = new Dictionary <string, string>();

            foreach (var d in issuedict)
            {
                if (d.Summary.Contains("@Burn-In Step"))
                {
                    var sn     = "";
                    var pjdata = BITestData.RetrieveProjectTestDataByDataID(d.IssueKey);
                    if (pjdata.Count > 0)
                    {
                        sn = pjdata[0].ModuleSerialNum;
                    }

                    if (!string.IsNullOrEmpty(sn) && !bisndict.ContainsKey(sn))
                    {
                        bisndict.Add(sn, d.ReportDate.ToString());
                        var pd = new ProjectTestData();
                        pd.ModuleSerialNum = sn;
                        pd.ErrAbbr         = pjdata[0].ErrAbbr;
                        pd.ProjectKey      = d.ProjectKey;
                        ret.Add(new ProjectFAViewModules(d, pd));
                    }
                    else if (!string.IsNullOrEmpty(sn) && bisndict.ContainsKey(sn))
                    {
                        //close automaticlly
                        IssueViewModels.CloseDupBIIssueAutomaticlly(d.ProjectKey, sn, bisndict[sn]);
                    }
                }
                else
                {
                    var sn     = "";
                    var pjdata = ProjectTestData.RetrieveProjectTestData(d.IssueKey);
                    if (pjdata.Count > 0)
                    {
                        sn = pjdata[0].ModuleSerialNum;
                    }

                    if (!string.IsNullOrEmpty(sn) && !fasndict.ContainsKey(sn))
                    {
                        fasndict.Add(sn, d.ReportDate.ToString());
                        ret.Add(new ProjectFAViewModules(d, pjdata[0]));
                    }
                    else if (!string.IsNullOrEmpty(sn) && fasndict.ContainsKey(sn))
                    {
                        //close automaticlly
                        IssueViewModels.CloseDupIssueAutomaticlly(d.ProjectKey, sn, fasndict[sn]);
                    }
                }
            }

            return(ret);
        }