Пример #1
0
 protected void ctrlInitOnline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
 {
     if (e.MessageHead == null)
     {
         return;
     }
     if (e.MessageHead == "ONLINEONLINE")
     {
         //上线完成 自动刷下一个 打印条码
         string sn = e.MessageBody.ToString();
         product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
         if (product == null)
         {
             return;
         }
         //if (check1.Checked)
         if (LoginInfo.ProductLineInfo.PLINE_CODE == "Z")
         {
             PublicClass.PrintTmFz(sn, product.PLAN_SO, product.CUSTOMER_NAME, "", product.PRODUCT_MODEL, 2, product.PLAN_CODE);
         }
         else
         {
             PublicClass.PrintTmFz(sn, product.PLAN_SO, product.CUSTOMER_NAME, "", product.PRODUCT_MODEL, 2, product.PLAN_CODE);
         }
         //timer1.Enabled = true;
         //timer1.Start();
         //timer1_Tick(timer1, new EventArgs());
     }
 }
Пример #2
0
        private void dgvTj_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //双击流水号进行标定
            if (e.RowIndex < 0)
            {
                return;
            }
            timer1.Enabled = false;
            RMESEventArgs thisEventArg = new RMESEventArgs();

            thisEventArg.MessageHead = "";
            thisEventArg.MessageBody = "";
            dgvInsite.ClearSelection();
            string sn        = dgvInsite.Rows[e.RowIndex].Cells["colSn"].Value.ToString();
            string plan_so   = dgvInsite.Rows[e.RowIndex].Cells["colSo"].Value.ToString();
            string plan_code = dgvInsite.Rows[e.RowIndex].Cells["colPlancode"].Value.ToString();
            List <ProductInfoEntity> newProduct = ProductInfoFactory.GetByCompanyCodeSN(LoginInfo.CompanyInfo.COMPANY_CODE, sn);

            if (newProduct.Count != 0)
            {
                thisEventArg.MessageHead = "FILLSN";
                thisEventArg.MessageBody = sn + "^" + plan_so + "^" + newProduct.First <ProductInfoEntity>().PRODUCT_MODEL + "^" + plan_code;
                SendDataChangeMessage(thisEventArg);
            }
            timer1.Enabled = true;
        }
Пример #3
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;
         }
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Пример #4
0
        protected void ctrlStationOffline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            if (e.MessageHead == "OFFLINE")
            {
                //string[]  txt = e.MessageBody.ToString().Split('^');
                //string sn = txt[0];
                //string quality_status = txt[1];
                string            sn      = e.MessageBody.ToString();
                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);     //获取sn信息
                //PlanSnEntity plansn1 = PlanSnFactory.GetBySn(sn);
                string plan_code = product.PLAN_CODE;
                //modify by thl 20161212 下线点对应的操作改到发动机第一次入库处执行
                if (dataConn.GetValue("select count(1) from data_complete where sn='" + sn + "' and plan_code='" + plan_code + "' and station_code='" + LoginInfo.StationInfo.STATION_CODE + "' ") == "1")
                {
                    dataConn.ExeSql("UPDATE DATA_PLAN SET OFFLINE_QTY=OFFLINE_QTY+1  WHERE plan_code='" + plan_code + "' ");
                }
                if (LoginInfo.ProductLineInfo.PLINE_CODE == "CL")
                {
                    ProductDataFactory.Station_OffLine(product.PLAN_CODE, sn, "Y");
                }
            }
            //else if (e.MessageHead == "SN")
            //{

            //    RMESEventArgs args = new RMESEventArgs();
            //    args.MessageHead = "OFFCTRL";
            //    args.MessageBody = "";
            //    SendDataChangeMessage(args);
            //}
        }
Пример #5
0
        //dataConn dc = new dataConn();

        public ctrlProcessFile(string sn)
        {
            InitializeComponent();
            //listView2.View = View.SmallIcon;
            listView1.View        = View.SmallIcon;
            this.RMesDataChanged += new RMesEventHandler(ctrlProcessFile_RMesDataChanged);
            //listView2.DoubleClick+=new EventHandler(listView1_DoubleClick);

            CompanyCode  = LoginInfo.CompanyInfo.COMPANY_CODE;
            PlineID      = LoginInfo.ProductLineInfo.RMES_ID;
            PlineCode1   = LoginInfo.ProductLineInfo.PLINE_CODE;
            StationID    = LoginInfo.StationInfo.RMES_ID;
            Station_Code = LoginInfo.StationInfo.STATION_CODE;
            StationName  = LoginInfo.StationInfo.STATION_NAME;
            ShiftCode    = LoginInfo.ShiftInfo.SHIFT_CODE;
            TeamCode     = LoginInfo.TeamInfo.TEAM_CODE;
            UserID       = LoginInfo.UserInfo.USER_ID;
            len_sn       = LoginInfo.LEN_SN;
            TheSo        = "";
            TheSn        = "";
            ThePlancode  = "";
            product      = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
            if (product != null)
            {
                TheSo       = product.PLAN_SO;
                TheSn       = product.SN;
                ThePlancode = product.PLAN_CODE;
                initInfo("");
            }
        }
