Exemple #1
0
        public ctrl_quality(string type, string sn, string stationcode1)
        {
            InitializeComponent();
            CompanyCode = LoginInfo.CompanyInfo.COMPANY_CODE;
            PlineID     = LoginInfo.ProductLineInfo.RMES_ID;
            PlineCode   = LoginInfo.ProductLineInfo.PLINE_CODE;
            StationCode = LoginInfo.StationInfo.STATION_CODE;
            stationname = LoginInfo.StationInfo.STATION_NAME;
            GridQuality.AutoGenerateColumns = false;
            GridQuality.RowHeadersVisible   = false;
            GridQuality.DataSource          = null;
            Thetype = type;
            TheSn   = sn;
            product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息
            if (product == null)
            {
                return;
            }
            //执行存储过程 获取RSTBOMQATS
            ProductDataFactory.PL_QUERY_QAZJTS(product.PLAN_SO, StationCode, PlineCode, "", product.PLAN_CODE, sn);
            string sql = "select count(1) from data_sn_qa where company_code='" + CompanyCode + "' and plan_code='" + product.PLAN_CODE + "' and sn='" + TheSn + "' and station_code='" + StationCode + "' and pline_code='" + PlineCode + "'  ";

            if (dataConn.GetValue(sql) == "0")
            {
                //插入data_sn_qa
                sql = " insert into data_sn_qa(rmes_id,sn,company_code,plan_code,pline_code,location_code,station_code,question,standard_answer,station_name)  "
                      + " select seq_rmes_id.nextval,'" + TheSn + "','" + CompanyCode + "','" + product.PLAN_CODE + "','" + PlineCode + "',gwdm,'" + StationCode + "',question,answer,'" + stationname + "'  from RSTBOMQATS where zddm='" + StationCode + "'    ";
                dataConn.ExeSql(sql);
            }
            ThePlancode = product.PLAN_CODE;
            GridQuality.Focus();
            IsABC = false;
            ShowData(type, TheSn, stationcode1);//A显示前道站点质量信息  B 显示当前站点质量信息
            try
            {
                if (GridQuality.Rows.Count > 0 && IsABC)
                {
                    PlanSnFactory.InitStationControl(CompanyCode, PlineID, LoginInfo.StationInfo.RMES_ID, product.PLAN_CODE, product.SN, "Rmes.WinForm.Controls.ctrl_quality");
                    dataConn.ExeSql("update data_sn_controls_complete set complete_flag='A' where station_code='" + LoginInfo.StationInfo.RMES_ID + "' and control_name='Rmes.WinForm.Controls.ctrl_quality' and sn='" + product.SN + "' and plan_code='" + product.PLAN_CODE + "' ");
                }
            }
            catch
            { }
            //this.RMesDataChanged += new RMesEventHandler(ctrl_Tj_RMesDataChanged);
        }
Exemple #2
0
        private void initSnEdit()
        {
            GridPrint.Rows.Clear();

            List <PlanEntity> allPlans = PlanFactory.GetByCreatePeriod(dateTimePicker1.Value, dateTimePicker2.Value);

            if (comboBox1.SelectedIndex >= 0)
            {
                string pline_code = comboBox1.SelectedValue.ToString();
                allPlans = (from s in allPlans where s.PLINE_CODE == pline_code select s).ToList();
            }
            if (allPlans.Count > 0)
            {
                foreach (var p in allPlans)
                {
                    List <PlanSnEntity> snEntity = PlanSnFactory.WebGetByOrderCode(p.ORDER_CODE);
                    if (snEntity == null)
                    {
                        continue;
                    }
                    foreach (var s in snEntity)
                    {
                        //int i = GridPrint.Rows.Add();
                        //GridPrint.Rows[i].Cells["colPrint"].Value = "打印";
                        //GridPrint.Rows[i].Cells["colProject"].Value = p.PROJECT_CODE;
                        //GridPrint.Rows[i].Cells["colOrderCode"].Value = p.ORDER_CODE;
                        //GridPrint.Rows[i].Cells["colModel"].Value = p.PLAN_SO;
                        //GridPrint.Rows[i].Cells["colSeries"].Value = p.PRODUCT_SERIES;
                        //GridPrint.Rows[i].Cells["colBarCode"].Value = p.DETECT_BARCODE;
                        //GridPrint.Rows[i].Cells["colSN"].Value = s.SN;
                    }
                }
            }
            if (statusStrip1.Items.Count == 0)
            {
                statusStrip1.Items.Add("记录数量:" + allPlans.Count.ToString());
            }
            else
            {
                statusStrip1.Items[0].Text = "记录数量:" + allPlans.Count.ToString();
            }
            // GridEdit.Rows[i].ReadOnly = true;
            // bCell.Value = "不可打印";
        }
