Пример #1
0
        public static void SetPassOrFailInOba(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            MESStationInput snInput       = Station.Inputs.Find(t => t.DisplayName == Paras[0].SESSION_TYPE.ToString());
            MESStationInput failSnInput   = Station.Inputs.Find(t => t.DisplayName == Paras[1].SESSION_TYPE.ToString());
            MESStationInput FailCodeInput = Station.Inputs.Find(t => t.DisplayName == Paras[2].SESSION_TYPE.ToString());
            MESStationInput LocationInput = Station.Inputs.Find(t => t.DisplayName == Paras[3].SESSION_TYPE.ToString());
            MESStationInput FailDescInput = Station.Inputs.Find(t => t.DisplayName == Paras[4].SESSION_TYPE.ToString());


            if (Input.Value.ToString().ToUpper().Equals("PASS"))
            {
                snInput.Visable       = true;;
                failSnInput.Visable   = false;
                FailCodeInput.Visable = false;
                LocationInput.Visable = false;
                FailDescInput.Visable = false;
                Station.NextInput     = snInput;
            }
            else
            {
                snInput.Visable     = false;;
                failSnInput.Visable = true;
                Station.NextInput   = failSnInput;
            }
        }
Пример #2
0
        public static void SetNextInputAction(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            //参数1,获取一个内存变量,检查它的值是否为配置值,
            //如是,设置next为配置2的
            //
            R_Station_Action_Para P1 = Paras[0];
            MESStationSession     s  = Station.StationSession.Find(t => t.MESDataType == P1.SESSION_TYPE && t.SessionKey == P1.SESSION_KEY);

            if (s == null)
            {
                return;
            }
            if (s.Value.ToString() == P1.VALUE.ToString())
            {
                R_Station_Action_Para P2 = Paras[1];
                MESStationInput       i  = Station.Inputs.Find(t => t.DisplayName == P2.VALUE.ToString());
                if (i != null)
                {
                    Station.NextInput = i;
                }
            }
            else
            {
                R_Station_Action_Para P2 = Paras[2];
                MESStationInput       i  = Station.Inputs.Find(t => t.DisplayName == P2.VALUE.ToString());
                if (i != null)
                {
                    Station.NextInput = i;
                }
            }
        }
Пример #3
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(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;
            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 }, MESReturnView.Station.StationMessageState.Pass);
            }
            else
            {
                throw new Exception(result);
            }
        }
Пример #4
0
        /// <summary>
        /// 檢查輸入的Action_code是否存在
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void ActionCodeDataChecker(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            if (Paras.Count != 1)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050"));
            }
            string            ActionCodeInput   = "";
            MESStationSession sessionActionCode = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (sessionActionCode == null)
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY }));
            }
            if (sessionActionCode.Value == null)
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY }));
            }
            try
            {
                T_C_ACTION_CODE t_c_action_code = new T_C_ACTION_CODE(Station.SFCDB, Station.DBType);
                C_ACTION_CODE   c_action_code   = new C_ACTION_CODE();
                c_action_code = t_c_action_code.GetByActionCode(sessionActionCode.Value.ToString(), Station.SFCDB);
                if (c_action_code == null)
                {
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000007", new string[] { "ActionCode", ActionCodeInput }));
                }
                Station.AddMessage("MES00000026", new string[] { }, MESReturnView.Station.StationMessageState.Pass);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #5
0
        /// <summary>
        /// 1.檢查SN 在r_repair_failcode 表中是否已经维修完成
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras">1個參數,WO保存的位置</param>
        public static void SNFailCodeReapirDatachecker(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            T_R_REPAIR_FAILCODE   RepairFailcode = new T_R_REPAIR_FAILCODE(Station.SFCDB, Station.DBType);
            Row_R_REPAIR_FAILCODE FailCodeRow;

            if (Paras.Count != 1)
            {
                throw new Exception("參數數量不正確!");
            }
            MESStationSession SNFailCodeSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (SNFailCodeSession == null)
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY }));
            }
            else
            {
                if (SNFailCodeSession.Value != null)
                {
                    FailCodeRow = RepairFailcode.GetByFailCodeID(SNFailCodeSession.Value.ToString(), Station.SFCDB);
                    if (FailCodeRow == null)
                    {
                        throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000192", new string[] {  }));
                    }
                }
                else
                {
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].VALUE }));
                }
            }
        }