Пример #6
0
        private void InitQuality(string sn1)
        {
            SN = sn1;
            if (SN != "")
            {
                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)
                {
                    GetFocus(0);
                }
            }
        }
Пример #7
0
        protected void ctrlProductScan_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            string sn, quality_status = "A";

            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "SN")
            {
                //上线后打印条码
                sn          = e.MessageBody.ToString();
                product     = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
                ThePlancode = product.PLAN_CODE;
                TheSo       = product.PLAN_SO;
                PublicClass.PrintTmISDE(product.PLAN_CODE, ThisSmTm);
                txtGTH.Text     = "";
                arg.MessageHead = "CLEAR1";
                arg.MessageBody = "";
                SendDataChangeMessage(arg);
                timer1.Enabled = true;
            }
            if (e.MessageHead == "ONLINEONLINE")
            {
                DataTable dt = dataConn.GetTable("select plan_code from data_plan where plan_qty<=online_qty and plan_code='" + ThePlancode + "'");
                if (dt.Rows.Count > 0)
                {
                    ProductDataFactory.ISDE_CREATE_JK_SJJHB(PlineCode1);
                }
                timer1.Enabled = true;
            }
        }
Пример #8
0
        protected void ctrlProductScan_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            string        sn, quality_status = "A";
            RMESEventArgs arg = new RMESEventArgs();

            arg.MessageHead = "";
            arg.MessageBody = "";
            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "SN")
            {
                //上线后打印条码
                sn       = e.MessageBody.ToString();
                product  = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
                ThisSmTm = product.PLAN_SO + "^DCEC^" + sn;
                PublicClass.PrintTmISDE(product.PLAN_CODE, ThisSmTm);

                arg.MessageHead = "CLEAR1";
                arg.MessageBody = "";
                SendDataChangeMessage(arg);
                timer1.Enabled = true;
            }
            if (e.MessageHead == "REFRESHCLPLAN")
            {
                timer1.Enabled = true;
            }
        }
Пример #9
0
        void ctrPlan_RMesDataChanged(object obj, RMESEventArgs e)
        {
            if (e.MessageHead == null)
            {
                return;
            }
            //if (e.MessageHead == "MESLL" || e.MessageHead=="QUA")
            //{
            //    this.Visible = false;
            //    return;
            //}
            //if (e.MessageHead.ToString() == "WORK")
            //{
            //    this.Visible = true;
            //    return;
            //}
            //if (e.MessageHead.ToString() == "PLAN")
            //{
            //    InitPlan(e.MessageBody.ToString());
            //    return;
            //}

            if (e.MessageHead == "SN")
            {
                string            sn  = e.MessageBody.ToString();
                ProductInfoEntity ent = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);
                if (ent != null)
                {
                    planCode = ent.PLAN_CODE;
                    initPlan();
                    InitPlan(planCode);
                    return;
                }
            }
            if (e.MessageHead == "REFRESHPLAN")
            {
                string            sn  = e.MessageBody.ToString();
                ProductInfoEntity ent = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);
                if (ent != null)
                {
                    planCode = ent.PLAN_CODE;
                    initPlan();
                    InitPlan(planCode);
                    return;
                }
            }
            //if (e.MessageHead == "SCP")
            //{
            //    getPlan(PlineCode);
            //    CurPlancode = "none";

            //    return;
            //}
            //if (e.MessageHead == "EXIT")
            //{
            //    //HandleExit(CurPlancode);
            //    return;
            //}
        }
Пример #10
0
        private void GridPlan_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //得到计划号
            if (e.RowIndex < 0)
            {
                return;
            }
            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 sn_flag = GridPlan.Rows[e.RowIndex].Cells["colSnFlag"].Value.ToString();


            ItemEntity iItem = ItemFactory.GetByItem(LoginInfo.CompanyInfo.COMPANY_CODE, item_code);

            if (iItem != null)
            {
                if (iItem.MANAGE_FLAG == "A")
                {
                    FrmShowPlanSn ps = new FrmShowPlanSn(plan_code, batch_code);
                    ps.Show();
                }
                else if (iItem.MANAGE_FLAG == "A" && sn_flag == "N")
                {
                    List <ProductInfoEntity> newProduct   = ProductInfoFactory.GetByCompanyCodeSN(LoginInfo.CompanyInfo.COMPANY_CODE, batch_code);
                    RMESEventArgs            thisEventArg = new RMESEventArgs();
                    if (newProduct.Count != 0)
                    {
                        thisEventArg.MessageHead = "SN";
                        thisEventArg.MessageBody = newProduct.First <ProductInfoEntity>();
                    }
                }
                else
                {
                    List <ProductInfoEntity> newProduct   = ProductInfoFactory.GetByCompanyCodeBatch(LoginInfo.CompanyInfo.COMPANY_CODE, batch_code);
                    RMESEventArgs            thisEventArg = new RMESEventArgs();
                    if (newProduct.Count != 0)
                    {
                        thisEventArg.MessageHead = "BATCH";
                        thisEventArg.MessageBody = newProduct.First <ProductInfoEntity>();
                    }
                    else
                    {
                        thisEventArg.MessageHead = null;
                        thisEventArg.MessageBody = null;
                    }
                    SendDataChangeMessage(thisEventArg);
                }
            }
        }