Exemple #3
0
 protected void ctrlPrintOffline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
 {
     if (e.MessageHead == "OFFLINE")
     {
         string[] txt = e.MessageBody.ToString().Split('^');
         Sn = txt[0];
         string       quality_status = txt[1];
         PlanSnEntity plansn1        = PlanSnFactory.GetBySn(Sn);
         PlanCode = plansn1.PLAN_CODE;
         PrintOfflineLabel();
     }
     else if (e.MessageHead == "SN")
     {
         RMESEventArgs args = new RMESEventArgs();
         args.MessageHead = "OFFCTRL";
         args.MessageBody = "";
         SendDataChangeMessage(args);
     }
 }
Exemple #4
0
        protected void ctrlStationOnline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            string plan_code, sn, order_code, sn_flag;

            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "ONLINE")
            {
                //DialogResult dlg=MessageBox.Show("是否上线", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ;
                //if (dlg == DialogResult.No) return;

                sn = e.MessageBody.ToString();

                //获取当前第一条计划的未上线流水号,打印流水号
                //流水号做上线
                PlanSnEntity ent_sn = PlanSnFactory.GetBySn(sn);
                if (ent_sn == null)//如果没有sn,则msgbd为plancode
                {
                    plan_code = "";
                    sn        = "";
                    MessageBox.Show("流水号非法!", "提示");
                    //sn = PlanFactory.GetByKey(plan_code).PLAN_BATCH;
                }
                else
                {
                    //order_code = PlanSnFactory.GetBySn(sn).ORDER_CODE;
                    //plan_code = PlanFactory.GetByOrder(order_code).PLAN_CODE;
                    plan_code = ent_sn.PLAN_CODE;
                }

                ProductDataFactory.Station_OnLine(plan_code, sn, DateTime.Now.ToString("yyyy-MM-dd"), LoginInfo.StationInfo.STATION_CODE, LoginInfo.ShiftInfo.SHIFT_CODE, LoginInfo.TeamInfo.TEAM_CODE, LoginInfo.UserInfo.USER_CODE);

                RMESEventArgs arg = new RMESEventArgs();
                arg.MessageHead = "SN";
                arg.MessageBody = sn;
                SendDataChangeMessage(arg);
            }
        }
Exemple #5
0
        private bool DealSn(string pSn)
        {
            string        sn      = pSn;
            RMESEventArgs arg     = new RMESEventArgs();
            PlanSnEntity  plansn1 = PlanSnFactory.GetBySn(sn);

            if (plansn1 == null)
            {
                return(false);
            }
            arg.MessageHead = plansn1.SN_FLAG == "N" ? "ONLINE" : "SN";
            string plan_code = plansn1.PLAN_CODE;
            string quality_status = "A", complete_flag = "0";

            List <ProductCompleteEntity> prc = ProductCompleteFactory.GetByPlanSn(CompanyCode, PlineCode, plan_code, sn, StationCode);

            if (prc.Count > 0)
            {
                complete_flag = prc.First <ProductCompleteEntity>().COMPLETE_FLAG;
            }
            if (complete_flag == "1")
            {
                MessageBox.Show("此项装配任务已经完成下线");
                return(false);
            }
            List <ProductDataEntity> prd = ProductDataFactory.GetProductDataByPlanSn(CompanyCode, PlineCode, plan_code, sn);

            //if (prd.Count > 0) quality_status = prd.First<ProductDataEntity>().QUALITY_STATUS;
            if (quality_status == "B")
            {
                DialogResult dlg = MessageBox.Show("此项装配工件质量不合格,要继续装配吗", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dlg == DialogResult.No)
                {
                    return(false);
                }
            }
            return(true);
        }
