示例#1
0
        /// <summary>
        /// HWD Allpart鋼網計數,add by LLF 2018-01-29
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void APStencilUpdateCountAction(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            OleExec apdb        = Station.APDB;
            string  Psn         = Input.Value.ToString();
            string  Line        = Station.Line;
            string  StationName = Station.StationName;

            OleDbParameter[] StencilSP = new OleDbParameter[4];
            StencilSP[0]               = new OleDbParameter("IN_P_SN", Psn);
            StencilSP[1]               = new OleDbParameter("IN_STATION", StationName);
            StencilSP[2]               = new OleDbParameter("IN_LINE", Line);
            StencilSP[3]               = new OleDbParameter();
            StencilSP[3].Size          = 1000;
            StencilSP[3].ParameterName = "RES";
            StencilSP[3].Direction     = System.Data.ParameterDirection.Output;
            string result = apdb.ExecProcedureNoReturn("MES1.CHECK_STENCIL_COUNT_UPDATE", StencilSP);

            if (result == "OK")
            {
                //apdbPool.Return(apdb);
                Station.AddMessage("MES00000062", new string[] { Psn }, MESReturnView.Station.StationMessageState.Pass);
            }
            else
            {
                //apdbPool.Return(apdb);
                throw new Exception(result);
            }
        }
示例#2
0
        /// <summary>
        /// HWD Allparts AOI測試資料檢查
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        /// MES1.CHECK_AOI_STATUS@mbdallpart(VAR_PANELNO,var_nextevent,var_productionline,var_LASTEDITBY,var_message )
        /// (G_SYSSERIALNO IN VARCHAR2,
        public static void AOITestAPDatachecker(MESPubLab.MESStation.MESStationBase Station, MESPubLab.MESStation.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            OleExec apdb        = Station.APDB;
            string  Psn         = Input.Value.ToString();
            string  Line        = Station.Line;
            string  StationName = Station.StationName;
            string  EMP_NO      = Station.LoginUser.EMP_NO;

            OleDbParameter[] StencilSP = new OleDbParameter[5];
            StencilSP[0]               = new OleDbParameter("G_SYSSERIALNO", Psn);
            StencilSP[1]               = new OleDbParameter("G_EVENTNAME", StationName);
            StencilSP[2]               = new OleDbParameter("G_LINE_NAME", Line);
            StencilSP[3]               = new OleDbParameter("G_EMP", EMP_NO);
            StencilSP[4]               = new OleDbParameter();
            StencilSP[4].Size          = 1000;
            StencilSP[4].ParameterName = "RES";
            StencilSP[4].Direction     = System.Data.ParameterDirection.Output;
            //string result = apdb.ExecProcedureNoReturn("MES1.CHECK_AOI_STATUS@mbdallpart", StencilSP);
            string result = apdb.ExecProcedureNoReturn("MES1.CHECK_AOI_STATUS", StencilSP);

            if (result == "OK")
            {
                Station.AddMessage("MES00000062", new string[] { Psn }, MESPubLab.MESStation.MESReturnView.Station.StationMessageState.Pass);
            }
            else
            {
                throw new Exception(result);
            }
        }
示例#3
0
        public static void APPanelSNReplaceAction(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            string ErrMessage = "";
            string PanelSN;
            SN     SNObj = new SN();

            string     StrSN = "";
            R_PANEL_SN Psn   = null;

            MESStationSession PanelSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (PanelSession == null)
            {
                ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY });
                throw new MESReturnMessage(ErrMessage);
            }
            PanelSN = PanelSession.InputValue.ToString();
            Psn     = SNObj.GetPanelVirtualSN(PanelSN, Station.SFCDB, DB_TYPE_ENUM.Oracle);

            MESStationSession SNSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);

            if (SNSession == null)
            {
                ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[1].SESSION_TYPE + Paras[1].SESSION_KEY });
                throw new MESReturnMessage(ErrMessage);
            }

            StrSN = SNSession.Value.ToString();



            OleExec apdb = Station.APDB;

            //Psn = PanelSession.InputValue.ToString();

            OleDbParameter[] StencilSP = new OleDbParameter[4];
            StencilSP[0]               = new OleDbParameter("G_PANEL", "");
            StencilSP[1]               = new OleDbParameter("G_PSN", StrSN);
            StencilSP[2]               = new OleDbParameter();
            StencilSP[2].Size          = 1000;
            StencilSP[2].ParameterName = "RES";
            StencilSP[2].Direction     = System.Data.ParameterDirection.Output;
            string result = apdb.ExecProcedureNoReturn("MES1.Z_PANEL_REPLACE_SP", StencilSP);

            if (result == "OK")
            {
                //apdbPool.Return(apdb);
                Station.AddMessage("MES00000062", new string[] { "" }, MESReturnView.Station.StationMessageState.Pass);
            }
            else
            {
                //apdbPool.Return(apdb);
                throw new Exception(result);
            }
        }