Пример #11
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);
        }
Пример #12
0
 void ctrPlan_RMesDataChanged(object obj, RMESEventArgs e)
 {
     if (e.MessageHead == null)
     {
         return;
     }
     if (e.MessageHead == "SN")
     {
         string            sn  = e.MessageBody.ToString();
         ProductInfoEntity ent = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);
         if (ent != null)
         {
             planCode = ent.PLAN_CODE;
             initPlan();
             InitPlan(planCode);
             return;
         }
     }
 }
Пример #13
0
        void ctrlProcessFile_RMesDataChanged(object obj, RMESEventArgs e)
        {
            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "SN" || e.MessageHead == "CHECK")
            {
                string sn = e.MessageBody.ToString();
                product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
                if (product != null)
                {
                    TheSo       = product.PLAN_SO;
                    TheSn       = product.SN;
                    ThePlancode = product.PLAN_CODE;
                    initInfo("");
                }
            }
            //if (!string.IsNullOrWhiteSpace(e.MessageHead) && e.MessageHead == "PRCS")
            //{

            //    string msgbody = e.MessageBody as string;
            //    if (string.IsNullOrWhiteSpace(msgbody)) return;
            //    string processcode = "";
            //    if (msgbody.IndexOf('^') <= 0) //只发送了工序的信息
            //        processcode = msgbody;
            //    else
            //        processcode = msgbody.Split('^')[0].ToString();
            //    initInfo(processcode);

            //}
            //else if (e.MessageHead == "MESLL")
            //{
            //    this.Visible = false;
            //    return;
            //}
            //if (e.MessageHead.ToString() == "WORK" || e.MessageHead.ToString() == "QUA")
            //{
            //    this.Visible = true;
            //    return;
            //}
            //throw new NotImplementedException();
        }
Пример #14
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            string            sn11    = textBox1.Text.Trim().ToUpper();
            ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, sn11);

            if (product == null)
            {
                MessageBox.Show("该流水号不合法", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            try
            {
                Print(product);
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message, "提示");
            }
        }
Пример #15
0
        private void txtLsh_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != 13)
            {
                return;
            }
            if (string.IsNullOrWhiteSpace(txtLsh.Text))
            {
                return;
            }
            string sn = txtLsh.Text.Trim().ToUpper();

            if (sn.Length != 8)
            {
                txtLsh.Text = "";
                MessageBox.Show("流水号位数为8位", "提示");
                return;
            }
            product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
            if (product == null)
            {
                txtLsh.Text  = "";
                txtSo.Text   = "";
                txtPlan.Text = "";
                txtJx.Text   = "";
                txtYh.Text   = "";
                txtYHH.Text  = "";
                txtFr.Text   = "";
                MessageBox.Show("流水号不合法", "提示");
                return;
            }
            string thisyhdm = dataConn.GetValue(" select nvl(KHH,'') from atpuplannameplate where bzso='" + product.PLAN_SO + "' and plan_code='" + product.PLAN_CODE + "' ");
            string thisFr   = dataConn.GetValue("select GET_FR('" + product.PLAN_SO + "','" + LoginInfo.ProductLineInfo.PLINE_CODE + "') from dual ");

            txtSo.Text   = product.PLAN_SO;
            txtPlan.Text = product.PLAN_CODE;
            txtJx.Text   = product.PRODUCT_MODEL;
            txtYh.Text   = product.CUSTOMER_NAME;
            txtYHH.Text  = thisyhdm;
            txtFr.Text   = thisFr;
            cmdPrn_Click(cmdPrn, new EventArgs());
        }
Пример #16
0
        protected void ctrlNavigation_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            //if (e.MessageHead == "QUACTRL") mnuQuality.Enabled = true;
            RMESEventArgs arg = new RMESEventArgs();

            arg.MessageHead = "";
            arg.MessageBody = "";
            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "SN" || e.MessageHead == "RECHECK" || e.MessageHead == "CHECKOK")
            {
                Thesn = e.MessageBody.ToString();
            }
            if (e.MessageHead == "PRINTISDE")
            {
                string[] txt = e.MessageBody.ToString().Split('|');
                TheSmTm     = txt[0];
                ThePlanCode = txt[1];
            }
            if (e.MessageHead == "SHOWBOMLQ")
            {
                string            txt     = e.MessageBody.ToString();
                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, txt);
                if (product == null)
                {
                    return;
                }
                string oldplancode = "";
                oldplancode = dataConn.GetValue("select jhmcold from atpujhsn where jhmc='" + product.PLAN_CODE + "'  and is_valid='N' and rownum=1");
                if (oldplancode == "")
                {
                    return;
                }

                ProductInfoEntity productold = ProductInfoFactory.GetByCompanyCodeSNSingleLQ(LoginInfo.CompanyInfo.COMPANY_CODE, txt, oldplancode);

                oldPlinecode = productold.PLINE_CODE;
            }
        }