Exemple #6
0
        public ctrPlanSn(string planId, string batchCode)
        {
            InitializeComponent();
            Batch_Code  = batchCode;
            CompanyCode = LoginInfo.CompanyInfo.COMPANY_CODE;
            PlineCode   = LoginInfo.ProductLineInfo.RMES_ID;
            StationCode = LoginInfo.StationInfo.STATION_CODE;

            List <PlanSnEntity> listSnData = PlanSnFactory.GetSnByPlanCode(planId);
            string adstatus = "A";

            try
            {
                //dataConn dc = new dataConn();
                adstatus = dataConn.GetValue(" select increase_flag from code_sn where pline_code='" + LoginInfo.ProductLineInfo.PLINE_CODE + "' ");
                //dataConn.CloseConn();
            }
            catch { }
            if (adstatus != "A")
            {
                listSnData = PlanSnFactory.GetSnByPlanCodedesc(planId);
            }


            listSn.Items.Clear();
            int i = 0;
            int j = 1;

            foreach (PlanSnEntity se in listSnData)
            {
                listSn.Items.Add((j++) + "--" + se.SN + "--" + se.SN_FLAG);
                if (se.SN_FLAG != "N")
                {
                    i++;
                }
            }
            label1.Text = "计划流水号总数:" + listSnData.Count + ";已上线计划流水号数量:" + i;
        }
Exemple #7
0
        protected void ctrlInitOnline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "ONLINE")
            {
                //上线完成 自动刷下一个 打印条码
                string       sn  = e.MessageBody.ToString();
                PlanSnEntity ent = PlanSnFactory.GetBySnPline(sn, PlineCode1);          //获取sn信息
                product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn); //获取sn信息

                if (product == null)
                {
                    return;
                }
                //if (check1.Checked)
                PublicClass.PrintTmFzSx(sn, product.PLAN_SO, product.CUSTOMER_NAME, "", product.PRODUCT_MODEL, 1);
                //timer1.Enabled = true;
                //timer1.Start();
                //timer1_Tick(timer1, new EventArgs());
            }
        }
Exemple #8
0
        private void GridPlan_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //得到计划号
            if (e.RowIndex < 0)
            {
                return;
            }
            ////string plan_code = GridPlan.Rows[e.RowIndex].Cells["ColPlanCode"].Value.ToString();
            ////string stationcode1 = "";
            ////try
            ////{
            ////    stationcode1 = LoginInfo.StationInfo.STATION_CODE;
            ////}
            ////catch { }
            ////if (stationcode1 == "")
            ////{
            ////    MessageBox.Show("站点为空!","提示");
            ////    return;
            ////}
            ////Form form13 = new Form();
            ////form13.Text = "BOM查看";
            ////form13.WindowState = FormWindowState.Maximized;
            ////ctrlShowBom print13 = new ctrlShowBom(plan_code, stationcode1);
            ////print13.Width = 1000;
            ////print13.Height = 500;
            ////print13.Top = 6;
            ////print13.Left = 6;
            ////form13.Controls.Add(print13);
            ////form13.Show(this);

            //timer1.Enabled = false;
            if (string.IsNullOrWhiteSpace(GridPlan.Rows[e.RowIndex].Cells["ColPlanCode"].Value as string))
            {
                return;
            }
            string plan_code = GridPlan.Rows[e.RowIndex].Cells["ColPlanCode"].Value.ToString();
            //string item_code = GridPlan.Rows[e.RowIndex].Cells["colPlanSo"].Value.ToString();
            //string batch_code = GridPlan.Rows[e.RowIndex].Cells["colPlanBatch"].Value.ToString();
            //string order_code = GridPlan.Rows[e.RowIndex].Cells["colOrderCode"].Value.ToString();
            //string sn_flag=GridPlan.Rows[e.RowIndex].Cells["colSnFlag"].Value.ToString();

            //if (!TheProcessValid(plan_code))
            //{
            //    MessageBox.Show("前一工序没有完成!", "工序错误提示");
            //    return;
            //}

            List <PlanSnEntity> lstsn = PlanSnFactory.GetSnByPlanCode(plan_code);

            if (lstsn.Count > 0)//如果已经有SN在data_plan_sn表中
            {
                FrmShowPlanSn ps = new FrmShowPlanSn(plan_code, "");
                ps.Show();
            }
            //else//这是另一种逻辑,没有预分配SN,则不按序列号管理。
            //{

            //    RMESEventArgs thisEventArg = new RMESEventArgs();
            //    thisEventArg.MessageHead = "PLAN";
            //    thisEventArg.MessageBody = plan_code;
            //   SendDataChangeMessage(thisEventArg);

            //}
        }