Пример #6
0
        //Add by LLF 2017-01-26 Begin
        public static void TrCodeDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            string  Process = "";
            string  Message = "";
            string  StrWO   = "";
            string  StrCode = "";
            string  IP      = string.Empty;
            OleExec APDB    = null;

            Dictionary <string, DataRow> TrSnTable = null;
            T_R_SN Table = new T_R_SN(Station.SFCDB, Station.DBType);

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

            if (WoSession == null)
            {
                Message = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY });
                throw new MESReturnMessage(Message);
            }
            StrWO = WoSession.Value.ToString();

            //獲取 TRSN 對象
            MESStationSession TrSnSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);

            if (TrSnSession == null)
            {
                Message = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[1].SESSION_TYPE + Paras[1].SESSION_KEY });
                throw new MESReturnMessage(Message);
            }
            TrSnTable = (Dictionary <string, DataRow>)TrSnSession.Value;

            Process = Paras[2].VALUE.ToString();

            IP = Paras[3].VALUE.ToString();

            try
            {
                APDB    = Station.APDB;
                StrCode = Table.GetAPTrCode(StrWO, TrSnTable["R_TR_SN"]["TR_SN"].ToString(), Process, Station.LoginUser.EMP_NO, IP, APDB);


                MESStationSession TrCodeSession = Station.StationSession.Find(t => t.MESDataType == Paras[4].SESSION_TYPE && t.SessionKey == Paras[4].SESSION_KEY);
                if (TrCodeSession == null)
                {
                    TrCodeSession = new MESStationSession()
                    {
                        MESDataType = Paras[4].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[4].SESSION_KEY, ResetInput = Input
                    };
                    Station.StationSession.Add(TrCodeSession);
                }

                TrCodeSession.Value = StrCode;
                Station.AddMessage("MES00000001", new string[] { TrCodeSession.Value.ToString() }, MESReturnView.Station.StationMessageState.Pass);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Пример #7
0
        /// <summary>
        /// 1.檢查输入的Location位置是否是在数据库中存在,不存在则报错
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras">1個參數,WO保存的位置</param>
        public static void ReapirLocationDatachecker(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            OleExec       apdb         = null;
            List <string> LocationList = new List <string>();

            if (Paras.Count != 2)
            {
                throw new Exception("參數數量不正確!");
            }

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

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

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

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

            //獲取ALLPART數據
            AP_DLL          APDLL = new AP_DLL();
            MESStationInput I     = Station.Inputs.Find(t => t.DisplayName == "Location");
            List <object>   ret   = I.DataForUse;

            ret.Clear();
            try
            {
                apdb         = Station.DBS["APDB"].Borrow();
                LocationList = APDLL.CheckLocationExist(ObjSN.SkuNo, StrLocation, apdb);
                if (LocationList.Count <= 0)
                {
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000072", new string[] { StrLocation, ObjSN.SkuNo }));
                }
                else
                {
                    foreach (object item in LocationList)
                    {
                        ret.Add(item);
                    }
                }
                Station.DBS["APDB"].Return(apdb);
                Station.AddMessage("MES00000001", new string[] { }, MESReturnView.Station.StationMessageState.Pass);
            }
            catch (Exception ex)
            {
                if (apdb != null)
                {
                    Station.DBS["APDB"].Return(apdb);
                }
                throw ex;
            }
        }
Пример #8
0
        /// <summary>
        /// Sn條碼長度如果是9位,則取前8位
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void LoadSnFromInput(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            if (Paras.Count == 0)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050"));
            }

            string NewSN = Input.Value.ToString();

            if (NewSN.Length != 8 && NewSN.Length != 9)
            {
                // Station.AddMessage("MES00000022", new string[] { "SN" }, MESReturnView.Station.StationMessageState.Fail);
                //Station.NextInput = Station.Inputs[2];
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000022", new string[] { "SN" }));
            }
            else
            {
                Input.Value = NewSN.Substring(0, 8);
            }


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

            if (s == null)
            {
                s = new MESStationSession()
                {
                    MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(s);
            }


            //if (Input.Value.ToString().Length == 8)
            //{
            //    //Station.AddMessage("MES00000029", new string[] { "Sn", Input.Value.ToString() }, MESReturnView.Station.StationMessageState.Pass);
            //    //Station.NextInput = Station.Inputs[1];
            //}
            //else if (NewSN)
            //{
            //    Station.AddMessage("MES00000029", new string[] { "LinkQTY", LinkNum.ToString() }, MESReturnView.Station.StationMessageState.Pass);
            //    Station.NextInput = Station.Inputs[1];
            //}
            //else
            //{
            //    Station.AddMessage("MES00000020", new string[] { "LinkQTY", "Number" }, MESReturnView.Station.StationMessageState.Message);
            //    Station.NextInput = Station.Inputs[3];
            //}
            //Station.NextInput = Station.Inputs[2];
            ////Station.DBS["APDB"].Borrow()
            //LogicObject.WorkOrder WO = new LogicObject.WorkOrder();
            //WO.WO = Input.Value.ToString();
            //s.Value = WO;
            //s.InputValue = Input.Value.ToString();
            //s.ResetInput = Input;
            //Station.AddMessage("MES00000029", new string[] { "Workorder", WO.ToString() }, MESReturnView.Station.StationMessageState.Message);
            //Station.AddMessage("MES00000029", new string[] { "Workorder", WO.ToString() }, MESReturnView.Station.StationMessageState.Pass);
            //Station.AddMessage("MES00000029", new string[] { "Workorder", WO.ToString() }, MESReturnView.Station.StationMessageState.Fail);
        }
Пример #9
0
        /// <summary>
        /// 從PanelLoadPoint保存的Panel對象加載工單對象到指定位置
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras">2個參數,WO,Panle保存的位置</param>
        public static void WoFromPanelDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            if (Paras.Count != 2)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000052"));
            }
            MESStationSession Swo    = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);
            MESStationSession Spanel = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);

            if (Swo == null)
            {
                Swo = new MESStationSession()
                {
                    MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(Swo);
            }

            if (Spanel == null)
            {
                //throw new Exception("请输入PANEL!");
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000171", new string[] { "PANEL" }));
            }
            else
            {
                Panel     ObjPanel       = (Panel)Spanel.Value;
                WorkOrder ObjWorkorder   = new WorkOrder();
                string    PanelLoadPoint = Input.Value.ToString();
                string    WOSavePoint    = null;

                try
                {
                    if (ObjPanel.PanelCollection.Count != 0)
                    {
                        WOSavePoint = ObjPanel.PanelCollection[0].WORKORDERNO.ToString();
                    }
                    else
                    {
                        //throw new Exception("Can Not Find " + PanelLoadPoint + " 'Information ' !");
                        throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000189", new string[] { PanelLoadPoint }));
                    }
                    ObjWorkorder.Init(WOSavePoint, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
                    if (ObjWorkorder == null)
                    {
                        //throw new Exception("Can Not Find " + WOSavePoint + " 'Information ' !");
                        throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000189", new string[] { WOSavePoint }));
                    }
                    Swo.Value = ObjWorkorder;

                    Station.AddMessage("MES00000029", new string[] { "Workorder", WOSavePoint }, MESReturnView.Station.StationMessageState.Pass);
                }
                catch (Exception ex)
                {
                    string msgCode = ex.Message;
                    throw ex;
                }
            }
        }
Пример #10
0
        public static void ClearInputAndMemory(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            string ClearFlag  = string.Empty;
            string ClearItem  = string.Empty;
            string ErrMessage = string.Empty;

            if (Paras.Count < 2)
            {
                ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000057", new string[] {});
                throw new MESReturnMessage(ErrMessage);
            }

            //獲取清除標誌位,表示是否要進行清除輸入操作
            MESStationSession ClearFlagSession = Station.StationSession.Find(t => t.MESDataType.Equals(Paras[0].SESSION_TYPE) && t.SessionKey.Equals(Paras[0].SESSION_KEY));

            if (ClearFlagSession != null)
            {
                //黃楊盛 2018年4月24日14:23:34 NPE就放FALSE
                //ClearFlag = ClearFlagSession.Value.ToString();
                ClearFlag = ClearFlagSession.Value?.ToString() ?? "false";
                Station.StationSession.Remove(ClearFlagSession);
                if (ClearFlag.ToLower().Equals("true"))
                {
                    List <R_Station_Action_Para> MemoryParas = Paras.FindAll(t => t.SESSION_TYPE.Equals("CLEARMEMORY"));
                    List <R_Station_Action_Para> InputParas  = Paras.FindAll(t => t.SESSION_TYPE.Equals("CLEARINPUT"));

                    //清除指定session
                    foreach (R_Station_Action_Para para in MemoryParas)
                    {
                        Station.StationSession.Remove(Station.StationSession.Find(t => t.MESDataType.ToUpper().Equals(para.VALUE.ToUpper())));
                    }

                    foreach (R_Station_Action_Para para in InputParas)
                    {
                        //清除所有輸入框的值
                        if (para.VALUE.ToUpper().Equals("ALL"))
                        {
                            foreach (MESStationInput StationInput in Station.Inputs)
                            {
                                StationInput.Value = "";
                            }
                            return;
                        }

                        //清除指定輸入框的值
                        ClearItem = para.VALUE.ToString().ToUpper();
                        MESStationInput input = Station.Inputs.Find(t => t.DisplayName.ToUpper().Equals(ClearItem) ||
                                                                    t.Name.ToUpper().Equals(ClearItem));
                        if (input != null)
                        {
                            input.Value = "";
                        }
                    }

                    //ClearFlagSession.Value = "false";
                }
            }
        }
Пример #11
0
        //產品維修CheckIn Action
        public static void SNInRepairAction(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            if (Paras.Count == 0)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050"));
            }
            MESStationSession SNLoadPoint = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (SNLoadPoint == null)
            {
                SNLoadPoint = new MESStationSession()
                {
                    MESDataType = "SN", InputValue = Input.Value.ToString(), SessionKey = "1", ResetInput = Input
                };
                Station.StationSession.Add(SNLoadPoint);
            }

            string sendEmp    = Station.Inputs.Find(s => s.DisplayName == "SendEMP").Value.ToString();
            string receiveEmp = Station.Inputs.Where(s => s.DisplayName == "ReceiveEMP").FirstOrDefault().Value.ToString();
            //string sendEmp = Station.Inputs[0].Value.ToString();
            //string receiveEmp = Station.Inputs[1].Value.ToString();
            string strSn = Input.Value.ToString();
            SN     sn    = new SN(strSn, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            T_R_REPAIR_TRANSFER   rTransfer      = new T_R_REPAIR_TRANSFER(Station.SFCDB, DB_TYPE_ENUM.Oracle);
            Row_R_REPAIR_TRANSFER rowTransfer    = (Row_R_REPAIR_TRANSFER)rTransfer.NewRow();
            T_R_REPAIR_MAIN       rRepairMain    = new T_R_REPAIR_MAIN(Station.SFCDB, DB_TYPE_ENUM.Oracle);
            List <R_REPAIR_MAIN>  RepariMainList = rRepairMain.GetRepairMainBySN(Station.SFCDB, strSn);
            R_REPAIR_MAIN         rMain          = RepariMainList.Where(r => r.CLOSED_FLAG == "0").FirstOrDefault(); // Find(r => r.CLOSED_FLAG == "0");

            if (rMain != null)
            {
                rowTransfer.ID             = rTransfer.GetNewID(Station.BU, Station.SFCDB);
                rowTransfer.REPAIR_MAIN_ID = rMain.ID;
                rowTransfer.IN_SEND_EMP    = sendEmp;
                rowTransfer.IN_RECEIVE_EMP = receiveEmp;
                rowTransfer.IN_TIME        = DateTime.Now;
                rowTransfer.SN             = strSn;
                rowTransfer.LINE_NAME      = Station.Line;
                rowTransfer.STATION_NAME   = sn.CurrentStation;
                rowTransfer.WORKORDERNO    = sn.WorkorderNo;
                rowTransfer.SKUNO          = sn.SkuNo;
                rowTransfer.CLOSED_FLAG    = "1";
                string strRet = (Station.SFCDB).ExecSQL(rowTransfer.GetInsertString(DB_TYPE_ENUM.Oracle));
                if (Convert.ToInt32(strRet) > 0)
                {
                    Station.AddMessage("MES00000001", new string[] { }, MESReturnView.Station.StationMessageState.Pass);
                }
                else
                {
                    Station.AddMessage("MES00000037", new string[] { "INSET R_REPAIR_TRANSFER" }, MESReturnView.Station.StationMessageState.Pass);
                }
            }
            else
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000066", new string[] { strSn, "CLOSED" }));
            }
        }