Пример #17
0
        void ctrProductComplete_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            if (e.MessageHead.ToString() == "MESLL")
            {
                this.Visible = false;
                return;
            }
            if (e.MessageHead.ToString() == "WORK")
            {
                this.Visible = true;
                return;
            }
            if (e.MessageHead.ToString() == "SN")
            {
                SN = e.MessageBody.ToString();
                SetMenuItemStatus(true);

                List <ProductInfoEntity> product = ProductInfoFactory.GetByCompanyCodeSN(CompanyCode, SN);
                if (product.Count > 0)
                {
                    PlanCode = product.First().PLAN_CODE;
                }
            }
            else if (e.MessageHead.ToString() == "PLAN")
            {
                PlanCode = e.MessageBody.ToString();
                SetMenuItemStatus(true);
            }

            else if (e.MessageHead == "SCP" || e.MessageHead == "OFFLINE")
            {
                SetMenuItemStatus(false);
                ItemQualifiedOffline.Enabled = false;
                ItemFailedOffline.Enabled    = false;
            }
            else if (e.MessageHead == "OFFCTRL")
            {
                ItemQualifiedOffline.Enabled = true;
                ItemFailedOffline.Enabled    = true;
            }
        }
Пример #18
0
        private void 改制BOM对比清单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //显示改制BOM对比清单 及 改制BOM扫描结果 及检测数据扫描结果
            if (Thesn == "")
            {
                MessageBox.Show("请扫描发动机流水号", "提示");
                return;
            }
            ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, Thesn);//获取sn信息

            if (product == null)
            {
                MessageBox.Show("无此发动机信息", "提示");
                return;
            }
            ThePlanCode = product.PLAN_CODE;
            FrmShowGZqd ps = new FrmShowGZqd(Thesn, ThePlanCode);

            ps.StartPosition = FormStartPosition.Manual;
            ps.StartPosition = FormStartPosition.CenterScreen;
            ps.Show(this);
        }
Пример #19
0
        void ctrQuality_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            string stationCode = LoginInfo.StationInfo.RMES_ID;

            if (e.MessageHead == null)
            {
                return;
            }

            if (e.MessageHead.ToString() == "SN")
            {
                SN = e.MessageBody as string;
                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, SN);
                if (product == null)
                {
                    return;                                //SN = product.SN;
                }
                List <QualitySnItem> QualitySn = QualityFactory.GetAll();
                GridQuality.DataSource = QualitySn;
                //ShowQualityList();
            }
        }
Пример #20
0
        void ctrQuality_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            string stationCode = LoginInfo.StationInfo.RMES_ID;

            if (e.MessageHead == null)
            {
                return;
            }

            if (e.MessageHead.ToString() == "SN")
            {
                SN = e.MessageBody as string;
                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, SN);
                if (product == null)
                {
                    return;                                //SN = product.SN;
                }
                //质量点的sn与计划一一对应 此处只返回一条计划
                _product = product;
                ShowQualityList();
            }
        }
Пример #21
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 == "RECHECK" || e.MessageHead == "CHECKOK")
            {
                string sn = e.MessageBody.ToString();
                product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
                string str1 = "";
                try
                {
                    str1 = dataConn.GetValue("select fr from data_sn_fr where sn='" + sn + "' and plan_code='" + product.PLAN_CODE + "'  ");
                }
                catch { }
                txtRemark.Text = str1 + "||" + product.REMARK;
            }
        }
Пример #22
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
                { }

                //
            }
        }
Пример #23
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
                { }
            }
        }
Пример #24
0
        void ctrlProductInfo_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "SN" || e.MessageHead == "ONLINE" || e.MessageHead == "OFFLINE" || e.MessageHead == "RECHECK" || e.MessageHead == "RESN")
            {
                //ProductInfoEntity product = e.MessageBody as ProductInfoEntity;
                string sn = e.MessageBody as string;

                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, sn);
                if (product == null)
                {
                    return;
                }
                label1.Text = product.PLAN_CODE;     //计划号
                label2.Text = product.PLAN_SO;       //SO
                label3.Text = product.PRODUCT_MODEL; //机型
                //label2.BackColor = SystemColors.GradientInactiveCaption;
            }
            if (e.MessageHead == "FILLSN")//初始化控件
            {
                string[] txt = e.MessageBody.ToString().Split('^');
                string   sn1 = txt[0];
                label1.Text = txt[3];       //计划号
                label2.Text = txt[1];       //SO
                label3.Text = txt[2];       //机型
            }
            if (e.MessageHead == "FILLSN2") //初始化控件
            {
                string[] txt = e.MessageBody.ToString().Split('^');
                label1.Text = txt[2];     //计划号
                label2.Text = txt[0];     //SO
                label3.Text = txt[1];     //机型
            }
            if (e.MessageHead == "CLEAR") //初始化控件
            {
                label1.Text = "";         //计划号
                label2.Text = "";         //SO
                label3.Text = "";         //机型
            }
            //////if (e.MessageHead == "YT")
            //////{
            //////    label2.BackColor = Color.Green;    //SO
            //////    label3.BackColor = Color.Green;  //机型
            //////}
            //////if (e.MessageHead == "JC")
            //////{
            //////    label2.BackColor = Color.Red;    //SO
            //////    label3.BackColor = Color.Red;  //机型
            //////}
            //////if (e.MessageHead == "FYT")
            //////{
            //////    label2.BackColor = SystemColors.GradientInactiveCaption;    //SO
            //////    label3.BackColor = SystemColors.GradientInactiveCaption;  //机型
            //////}
            //////if (e.MessageHead == "FJC")
            //////{
            //////    label2.BackColor = SystemColors.GradientInactiveCaption;    //SO
            //////    label3.BackColor = SystemColors.GradientInactiveCaption;  //机型
            //////}
            //else if(e.MessageHead==null)
            //{
            //    label1.Text = "";
            //    label2.Text = "";
            //    label3.Text = "";
            //}
            //if (e.MessageHead == "SCP")
            //{
            //    label1.Text = "";
            //    label2.Text = "";
            //    label3.Text = "";
            //}
            //if (e.MessageHead == "MESLL")
            //{
            //    this.Visible = false;
            //    return;
            //}
            //if (e.MessageHead.ToString() == "WORK")
            //{
            //    this.Visible = true;
            //    return;
            //}
            if (e.MessageHead == "JC")
            {
                label2.BackColor = Color.Red;
            }
            if (e.MessageHead == "FJC")
            {
                label2.BackColor = SystemColors.GradientInactiveCaption;
            }
            if (e.MessageHead == "YT")
            {
                label2.BackColor = Color.Green;  //SO
                label3.BackColor = Color.Green;  //机型
            }
            if (e.MessageHead == "FYT")
            {
                label2.BackColor = SystemColors.GradientInactiveCaption;
                label3.BackColor = SystemColors.GradientInactiveCaption;  //机型
            }
        }