示例#4
0
        /// <summary>
        /// 檢查當前工單是否上料齊套
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void SMTAPMaterialChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            //return;
            //input test
            //string inputValue = Input.Value.ToString();
            MESStationSession WO_Session = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (WO_Session == null)
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "WO" }));
            }
            MESStationSession SN_Session = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);

            if (SN_Session == null)
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SN" }));
            }

            string wo = WO_Session.Value.ToString();
            //Modify By LLF 2018-01-26 SN_Session.Value是對象,取InputValue
            //string sn = SN_Session.Value.ToString();
            string sn      = SN_Session.InputValue.ToString();
            string line    = Station.Line;
            string station = Station.StationName;

            OleExecPool apdbPool = Station.DBS["APDB"];
            OleExec     apdb     = apdbPool.Borrow();

            OleDbParameter[] paras = new OleDbParameter[] {
                new OleDbParameter("G_PSN", sn),
                new OleDbParameter("G_WO", wo),
                new OleDbParameter("G_STATION", line),
                new OleDbParameter("G_EVENT", station),
                new OleDbParameter(":RES", OleDbType.VarChar, 800)
            };
            paras[4].Direction = ParameterDirection.Output;
            string msg = apdb.ExecProcedureNoReturn("MES1.CMC_INSERTDATA_SP", paras);

            if (apdb != null)
            {
                apdbPool.Return(apdb);
            }
            if ("OK".Equals(msg.ToUpper()))
            {
                Station.AddMessage("MES00000047", new string[] { "wo" }, StationMessageState.Pass);//wo
            }
            else
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000046", new string[] { msg }));
            }
        }
示例#5
0
        public string APUpdatePanlSN(string PanelSN, string SN, OleExec DB)
        {
            string ErrMessage = "";

            //Psn = PanelSession.InputValue.ToString();

            OleDbParameter[] PanelReplaceSP = new OleDbParameter[3];
            PanelReplaceSP[0]               = new OleDbParameter("G_PANEL", PanelSN);
            PanelReplaceSP[1]               = new OleDbParameter("G_PSN", SN);
            PanelReplaceSP[2]               = new OleDbParameter();
            PanelReplaceSP[2].Size          = 1000;
            PanelReplaceSP[2].ParameterName = "RES";
            PanelReplaceSP[2].Direction     = System.Data.ParameterDirection.Output;
            string result = DB.ExecProcedureNoReturn("MES1.Z_PANEL_REPLACE_SP", PanelReplaceSP);

            return(result);
        }
示例#6
0
        public string GetNewID(string BU, OleExec DB, DB_TYPE_ENUM DBType)
        {
            //string strSql = "exec sfc.get_id('KKI','C_sku',OUT_RES); ";
            //string ret = "";
            OleDbParameter[] para = new OleDbParameter[]
            {
                new OleDbParameter(":IN_BU", OleDbType.VarChar, 300),
                new OleDbParameter(":IN_TYPE", OleDbType.VarChar, 300),
                new OleDbParameter(":OUT_RES", OleDbType.VarChar, 500)
            };
            para[0].Value     = BU;
            para[1].Value     = TableName;
            para[2].Direction = ParameterDirection.Output;
            DB.ExecProcedureNoReturn("SFC.GET_ID", para);
            string newID = para[2].Value.ToString();

            if (newID.StartsWith("ERR"))
            {
                throw new Exception("獲取表'" + TableName + "' ID 異常! " + newID);
            }
            return(newID);
        }
示例#7
0
        /// <summary>
        /// 檢查當前工單的錫膏是否上線:
        ///HWD CHECK&補Allparts錫膏資料(連板&非連板均調用該SP)
        ///MES1.CHECK_SOLDER_INSERTDATA(Panelno,Nextevent,L_tmp_line,)
        ///var_message返回 OK則OK, 反之,throw(ErrorMessage)
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void SMTSolderDatachecker(MESPubLab.MESStation.MESStationBase Station, MESPubLab.MESStation.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            //Marked by LLF 2018-01-29
            //if (Paras.Count == 0)
            //{
            //    throw new Exception("參數數量不正確!");
            //}

            OleExec     apdb      = Station.APDB;
            string      PsnInsert = Input.Value.ToString();
            string      Line      = Station.Line;
            List <R_SN> ListRsn   = new List <R_SN>();
            T_R_SN      RSn       = new T_R_SN(Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);

            ListRsn = RSn.GetRSNbyPsn(PsnInsert, Station.SFCDB);
            //Modify BY LLF 20108-01-29,應該是獲取當前工站
            //string Next_Station = ListRsn[0].NEXT_STATION;
            string StationName = Station.StationName;

            OleDbParameter[] SolderSP = new OleDbParameter[4];
            SolderSP[0]               = new OleDbParameter("G_PSN", PsnInsert);
            SolderSP[1]               = new OleDbParameter("G_EVENTNAME", StationName);
            SolderSP[2]               = new OleDbParameter("G_LINE", Line);
            SolderSP[3]               = new OleDbParameter();
            SolderSP[3].Size          = 1000;
            SolderSP[3].ParameterName = "RES";
            SolderSP[3].Direction     = System.Data.ParameterDirection.Output;
            SolderSP[3].Size          = 200;
            string result = apdb.ExecProcedureNoReturn("MES1.CHECK_SOLDER_INSERTDATA", SolderSP);

            if (result == "OK")
            {
                Station.AddMessage("MES00000062", new string[] { PsnInsert }, MESPubLab.MESStation.MESReturnView.Station.StationMessageState.Pass);
            }
            else
            {
                throw new Exception(result);
            }
        }