Пример #12
0
        public static void TEST1(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            string SN = SNMaker.SNmaker.GetNextSN("TEST", Station.SFCDB);

            Station.StationMessages.Add(new StationMessage()
            {
                Message = SN, State = StationMessageState.Message
            });
        }
Пример #13
0
        public virtual void LoadData(MESStationBase station, MESStationInput Input)
        {
            string WO = Input.Value.ToString();

            //.....
            station.StationSession.Add(new MESStationSession {
                Value = WO, MESDataType = SessionType, SessionKey = SessionKey
            });
        }
Пример #14
0
        public static void SetNextInput(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            MESStationInput input = Station.Inputs.Find(t => t.DisplayName == Paras[0].VALUE.ToString().Trim());

            if (input != null)
            {
                Station.NextInput = input;
            }
        }
Пример #15
0
        //加載SN待過工站
        public static void SNNextStationDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            //Modify by LLF 2018-01-26 通過配置獲取
            //MESStationSession WipStationSave = new MESStationSession() {MESDataType= "WIPSTATION", InputValue=Input.Value.ToString(),SessionKey="1",ResetInput=Input };

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

            if (NextStationSave == null)
            {
                NextStationSave = new MESStationSession()
                {
                    MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(NextStationSave);
            }
            string             strSn           = Input.Value.ToString();
            SN                 sn              = new SN(strSn, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            Route              routeDetail     = new Route(sn.RouteID, GetRouteType.ROUTEID, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            List <string>      snStationList   = new List <string>();
            List <RouteDetail> routeDetailList = routeDetail.DETAIL;
            RouteDetail        R = routeDetailList.Where(r => r.STATION_NAME == sn.CurrentStation).FirstOrDefault();

            //Modify by LLF 2018-01-29
            //string nextStation1 = routeDetailList.Where(r => r.SEQ_NO == R.SEQ_NO + 10).FirstOrDefault().STATION_NAME;

            string nextStation1 = sn.NextStation;

            if (!sn.CurrentStation.Equals("REWORK"))
            {
                if (R == null)
                {
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000156", new string[] { strSn, sn.CurrentStation }));
                }

                if (routeDetailList.Where(r => r.SEQ_NO > R.SEQ_NO).FirstOrDefault() == null && !sn.CurrentStation.Equals("REWORK"))
                {
                    if (!string.IsNullOrEmpty(sn.CurrentStation))
                    {
                        StrNextStation = sn.NextStation;
                    }
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000200", new string[] { strSn, StrNextStation }));
                }
                nextStation1 = routeDetailList.Where(r => r.SEQ_NO > R.SEQ_NO).FirstOrDefault().STATION_NAME;
            }

            snStationList.Add(nextStation1);
            if (R != null && R.DIRECTLINKLIST != null)
            {
                foreach (var item in R.DIRECTLINKLIST)
                {
                    snStationList.Add(item.STATION_NAME);
                }
            }
            NextStationSave.Value = snStationList;
            Station.AddMessage("MES00000029", new string[] { "NextStationList", "NextStation" }, MESReturnView.Station.StationMessageState.Pass);
        }
Пример #16
0
        public static void SmtSkuFromWODataCheck(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            if (Paras.Count != 3)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050"));
            }
            //加載SKUSavePoint位置
            MESStationSession SkuSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (SkuSession == null)
            {
                SkuSession = new MESStationSession()
                {
                    MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(SkuSession);
            }
            //加載WoLoadPoint
            MESStationSession WOSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);

            if (WOSession == null)
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[1].SESSION_TYPE }));
                // throw new Exception("WO參數不存在!");
            }

            WorkOrder WOObject = (WorkOrder)WOSession.Value;

            //WOObject.SkuNO

            SKU sku = new SKU();

            try
            {
                MESDBHelper.OleExec ole = Station.SFCDB;
                sku = sku.Init(WOObject.SkuNO, ole, MESDataObject.DB_TYPE_ENUM.Oracle);

                MESStationSession SessionSN    = Station.StationSession.Find(t => t.MESDataType == Paras[2].SESSION_TYPE && t.SessionKey == Paras[2].SESSION_KEY);
                DisplayOutPut     CurrentSkuno = Station.DisplayOutput.Find(t => t.Name == "SKUNO");
                //SN機種與當前操作機種不一致卡住
                if (CurrentSkuno.Value != null && CurrentSkuno.Value.ToString().Trim().Length > 0 && !sku.SkuNo.Equals(CurrentSkuno.Value.ToString()))
                {
                    string ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000235", new string[] { SessionSN.Value.ToString(), sku.SkuNo, CurrentSkuno.Value.ToString() });
                    throw new MESReturnMessage(ErrMessage);
                }

                SkuSession.Value = sku;
                Station.AddMessage("MES00000029", new string[] { "Skuno", sku.ToString() }, MESReturnView.Station.StationMessageState.Pass);
            }
            catch (Exception e)
            {
                Station.AddMessage("MES00000007", new string[] { "Skuno" }, MESReturnView.Station.StationMessageState.Fail);
                throw e;
            }
        }