Пример #25
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);
            }
        }
Пример #26
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 == "REFRESHPLAN" || e.MessageHead == "RESN")
            {
                //校验sn后进行insite标定
                timer1.Enabled = false;
                string sn = e.MessageBody.ToString();
                product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
                if (product == null)
                {
                    return;
                }
                //是否改制返修发动机
                string sql = "";
                if (product.PLAN_TYPE != "C" && product.PLAN_TYPE != "D")
                {
                    sql = "select * from dp_rckwcb where ghtm='" + sn + "' and rklx='正常出库' ";
                    DataTable dt = dataConn.GetTable(sql);
                    if (dt.Rows.Count > 0)
                    {
                        MessageBox.Show("该流水号已正常出库,无法标定", "提示");
                        return;
                    }
                }
                sql = "select insite_bd from atpuecmlsh where ghtm='" + sn + "' ";
                DataTable dt1 = dataConn.GetTable(sql);
                if (dt1.Rows.Count == 0)
                {
                    MessageBox.Show("此发动机号非法", "提示");
                    return;
                }
                else
                {
                    if (dt1.Rows[0][0].ToString() == "")
                    {
                        DialogResult drt = MessageBox.Show("非INSITE版标定发动机!是否标定?", "提示", MessageBoxButtons.YesNo);
                        if (drt == DialogResult.No)
                        {
                            return;
                        }
                    }
                    else if (dt1.Rows[0][0].ToString() == "Y")
                    {
                        DialogResult drt = MessageBox.Show("已刷过INSITE版标定!是否重复标定?", "提示", MessageBoxButtons.YesNo);
                        if (drt == DialogResult.No)
                        {
                            return;
                        }
                    }
                }
                sql = "update atpuecmlsh set insite_bd='Y',insite_time=sysdate,INSITE_CZY='" + LoginInfo.UserInfo.USER_CODE + "' where ghtm='" + sn + "' ";
                dataConn.ExeSql(sql);
                refreash();
                timer1.Enabled = true;
            }
        }
Пример #27
0
        protected void ctrlStationOffline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            if (e.MessageHead == "OFFLINE")
            {
                //string[]  txt = e.MessageBody.ToString().Split('^');
                //string sn = txt[0];
                //string quality_status = txt[1];
                string            sn      = e.MessageBody.ToString();
                ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
                //PlanSnEntity plansn1 = PlanSnFactory.GetBySn(sn);
                string plan_code = product.PLAN_CODE;
                //modify by thl 20161212 下线点对应的操作改到发动机第一次入库处执行
                if (dataConn.GetValue("select count(1) from data_complete where sn='" + sn + "' and plan_code='" + plan_code + "' and station_code='" + LoginInfo.StationInfo.STATION_CODE + "' ") == "1")
                {
                    dataConn.ExeSql("UPDATE DATA_PLAN SET OFFLINE_QTY=OFFLINE_QTY+1  WHERE plan_code='" + plan_code + "' ");
                }
                //if (LoginInfo.ProductLineInfo.PLINE_CODE == "CL")
                //{
                //    ProductDataFactory.Station_OffLine(product.PLAN_CODE, sn, "Y");
                //}
                if (PlineCode == "L")//柳汽下线打合格证
                {
                    string sql = "select count(1) from ATPUHGZ where lsh='" + sn + "'";
                    if (dataConn.GetValue(sql) != "0")
                    {
                        MessageBox.Show("该发动机已经打印", "提示");
                    }

                    string printrq = "";
                    if (!check1.Checked)
                    {
                        printrq = DateTime.Now.ToString("yyyy-MM-dd");
                    }
                    string printso = product.PLAN_SO;
                    if (printso.Length > 2)
                    {
                        if (printso.Substring(printso.Length - 2, 1) == ".")
                        {
                            printso = printso.Substring(printso.Length - 2);
                        }
                    }
                    sql = "SELECT PF,bz FROM dmsopfb where upper(so)='" + product.PLAN_SO + "'";
                    string    thePdfj = "", thePfbgh = "";
                    DataTable dt = dataConn.GetTable(sql);
                    if (dt.Rows.Count > 0)
                    {
                        thePdfj  = dt.Rows[0][0].ToString();
                        thePfbgh = dt.Rows[0][1].ToString();
                    }
                    PublicClass.PrintTmFzLQ(sn, printso, LoginInfo.UserInfo.USER_CODE, product.PRODUCT_MODEL, printrq, thePdfj, thePfbgh, 1);
                }
            }
            //else if (e.MessageHead == "SN")
            //{

            //    RMESEventArgs args = new RMESEventArgs();
            //    args.MessageHead = "OFFCTRL";
            //    args.MessageBody = "";
            //    SendDataChangeMessage(args);
            //}
        }