Exemple #9
0
        void ctrl_Tj_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            RMESEventArgs arg = new RMESEventArgs();

            arg.MessageHead = "";
            arg.MessageBody = "";
            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "SN" || e.MessageHead == "RESN" || e.MessageHead == "RECHECK")
            {
                TheSn   = e.MessageBody.ToString();
                product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息
                if (product == null)
                {
                    return;
                }
                ThePlancode = product.PLAN_CODE;
                //初始化质量数据
                //string sql = "select count(1) from data_sn_qa where company_code='"+CompanyCode+"' and plan_code='"+product.PLAN_CODE+"' and sn='"+TheSn+"' and station_code='"+StationCode+"' and pline_code='"+PlineCode+"'  ";
                //if (dataConn.GetValue(sql) == "0")
                //{
                //    //插入data_sn_qa
                //    sql = " insert into data_sn_qa(rmes_id,sn,company_code,plan_code,pline_code,location_code,station_code,question,standard_answer,station_name) values "
                //        + " select seq_rmes_id.nextval,'"+TheSn+"','" + CompanyCode + "','" + product.PLAN_CODE + "','" + PlineCode + "',gwdm,'" + StationCode + "',question,answer,'"+stationname+"'  from RSTBOMQATS where zddm='" + StationCode + "'    ";
                //    dataConn.ExeSql(sql);
                //}
                string type = "B";
                Thetype = type;
                string sn = TheSn;
                product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息
                if (product == null)
                {
                    return;
                }
                //执行存储过程 获取RSTBOMQATS
                ProductDataFactory.PL_QUERY_QAZJTS(product.PLAN_SO, StationCode, PlineCode, "", product.PLAN_CODE, sn);
                string sql = "select count(1) from data_sn_qa where company_code='" + CompanyCode + "' and plan_code='" + product.PLAN_CODE + "' and sn='" + TheSn + "' and station_code='" + StationCode + "' and pline_code='" + PlineCode + "'  ";
                if (dataConn.GetValue(sql) == "0")
                {
                    //插入data_sn_qa
                    sql = " insert into data_sn_qa(rmes_id,sn,company_code,plan_code,pline_code,location_code,station_code,question,standard_answer,station_name)  "
                          + " select seq_rmes_id.nextval,'" + TheSn + "','" + CompanyCode + "','" + product.PLAN_CODE + "','" + PlineCode + "',gwdm,'" + StationCode + "',question,answer,'" + stationname + "'  from RSTBOMQATS where zddm='" + StationCode + "'    ";
                    dataConn.ExeSql(sql);
                }
                ThePlancode = product.PLAN_CODE;
                GridQuality.Focus();
                IsABC = false;
                ShowData(type, TheSn, StationCode);//A显示前道站点质量信息  B 显示当前站点质量信息
                try
                {
                    if (GridQuality.Rows.Count > 0 && IsABC)
                    {
                        PlanSnFactory.InitStationControl(CompanyCode, PlineID, LoginInfo.StationInfo.RMES_ID, product.PLAN_CODE, product.SN, "Rmes.WinForm.Controls.ctrl_quality");
                        dataConn.ExeSql("update data_sn_controls_complete set complete_flag='A' where station_code='" + LoginInfo.StationInfo.RMES_ID + "' and control_name='Rmes.WinForm.Controls.ctrl_quality' and sn='" + product.SN + "' and plan_code='" + product.PLAN_CODE + "' ");
                    }
                }
                catch
                { }

                //
            }
        }