Пример #17
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);
            }
        }
Пример #18
0
        //Add by LLF 2018-02-19 Begin
        public static void PTHTrCodeDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            string  Message       = "";
            string  StrWO         = "";
            string  StrCode       = "";
            string  StationName   = string.Empty;
            string  StrStationNum = string.Empty;
            OleExec APDB          = null;

            T_R_SN Table = new T_R_SN(Station.SFCDB, Station.DBType);

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

            if (WOSession == null)
            {
                Message = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY });
                throw new MESReturnMessage(Message);
            }
            StrWO = WOSession.Value.ToString();

            //獲取 TRSN 對象
            MESStationSession StationNumSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);

            if (StationNumSession == null)
            {
                Message = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[1].SESSION_TYPE + Paras[1].SESSION_KEY });
                throw new MESReturnMessage(Message);
            }
            StrStationNum = StationNumSession.Value.ToString();

            StationName = Station.Line + Station.StationName + StrStationNum;
            try
            {
                APDB    = Station.APDB;
                StrCode = Table.GetAPPTHTrCode(StrWO, StationName, APDB);


                MESStationSession PTHTrSnSession = Station.StationSession.Find(t => t.MESDataType == Paras[2].SESSION_TYPE && t.SessionKey == Paras[2].SESSION_KEY);
                if (PTHTrSnSession == null)
                {
                    PTHTrSnSession = new MESStationSession()
                    {
                        MESDataType = Paras[2].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[2].SESSION_KEY, ResetInput = Input
                    };
                    Station.StationSession.Add(PTHTrSnSession);
                }

                PTHTrSnSession.Value = StrCode;
                Station.AddMessage("MES00000001", new string[] { PTHTrSnSession.Value.ToString() }, MESReturnView.Station.StationMessageState.Pass);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Пример #19
0
        //產品維修CheckOut Action
        public static void SNOutRepairAction(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            if (Paras.Count == 0)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050"));
            }
            MESStationSession SNLoadPoint = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (SNLoadPoint == null)
            {
                SNLoadPoint = new MESStationSession()
                {
                    MESDataType = "SN", InputValue = Input.Value.ToString(), SessionKey = "1", ResetInput = Input
                };
                Station.StationSession.Add(SNLoadPoint);
            }

            string checkOutSendEmp    = Station.Inputs.Find(s => s.DisplayName == "SendEMP").Value.ToString();
            string checkOutReceiveEmp = Station.Inputs.Find(s => s.DisplayName == "ReceiveEMP").Value.ToString();
            string strSn = Input.Value.ToString();
            SN     sn    = new SN(strSn, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            T_R_REPAIR_TRANSFER   rTransfer   = new T_R_REPAIR_TRANSFER(Station.SFCDB, DB_TYPE_ENUM.Oracle);
            Row_R_REPAIR_TRANSFER rowTransfer = (Row_R_REPAIR_TRANSFER)rTransfer.NewRow();

            List <R_REPAIR_TRANSFER> transferList    = rTransfer.GetReSNbysn(strSn, Station.SFCDB);
            R_REPAIR_TRANSFER        rRepairTransfer = transferList.Where(r => r.CLOSED_FLAG == "1").FirstOrDefault();//TRANSFER表 1 表示不良

            if (rRepairTransfer != null)
            {
                rowTransfer = (Row_R_REPAIR_TRANSFER)rTransfer.GetObjByID(rRepairTransfer.ID, Station.SFCDB);

                //T_R_REPAIR_MAIN rRepairMain = new T_R_REPAIR_MAIN(Station.SFCDB, DB_TYPE_ENUM.Oracle);
                //List<R_REPAIR_MAIN> RepariMainList = rRepairMain.GetRepairMainBySN(Station.SFCDB, strSn);
                //R_REPAIR_MAIN rMain = RepariMainList.Where(r => r.CLOSED_FLAG == "0").FirstOrDefault();

                rowTransfer.OUT_TIME        = DateTime.Now;
                rowTransfer.OUT_SEND_EMP    = checkOutSendEmp;
                rowTransfer.OUT_RECEIVE_EMP = checkOutReceiveEmp;

                string strRet = (Station.SFCDB).ExecSQL(rowTransfer.GetUpdateString(DB_TYPE_ENUM.Oracle));
                if (Convert.ToInt32(strRet) > 0)
                {
                    Station.AddMessage("MES00000001", new string[] { }, MESReturnView.Station.StationMessageState.Pass);
                }
                else
                {
                    Station.AddMessage("MES00000037", new string[] { "UPDATE R_REPAIR_TRANSFER" }, MESReturnView.Station.StationMessageState.Pass);
                }
            }
            else
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000066", new string[] { strSn, "abnormal" }));
            }
        }