Пример #28
0
        private void txtLsh_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != 13)
            {
                return;
            }
            if (string.IsNullOrWhiteSpace(txtLsh.Text))
            {
                return;
            }
            GetFocused(txtLsh);
            string ThisInput = txtLsh.Text.Trim().ToUpper();

            if (ThisInput.StartsWith("$")) //单独指令
            {
                switch (ThisInput)
                {
                case "$QUIT":     //关闭计算机
                    Process.Start("shutdown.exe", "-s -t 10");
                    break;

                case "$EXIT":    //退出程序
                    BaseForm tempForm1 = (BaseForm)this.ParentForm;
                    PublicClass.ClearEvents(tempForm1);
                    Application.Exit();
                    break;

                case "$CANC":    //重新登录
                    //三漏数据处理 每次处理上一个流水号  退出时处理当前
                    BaseForm tempForm = (BaseForm)this.ParentForm;
                    PublicClass.ClearEvents(tempForm);
                    Application.Restart();
                    break;
                }
            }
            TheSn   = ThisInput;
            product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息
            if (product == null)
            {
                MessageBox.Show("非法流水号", "提示");
                txtLsh.Text = "";
                GetFocused(txtLsh);
                return;
            }
            txtSo.Text     = product.PLAN_SO;
            txtJx.Text     = product.PRODUCT_MODEL;
            txtUnitNo.Text = product.UNITNO;
            TheFdjxl       = product.PRODUCT_SERIES;
            ThePlancode    = product.PLAN_CODE;
            TheSo          = txtSo.Text;
            TheJx          = txtJx.Text;
            thePlinecode   = product.PLINE_CODE;
            string    sql = "select item_code from data_plan_standard_bom where plan_code='" + ThePlancode + "' and item_name='电控模块' and process_code!='90015'  and rownum=1 ";
            DataTable dt  = dataConn.GetTable(sql);

            if (dt.Rows.Count > 0)
            {
                txtEcm.Text = dt.Rows[0][0].ToString();
            }
            else
            {
                txtEcm.Text = "*";
            }
            GetFocused(txtLsh);
        }
