Пример #1
0
 /// <summary>
 /// 修改校准任务结果的吸光度
 /// </summary>
 /// <param name="calibResInfo"></param>
 public void UpdateSDTResult(CalibrationResultinfo calibResInfo)
 {
     try
     {
         ism_SqlMap.Update("Calibrator.UpdateSDTResult", calibResInfo);
         Hashtable ht = new Hashtable();
         ht.Add("SampleType", calibResInfo.SampleType);
         ht.Add("ProjectName", calibResInfo.ProjectName);
         ht.Add("CalibDate", DateTime.Now.ToString());
         ht.Add("DrawDate", calibResInfo.CalibrationDT);
         ht.Add("CalibMethod", calibResInfo.CalibMethod);
         int count = (int)ism_SqlMap.QueryForObject("Calibrator.QueryCalibCurveByProject", ht);
         if (count == 0)
         {
             ism_SqlMap.Insert("Calibrator.AddCalibCurveByProject", ht);
         }
         else
         {
             ism_SqlMap.Update("Calibrator.UpdateCalibCurveByProject", ht);
         }
     }
     catch (Exception e)
     {
         LogInfo.WriteErrorLog("UpdateSDTResult(CalibrationResultinfo calibResInfo)==" + e.ToString(), Module.Calibration);
     }
 }