示例#8
0
        /// HWD PTH Allpart扣料,add by LLF 2018-02-19
        /// </summary>
        public static void APAssignMaterialPTHAction(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
//            OleExecPool apdbPool = null;
            OleExec apdb = null;

            try
            {
                apdb = Station.APDB;
                string Line        = Station.Line;
                string StationName = string.Empty;
                string ErrMessage  = string.Empty;
                string StrWO       = string.Empty;
                string StationNum  = string.Empty;
                string TRCode      = string.Empty;
                string SN          = string.Empty;

                MESStationSession SNSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);
                if (SNSession == null)
                {
                    ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY });
                    throw new MESReturnMessage(ErrMessage);
                }
                SN = SNSession.Value.ToString();

                MESStationSession WOSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);
                if (WOSession == null)
                {
                    ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[1].SESSION_TYPE + Paras[1].SESSION_KEY });
                    throw new MESReturnMessage(ErrMessage);
                }
                StrWO = WOSession.Value.ToString();

                MESStationSession StationNumSession = Station.StationSession.Find(t => t.MESDataType == Paras[2].SESSION_TYPE && t.SessionKey == Paras[2].SESSION_KEY);
                if (StationNumSession == null)
                {
                    ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[2].SESSION_TYPE + Paras[2].SESSION_KEY });
                    throw new MESReturnMessage(ErrMessage);
                }
                StationNum  = StationNumSession.Value.ToString();
                StationName = Station.Line + Station.StationName + StationNum;

                MESStationSession PTHTRCodeSession = Station.StationSession.Find(t => t.MESDataType == Paras[3].SESSION_TYPE && t.SessionKey == Paras[3].SESSION_KEY);
                if (PTHTRCodeSession == null)
                {
                    ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[3].SESSION_TYPE + Paras[3].SESSION_KEY });
                    throw new MESReturnMessage(ErrMessage);
                }

                TRCode = PTHTRCodeSession.Value.ToString();

                OleDbParameter[] AssignMaterialPTHSP = new OleDbParameter[6];
                AssignMaterialPTHSP[0]               = new OleDbParameter("g_type", "0010");
                AssignMaterialPTHSP[1]               = new OleDbParameter("g_wo", StrWO);
                AssignMaterialPTHSP[2]               = new OleDbParameter("g_station", StationName);
                AssignMaterialPTHSP[3]               = new OleDbParameter("g_tr_code", TRCode);
                AssignMaterialPTHSP[4]               = new OleDbParameter("g_psn", SN);
                AssignMaterialPTHSP[5]               = new OleDbParameter();
                AssignMaterialPTHSP[5].Size          = 1000;
                AssignMaterialPTHSP[5].ParameterName = "RES";
                AssignMaterialPTHSP[5].Direction     = System.Data.ParameterDirection.Output;
                string result = apdb.ExecProcedureNoReturn("MES1.assign_material_pth", AssignMaterialPTHSP);
                if (result.IndexOf("OK") >= 0)
                {
                    OleDbParameter[] AssignMaterialPTH0020 = new OleDbParameter[6];
                    AssignMaterialPTH0020[0]               = new OleDbParameter("g_type", "0020");
                    AssignMaterialPTH0020[1]               = new OleDbParameter("g_wo", StrWO);
                    AssignMaterialPTH0020[2]               = new OleDbParameter("g_station", StationName);
                    AssignMaterialPTH0020[3]               = new OleDbParameter("g_tr_code", TRCode);
                    AssignMaterialPTH0020[4]               = new OleDbParameter("g_psn", SN);
                    AssignMaterialPTH0020[5]               = new OleDbParameter();
                    AssignMaterialPTH0020[5].Size          = 1000;
                    AssignMaterialPTH0020[5].ParameterName = "RES";
                    AssignMaterialPTH0020[5].Direction     = System.Data.ParameterDirection.Output;
                    result = apdb.ExecProcedureNoReturn("MES1.assign_material_pth", AssignMaterialPTH0020);
                    //apdbPool.Return(apdb);
                    if (result.IndexOf("OK") == -1)
                    {
                        throw new Exception(result);
                    }
                }
                else
                {
                    //apdbPool.Return(apdb);
                    throw new Exception(result);
                }
            }
            catch (Exception ex)
            {
                //if (apdb != null)
                //{
                //    //apdbPool.Return(apdb);
                //}
                throw new Exception(ex.Message.ToString());
            }
        }