Пример #29
0
        void ctrl_check_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 == "CHECK")
                {
                    string sn = e.MessageBody as string;


                    ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, sn);
                    if (product == null)
                    {
                        MessageBox.Show("该流水号不合法", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (product.LQ_FLAG == "Y" && LoginInfo.StationInfo.STATION_AREA == "U")
                    {
                        arg.MessageHead = "LQ";
                        arg.MessageBody = sn;
                        SendDataChangeMessage(arg);
                        MessageBox.Show("该计划为柳汽计划", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    string plancode  = product.PLAN_CODE;
                    string plinecode = LoginInfo.ProductLineInfo.PLINE_CODE;
                    //ZS5-1跳序控制
                    AtpuEntity tx = AtpuFactory.GetByStationCode(LoginInfo.StationInfo.STATION_NAME, LoginInfo.ProductLineInfo.PLINE_CODE);
                    if (tx != null)
                    {
                        if (tx.ZDMC == stationname && tx.GZDD == LoginInfo.ProductLineInfo.PLINE_CODE)
                        {
                            string    jhmc = "";
                            string    sql  = "select jhmc from atpujhb_tmp where zdmc='" + stationname + "' and wcsl<sl  and jhmc<>'" + plancode + "' and flag='Y' ";
                            DataTable dt   = dataConn.GetTable(sql);
                            if (dt.Rows.Count > 0)
                            {
                                jhmc = dt.Rows[0][0].ToString();
                            }
                            sql = "select flag from atpujhb_tmp where zdmc='" + stationname + "'   and jhmc='" + plancode + "'";
                            DataTable dt1 = dataConn.GetTable(sql);
                            if (dt1.Rows.Count == 0)
                            {
                                sql = "insert into atpujhb_tmp(jhdm,jhmc,jhso,ggxhmc,sl,yhmc,rqbegin,rqend,zdrq,sxsl,wcsl,bz,xh,fdjxl,gzdd,ghsl,havebom,run,qr,kffl,jzrq,unitno,gzqy,zdmc) ";
                                sql = sql + " select plan_seq,plan_code,plan_so,product_model,plan_qty,customer_name,begin_date,end_date,create_time,online_qty,(select count(distinct ghtm) from sjwcb_tmp where jhdm='" + plancode + "' and zdmc='" + stationname + "'),remark,'','',rounting_site,'',bom_flag,run_flag,confirm_flag,item_flag,account_date,lq_flag,pline_code,'" + stationname + "' ";
                                sql = sql + " from data_plan where plan_code='" + plancode + "' ";
                                dataConn.ExeSql(sql);
                                if (jhmc != "")
                                {
                                    MessageBox.Show("计划" + jhmc + "尚未完成,请联系班组长解锁", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                    arg.MessageHead = "INIT";
                                    arg.MessageBody = sn;
                                    SendDataChangeMessage(arg);
                                    return;
                                }
                            }
                            else
                            {
                                if (jhmc != "" && dt1.Rows[0][0].ToString() != "Y")
                                {
                                    MessageBox.Show("计划" + jhmc + "尚未完成,请联系班组长解锁", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                    arg.MessageHead = "INIT";
                                    arg.MessageBody = sn;
                                    SendDataChangeMessage(arg);
                                    return;
                                }
                            }
                        }
                    }
                    //ZF180VEPS灌录
                    if (stationname == "ZF180" || stationname == "ATPU-U860")
                    {
                        string veps = "";
                        //ProductDataFactory.VEPS_CHECK_SO(LoginInfo.ProductLineInfo.PLINE_CODE, product.PLAN_SO, out veps);
                        VEPS_CHECK_SO sp = new VEPS_CHECK_SO()
                        {
                            GZDD1   = LoginInfo.ProductLineInfo.PLINE_CODE,
                            SO1     = product.PLAN_SO,
                            RETSTR1 = ""
                        };
                        Procedure.run(sp);
                        veps = sp.RETSTR1;
                        if (veps == "0")
                        {
                            CsGlobalClass.NEEDVEPS = false;
                        }
                        else if (veps == "1")
                        {
                            MessageBox.Show("VEPS数据维护不全,请联系管理人员!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            arg.MessageHead = "INIT";
                            arg.MessageBody = sn;
                            SendDataChangeMessage(arg);
                            CsGlobalClass.NEEDVEPS = false;
                            return;
                        }
                        else if (veps == "2")
                        {
                            CsGlobalClass.NEEDVEPS = true;
                            //arg.MessageHead = "VEPS";
                            //arg.MessageBody = sn;
                            //SendDataChangeMessage(arg);
                        }
                    }
                    //机型 SO变换提示 机型取消
                    if (stationname != "ZF200-1" && stationname != "ZF210" && stationname != "ZF245")
                    {
                        string tishi = PublicClass.checktishi(stationname, product.PLAN_SO, sn);
                        if (tishi != "")
                        {
                            MessageBox.Show(tishi, "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            arg.MessageHead = "INIT";
                            arg.MessageBody = sn;
                            SendDataChangeMessage(arg);
                            if (tishi.Contains("漏扫"))
                            {
                                return;
                            }
                        }
                    }
                    try
                    {
                        //宇通判断 SO框变绿
                        if (product.REMARK.Contains("宇通"))
                        {
                            arg.MessageHead = "YT";
                            arg.MessageBody = sn;
                            SendDataChangeMessage(arg);
                        }
                        else
                        {
                            arg.MessageHead = "FYT";
                            arg.MessageBody = sn;
                            SendDataChangeMessage(arg);
                        }
                        //军车判断 SO框变红
                        if (product.REMARK.Contains("JC"))
                        {
                            arg.MessageHead = "JC";
                            arg.MessageBody = sn;
                            SendDataChangeMessage(arg);
                        }
                        else
                        {
                            if (arg.MessageHead != "YT")
                            {
                                arg.MessageHead = "FJC";
                                arg.MessageBody = sn;
                                SendDataChangeMessage(arg);
                            }
                        }
                    }
                    catch { }
                    CsGlobalClass.OLDSO = product.PLAN_SO;
                    CsGlobalClass.OLDJX = product.PRODUCT_MODEL;
                    try
                    {
                        CsGlobalClass.FDJXL = dataConn.GetValue("select nvl(upper(xl),'') from copy_engine_property where upper(so)='" + product.PLAN_SO + "'");
                    }
                    catch
                    {
                        CsGlobalClass.FDJXL = "";
                    }
                    if (LoginInfo.ProductLineInfo.PLINE_CODE == "L")
                    {
                        //显示BOM 显示装机提示
                        arg.MessageHead = "SHOWBOMLQ";
                        arg.MessageBody = sn;
                        SendDataChangeMessage(arg);
                    }
                    else
                    {
                        //显示BOM 显示装机提示
                        arg.MessageHead = "SHOWBOM";
                        arg.MessageBody = sn;
                        SendDataChangeMessage(arg);
                    }
                    //显示检测数据
                    arg.MessageHead = "SHOWDETECT";
                    arg.MessageBody = sn;
                    SendDataChangeMessage(arg);
                    ////装机图片显示 转到showbom执行
                    //if (stationname != "ZF245")
                    //{
                    //    arg.MessageHead = "SHOWPICTURE";
                    //    arg.MessageBody = sn;
                    //    SendDataChangeMessage(arg);
                    //}
                    //判断改制 窗体变红
                    if (product.PLAN_TYPE == "C" || product.PLAN_TYPE == "D")
                    {
                        arg.MessageHead = "GZ";
                        arg.MessageBody = sn;
                        SendDataChangeMessage(arg);
                    }
                    //试验程序号
                    if (stationname == "Z460" || stationname == "ATPU-A30" || stationname == "XA120" || stationname == "RA020")
                    {
                        PublicClass.TestDataCreate(sn, product.PLINE_CODE, product.PLAN_CODE);////未完成 取计划对应的FR
                    }
                    ////特殊站点装机提示 转到showbom执行
                    //if (stationname == "ZF130" && sn.Length >= 8)
                    //{
                    //    string zjts = "";
                    //    zjts = dataConn.GetValue("select PL_QRY_QZDSJ('" + sn + "','Z635','ZF130') from dual");
                    //    arg.MessageHead = "ZJTSADD";
                    //    arg.MessageBody = zjts;
                    //    SendDataChangeMessage(arg);
                    //}
                    //重复扫描
                    if (sn == CsGlobalClass.NEWSN)
                    {
                        if (CsGlobalClass.NEEDVEPS)
                        {
                            //重复扫描 灌录VEPS
                            try
                            {
                                PublicClass.Handle_Veps(product.PLAN_SO, sn);
                                CsGlobalClass.NEEDVEPS = false;
                            }
                            catch
                            {
                                CsGlobalClass.NEEDVEPS = false;
                            }
                        }
                        arg.MessageHead = "RECHECK";
                        arg.MessageBody = sn;
                        SendDataChangeMessage(arg);
                        return;//重复扫描返回
                    }
                    else
                    {
                        //三漏数据处理 每次处理上一个流水号  退出时处理当前
                        if (stationname == "Z690-1" || stationname == "Z690-2" || stationname == "Z690-3" || stationname == "Z690-4" || stationname == "ATPU-A470" || stationname == "ATPU-A480")
                        {
                            if (CsGlobalClass.NEWSN != "")
                            {
                                PublicClass.InsertSLData(CsGlobalClass.NEWSN);
                            }
                        }
                        if (CsGlobalClass.NEWSN != "")
                        {
                            dataConn.ExeSql("update data_complete set complete_time=sysdate where sn='" + CsGlobalClass.NEWSN + "' and plan_code='" + CsGlobalClass.NEWPLANCODE + "' and station_code='" + LoginInfo.StationInfo.STATION_CODE + "' and complete_time is null ");
                        }
                        CsGlobalClass.NEWSN       = sn;
                        CsGlobalClass.NEWPLANCODE = product.PLAN_CODE;
                        //CsGlobalClass.DGSM = false;
                    }

                    //
                    if (stationname == "Z750-1")
                    {
                        string count1 = dataConn.GetValue("select count(1) from data_plan where plan_code='" + product.PLAN_CODE + "' and plan_so ='" + product.PLAN_SO + "' and remark like '%缸体端面不打印机型号%'");
                        if (count1 != "0")
                        {
                            MessageBox.Show("缸体端面未打印机型号、流水号,请注意!");
                        }
                    }
                    //量检具辅料周期更换提醒
                    string    sqllj = "select t.ljj,t.cycle,t.sl,t.xh from atpuflgjthzqb t where location_name='" + stationname + "'";
                    DataTable dtlj  = dataConn.GetTable(sqllj);
                    for (int i = 0; i < dtlj.Rows.Count; i++)
                    {
                        string LJJName  = dtlj.Rows[i][0].ToString();
                        int    LJJCycle = Convert.ToInt32(dtlj.Rows[i][1].ToString());
                        int    LJJSL    = Convert.ToInt32(dtlj.Rows[i][2].ToString());
                        string LJJXh    = dtlj.Rows[i][3].ToString();

                        dataConn.ExeSql("update atpuflgjthzqb set sl=sl+1 WHERE xh='" + LJJXh + "'");

                        if ((LJJSL + 1) % LJJCycle == 0)
                        {
                            MessageBox.Show("第" + LJJCycle + "台,请更换" + LJJName);
                            dataConn.ExeSql(" update atpuflgjthzqb set sl=0 WHERE xh='" + LJJXh + "'");
                        }
                    }
                    //完成记录 零件扫描 检测数据录入

                    //打印
                    Print(product);


                    arg.MessageHead = "CHECKOK";
                    arg.MessageBody = sn;
                    SendDataChangeMessage(arg);
                }
            }
            catch (Exception e1)
            {
                if (!e1.Message.Contains("由于程序无法提交或取消单元格值更改,操作失败。"))
                {
                    MessageBox.Show(e1.Message);
                }
            }
            //SendDataChangeMessage(arg);
        }