Exemple #10
0
        void ctrl_Fx_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            try
            {
                RMESEventArgs arg = new RMESEventArgs();
                arg.MessageHead = "";
                arg.MessageBody = "";
                if (e.MessageHead == null)
                {
                    return;
                }
                if (e.MessageHead == "SN")
                {
                    TheSn   = e.MessageBody.ToString();
                    product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息
                    if (product == null)
                    {
                        return;
                    }
                    TheSo       = product.PLAN_SO;
                    ThePlancode = product.PLAN_CODE;
                }
                if (e.MessageHead == "CHECKFX")
                {
                    //检查返修站点提交的流水号信息 做如下处理: 获取流水号对应的信息;线下返修做返修上线;
                    TheSn = e.MessageBody.ToString();
                    PlanSnEntity ent = PlanSnFactory.GetBySnPline(TheSn, PlineCode);           //获取sn信息
                    product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn); //获取sn信息
                    if (product == null)
                    {
                        return;
                    }
                    TheSo       = product.PLAN_SO;
                    ThePlancode = product.PLAN_CODE;

                    //判断是否线下返修未上线
                    if (ent.SN_FLAG == "P" || ent.SN_FLAG == "N")         //未上线 初始为N 打印为P  上线未Y
                    {
                        if (LoginInfo.StationInfo.STATION_TYPE == "ST05") //当前站点是返修站点
                        {
                            arg.MessageHead = "ONLINE";
                            arg.MessageBody = TheSn;
                            SendDataChangeMessage(arg);
                        }
                        else
                        {
                            MessageBox.Show("此发动机流水号未上线");
                            return;
                        }
                    }
                    else
                    {
                        arg.MessageHead = "SN";
                        arg.MessageBody = TheSn;
                        SendDataChangeMessage(arg);
                    }

                    //显示BOM 显示装机提示
                    arg.MessageHead = "SHOWBOMFX1";
                    arg.MessageBody = TheSn;
                    SendDataChangeMessage(arg);
                    //显示检测数据
                    arg.MessageHead = "SHOWDETECTFX1";
                    arg.MessageBody = TheSn;
                    SendDataChangeMessage(arg);
                }
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message);
            }
        }
