Пример #1
0
        public int GetStationPassCount(string StationName, bool isContailFail, OleExec sfcdb)
        {
            int result = 0;
            T_R_SN_STATION_DETAIL TR_SN_STATION_DETAIL = new T_R_SN_STATION_DETAIL(sfcdb, MESDataObject.DB_TYPE_ENUM.Oracle);

            if (isContailFail)
            {
                result = TR_SN_STATION_DETAIL.GetCountByWOAndStation(WO.WORKORDERNO, StationName, sfcdb);
            }
            else
            {
                result = TR_SN_STATION_DETAIL.GetCountByWOAndStationNotContailFail(WO.WORKORDERNO, StationName, sfcdb);
            }
            return(result);
        }
Пример #2
0
        /// <summary>
        /// 工單信息加載器,加載工單信息到指定位置,主要用來給界面做輸出. 2018/1/2 肖倫
        /// </summary>
        /// <param name="Station"></param>
        /// <param name="Input"></param>
        /// <param name="Paras">
        /// InputQTYSave	工單已投數量保存位置	{SESSION_TYPE:"INPUTQTY",SSION_KEY:"1",VALUE:""}
        /// FinishQTYSave 工單已完成數量保存位置 { SESSION_TYPE:"FINISHQTY",SSION_KEY:"1",VALUE:""}
        /// StationQTYSave 本工站過站數量保存位置 { SESSION_TYPE:"STATIONQTY",SSION_KEY:"1",VALUE:""}
        /// WOLoadPoint 工單的保存位置 { SESSION_TYPE:"WO",SSION_KEY:"1",VALUE:""}
        /// </param>
        public static void WoInfoDataloader(MESStationBase Station, MESStationInput Input, List <R_Station_Action_Para> Paras)
        {
            MESStation.LogicObject.WorkOrder wo = new MESStation.LogicObject.WorkOrder();
            string strWONO = "";

            if (Paras.Count != 5)
            {
                string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000057");
                throw new MESReturnMessage(errMsg);
            }
            MESStationSession InputQTY_Session = Station.StationSession.Find(t => t.MESDataType == Paras[0].SESSION_TYPE && t.SessionKey == Paras[0].SESSION_KEY);

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

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

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

            if (Wo_Session == null)
            {
                strWONO    = Input.Value.ToString();
                Wo_Session = new MESStationSession()
                {
                    MESDataType = Paras[3].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[3].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(Wo_Session);
            }
            strWONO = Wo_Session.Value.ToString();
            //add by LLF 2018-03-26 增加工單數量Sesstion
            MESStationSession WoQty_Session = Station.StationSession.Find(t => t.MESDataType == Paras[4].SESSION_TYPE && t.SessionKey == Paras[4].SESSION_KEY);

            if (WoQty_Session == null)
            {
                WoQty_Session = new MESStationSession()
                {
                    MESDataType = Paras[4].SESSION_TYPE, InputValue = Input.Value.ToString(), SessionKey = Paras[4].SESSION_KEY, ResetInput = Input
                };
                Station.StationSession.Add(WoQty_Session);
            }
            else
            {
                //wo = (WorkOrder)Wo_Session.Value;
                //if (wo != null && wo.WorkorderNo != null && wo.WorkorderNo.Length > 0)
                //{
                //    strWONO = wo.WorkorderNo;
                //   // wo.Init(wo.WorkorderNo, Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
                //}
                //else
                //{
                //    wo = new MESStation.LogicObject.WorkOrder();
                //    strWONO = Input.Value.ToString();
                //   // wo.Init(Input.Value.ToString(), Station.SFCDB, MESDataObject.DB_TYPE_ENUM.Oracle);
                //}
                //  Wo_Session.Value = wo;
                //strWONO = Wo_Session.Value.ToString();
                Wo_Session.InputValue = Input.Value.ToString();
                Wo_Session.ResetInput = Input;
            }
            try
            {
                wo.Init(strWONO, Station.SFCDB, Station.DBType);
                Wo_Session.Value        = wo;
                InputQTY_Session.Value  = wo.INPUT_QTY;
                FinishQTY_Session.Value = wo.FINISHED_QTY;
                WoQty_Session.Value     = wo.WORKORDER_QTY;
                T_R_SN_STATION_DETAIL TR_SN_STATION_DETAIL = new T_R_SN_STATION_DETAIL(Station.SFCDB, Station.DBType);
                StationQTY_Session.Value = TR_SN_STATION_DETAIL.GetCountByWOAndStation(wo.ToString(), Station.StationName, Station.SFCDB);
                Station.AddMessage("MES00000001", new string[] { Input.Value.ToString() }, MESReturnView.Station.StationMessageState.Pass);
            }
            catch (Exception ex)
            {
                Wo_Session.Value         = null;
                InputQTY_Session.Value   = 0;
                FinishQTY_Session.Value  = 0;
                StationQTY_Session.Value = 0;
                WoQty_Session.Value      = 0;
                throw ex;
            }
        }