/// <summary> /// 從SN對象LOADER BACK STATION /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void GetBackStationDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count == 0) { 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) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY })); } //MESStationSession SnSession = 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[1].SESSION_TYPE + Paras[1].SESSION_KEY })); //} //SN ObjSn = (SN)Input.Value; //try //{ //} //catch (Exception ex) //{ // throw ex; //} }
public static void PanelVitualSNDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { string PanelSN = ""; SN SNObj = new SN(); R_PANEL_SN PanelObj = null; MESStationSession PANEL = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (PANEL == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY })); } MESStationSession VirtualSN = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (VirtualSN == null) { VirtualSN = new MESStationSession() { MESDataType = Paras[1].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[1].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(VirtualSN); } VirtualSN.InputValue = Input.Value.ToString(); VirtualSN.ResetInput = Input; PanelSN = PANEL.InputValue.ToString(); PanelObj = SNObj.GetPanelVirtualSN(PanelSN, Station.SFCDB, DB_TYPE_ENUM.Oracle); VirtualSN.Value = PanelObj; }
/// <summary> /// REPAIR_CHECK_OUT狀態檢查 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void RepairOutStatusChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count != 1) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession sessionSN = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (sessionSN == null || sessionSN.Value == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[2].SESSION_TYPE })); } SN snObject = (SN)sessionSN.Value; T_R_REPAIR_TRANSFER t_r_repair = new T_R_REPAIR_TRANSFER(Station.SFCDB, Station.DBType); if (!t_r_repair.SNIsRepairIn(snObject.SerialNo, Station.SFCDB)) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MSGCODE20180619154342", new string[] { snObject.SerialNo })); } T_R_REPAIR_MAIN t_r_repair_main = new T_R_REPAIR_MAIN(Station.SFCDB, Station.DBType); if (!t_r_repair_main.SNIsRepaired(snObject.SerialNo, Station.SFCDB)) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000071", new string[] { snObject.SerialNo })); } }
/// <summary> /// 檢查該 Panel 是不是在指定站位 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void CheckPanelInSmtLoading(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { string PanelSn = string.Empty; T_R_PANEL_SN RPanelSn = new T_R_PANEL_SN(Station.SFCDB, Station.DBType); string ErrMessage = string.Empty; string UniqueStation = string.Empty; if (Paras.Count < 1) { ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000057"); throw new MESReturnMessage(ErrMessage); } PanelSn = Input.Value.ToString(); UniqueStation = Paras[0].VALUE; if (UniqueStation.Length == 0) { ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000050"); throw new MESReturnMessage(ErrMessage); } if (!RPanelSn.GetPanelUniqueStation(PanelSn, Station.SFCDB).ToUpper().Equals(UniqueStation)) { ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000206", new string[] { PanelSn, UniqueStation }); throw new MESReturnMessage(ErrMessage); } }
public static void RepairPCBASNChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count != 2) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession SNSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (SNSession == null || SNSession.Value == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "PCBASNSession" })); } MESStationSession PCBASNSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (PCBASNSession == null || PCBASNSession.Value == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "PCBASNSession" })); } try { LogicObject.SN snObject = (LogicObject.SN)SNSession.Value; if (snObject.SerialNo != PCBASNSession.Value.ToString() && snObject.BoxSN != PCBASNSession.Value.ToString()) { T_R_SN_KP t_sn_kp = new T_R_SN_KP(Station.SFCDB, Station.DBType); if (!t_sn_kp.KpIsLinkBySN(snObject.ID, PCBASNSession.Value.ToString(), Station.SFCDB)) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MSGCODE20180616081316", new string[] { PCBASNSession.Value.ToString(), snObject.SerialNo })); } } } catch (Exception ex) { throw ex; } }
public static void LoadPanelWaitReplaceSn(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count != 2) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession sessionPanel = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (sessionPanel == null || sessionPanel.Value == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY })); } MESStationSession sessionSN = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (sessionSN == null) { sessionSN = new MESStationSession { MESDataType = Paras[1].SESSION_TYPE, SessionKey = Paras[1].SESSION_KEY, Value = "", InputValue = "", ResetInput = Input }; Station.StationSession.Add(sessionSN); } T_R_SN r_sn = new T_R_SN(Station.SFCDB, Station.DBType); sessionSN.Value = r_sn.GetPanelWaitReplaceSn(sessionPanel.InputValue.ToString(), Station.SFCDB); Station.AddMessage("MES00000001", new string[] { }, MESPubLab.MESStation.MESReturnView.Station.StationMessageState.Message); }
public static void loaderBox(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count == 0) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession PackNoSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); T_R_PACKING t_R_PACKING = new T_R_PACKING(Station.SFCDB, DB_TYPE_ENUM.Oracle); List <R_PACKING> list = new List <R_PACKING>(); if (Input.Value != null) { list = t_R_PACKING.GetListPackByPackno((string)Input.Value, Station.SFCDB); if (list.Count > 0) { PackNoSession = new MESStationSession() { MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input, Value = list[0] }; } Station.StationSession.Add(PackNoSession); } }
/// <summary> /// 從SKU加載Customer /// 若Series已裝載則從Series加載 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void CustFromSKUDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { OleExec sfcdb = Station.SFCDB; C_SERIES c_series = null; C_CUSTOMER c_customer = null; MESStationSession serieSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (serieSession == null) { MESStationSession skuSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (skuSession == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SKU" })); } SKU sku = (SKU)skuSession.Value; if (sku == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SKU" })); } c_series = new T_C_SERIES(sfcdb, DB_TYPE_ENUM.Oracle).GetDetailById(sfcdb, sku.CSeriesId);//sku.CSeriesId //是否加入StationSession... } else { c_series = (C_SERIES)serieSession.Value; } if (c_series == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SERIES" })); } //構建查詢CUSTOMER參數 Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("ID", c_series.CUSTOMER_ID); List <C_CUSTOMER> customers = new T_C_CUSTOMER(sfcdb, DB_TYPE_ENUM.Oracle).GetCustomerList(parameters, sfcdb); if (customers.Count == 0) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "CUSTOMER" })); } c_customer = customers[0]; MESStationSession custSession = Station.StationSession.Find(t => t.MESDataType == Paras[2].SESSION_TYPE && t.SessionKey == Paras[2].SESSION_KEY); if (custSession == null) { custSession = new MESStationSession() { MESDataType = Paras[2].SESSION_TYPE, SessionKey = Paras[2].SESSION_KEY }; Station.StationSession.Add(custSession); } custSession.Value = c_customer; Station.AddMessage("MES00000029", new string[] { "CUSTOMER", c_customer.CUSTOMER_NAME }, StationMessageState.Pass); }
/// <summary> /// 從SN對象中加載RepairFailCode訊息 // 同上一个方法一样,只是传出数据格式变化 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void SNRepairFailCodeDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count == 0) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession SN_Session = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (SN_Session == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SN" })); } //Repair Action Session MESStationSession RepairAction = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (RepairAction == null) { RepairAction = new MESStationSession() { MESDataType = Paras[1].SESSION_TYPE, SessionKey = Paras[1].SESSION_KEY }; Station.StationSession.Add(RepairAction); } MESStationSession RepairFailCode = Station.StationSession.Find(t => t.MESDataType == Paras[2].SESSION_TYPE && t.SessionKey == Paras[2].SESSION_KEY); if (RepairFailCode == null) { RepairFailCode = new MESStationSession() { MESDataType = Paras[2].SESSION_TYPE, SessionKey = Paras[2].SESSION_KEY }; Station.StationSession.Add(RepairFailCode); } string sn = SN_Session.Value.ToString(); DataTable FailCodeInfo = new DataTable(); T_R_REPAIR_FAILCODE TFailcode = new T_R_REPAIR_FAILCODE(Station.SFCDB, Station.DBType); FailCodeInfo = TFailcode.SelectFailCodeBySN(sn, Station.SFCDB, Station.DBType); if (FailCodeInfo.Rows.Count == 0) { foreach (R_Station_Output output in Station.StationOutputs) { Station.StationSession.Find(s => s.MESDataType == output.SESSION_TYPE && s.SessionKey == output.SESSION_KEY).Value = ""; } throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MSGCODE20180616102950", new string[] { sn })); } RepairFailCode.Value = ConvertToJson.DataTableToJson(FailCodeInfo); DataTable RepairActionInfo = new DataTable(); T_r_repair_action TAction = new T_r_repair_action(Station.SFCDB, Station.DBType); RepairActionInfo = TAction.SelectRepairActionBySN(sn, Station.SFCDB, Station.DBType); RepairAction.Value = ConvertToJson.DataTableToJson(RepairActionInfo); }
/// <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 })); } }
/// <summary> /// REPAIR_CHECK_OUT權限檢查 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void RepairOutEmpChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count != 2) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000050")); } string type = Paras[0].VALUE.ToString().ToUpper(); if (type == "") { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE })); } MESStationSession sessionEmp = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (sessionEmp == null || sessionEmp.Value == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[1].SESSION_TYPE })); } //Vertiv SE&RE黃克喜要求只有指定人員才能掃入和接收REPAIR_CHECK_IN T_c_user t_c_uer = new T_c_user(Station.SFCDB, Station.DBType); Row_c_user rowUser = t_c_uer.getC_Userbyempno(sessionEmp.Value.ToString(), Station.SFCDB, Station.DBType); T_C_CONTROL t_c_control = new T_C_CONTROL(Station.SFCDB, Station.DBType); string[] inEmp = t_c_control.GetControlByName("REPAIR_CHECK_OUT_SEND", Station.SFCDB).CONTROL_VALUE.Split(','); string[] receiveEmp = t_c_control.GetControlByName("REPAIR_CHECK_OUT_RECEIVE", Station.SFCDB).CONTROL_VALUE.Split(','); List <string> inEmpList = new List <string>(inEmp); List <string> receiveList = new List <string>(receiveEmp); if (rowUser == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MSGCODE20180620163103", new string[] { sessionEmp.Value.ToString() })); } if (type == "SEND") { if (inEmpList.Find(s => s == rowUser.EMP_NO) == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MSGCODE20180619155133", new string[] { rowUser.EMP_NO })); } } else if (type == "RECEIVE") { if (receiveList.Find(s => s == rowUser.EMP_NO) == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MSGCODE20180619154947", new string[] { rowUser.EMP_NO })); } } else { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MSGCODE20180607163531", new string[] { "Input" })); } }
public static void LinkKeypartDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count != 3) { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000057"); throw new MESReturnMessage(errMsg); } string Sn = Input.Value.ToString(); MESStationSession WOSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (WOSession == null) { WOSession = new MESStationSession() { MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(WOSession); } MESStationSession SubKPSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (SubKPSession == null) { SubKPSession = new MESStationSession() { MESDataType = Paras[1].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[1].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SubKPSession); } MESStationSession MainKPSession = Station.StationSession.Find(t => t.MESDataType == Paras[2].SESSION_TYPE && t.SessionKey == Paras[2].SESSION_KEY); if (MainKPSession == null) { MainKPSession = new MESStationSession() { MESDataType = Paras[2].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[2].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(MainKPSession); } SN sn = null; WorkOrder wo = null; T_C_KEYPART tck = new T_C_KEYPART(Station.SFCDB, DB_TYPE_ENUM.Oracle); sn.Load(Sn, Station.SFCDB, DB_TYPE_ENUM.Oracle); wo.Init(sn.WorkorderNo, Station.SFCDB, DB_TYPE_ENUM.Oracle); List <C_KEYPART> keyparts = tck.GetKeypartListByWOAndStation(Station.SFCDB, wo.WorkorderNo, Station.StationName); SubKPSession.Value = keyparts.Where(s => s.SEQ_NO == 10).ToList(); MainKPSession.Value = keyparts.Where(s => s.SEQ_NO != 10).ToList().OrderBy(s => s.SEQ_NO); }
public static void logout(string Token) { List <string> keys = StationPool.Keys.ToList(); for (int i = 0; i < keys.Count; i++) { if (keys[i].StartsWith(Token)) { MESStationBase s = StationPool[keys[i]]; s.DBS = null; s.SFCDB = null; StationPool.Remove(keys[i]); } } }
/// <summary> /// 從SN對象中加載RepairFail訊息 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void SNRepairFailDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count == 0) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession SN_Session = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (SN_Session == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SN" })); } //Repair Session MESStationSession RepairMain = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (RepairMain == null) { RepairMain = new MESStationSession() { MESDataType = Paras[1].SESSION_TYPE, SessionKey = Paras[1].SESSION_KEY }; Station.StationSession.Add(RepairMain); } MESStationSession RepairFailCode = Station.StationSession.Find(t => t.MESDataType == Paras[2].SESSION_TYPE && t.SessionKey == Paras[2].SESSION_KEY); if (RepairFailCode == null) { RepairFailCode = new MESStationSession() { MESDataType = Paras[2].SESSION_TYPE, SessionKey = Paras[2].SESSION_KEY }; Station.StationSession.Add(RepairFailCode); } string sn = SN_Session.Value.ToString(); OleExec sfcdb = Station.SFCDB; //存入R_REPAIR_MAIN信息 Dictionary <string, List <R_REPAIR_MAIN> > repairMainInfo = new Dictionary <string, List <R_REPAIR_MAIN> >(); List <R_REPAIR_MAIN> repairMains = new T_R_REPAIR_MAIN(sfcdb, DB_TYPE_ENUM.Oracle).GetRepairMainBySN(sfcdb, sn); repairMainInfo.Add("R_REPAIR_MAIN", repairMains); RepairMain.Value = repairMainInfo; //存入R_REPAIR_FAILCODE信息 Dictionary <string, List <R_REPAIR_FAILCODE> > repairFailCodeInfo = new Dictionary <string, List <R_REPAIR_FAILCODE> >(); List <R_REPAIR_FAILCODE> failCodes = new T_R_REPAIR_FAILCODE(sfcdb, DB_TYPE_ENUM.Oracle).GetFailCodeBySN(sfcdb, sn); repairFailCodeInfo.Add("R_REPAIR_FAILCODE", failCodes); RepairFailCode.Value = repairFailCodeInfo; }
public static void SNLinkMainSNKPAction_Old(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { WorkOrder wO = null; //SN Sub_SN = null; //SN Min_Sn = null; SN Sub_SN = new SN(); SN Min_Sn = new SN(); string ErrMessage = string.Empty; string wo = Station.Inputs.Find(s => s.DisplayName == "WO").Value.ToString(); string s_sn = Station.Inputs.Find(s => s.DisplayName == "SUB_SN").Value.ToString(); string m_sn = Station.Inputs.Find(s => s.DisplayName == "MIN_SN").Value.ToString(); if (Paras.Count == 0) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession WOLoadPoint = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (WOLoadPoint == null) { ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY }); throw new MESReturnMessage(ErrMessage); } wO = (WorkOrder)WOLoadPoint.Value; Sub_SN.Load(s_sn, Station.SFCDB, DB_TYPE_ENUM.Oracle); Min_Sn.Load(m_sn, Station.SFCDB, DB_TYPE_ENUM.Oracle); T_C_KEYPART tck = new T_C_KEYPART(Station.SFCDB, DB_TYPE_ENUM.Oracle); T_R_SN_KEYPART_DETAIL T_kd = new T_R_SN_KEYPART_DETAIL(Station.SFCDB, DB_TYPE_ENUM.Oracle); List <C_KEYPART> KEYPARTS = tck.GetKeypartListByWOAndStation(Station.SFCDB, wO.WorkorderNo, Station.StationName); List <R_SN_KEYPART_DETAIL> KEYPARTD = T_kd.GetKeypartBySub_Sn(Station.SFCDB, s_sn, Station.StationName); if (KEYPARTS.Count >= 2) { if (KEYPARTS.Count > KEYPARTD.Count) { int i = KEYPARTD.Count; T_kd.INSN_KEYPART_DETAIL(Station.SFCDB, Station.BU, Sub_SN.ID, Sub_SN.SerialNo, Min_Sn.SerialNo, Station.StationName, KEYPARTS[i].PART_NO, KEYPARTS[i].SEQ_NO, KEYPARTS[i].CATEGORY_NAME, KEYPARTS[i].CATEGORY, Station.LoginUser.EMP_NO); } Station.AddMessage("MES00000180", new string[] { "MAIN_SN", m_sn }, StationMessageState.Pass); } else { ErrMessage = MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { Min_Sn.SerialNo }); throw new MESReturnMessage(ErrMessage); } }
/// <summary> /// 維修輸入SN Fail次數管控 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void SNRepairCountChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { //string inputValue = Input.Value.ToString(); if (Paras.Count != 2) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession SN_Session = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (SN_Session == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SN" })); } SN sn = (SN)SN_Session.Value; string skuno = null; //Paras: SESSION_TYPE='SKU' SESSION_KEY='1' VALUE='0,1' switch (Paras[1].VALUE) { case "0": skuno = sn.SkuNo; break; default: skuno = "ALL"; break; } OleExec sfcdb = Station.SFCDB; C_REPAIR_DAY repairDay = new T_C_REPAIR_DAY(sfcdb, DB_TYPE_ENUM.Oracle).GetDetailBySkuno(sfcdb, skuno); if (repairDay != null) { //repair_count if (repairDay.REPAIR_COUNT == 3) { Station.AddMessage("MES00000087", new string[] { repairDay.REPAIR_COUNT.ToString(), "請注意" }, StationMessageState.Message); } if (repairDay.REPAIR_COUNT > 3) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000087", new string[] { repairDay.REPAIR_COUNT.ToString(), "已鎖定" })); } } }
public static void RepairInputSNDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count == 0) { foreach (R_Station_Output output in Station.StationOutputs) { Station.StationSession.Find(s => s.MESDataType == output.SESSION_TYPE && s.SessionKey == output.SESSION_KEY).Value = ""; } throw new Exception("參數數量不正確!"); } MESStationSession SNSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (SNSession == null) { SNSession = new MESStationSession() { MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(SNSession); } string inputValue = Input.Value.ToString(); SN SNObj = null; try { SNObj = new SN(inputValue, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle); if (string.IsNullOrEmpty(SNObj.SerialNo)) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000007", new string[] { "SN:" + inputValue })); } SNSession.Value = SNObj; SNSession.InputValue = inputValue; SNSession.ResetInput = Input; Station.AddMessage("MES00000029", new string[] { "SN:", inputValue }, StationMessageState.Pass); } catch (Exception ex) { foreach (R_Station_Output output in Station.StationOutputs) { Station.StationSession.Find(s => s.MESDataType == output.SESSION_TYPE && s.SessionKey == output.SESSION_KEY).Value = ""; } throw ex; } }
public static void PanelVirtualSNChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { string PanelSN = ""; bool CheckFlag = false; SN SNObj = new SN(); MESStationSession PanelSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (PanelSession == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000052", new string[] { Paras[0].SESSION_TYPE + Paras[0].SESSION_KEY })); } PanelSN = PanelSession.InputValue.ToString(); CheckFlag = SNObj.CheckPanelVirtualSNExist(PanelSN, Station.SFCDB, DB_TYPE_ENUM.Oracle); if (!CheckFlag) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000139", new string[] { PanelSN })); } }
//Add by LLF 2018-01-26 End /// <summary> /// 檢查當前工單是否上料齊套 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void SMTPanelNoCheck(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { MESStationSession WO_Session = Station.StationSession.Find(t => t.MESDataType == "WO" && t.SessionKey == "1"); if (WO_Session == null) { Station.AddMessage("MES00000007", new string[] { "WO" }, StationMessageState.Fail); return; } string wo = WO_Session.Value.ToString(); OleExec apdb = Station.APDB; //string msg = apdb.ExecProcedureNoReturn("", null); if (apdb != null) { } }
/// <summary> /// 維修輸入SN Fail狀態檢查 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void SNRepairFailChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { OleExec sfcdb = Station.SFCDB; //input test /*string inputValue = Input.Value.ToString(); * if (string.IsNullOrEmpty(inputValue)) * { * throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000006", new string[] { "SN輸入值" })); * } * SN sn = new SN(inputValue, sfcdb, DB_TYPE_ENUM.Oracle);*/ MESStationSession SN_Session = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (SN_Session == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SN" })); } SN sn = (SN)SN_Session.Value; if (sn.RepairFailedFlag == "0") { //正常品 throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000078", new string[] { sn.SerialNo })); } List <R_REPAIR_MAIN> repairMains = new T_R_REPAIR_MAIN(sfcdb, DB_TYPE_ENUM.Oracle).GetRepairMainBySN(sfcdb, sn.SerialNo); if (repairMains == null || repairMains.Count == 0) { //無維修主檔信息 throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000079", new string[] { "SN", sn.SerialNo })); } foreach (R_REPAIR_MAIN rm in repairMains) { //存在closed_flag=0 if (rm.CLOSED_FLAG != "0") { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000097", new string[] { "SN", rm.SN })); } } Station.AddMessage("MES00000046", new string[] { "OK" }, StationMessageState.Pass); }
/// <summary> /// 從SKU加載Series /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void SeriesFromSKUDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { //加載SeriesSavePoint MESStationSession SeriesSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (SeriesSession == null) { SeriesSession = new MESStationSession() { MESDataType = Paras[0].SESSION_TYPE, SessionKey = Paras[0].SESSION_KEY }; Station.StationSession.Add(SeriesSession); } //SKULoadPoint MESStationSession SkuSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (SkuSession == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SKU" })); } SKU sku = (SKU)SkuSession.Value; if (sku == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SKU" })); } OleExec sfcdb = Station.SFCDB; T_C_SERIES t_c_series = new T_C_SERIES(sfcdb, DB_TYPE_ENUM.Oracle); C_SERIES c_series = t_c_series.GetDetailById(sfcdb, sku.CSeriesId);//sku.CSeriesId if (c_series == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SERIES" })); } SeriesSession.Value = c_series; Station.AddMessage("MES00000029", new string[] { "SERIES", c_series.SERIES_NAME }, StationMessageState.Pass); }
public static void StationItemsDataloader(MESStationBase Station, MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras) { if (Paras.Count != 1) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession ReturnStationItemsSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (ReturnStationItemsSession == null) { ReturnStationItemsSession = new MESStationSession() { MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(ReturnStationItemsSession); } ReturnStationItemsSession.Value = Input.Value.ToString(); // Input.DataForUse.Add(Input.Value.ToString()); }
/// <summary> /// 檢查線體是否被鎖 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void LineLockedChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { //GET LINE string LineName = Station.Line; string CurrentStation = Station.StationName; if (string.IsNullOrEmpty(LineName)) { throw new MESReturnMessage("LINE線體加載異常"); } OleExec sfcdb = Station.SFCDB; R_SN_LOCK r_sn_lock = new T_R_SN_LOCK(sfcdb, DB_TYPE_ENUM.Oracle).GetDetailBySN(sfcdb, LineName, CurrentStation);//sn.SerialNo,sn.CurrentStation if (r_sn_lock != null) { Station.AddMessage("MES00000044", new string[] { "LINE", r_sn_lock.SN, r_sn_lock.LOCK_EMP }, StationMessageState.Fail); //return; throw new MESReturnMessage("線體被鎖定"); } }
/// <summary> /// 連板數量檢查 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> //Add by LLF 2018-01-26 Begin public static void SMTLoadingLinkQtyChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { try { MESStationSession AP_LinkQty = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (AP_LinkQty == null) { Station.Inputs[2].Value = ""; Station.Inputs[3].Enable = false; throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000133", new string[] { })); } if (Convert.ToInt16(AP_LinkQty.Value.ToString()) <= 0) { Station.Inputs[2].Value = ""; Station.Inputs[3].Enable = false; throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000137", new string[] { AP_LinkQty.Value.ToString() })); } MESStationSession Input_LinkQty = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (Input_LinkQty == null) { Station.Inputs[2].Value = ""; Station.Inputs[3].Enable = false; throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000132", new string[] { })); } if (Convert.ToInt16(Input_LinkQty.Value.ToString()) > Convert.ToInt16(AP_LinkQty.Value.ToString())) { Station.Inputs[2].Value = ""; Station.Inputs[3].Enable = false; throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000131", new string[] { Input_LinkQty.Value.ToString(), AP_LinkQty.Value.ToString() })); } Station.Inputs[3].Enable = true; Station.AddMessage("MES00000001", new string[] { }, MESPubLab.MESStation.MESReturnView.Station.StationMessageState.Pass); } catch (Exception ex) { throw (ex); } }
/// <summary> /// 從SN對象加載該SN已經維修的次數 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void SNRepairCountDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count != 2) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession sessionSN = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (sessionSN == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SN" })); } if (sessionSN.Value == null) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000045", new string[] { "SN" })); } //Repair Count Session MESStationSession sessionRepairCount = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (sessionRepairCount == null) { sessionRepairCount = new MESStationSession() { MESDataType = Paras[1].SESSION_TYPE, SessionKey = Paras[1].SESSION_KEY, ResetInput = Input }; Station.StationSession.Add(sessionRepairCount); } try { LogicObject.SN snObject = (LogicObject.SN)sessionSN.Value; T_R_REPAIR_MAIN t_r_repair_main = new T_R_REPAIR_MAIN(Station.SFCDB, Station.DBType); sessionRepairCount.Value = t_r_repair_main.GetRepairedCount(snObject.SerialNo, Station.SFCDB, Station.DBType); sessionRepairCount.InputValue = t_r_repair_main.GetRepairedCount(snObject.SerialNo, Station.SFCDB, Station.DBType).ToString(); sessionRepairCount.ResetInput = Input; Station.AddMessage("MES00000029", new string[] { Paras[1].SESSION_TYPE, sessionRepairCount.Value.ToString() }, MESPubLab.MESStation.MESReturnView.Station.StationMessageState.Message); } catch (Exception ex) { throw ex; } }
/// <summary> /// 檢查當前站是否在下一站的清單中 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> /// add by LLF 2018-01-27 public static void NextStationDataChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { List <string> ListNextStation = new List <string>(); SN SNObj = new SN(); string StrStation = ""; MESStationSession NextStation_Session = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (NextStation_Session == null) { //Station.AddMessage("MES00000135", new string[] { "ListNextStation--Function:NextStationDataChecker" }, StationMessageState.Fail); throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000135", new string[] { "ListNextStation--Function:NextStationDataChecker" })); } ListNextStation = (List <string>)NextStation_Session.Value; StrStation = SNObj.StringListToString(ListNextStation); if (!ListNextStation.Contains(Station.StationName)) { throw new MESReturnMessage(MESReturnMessage.GetMESReturnMessage("MES00000136", new string[] { StrStation })); } }
/// <summary> /// 檢查SN/PanelSN是否被鎖 /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void SNLockedChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { //input test //string inputValue = Input.Value.ToString(); //MESStationSession snSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); //if (snSession == null) //{ // throw new MESReturnMessage("SN加載異常"); //} //SN sn = (SN) snSession.Value; OleExec sfcdb = Station.SFCDB; //R_SN_LOCK r_sn_lock = new T_R_SN_LOCK(sfcdb, DB_TYPE_ENUM.Oracle).GetDetailBySN(sfcdb, sn.SerialNo, Station.StationName);//sn.SerialNo,sn.CurrentStation R_SN_LOCK r_sn_lock = new T_R_SN_LOCK(sfcdb, DB_TYPE_ENUM.Oracle).GetDetailBySN(sfcdb, Input.Value.ToString(), Station.StationName);//sn.SerialNo,sn.CurrentStation if (r_sn_lock != null) { Station.AddMessage("MES00000044", new string[] { "SN", r_sn_lock.SN, r_sn_lock.LOCK_EMP }, StationMessageState.Fail); //return; throw new MESReturnMessage("SN被鎖定"); } }
public static void PanelRuleDataChecker(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { //input test //string inputValue = Input.Value.ToString(); 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); } MESStationSession PanelSession = Station.StationSession.Find(t => t.MESDataType == Paras[1].SESSION_TYPE && t.SessionKey == Paras[1].SESSION_KEY); if (PanelSession == null) { throw new MESReturnMessage("Panel加載異常"); } Station.AddMessage("OK", new string[] { "ok" }, StationMessageState.Pass); }
public static void ObaSampleStationInit(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count == 0) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationInput snInput = Station.Inputs.Find(t => t.DisplayName == Paras[0].SESSION_TYPE); MESStationInput scanTypeInput = Station.Inputs.Find(t => t.DisplayName == Paras[1].SESSION_TYPE); MESStationInput failSnInput = Station.Inputs.Find(t => t.DisplayName == Paras[2].SESSION_TYPE); MESStationInput FailCodeInput = Station.Inputs.Find(t => t.DisplayName == Paras[3].SESSION_TYPE); MESStationInput LocationInput = Station.Inputs.Find(t => t.DisplayName == Paras[4].SESSION_TYPE); MESStationInput FailDescInput = Station.Inputs.Find(t => t.DisplayName == Paras[5].SESSION_TYPE); snInput.Visable = false; failSnInput.Visable = false; FailCodeInput.Visable = false; LocationInput.Visable = false; FailDescInput.Visable = false; scanTypeInput.Visable = false; scanTypeInput.DataForUse.Add("Pass"); scanTypeInput.DataForUse.Add("Fail"); }
/// <summary> /// /// </summary> /// <param name="Station"></param> /// <param name="Input"></param> /// <param name="Paras"></param> public static void InputPackNoDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras) { if (Paras.Count == 0) { throw new Exception(MESReturnMessage.GetMESReturnMessage("MES00000050")); } MESStationSession PackNoSession = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY); if (PackNoSession != null) { Station.StationSession.Remove(PackNoSession); } else { PackNoSession = new MESStationSession() { MESDataType = Paras[0].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[0].SESSION_KEY, ResetInput = Input }; PackNoSession.InputValue = Input.Value.ToString(); Station.StationSession.Add(PackNoSession); } }