Пример #2
0
        /// <summary>
        /// 修改校准曲线,拟合表
        /// </summary>
        /// <param name="r"></param>
        public void OnSDTCalibrateCurve(CalibrationResultinfo r)
        {
            if (IsResultRight(r.Remarks) == true)
            {
                myBatis.UpdateCalibratingCurve(r);
                myBatis.UpdateSDTResult(r);
            }

            SDTTableItem SDTTableItem_Calibrating = myBatis.QuerySDTTableItemByCalibrating(r.ProjectName, r.SampleType, r.CalibrationDT, r.CalibMethod);

            if (SDTTableItem_Calibrating != null)
            {
                bool sb = myBatis.IsHasSDTSchedule(r);
                //为true,任务失败
                if (sb == false)
                {
                    if (IsSdtCurveRight(SDTTableItem_Calibrating) == true)
                    {
                        myBatis.SetSDTTabelSuccessfulState(r.ProjectName, r.SampleType);
                        myBatis.SetSDTUsingFlag(SDTTableItem_Calibrating);
                    }
                    else
                    {
                        myBatis.SetSDTTabelFailedState(r.ProjectName, r.SampleType);
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        /// 根据项目信息查询校准任务对应的任务状态是否已完成
        /// </summary>
        /// <param name="calibResInfo"></param>
        /// <returns></returns>
        public bool IsHasSDTSchedule(CalibrationResultinfo calibResInfo)
        {
            bool bExist = false;

            try
            {
                Hashtable ht = new Hashtable();
                ht.Add("SampleNum", calibResInfo.SampleNum);
                ht.Add("ProjectName", calibResInfo.ProjectName);
                ht.Add("SampleType", calibResInfo.SampleType);
                ht.Add("CalibratorName", calibResInfo.CalibratorName);
                ht.Add("DrawDate", calibResInfo.CalibrationDT);
                int succes = (int)ism_SqlMap.QueryForObject("Calibrator.QueryCalibTaskCountByProject", ht);

                if (succes != TaskState.SUCC)
                {
                    bExist = true;
                }
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("IsHasSDTSchedule(CalibrationResultinfo calibResInfo)==" + e.ToString(), Module.Calibration);
            }

            return(bExist);
        }
Пример #4
0
        public void RunningErrors(int wn, string er)
        {
            RealTimeCUVDataInfo rt = myBatis.GetRealTimeCUVDataByWorkNo(wn);

            if (rt == null)
            {
                return;
            }


            switch (rt.WorkType)
            {
            case WORKTYPE.N:
            case WORKTYPE.E:
                SampleResultInfo samResInfo = myBatis.GetNORResult(rt);
                samResInfo.Remarks += "|" + er + "|";
                myBatis.UpdateNORResultRunLog(samResInfo);
                break;

            case WORKTYPE.B:
            case WORKTYPE.S:
                CalibrationResultinfo calibResInfo = myBatis.QueryCalibResultInfoByTCNO(rt);
                calibResInfo.Remarks += "|" + er + "|";
                myBatis.UpdateCalibResultRunLog(calibResInfo);
                break;

            case WORKTYPE.C:
                QualityControlResultInfo qcResInfo = myBatis.GetQCResult(rt);
                qcResInfo.Remarks += "|" + er + "|";
                myBatis.UpdateQCResultRunLog(qcResInfo);
                break;
            }
        }
Пример #5
0
 public void CalibrationAdd(CalibrationResultinfo calibrationResultinfo)
 {
     results.Clear();
     txtCheckPro.Text    = calibrationResultinfo.ProjectName;
     txtSampleType.Text  = calibrationResultinfo.SampleType;
     txtReagentName.Text = calibrationResultinfo.CalibratorName;
     deStartTime.Text    = DateTime.Now.AddMonths(-1).ToShortDateString();
     deEndTime.Text      = DateTime.Now.ToShortDateString();
 }
Пример #6
0
        public bool CheckResultsHasRihgt(CalibrationResultinfo results)
        {
            bool hasrightflag = false;

            if (IsResultRight(results.Remarks) == true)
            {
                hasrightflag = true;
            }
            return(hasrightflag);
        }
Пример #7
0
        public bool GetResultBeExistFromRealTimeWorkNum(int workNo, out RealTimeCUVDataInfo rt)
        {
            bool bExist = false;

            rt = myBatis.GetRealTimeCUVDataByWorkNo(workNo);
            if (rt == null)
            {
                return(bExist);
            }

            switch (rt.WorkType)
            {
            case WORKTYPE.N:
            case WORKTYPE.E:
                SampleResultInfo samResInfo = myBatis.GetNORResult(rt);
                if (samResInfo == null)
                {
                    bExist = false;
                }
                else
                {
                    bExist = true;
                }
                break;

            case WORKTYPE.B:
            case WORKTYPE.S:
                CalibrationResultinfo calibResInfo = myBatis.QueryCalibResultInfoByTCNO(rt);
                if (calibResInfo == null)
                {
                    bExist = false;
                }
                else
                {
                    bExist = true;
                }
                break;

            case WORKTYPE.C:
                QualityControlResultInfo qcResInfo = myBatis.GetQCResult(rt);
                if (qcResInfo == null)
                {
                    bExist = false;
                }
                else
                {
                    bExist = true;
                }
                break;
            }
            return(bExist);
        }
Пример #8
0
        /// <summary>
        /// 获取校准吸光度
        /// </summary>
        /// <param name="calibResultInfo"></param>
        /// <returns></returns>
        public float GetResultAbsValue(CalibrationResultinfo calibResultInfo)
        {
            float abs = 0;

            AssayProjectParamInfo para = myBatis.GetAssayProjectParamInfoByNameAndType("GetAssayProjectParamInfoByNameAndType", new AssayProjectInfo()
            {
                ProjectName = calibResultInfo.ProjectName, SampleType = calibResultInfo.SampleType
            });
            TimeCourseInfo tc           = myBatis.GetTimeCourse(calibResultInfo.TCNO, calibResultInfo.CalibrationDT);
            string         dilutionType = "定标体积";

            //SampleInfo s = myBatis.GetSample(samResultInfo.SampleNum, samResultInfo.SampleCreateTime);

            // string SMPVOLTypeStr = null;
            //if (s != null)
            //{
            //    SMPType smptype = new SMPTypeService().Get(s.SampleType) as SMPType;
            //    if (smptype != null)
            //    {
            //        SMPVOLTypeStr = smptype.SMPVOLType;
            //    }
            //    else
            //    {
            //        SMPVOLTypeStr = "S";
            //    }
            //}

            if (para != null)
            {
                switch (para.AnalysisMethod)
                {
                case "一点终点法":
                    abs = ABSProcess.OnePoint(tc, para, dilutionType);
                    break;

                case "二点终点法":
                    abs = ABSProcess.TwoPoint(tc, para, dilutionType);
                    break;

                case "速率A法":
                    abs = ABSProcess.RateA(tc, para, dilutionType);
                    break;

                case "速率B法":
                    abs = ABSProcess.RateB(tc, para, dilutionType);
                    break;
                }
            }

            return(abs);
        }
Пример #9
0
        /// <summary>
        /// 显示校准信息对应的反应进程数据
        /// </summary>
        /// <param name="calibrationResultInfoAndTimeCUVNO"></param>
        public void calibrationResultInfoAndTimeCUVNOAdd(List <CalibrationResultinfo> calibrationResultInfoAndTimeCUVNO)
        {
            List <CalibrationResultinfo> lstCalibReuslt = new List <CalibrationResultinfo>();
            CalibrationResultinfo        c   = null;
            List <string> lstCalibrationName = new List <string>();

            if (calibrationResultInfoAndTimeCUVNO.Count > 0)
            {
                foreach (CalibrationResultinfo calibrationResultInfo in calibrationResultInfoAndTimeCUVNO)
                {
                    lstCalibrationResultInfo.Add(calibrationResultInfo);
                    lstCalibrationName.Add(calibrationResultInfo.CalibratorName);
                    if (c == null || c.CalibrationDT == null || c.CalibrationDT != calibrationResultInfo.CalibrationDT)
                    {
                        c = new CalibrationResultinfo();
                        textEditProName.Text = c.ProjectName = calibrationResultInfo.ProjectName;
                        textEditSamType.Text = c.SampleType = calibrationResultInfo.SampleType;
                        c.CalibMethod        = calibrationResultInfo.CalibMethod;
                        c.CalibrationDT      = calibrationResultInfo.CalibrationDT;
                        lstCalibReuslt.Add(c);
                    }
                }
                comBoxEditCalibName.Properties.Items.AddRange(lstCalibrationName.Distinct().ToList());
                if (lstCalibReuslt.Count > 1)
                {
                    int i;
                    for (i = 0; i < lstCalibReuslt.Count; i++)
                    {
                        comboBoxCalibTime.Properties.Items.Add(lstCalibReuslt[i].CalibrationDT);
                    }
                    comboBoxCalibTime.Text = lstCalibReuslt[i - 1].CalibrationDT.ToString();
                }
                else
                {
                    comboBoxCalibTime.Properties.Items.Add(lstCalibReuslt[0].CalibrationDT);
                    comboBoxCalibTime.Text = lstCalibReuslt[0].CalibrationDT.ToString();
                }
                if (comBoxEditCalibName.SelectedIndex == -1)
                {
                    comBoxEditCalibName.SelectedIndex = 0;
                }
                else
                {
                    comBoxEditCalibName_SelectedIndexChanged(null, null);
                }
            }
        }
Пример #10
0
 public void UpdateCalibResultRunLog(CalibrationResultinfo calibResInfo)
 {
     try
     {
         Hashtable ht = new Hashtable();
         ht.Add("SampleNum", calibResInfo.SampleNum);
         ht.Add("ProjectName", calibResInfo.ProjectName);
         ht.Add("TCNO", calibResInfo.TCNO);
         ht.Add("Remarks", calibResInfo.Remarks);
         ht.Add("CalibrationDT", calibResInfo.CalibrationDT);
         ism_SqlMap.Update("Calibrator.UpdateCalibResultRunLog", ht);
     }
     catch (Exception e)
     {
         LogInfo.WriteErrorLog("UpdateCalibResultRunLog(CalibrationResultinfo calibResInfo)==" + e.ToString(), Module.Calibration);
     }
 }
Пример #11
0
        public CalibrationResultinfo QueryCalibResultInfoByTCNO(RealTimeCUVDataInfo realTimeDataInfo)
        {
            CalibrationResultinfo calibResInfo = new CalibrationResultinfo();

            try
            {
                Hashtable ht = new Hashtable();
                ht.Add("TCNO", realTimeDataInfo.TC);
                ht.Add("BeginTime", DateTime.Now.Date);
                ht.Add("EndTime", DateTime.Now.AddDays(1).Date);
                calibResInfo = ism_SqlMap.QueryForObject("Calibrator.QueryCalibResultInfoByTCNO", ht) as CalibrationResultinfo;
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("QueryCalibResultInfoByTCNO(RealTimeCUVDataInfo realTimeDataInfo)==" + e.ToString(), Module.Calibration);
            }

            return(calibResInfo);
        }
Пример #12
0
        public CalibrationResultinfo GetSDTResultByProject(string projectName, string sampleType, DateTime drawDate, string calibName)
        {
            CalibrationResultinfo calibResInfo = new CalibrationResultinfo();

            try
            {
                Hashtable ht = new Hashtable();
                ht.Add("ProjectName", projectName);
                ht.Add("SampleType", sampleType);
                ht.Add("CreateDate", drawDate);
                ht.Add("CalibName", calibName);
                calibResInfo = ism_SqlMap.QueryForObject("Calibrator.GetSDTResultByProject", ht) as CalibrationResultinfo;
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("IsHasSDTSchedule(CalibrationResultinfo calibResInfo)==" + e.ToString(), Module.Calibration);
            }

            return(calibResInfo);
        }
Пример #13
0
        /// <summary>
        /// 反应进程点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnReactionProcess_Click(object sender, EventArgs e)
        {
            if (gridView1.SelectedRowsCount > 0)
            {
                if (reactionProcessCB == null)
                {
                    reactionProcessCB = new ReactionProcessCB();
                    reactionProcessCB.CalibrationTimeCoursetEvent += calibrationCurve_CalibrationEvent;
                    reactionProcessCB.StartPosition = FormStartPosition.CenterScreen;
                }
                CalibrationResultinfo calibrationResultinfo = new CalibrationResultinfo();
                int selectedHandle = this.gridView1.GetSelectedRows()[0];
                calibrationResultinfo.CalibMethod = this.gridView1.GetRowCellValue(selectedHandle, "检测方法").ToString();
                calibrationResultinfo.ProjectName = this.gridView1.GetRowCellValue(selectedHandle, "检测项目").ToString();
                calibrationResultinfo.SampleType  = this.gridView1.GetRowCellValue(selectedHandle, "样本类型").ToString();

                reactionProcessCB.calibrationResult = calibrationResultinfo;
                reactionProcessCB.ReactionProcessCB_Load(null, null);
                reactionProcessCB.ShowDialog();
            }
        }
Пример #14
0
 /// <summary>
 /// 校准追溯点击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCalibTrace_Click(object sender, EventArgs e)
 {
     if (gridView1.SelectedRowsCount > 0)
     {
         if (calibrationTrace == null)
         {
             calibrationTrace = new CalibrationTrace();
             calibrationTrace.StartPosition = FormStartPosition.CenterScreen;
         }
         CalibrationResultinfo calibrationResultinfo = new CalibrationResultinfo();
         int selectedHandle = this.gridView1.GetSelectedRows()[0];
         calibrationResultinfo.CalibMethod = this.gridView1.GetRowCellValue(selectedHandle, "检测方法").ToString();
         calibrationResultinfo.ProjectName = this.gridView1.GetRowCellValue(selectedHandle, "检测项目").ToString();
         calibrationResultinfo.SampleType  = this.gridView1.GetRowCellValue(selectedHandle, "样本类型").ToString();
         calibStateDictionary.Clear();
         calibStateDictionary.Add("QueryCalibrationResultinfo", new object[] { XmlUtility.Serializer(typeof(CalibrationResultinfo), calibrationResultinfo) });
         CalibrationStateSend(calibStateDictionary);
         calibrationTrace.CalibrationAdd(calibrationResultinfo);
         calibrationTrace.ShowDialog();
     }
 }
Пример #15
0
        private void RealTimeCalculate(RealTimeCUVDataInfo realTimeData)
        {
            SampleResultInfo norResult = null;

            switch (realTimeData.WorkType)
            {
            case WORKTYPE.N:
            case WORKTYPE.E:
                norResult = myBatis.GetNORResult(realTimeData) as SampleResultInfo;
                if (norResult != null)
                {
                    if (resultService.IsResultRight(norResult.ToString()) == true)
                    {
                        norResult.AbsValue = resultService.GetResultAbsValue(norResult);
                        float rc = resultService.GetResultConcValue(norResult);
                        norResult.ConcResult = rc < 0 ? 0 : rc;
                    }
                    else
                    {
                        norResult.AbsValue   = -1;
                        norResult.ConcResult = -1;
                    }
                    //时时结果处理
                    myBatis.UpdateCurrentNORResult(norResult);
                    // resultService.ProcessCurrentNormalResultCalValue(norResult); 针对计算项目,在前台计算

                    resultService.AnalyzeResult(norResult);

                    //resultService.SetIntradayNorResultCalculated(true, norResult);
                }
                break;

            case WORKTYPE.B:
            case WORKTYPE.S:
                CalibrationResultinfo calibResInfo = myBatis.QueryCalibResultInfoByTCNO(realTimeData);    //根据进程编号获取需要更新的校准结果记录
                if (calibResInfo != null)
                {
                    if (resultService.IsResultRight(calibResInfo.Remarks) == true)
                    {
                        calibResInfo.CalibAbs = resultService.GetResultAbsValue(calibResInfo);

                        /*显示定标实际测量值
                         * AssayRunPara ar = new AssayRunParaService().Get(R.ItemName) as AssayRunPara;
                         * if(ar!=null)
                         * {
                         *  float k = (ar.SDTVol.VolPre+ar.SDTVol.VolDil)/ar.SDTVol.VolPre;
                         *  R.RAbsValue = (float.Parse(R.RAbsValue) * k).ToString("#0.0000");
                         * }
                         * */
                        //R.RConcValue = resultService.GetResultConcValue(R).ToString("#0.0000");
                    }
                    else
                    {
                        calibResInfo.CalibAbs = -1;
                        // R.RConcValue = "NA";
                    }
                    calibResInfo.TCNO = realTimeData.TC;
                    myBatis.UpdateSDTTaskState(calibResInfo.SampleNum, calibResInfo.ProjectName, calibResInfo.CalibratorName, calibResInfo.CalibrationDT, TaskState.SUCC);

                    resultService.OnSDTCalibrateCurve(calibResInfo);
                    //resultService.SetSDTResultCalculated(true, R);
                }
                break;

            case WORKTYPE.C:
                QualityControlResultInfo qCResInfo = myBatis.GetQCResult(realTimeData);
                if (qCResInfo != null)
                {
                    if (resultService.IsResultRight(qCResInfo.Remarks) == true)
                    {
                        qCResInfo.AbsValue   = resultService.GetResultAbsValue(qCResInfo);
                        qCResInfo.ConcResult = resultService.GetResultConcValue(qCResInfo);
                    }
                    else
                    {
                        qCResInfo.AbsValue   = -1;
                        qCResInfo.ConcResult = -1;
                    }
                    myBatis.UpdateQCResult(qCResInfo);
                    //resultService.SetQCResultCalculated(true, R);
                }
                break;
            }
        }
Пример #16
0
        /// <summary>
        /// 修改校准曲线表的吸光度
        /// </summary>
        /// <param name="calibResInfo"></param>
        public void UpdateCalibratingCurve(CalibrationResultinfo calibResInfo)
        {
            try
            {
                // 1.获取原来项目对应校准曲线数据
                Hashtable ht = new Hashtable();
                ht.Add("ProjectName", calibResInfo.ProjectName);
                ht.Add("SampleType", calibResInfo.SampleType);
                ht.Add("CalibMethod", calibResInfo.CalibMethod);
                ht.Add("DrawDate", calibResInfo.CalibrationDT.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                SDTTableItem sdtItem = ism_SqlMap.QueryForObject("Calibrator.QuerySDTTableItemByCalibrating", ht) as SDTTableItem;

                // 2.更新对应校准品校准测得的吸光度
                if (sdtItem != null)
                {
                    float fAbsNew = 0;
                    if (calibResInfo.CalibratorName == sdtItem.BlkItem)
                    {
                        if (sdtItem.BlkAbs == 0)
                        {
                            fAbsNew = calibResInfo.CalibAbs;
                        }
                        else
                        {
                            fAbsNew = (sdtItem.BlkAbs + calibResInfo.CalibAbs) / 2;
                        }
                        ht.Add("BlkAbs", fAbsNew);
                    }
                    else if (calibResInfo.CalibratorName == sdtItem.Calib1Item)
                    {
                        if (sdtItem.SDT1Abs == 0)
                        {
                            fAbsNew = calibResInfo.CalibAbs;
                        }
                        else
                        {
                            fAbsNew = (sdtItem.SDT1Abs + calibResInfo.CalibAbs) / 2;
                        }
                        ht.Add("SDT1Abs", fAbsNew);
                    }
                    else if (calibResInfo.CalibratorName == sdtItem.Calib2Item)
                    {
                        if (sdtItem.SDT2Abs == 0)
                        {
                            fAbsNew = calibResInfo.CalibAbs;
                        }
                        else
                        {
                            fAbsNew = (sdtItem.SDT2Abs + calibResInfo.CalibAbs) / 2;
                        }
                        ht.Add("SDT2Abs", fAbsNew);
                    }
                    else if (calibResInfo.CalibratorName == sdtItem.Calib3Item)
                    {
                        if (sdtItem.SDT3Abs == 0)
                        {
                            fAbsNew = calibResInfo.CalibAbs;
                        }
                        else
                        {
                            fAbsNew = (sdtItem.SDT3Abs + calibResInfo.CalibAbs) / 2;
                        }
                        ht.Add("SDT3Abs", fAbsNew);
                    }
                    else if (calibResInfo.CalibratorName == sdtItem.Calib4Item)
                    {
                        if (sdtItem.SDT4Abs == 0)
                        {
                            fAbsNew = calibResInfo.CalibAbs;
                        }
                        else
                        {
                            fAbsNew = (sdtItem.SDT4Abs + calibResInfo.CalibAbs) / 2;
                        }
                        ht.Add("SDT4Abs", fAbsNew);
                    }
                    else if (calibResInfo.CalibratorName == sdtItem.Calib5Item)
                    {
                        if (sdtItem.SDT5Abs == 0)
                        {
                            fAbsNew = calibResInfo.CalibAbs;
                        }
                        else
                        {
                            fAbsNew = (sdtItem.SDT5Abs + calibResInfo.CalibAbs) / 2;
                        }
                        ht.Add("SDT5Abs", fAbsNew);
                    }
                    else if (calibResInfo.CalibratorName == sdtItem.Calib6Item)
                    {
                        if (sdtItem.SDT6Abs == 0)
                        {
                            fAbsNew = calibResInfo.CalibAbs;
                        }
                        else
                        {
                            fAbsNew = (sdtItem.SDT6Abs + calibResInfo.CalibAbs) / 2;
                        }
                        ht.Add("SDT6Abs", fAbsNew);
                    }
                    ism_SqlMap.Update("Calibrator.UpdateSDTTableItem", ht);
                }
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("UpdateCalibratingCurve(CalibrationResultinfo calibResInfo)==" + e.ToString(), Module.Calibration);
            }
        }
Пример #17
0
        private void SaveABS(int WN, int PT, float PW, float SW)
        {
            //TimeCourseService timeCoursService = new TimeCourseService();
            myBatis.UpdateRealTimeState(WN, PT);
            RealTimeCUVDataInfo realTimeData = myBatis.QueryRealTimeCUVDataTC(WN);

            if (realTimeData == null)
            {
                return;
            }

            if (PT == RunConfigureUtility.BlankPoint)
            {
                //timeCoursService.UpdateBlkABSData(realTimeData.TC, PW, SW);
                myBatis.UpdateBlkABSData(realTimeData.TC, PW, SW);
            }
            else
            {
                //timeCoursService.UpdateABSData(realTimeData.TC, PT, PW, SW);
                myBatis.UpdateABSData(realTimeData.TC, PT, PW, SW);
                //SaveDataQueue(new string[] { realTimeData.TC.ToString(), PT.ToString(), PW.ToString(), SW.ToString() });
                //ProcessingQueueEvent(new string[] { realTimeData.TC.ToString(), PT.ToString(), PW.ToString(), SW.ToString() });
            }

            if (PT == RunConfigureUtility.LastPoint)
            {
                TaskInfo t = null;
                switch (realTimeData.WorkType)
                {
                case WORKTYPE.N:
                case WORKTYPE.E:
                    //2018、11、15 改成存储过程
                    //myBatis.UpdateSMPScheduleFinishCount(realTimeData.SmpNo, realTimeData.Assay, myBatis.GetSMPScheduleFinishCount(realTimeData.SmpNo, realTimeData.Assay) + 1);
                    myBatis.UpdateSMPScheduleFinishCount(realTimeData.SmpNo, realTimeData.Assay);
                    t = myBatis.GetSMPSchedule(realTimeData.SmpNo, realTimeData.Assay);
                    if (t != null && t.FinishTimes == t.InspectTimes)
                    {
                        //2018、11、15 改成使用存储过程
                        //myBatis.UpdateSampleStatePerform(t, TaskState.SUCC);
                        ////2018 9/4
                        ////myBatis.UpdteTaskState(t.SampleNum.ToString(), t.ProjectName);
                        //myBatis.UpdateTaskStatePerform(t, TaskState.SUCC);
                        myBatis.UpdateSampleInfoAndTaskInfo(t, TaskState.SUCC);
                    }
                    break;

                case WORKTYPE.B:
                case WORKTYPE.S:
                    CalibrationResultinfo calibResult = myBatis.QueryCalibResultInfo(realTimeData.Assay, realTimeData.SmpNo, realTimeData.TC);
                    myBatis.UpdateSDTScheduleFinishCount(calibResult.SampleNum, calibResult.ProjectName, calibResult.CalibratorName, calibResult.CalibrationDT,
                                                         myBatis.GetSDTScheduleFinishCount(calibResult.SampleNum, calibResult.ProjectName, calibResult.CalibratorName, calibResult.CalibrationDT) + 1);
                    CalibratorinfoTask s = myBatis.GetSDTSchedule(calibResult.ProjectName, calibResult.SampleNum, calibResult.CalibratorName, calibResult.CalibrationDT);
                    if (s != null && s.SendTimes == s.InspectTimes && s.SendTimes == s.FinishTimes)
                    {
                        //myBatis.ClearSDTSchedules(s.SampleNum, s.ProjectName);

                        myBatis.UpdateSDTResultState(s, TaskState.SUCC);
                    }
                    break;

                case WORKTYPE.C:
                    myBatis.UpdateQCScheduleFinishCount(realTimeData.SmpNo, realTimeData.Assay, myBatis.GetQCScheduleFinishCount(realTimeData.SmpNo, realTimeData.Assay) + 1);
                    QCTaskInfo c = myBatis.GetQCSchedule(realTimeData.SmpNo, realTimeData.Assay) as QCTaskInfo;
                    if (c != null && c.InspectTimes == c.SendTimes && c.SendTimes == c.FinishTimes)
                    {
                        myBatis.UpdateQCTaksState(c.SampleNum, c.ProjectName);
                    }
                    break;
                }

                myBatis.DeleteRealTimeCUVData(WN);
                RealTimeCalculate(realTimeData);
                //SaveDataQueue(realTimeData);
                //switch (realTimeData.WorkType)
                //{
                //    case WORKTYPE.N:
                //    case WORKTYPE.E:
                //        TaskInfo t = new TaskInfo();
                //        t = myBatis.GetSMPSchedule(realTimeData.SmpNo, realTimeData.Assay);
                //        if (t != null && t.FinishTimes == t.InspectTimes)
                //        {
                //            myBatis.UpdateSampleStatePerform(t, TaskState.SUCC);
                //            //2018 9/4
                //            //myBatis.UpdteTaskState(t.SampleNum.ToString(), t.ProjectName);
                //            myBatis.UpdateTaskStatePerform(t, TaskState.SUCC);
                //        }
                //        break;
                //    case WORKTYPE.B:
                //    case WORKTYPE.S:
                //        CalibrationResultinfo calibResult = myBatis.QueryCalibResultInfo(realTimeData.Assay, realTimeData.SmpNo, realTimeData.TC);
                //        CalibratorinfoTask s = myBatis.GetSDTSchedule(calibResult.ProjectName, calibResult.SampleNum, calibResult.CalibratorName, calibResult.CalibrationDT);
                //        if (s != null && s.SendTimes == s.InspectTimes && s.SendTimes == s.FinishTimes)
                //        {
                //            //myBatis.ClearSDTSchedules(s.SampleNum, s.ProjectName);

                //            myBatis.UpdateSDTResultState(s, TaskState.SUCC);
                //        }
                //        break;
                //    case WORKTYPE.C:
                //        QCTaskInfo c = myBatis.GetQCSchedule(realTimeData.SmpNo, realTimeData.Assay) as QCTaskInfo;
                //        //if (c != null && c.FinishTimes >= c.InspectTimes)
                //        //{
                //        //myBatis.ClearQCSchedules(c.SampleNum, c.ProjectName);
                //        //}
                //        if (c != null && c.InspectTimes == c.SendTimes && c.SendTimes == c.FinishTimes)
                //        {
                //            myBatis.UpdateQCTaksState(c.SampleNum, c.ProjectName);
                //        }
                //        break;
                //}
            }
        }
Пример #18
0
        public bool IsSdtCurveRight(SDTTableItem curve)
        {
            CalibrationResultinfo results = null;
            bool blkrihgtflag             = false;

            results = myBatis.GetSDTResultByProject(curve.ProjectName, curve.SampleType, curve.DrawDate, curve.BlkItem);
            if (results != null)
            {
                blkrihgtflag = CheckResultsHasRihgt(results);
            }
            else
            {
                blkrihgtflag = true;
            }
            bool s1rihgtflag = false;

            results = myBatis.GetSDTResultByProject(curve.ProjectName, curve.SampleType, curve.DrawDate, curve.Calib1Item);
            if (results != null)
            {
                s1rihgtflag = CheckResultsHasRihgt(results);
            }
            else
            {
                s1rihgtflag = true;
            }
            bool s2rihgtflag = false;

            results = myBatis.GetSDTResultByProject(curve.ProjectName, curve.SampleType, curve.DrawDate, curve.Calib2Item);
            if (results != null)
            {
                s2rihgtflag = CheckResultsHasRihgt(results);
            }
            else
            {
                s2rihgtflag = true;
            }
            bool s3rihgtflag = false;

            results = myBatis.GetSDTResultByProject(curve.ProjectName, curve.SampleType, curve.DrawDate, curve.Calib3Item);
            if (results != null)
            {
                s3rihgtflag = CheckResultsHasRihgt(results);
            }
            else
            {
                s3rihgtflag = true;
            }
            bool s4rihgtflag = false;

            results = myBatis.GetSDTResultByProject(curve.ProjectName, curve.SampleType, curve.DrawDate, curve.Calib4Item);
            if (results != null)
            {
                s4rihgtflag = CheckResultsHasRihgt(results);
            }
            else
            {
                s4rihgtflag = true;
            }
            bool s5rihgtflag = false;

            results = myBatis.GetSDTResultByProject(curve.ProjectName, curve.SampleType, curve.DrawDate, curve.Calib5Item);
            if (results != null)
            {
                s5rihgtflag = CheckResultsHasRihgt(results);
            }
            else
            {
                s5rihgtflag = true;
            }
            bool s6rihgtflag = false;

            results = myBatis.GetSDTResultByProject(curve.ProjectName, curve.SampleType, curve.DrawDate, curve.Calib6Item);
            if (results != null)
            {
                s6rihgtflag = CheckResultsHasRihgt(results);
            }
            else
            {
                s6rihgtflag = true;
            }
            if (blkrihgtflag == true && s1rihgtflag == true && s2rihgtflag == true && s3rihgtflag == true && s4rihgtflag == true && s5rihgtflag == true && s6rihgtflag == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #19
0
 /// <summary>
 /// 获取校准结果和比色杯编号
 /// </summary>
 /// <param name="strDBMethod"></param>
 /// <param name="calibrationReactionProcess"></param>
 /// <returns></returns>
 public List <CalibrationResultinfo> QueryCalibrationResultInfoAndTimeCUVNO(string strDBMethod, CalibrationResultinfo calibrationResultinfoAndTimeCUVNO)
 {
     return(myBatis.QueryCalibrationResultInfoAndTimeCUVNO(strDBMethod, calibrationResultinfoAndTimeCUVNO));
 }
Пример #20
0
        public List <CalibrationResultinfo> QueryCalibrationResultinfo(string strDBMethod, CalibrationResultinfo calibrationResultinfo)
        {
            List <CalibrationResultinfo> lstCalibrationResultinfo = new List <CalibrationResultinfo>();

            return(lstCalibrationResultinfo = myBatis.QueryCalibrationResultinfo(strDBMethod, calibrationResultinfo));
        }