Пример #20
0
        /// <summary>
        /// 根據SN的SKUNO帶出維修LOCATION
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void LocationFromSNDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            List <string> LocationList = new List <string>();
            string        ErrMessage   = "";
            OleExec       apdb         = null;

            if (Paras.Count != 1)
            {
                string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000057");
                throw new MESReturnMessage(errMsg);
            }

            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 ObjSn = (SN)SNSession.Value;

            //獲取ALLPART數據
            AP_DLL          APDLL = new AP_DLL();
            MESStationInput I     = Station.Inputs.Find(t => t.DisplayName == "Location");
            List <object>   ret   = I.DataForUse;

            ret.Clear();
            try
            {
                apdb = Station.APDB;

                LocationList = APDLL.GetLocationList(ObjSn.SkuNo, apdb);
                if (LocationList.Count <= 0)
                {
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000072", new string[] { }));
                }
                else
                {
                    foreach (object item in LocationList)
                    {
                        ret.Add(item);
                    }
                }

                Station.AddMessage("MES00000001", new string[] { }, MESReturnView.Station.StationMessageState.Pass);
            }
            catch (Exception ex)
            {
                if (apdb != null)
                {
                }
                throw ex;
            }
        }
Пример #21
0
 public static void InputsDisable(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
 {
     for (int i = 0; i < Paras.Count; i++)
     {
         MESStationInput input = Station.Inputs.Find(t => t.DisplayName == Paras[i].VALUE.ToString().Trim());
         if (input != null)
         {
             input.Enable = false;
         }
     }
 }
Пример #22
0
        public StationAction(R_Input_Action _InputAction, MESStationInput _Input)
        {
            Input             = _Input;
            RInputAction      = _InputAction;
            Station           = _Input.Station;
            StationActionType = StationActionTypeEnum.Input;
            OleExec SFCDB = Input.Station.SFCDB;

            LoadT_c_station_action(_InputAction.C_STATION_ACTION_ID, SFCDB);
            LoadPara(SFCDB);
        }
Пример #23
0
 public static void InputsDisableControl(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
 {
     for (int i = 0; i < Paras.Count; i++)
     {
         MESStationInput input = Station.Inputs.Find(t => t.DisplayName == Paras[i].SESSION_TYPE);
         if (input != null)
         {
             input.Visable = Paras[i].VALUE.ToString().Trim().ToUpper() == "TRUE"?true:false;
         }
     }
 }
Пример #24
0
        public static void InputEmpPrivchecker(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            if (Paras.Count == 0)
            {
                throw new Exception("參數數量不正確!");
            }
            MESStationSession EMP_NOLoadPoint = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (EMP_NOLoadPoint == null)
            {
                EMP_NOLoadPoint = new MESStationSession()
                {
                    MESDataType = "INPUTEMP", InputValue = Input.Value.ToString(), SessionKey = "1", ResetInput = Input
                };
                Station.StationSession.Add(EMP_NOLoadPoint);
            }
            bool   bPrivilege = false;
            string empNo      = Input.Value.ToString();
            //T_c_user cUser = new T_c_user(Station.SFCDB, DB_TYPE_ENUM.Oracle);
            //Row_c_user rUser = cUser.getC_Userbyempno(empNo, Station.SFCDB, DB_TYPE_ENUM.Oracle);

            T_c_user_role       cUserRole  = new T_c_user_role(Station.SFCDB, DB_TYPE_ENUM.Oracle);
            List <get_c_roleid> roleList   = cUserRole.GetRoleID(empNo, Station.SFCDB);
            List <string>       listRoleID = new List <string>();

            foreach (var item in roleList)
            {
                listRoleID.Add(item.ROLE_ID);
            }
            T_C_ROLE_PRIVILEGE tRolePrivilege = new T_C_ROLE_PRIVILEGE(Station.SFCDB, DB_TYPE_ENUM.Oracle);
            List <c_role_privilegeinfobyemp> privilegeList = new List <c_role_privilegeinfobyemp>();

            foreach (string item in listRoleID)
            {
                List <c_role_privilegeinfobyemp> tempList = tRolePrivilege.QueryRolePrivilege(item, Station.SFCDB);
                privilegeList.AddRange(tempList);
            }
            EMP_NOLoadPoint.Value = privilegeList;
            foreach (var item in privilegeList)
            {
                if (item.PRIVILEGE_NAME == Station.DisplayName)
                {
                    bPrivilege = true;
                }
            }
            if (bPrivilege)
            {
                Station.AddMessage("MES00000001", new string[] { }, MESReturnView.Station.StationMessageState.Pass);
            }
            else
            {
                throw new Exception("no privilege");
            }
        }
Пример #25
0
        /// <summary>
        /// 加載工站Pass下一站
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        /// add by LLF 2018-01-29
        public static void StationNextDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            string            NextStation     = "";
            MESStationSession StationNextSave = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (StationNextSave == null)
            {
                StationNextSave = new MESStationSession()
                {
                    MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(StationNextSave);
            }
            string strSn = Input.Value.ToString();
            SN     sn    = new SN();

            //Marked by LLF 2018-02-22 begin
            //sn.PanelSN(strSn, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            try
            {
                sn.PanelSN(strSn, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            }
            catch
            {
                sn.Load(strSn, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            }
            //Marked by LLF 2018-02-22 end

            Route              routeDetail     = new Route(sn.RouteID, GetRouteType.ROUTEID, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            List <string>      snStationList   = new List <string>();
            List <RouteDetail> routeDetailList = routeDetail.DETAIL;
            RouteDetail        R = routeDetailList.Where(r => r.STATION_NAME == Station.StationName).FirstOrDefault();

            if (routeDetailList.Where(r => r.SEQ_NO > R.SEQ_NO).FirstOrDefault() == null)//當前工站為最後一個工站時
            {
                NextStation = routeDetailList.Where(r => r.SEQ_NO == R.SEQ_NO).FirstOrDefault().STATION_TYPE;
            }
            else
            {
                NextStation = routeDetailList.Where(r => r.SEQ_NO > R.SEQ_NO).FirstOrDefault().STATION_NAME;
            }

            snStationList.Add(NextStation);
            if (R.DIRECTLINKLIST != null)
            {
                foreach (var item in R.DIRECTLINKLIST)
                {
                    snStationList.Add(item.STATION_NAME);
                }
            }
            StationNextSave.Value = snStationList;
            Station.AddMessage("MES00000029", new string[] { "StationNext", "StationNextList" }, MESReturnView.Station.StationMessageState.Pass);
        }
Пример #26
0
        /// <summary>
        /// By工單Route獲取下一工站
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void StationNextByWODataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            string    NextStation = "";
            WorkOrder WoObj       = new WorkOrder();

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

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

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

            if (StationNextSave == null)
            {
                StationNextSave = new MESStationSession()
                {
                    MESDataType = Paras[1].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[1].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(StationNextSave);
            }

            WoObj = (WorkOrder)WOSession.Value;
            Route routeDetail = new Route(WoObj.RouteID, GetRouteType.ROUTEID, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);

            List <string>      snStationList   = new List <string>();
            List <RouteDetail> routeDetailList = routeDetail.DETAIL;
            RouteDetail        R = routeDetailList.Where(r => r.STATION_NAME == Station.StationName).FirstOrDefault();

            if (routeDetailList.Where(r => r.SEQ_NO > R.SEQ_NO).FirstOrDefault() == null)//當前工站為最後一個工站時
            {
                NextStation = routeDetailList.Where(r => r.SEQ_NO == R.SEQ_NO).FirstOrDefault().STATION_TYPE;
            }
            else
            {
                NextStation = routeDetailList.Where(r => r.SEQ_NO > R.SEQ_NO).FirstOrDefault().STATION_NAME;
            }

            snStationList.Add(NextStation);

            if (R.DIRECTLINKLIST != null)
            {
                foreach (var item in R.DIRECTLINKLIST)
                {
                    snStationList.Add(item.STATION_NAME);
                }
            }
            StationNextSave.Value = snStationList;
            Station.AddMessage("MES00000029", new string[] { "StationNext", "StationNextList" }, MESReturnView.Station.StationMessageState.Pass);
        }
Пример #27
0
        public static void SnSKUDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            if (Paras.Count != 2)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050"));
            }
            //加載SnPoint位置
            MESStationSession SnSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (SnSession == null)
            {
                //modify by 張官軍 2018-03-15
                //根據該方法的定義:從 SN 對象加載機種對象,SnSession 不能為空
                //SnSession = new MESStationSession() { MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input };
                //Station.StationSession.Add(SnSession);
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000170"));
            }
            //加載SkunoPoint
            MESStationSession SkuSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);

            if (SkuSession == null)
            {
                SkuSession = new MESStationSession()
                {
                    MESDataType = Paras[1].SESSION_TYPE, SessionKey = Paras[1].SESSION_KEY
                };
                Station.StationSession.Add(SkuSession);
                //throw new MESReturnMessage("Skuno參數不存在");
            }

            // BY SDL 20180320  SN SnObject = (SN)SkuSession.Value;.

            SN SnObject = (SN)SnSession.Value;

            //SnObject.SerialNo

            SKU sku = new SKU();

            try
            {
                MESDBHelper.OleExec ole = Station.SFCDB;
                sku = sku.InitBySn(SnObject.SerialNo, ole, MESDataObject.DB_TYPE_ENUM.Oracle);
                SkuSession.Value = sku;
                Station.AddMessage("MES00000029", new string[] { "SN", sku.ToString() }, MESReturnView.Station.StationMessageState.Pass);
            }
            catch
            {
                //Station.AddMessage("MES00000007", new string[] { "SN" }, MESReturnView.Station.StationMessageState.Fail);
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000007", new string[] { "SN" }));
            }
        }
Пример #28
0
        /// <summary>
        /// 從輸入加載FailDesc
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void FailDescDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            MESStationSession FailDescSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

            if (FailDescSession == null)
            {
                FailDescSession = new MESStationSession()
                {
                    MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(FailDescSession);
            }
            FailDescSession.Value = Input.Value.ToString();
        }
Пример #29
0
        /// <summary>
        /// 檢查當前工單的鋼網是否上線
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras"></param>
        public static void SMTStencilDatachecker(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            if (Paras.Count == 0)
            {
                throw new Exception("參數數量不正確!");
            }


            OleExec apdb = Station.APDB;

            if (apdb != null)
            {
            }
        }
Пример #30
0
        public static void SampleLotDataloader(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            string           StrSN = "";
            Row_R_LOT_STATUS RLotStatus;
            T_R_LOT_STATUS   TR  = new T_R_LOT_STATUS(Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
            LotNo            LOT = new LotNo();

            if (Paras.Count <= 0)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050"));
            }
            MESStationSession SNSession    = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);
            MESStationSession LotNoSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY);

            if (SNSession == null)
            {
                throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY }));
            }
            else
            {
                StrSN = SNSession.Value.ToString();
            }

            if (LotNoSession == null)
            {
                LotNoSession = new MESStationSession()
                {
                    MESDataType = Paras[1].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[1].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(LotNoSession);
            }
            try
            {
                RLotStatus = TR.GetSampleLotBySN(StrSN, Station.SFCDB);
                if (RLotStatus != null)
                {
                    LotNoSession.Value = RLotStatus.GetDataObject();
                }
                else
                {
                    //throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[1].SESSION_TYPE + Paras[1].SESSION_KEY }));
                    throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000159", new string[] { }));
                }
            }
            catch (Exception ex)
            {
                string msgCode = ex.Message;
                throw ex;
            }
        }