Exemple #11
0
        void ctrQualityCheck_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            string        stationID = LoginInfo.StationInfo.RMES_ID;
            RMESEventArgs arg       = new RMESEventArgs();

            arg.MessageHead = "";
            arg.MessageBody = "";
            if (e.MessageHead == null)
            {
                return;
            }
            //if (e.MessageHead == "WORK" || e.MessageHead=="MESLL")
            //    this.Visible = false;
            //else if (e.MessageHead == "QUA")
            //    this.Visible = true;
            //else
            if (e.MessageHead.ToString() == "SN")
            {
                SN = e.MessageBody.ToString();
                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, SN);
                if (product == null)
                {
                    return;
                }
                PlanCode = product.PLAN_CODE;
                PlanSo   = product.PLAN_SO;
                Fdjxl    = product.PRODUCT_SERIES;
                Gylx     = product.ROUNTING_REMARK;
                //this.GridQuality.DataSource = SNDetectTempFactory.GetBySNStation(SN, StationCode);
                //StationEntity station = StationFactory.GetByKey(StationID);
                //List<SNDetectTempEntity> temp = SNDetectTempFactory.GetBySNStation(SN, StationID);
                //foreach (var t in temp)
                //{

                //    int i=GridQuality.Rows.Add();
                //    GridQuality.Rows[i].Cells["colRmesID"].Value = t.RMES_ID;
                //    GridQuality.Rows[i].Cells["colDetectCode"].Value = t.DETECT_ITEM_CODE;
                //    GridQuality.Rows[i].Cells["colDetectDesc"].Value = t.DETECT_ITEM_DESC;
                //    GridQuality.Rows[i].Cells["colQuanVal"].Value = t.DETECT_QUAN_VALUE;
                //    //GridQuality.Rows[i].Cells["colDetectRequire"].Value = t.QUAN_VALUE_REQUIRE;
                //    //GridQuality.Rows[i].Cells["colImage"].Value = t.IMAGE_FILE;
                //    GridQuality.Rows[i].Cells["colRemark"].Value = t.REMARK;
                //    GridQuality.Rows[i].Cells["colDataUp"].Value = t.MAX_VALUE;
                //    GridQuality.Rows[i].Cells["colDataDown"].Value = t.MIN_VALUE;
                //    GridQuality.Rows[i].Cells["colDetectFlag"].Value = t.DETECT_FLAG;
                //    ////DataGridViewComboBoxCell c = (DataGridViewComboBoxCell)(GridQuality.Rows[i].Cells["colFaultCode"]);
                //    ////List<DetectErrorItemEntity> errors = DetectErrorItemFactory.GetByDetectItemCode(station.WORKUNIT_CODE,t.DETECT_ITEM_CODE);
                //    ////c.DataSource = errors;
                //    ////c.DisplayMember = "ERROR_ITEM_NAME";
                //    ////c.ValueMember = "RMES_ID";

                //}
                //if (GridQuality.Rows.Count > 0)
                //{
                //    RMESEventArgs args = new RMESEventArgs();
                //    args.MessageHead = "QUACTRL";
                //    args.MessageBody = "";
                //    SendDataChangeMessage(args);
                //    ShowQualityList();
                //}
            }
            else if (e.MessageHead.ToString() == "PLAN")
            {
                //PlanCode = e.MessageBody.ToString();
                //SNDetectTempFactory.InitQualitDetectList(CompanyCode, PlineID, StationID, PlanCode, SN, UserID);
                ////this.GridQuality.DataSource = SNDetectTempFactory.GetBySNStation(SN, StationID);
                //StationEntity station = StationFactory.GetByKey(StationID);
                //List<SNDetectTempEntity> temp = SNDetectTempFactory.GetBySNStation(SN, StationID);
                //foreach (var t in temp)
                //{

                //    int i = GridQuality.Rows.Add();
                //    GridQuality.Rows[i].Cells["colRmesID"].Value = t.RMES_ID;
                //    GridQuality.Rows[i].Cells["colDetectCode"].Value = t.DETECT_ITEM_CODE;
                //    GridQuality.Rows[i].Cells["colDetectDesc"].Value = t.DETECT_ITEM_DESC;
                //    GridQuality.Rows[i].Cells["colQuanVal"].Value = t.DETECT_QUAN_VALUE;
                //    //GridQuality.Rows[i].Cells["colDetectRequire"].Value = t.QUAN_VALUE_REQUIRE;
                //    //GridQuality.Rows[i].Cells["colImage"].Value = t.IMAGE_FILE;
                //    GridQuality.Rows[i].Cells["colRemark"].Value = t.REMARK;
                //    GridQuality.Rows[i].Cells["colDataUp"].Value = t.MAX_VALUE;
                //    GridQuality.Rows[i].Cells["colDataDown"].Value = t.MIN_VALUE;
                //    GridQuality.Rows[i].Cells["colDetectFlag"].Value = t.DETECT_FLAG;
                //    //DataGridViewComboBoxCell c = (DataGridViewComboBoxCell)(GridQuality.Rows[i].Cells["colFaultCode"]);
                //    //List<DetectErrorItemEntity> errors = DetectErrorItemFactory.GetByDetectItemCode(station.WORKUNIT_CODE, t.DETECT_ITEM_CODE);
                //    //c.DataSource = errors;
                //    //c.DisplayMember = "ERROR_ITEM_NAME";
                //    //c.ValueMember = "RMES_ID";

                //}
                //if (GridQuality.Rows.Count > 0)
                //{
                //    RMESEventArgs args = new RMESEventArgs();
                //    args.MessageHead = "QUACTRL";
                //    args.MessageBody = "";
                //    SendDataChangeMessage(args);
                //    ShowQualityList();
                //}
            }
            else if (e.MessageHead.ToString() == "FOCUSDETECT")
            {
                //指定站点先防错 后采集数据
                if (GridQuality.Rows.Count > 0)
                {
                    if (StationName == "Z100" || StationName == "Z110" || StationName == "Z120")
                    {
                        GetFocus(0);
                    }
                }
            }
            else if (e.MessageHead == "SCP" || e.MessageHead == "OFFLINE")//下线处理data_sn_detect
            {
                //this.GridQuality.DataSource = null;
                //ProductDataFactory.QualityControlComplete(CompanyCode, PlineCode, StationCode, PlanCode, SN);
            }
            else if (e.MessageHead == "SHOWDETECT")
            {
                SN = e.MessageBody.ToString();
                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, SN);
                if (product == null)
                {
                    return;
                }
                PlanCode       = product.PLAN_CODE;
                PlanSo         = product.PLAN_SO;
                Fdjxl          = product.PRODUCT_SERIES;
                Gylx           = product.ROUNTING_REMARK;
                stationcode_fx = StationCode;
                stationname_fx = StationName;
                //check中 显示BOM信息和检测数据
                SNDetectTempFactory.InitQualitDetectList(CompanyCode, PlineID, StationID, PlanCode, SN, UserCode, StationID);
                string    sql = "select * from data_sn_detect_data_TEMP where station_code='" + StationCode + "' and sn='" + SN + "' and plan_code='" + PlanCode + "' and detect_name!='LJTM' order by location_code,detect_seq ";
                DataTable dt  = dataConn.GetTable(sql);
                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.NewRow();
                    dt.Rows.Add(dr);
                }
                this.GridQuality.DataSource = dt;
                ShowQualityList();
                if (GridQuality.Rows.Count > 0)
                {
                    PlanSnFactory.InitStationControl(CompanyCode, PlineID, StationID, product.PLAN_CODE, product.SN, "Rmes.WinForm.Controls.ctrlQualityDetect");
                    if (StationName == "Z100" || StationName == "Z110" || StationName == "Z120")
                    {
                        //指定站点先防错后采集数据
                    }
                    else
                    {
                        GetFocus(0);
                    }
                }
                else
                {
                    arg.MessageHead = "INIT";
                    arg.MessageBody = "";
                    SendDataChangeMessage(arg);
                }
                SendBomConfirm2SN();
            }
            else if (e.MessageHead == "SHOWDETECTFX1")
            {
                SN = e.MessageBody.ToString();
                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, SN);
                if (product == null)
                {
                    return;
                }
                PlanCode       = product.PLAN_CODE;
                PlanSo         = product.PLAN_SO;
                Fdjxl          = product.PRODUCT_SERIES;
                Gylx           = product.ROUNTING_REMARK;
                stationcode_fx = StationCode;
                stationname_fx = StationName;
                //check中 显示BOM信息和检测数据
                //返修站点无需在往temp表中更新数据,在返修发动机上线时已经获取了历史记录,20161106
                //如果需要实时检测数据,则要对检测数据进行删除和新增,在选择对应站点是进行处理
                //SNDetectTempFactory.InitQualitDetectList(CompanyCode, PlineID, StationID, PlanCode, SN, UserCode, StationID);
                string    sql = "select * from data_sn_detect_data_TEMP where sn='" + SN + "' and plan_code='" + PlanCode + "' and detect_name!='LJTM' order by location_code,detect_seq ";
                DataTable dt  = dataConn.GetTable(sql);

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.NewRow();
                    dt.Rows.Add(dr);
                }

                this.GridQuality.DataSource = dt;
                ShowQualityList();
                if (GridQuality.Rows.Count > 0)
                {
                    //PlanSnFactory.InitStationControl(CompanyCode, PlineID, StationID, product.PLAN_CODE, product.SN, "Rmes.WinForm.Controls.ctrlQualityDetect");
                    if (StationName == "Z100" || StationName == "Z110" || StationName == "Z120")
                    {
                        //指定站点先防错后采集数据
                    }
                    else
                    {
                        GetFocus(0);
                    }
                }
                else
                {
                    arg.MessageHead = "INIT";
                    arg.MessageBody = "";
                    SendDataChangeMessage(arg);
                }
                //SendBomConfirm2SN();
            }
            else if (e.MessageHead == "SHOWDETECT_FX")
            {
                try
                {
                    //SN = e.MessageBody.ToString();
                    string   item_info = e.MessageBody.ToString();//消息体是sn^stationcode^stationname
                    string[] cmd_info  = item_info.Split('^');
                    SN             = cmd_info[0];
                    stationcode_fx = cmd_info[1];
                    stationname_fx = cmd_info[2];
                    StationEntity ent_st      = StationFactory.GetBySTATIONCODE(stationcode_fx);
                    string        station_id1 = ent_st.RMES_ID;

                    ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, SN);
                    if (product == null)
                    {
                        return;
                    }
                    PlanCode = product.PLAN_CODE;
                    PlanSo   = product.PLAN_SO;
                    Fdjxl    = product.PRODUCT_SERIES;
                    Gylx     = product.ROUNTING_REMARK;
                    //check中 显示BOM信息和检测数据
                    SNDetectTempFactory.InitQualitDetectList(CompanyCode, PlineID, station_id1, PlanCode, SN, UserCode, StationID);
                    string    sql = "select * from data_sn_detect_data_TEMP where station_code='" + stationcode_fx + "' and sn='" + SN + "' and plan_code='" + PlanCode + "' and detect_name!='LJTM' order by location_code,detect_seq ";
                    DataTable dt  = dataConn.GetTable(sql);

                    if (dt.Rows.Count > 0)
                    {
                        DataRow dr = dt.NewRow();
                        dt.Rows.Add(dr);
                    }

                    this.GridQuality.DataSource = dt;
                    ShowQualityList();
                    if (GridQuality.Rows.Count > 0)
                    {
                        GetFocus(0);
                    }
                    else
                    {
                        arg.MessageHead = "INIT";
                        arg.MessageBody = "";
                        SendDataChangeMessage(arg);
                    }
                    SendBomConfirm2SN();
                }
                catch
                { }
            }
        }