Exemplo n.º 1
0
        public static bool TryGetValue(string codeGroup, string codeName, out string value)
        {
            value = codeName;

            if (LcdHelper.IsNullOrEmpty_AnyOne(codeGroup, codeName))
            {
                return(false);
            }

            var conf = InputMart.Instance.RTS_CONFIG;

            if (conf == null)
            {
                return(false);
            }

            var find = conf.Rows.Find(codeGroup, codeName);

            if (find != null)
            {
                value = find.CODE_VALUE;
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public static Inputs.JobRunMonitor SafeGet(this RunStateMaster runStateMst)
        {
            var context = ModelContext.Current;

            Inputs.JobRunMonitor runState = null;
            if (InputMart.Instance.JobRunMonitor.Rows.Count == 0)
            {
                runState = new Inputs.JobRunMonitor();

                runState.JOB_TYPE     = "RTS";
                runState.VERSION_TYPE = LcdHelper.GetParameter(context.Arguments, "versionType", LcdHelper.DEFAULT_VERSION_TYPE);
                runState.VERSION_DATE = LcdHelper.GetVersionDate();

                runState.VERSION_NO      = context.VersionNo;
                runState.PLAN_START_TIME = context.StartTime;

                runState.CREATE_TIME = DateTime.Now;
            }
            else
            {
                runState = InputMart.Instance.JobRunMonitor.Rows[0];
            }

            return(runState);
        }
Exemplo n.º 3
0
        public static int GetChamberCount(string factoryID, string shopID, string eqpID)
        {
            int defaultCount = 1;

            if (string.IsNullOrEmpty(factoryID) ||
                string.IsNullOrEmpty(shopID) ||
                string.IsNullOrEmpty(eqpID))
            {
                return(defaultCount);
            }

            var eqps = InputMart.Instance.RTS_EQP;

            if (eqps == null || eqps.Rows.Count == 0)
            {
                return(1);
            }

            var find = eqps.Rows.Find(factoryID, shopID, eqpID);

            if (find != null)
            {
                if (LcdHelper.IsChamberType(find.SIM_TYPE))
                {
                    return((int)Math.Max(find.CHAMBER_COUNT, 1));
                }
            }

            return(defaultCount);
        }
Exemplo n.º 4
0
        public static InboudRunType GetRunType()
        {
            string runTypeStr = GlobalParameters.Instance.RunType;
            var    runType    = LcdHelper.ToEnum(runTypeStr, InboudRunType.NONE);

            return(runType);
        }
Exemplo n.º 5
0
        public static ChamberType GetChamberType(string factoryID, string shopID, string eqpID)
        {
            if (string.IsNullOrEmpty(factoryID) ||
                string.IsNullOrEmpty(shopID) ||
                string.IsNullOrEmpty(eqpID))
            {
                return(ChamberType.NONE);
            }

            var eqps = InputMart.Instance.RTS_EQP;

            if (eqps == null || eqps.Rows.Count == 0)
            {
                return(ChamberType.NONE);
            }

            var find = eqps.Rows.Find(factoryID, shopID, eqpID);

            if (find != null)
            {
                return(LcdHelper.GetChamberType(find.SIM_TYPE));
            }

            return(ChamberType.NONE);
        }
Exemplo n.º 6
0
        public static DateTime GetRptDate_1Hour(DateTime t)
        {
            //DayStartTime为基准
            //DayStartTime 기준
            int baseMinute = ShopCalendar.StartTimeOfDayT(ModelContext.Current.StartTime).Minute;

            return(LcdHelper.GetRptDate_1Hour(t, baseMinute));
        }
Exemplo n.º 7
0
        public static bool IsPhotoEqpGroup(string eqpGroup)
        {
            if (string.IsNullOrEmpty(eqpGroup))
            {
                return(false);
            }

            string key          = ConfigHelper.PHOTO_EQP_GROUP_PATTERN;
            string defaultValue = PHOTO_EQP_GROUP_PATTERN;

            string pattern = ConfigHelper.GetCodeMap_InboundCodeMap(key, defaultValue);

            return(LcdHelper.ToUpper(eqpGroup).Contains(pattern));
        }
Exemplo n.º 8
0
        public static string MergeString(string org, string dst)
        {
            string result = LcdHelper.IdentityNull();

            if (LcdHelper.IsEmptyID(org) == true)
            {
                result = dst;
            }
            else
            {
                result = string.Format("{0},{1}", org, dst);
            }

            return(result);
        }
Exemplo n.º 9
0
        private static void Add_ENG_EQP_STATUS()
        {
            var table = OutputMart.Instance.RSL_RTS_EQP_STATUS_IF.Table;

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            if (MainHelper.CheckActiveAction(table.TableName) == false)
            {
                return;
            }

            var modelContext = ModelContext.Current;

            DateTime versionDate = LcdHelper.GetVersionDate();

            foreach (var entity in table.Rows)
            {
                var newEntity = new ENG_EQP_STATUS();

                newEntity.VERSION_DATE = versionDate;
                newEntity.VERSION_NO   = modelContext.VersionNo;

                newEntity.FACTORY_ID           = entity.FACTORY_ID;
                newEntity.SHOP_ID              = entity.SHOP_ID;
                newEntity.EQP_ID               = entity.EQP_ID;
                newEntity.STATUS               = entity.STATUS;
                newEntity.REASON_CODE          = entity.REASON_CODE;
                newEntity.EVENT_START_TIME     = entity.EVENT_START_TIME;
                newEntity.EVENT_END_TIME       = entity.EVENT_END_TIME;
                newEntity.VALID_CHAMBER        = entity.VALID_CHAMBER;
                newEntity.LAST_SHOP_ID         = entity.LAST_SHOP_ID;
                newEntity.LAST_STEP_ID         = entity.LAST_STEP_ID;
                newEntity.LAST_PRODUCT_ID      = entity.LAST_PRODUCT_ID;
                newEntity.LAST_PRODUCT_VERSION = entity.LAST_PRODUCT_VERSION;
                newEntity.LAST_OWNER_TYPE      = entity.LAST_OWNER_TYPE;
                newEntity.LAST_TRACK_IN_TIME   = entity.LAST_TRACK_IN_TIME;
                newEntity.LAST_CONTINUOUS_QTY  = entity.LAST_CONTINUOUS_QTY;
                newEntity.LAST_ACID_DENSITY    = entity.LAST_ACID_DENSITY;

                newEntity.UPDATE_TIME = entity.UPDATE_DTTM;

                OutputMart.Instance.ENG_EQP_STATUS.Add(newEntity);
            }
        }
Exemplo n.º 10
0
        public static string ToVaildProductID(string shopID, string productID)
        {
            if (LcdHelper.IsCellShop(shopID) == false)
            {
                return(productID);
            }

            var    dashboard = InputMart.Instance.Dashboard;
            string cellCode  = dashboard.GetCellCode(productID);

            if (string.IsNullOrEmpty(cellCode) == false)
            {
                return(cellCode);
            }

            return(productID);
        }
Exemplo n.º 11
0
        private static void Add_ENG_EQP_IN_OUT_ACT()
        {
            var table = OutputMart.Instance.RSL_RTS_EQP_IN_OUT_ACT_IF.Table;

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            var result = OutputMart.Instance.ENG_EQP_IN_OUT_ACT;

            if (MainHelper.CheckActiveAction(result.Table.TableName) == false)
            {
                return;
            }

            var modelContext = ModelContext.Current;

            DateTime versionDate = LcdHelper.GetVersionDate();
            string   versionNo   = modelContext.VersionNo;

            foreach (var entity in table.Rows)
            {
                var newEntity = new ENG_EQP_IN_OUT_ACT();

                newEntity.VERSION_DATE = versionDate;
                newEntity.VERSION_NO   = versionNo;

                newEntity.FACTORY_ID      = entity.FACTORY_ID;
                newEntity.SHOP_ID         = entity.SHOP_ID;
                newEntity.RPT_DATE        = entity.RPT_DATE;
                newEntity.EQP_ID          = entity.EQP_ID;
                newEntity.STEP_ID         = entity.STEP_ID;
                newEntity.PROCESS_ID      = entity.PROC_ID;
                newEntity.PRODUCT_ID      = entity.PROD_ID;
                newEntity.PRODUCT_VERSION = entity.PROD_VER;
                newEntity.OWNER_TYPE      = entity.OWNER_TYPE;
                newEntity.OWNER_ID        = entity.OWNER_ID;
                newEntity.IN_QTY          = entity.IN_QTY;
                newEntity.OUT_QTY         = entity.OUT_QTY;

                newEntity.UPDATE_TIME = entity.UPDATE_DTTM;

                result.Add(newEntity);
            }
        }
Exemplo n.º 12
0
        private static void Set_RSL_RTS_EQP_STATUS_IF(string eqpID, string lastStepID, RSL_RTS_EQP_STATUS_IF parent, RSL_RTS_EQP_STATUS_IF child)
        {
            var table = InputMart.Instance.IF_LOTHISTORY;

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            if (MainHelper.CheckActiveAction(table.TableName) == false)
            {
                return;
            }

            child.STATUS           = parent.STATUS;
            child.REASON_CODE      = parent.REASON_CODE;
            child.EVENT_START_TIME = parent.EVENT_START_TIME;
            child.EVENT_END_TIME   = parent.EVENT_END_TIME;
            //child.VALID_CHAMBER = parent.VALID_CHAMBER;
            child.UPDATE_DTTM = parent.UPDATE_DTTM;

            //LOTHISTORY : 해당 Step를 진행한 마지막 정보 기록
            var list = table.Rows.ToList().FindAll(t => t.EVENTNAME == "TrackIn" && t.MACHINENAME == eqpID && t.PROCESSOPERATIONNAME == lastStepID);

            if (list == null || list.Count == 0)
            {
                return;
            }

            var last = list.OrderBy(t => t.EVENTTIME).LastOrDefault();

            if (last != null)
            {
                child.LAST_SHOP_ID         = last.FACTORYNAME;
                child.LAST_STEP_ID         = last.PROCESSOPERATIONNAME;
                child.LAST_PRODUCT_ID      = last.PRODUCTSPECNAME;
                child.LAST_PRODUCT_VERSION = last.PRODUCTSPECVERSION;
                child.LAST_OWNER_TYPE      = GetOwnerType(last.OWNERID);
                child.LAST_TRACK_IN_TIME   = LcdHelper.DbDateTime(last.EVENTTIME);

                //不可By Chamber统计(2019.09.21)
                //Chamber별 정보 집계 불가한 상태(2019.09.21)
                child.LAST_CONTINUOUS_QTY = 0;
            }
        }
Exemplo n.º 13
0
        public static bool ExcludeData(string shopID, string productID)
        {
            if (LcdHelper.IsCellShop(shopID))
            {
                if (string.IsNullOrEmpty(productID))
                {
                    return(true);
                }

                string prodShopID = LcdHelper.GetShopIDByProductID(productID, shopID);
                if (LcdHelper.IsCfShop(prodShopID))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 14
0
        public static DateTime GetVersionDate()
        {
            var context = ModelContext.Current;

            DateTime versionDate = context.StartTime.SplitDate();

            string versionDay;

            if (context.QueryArgs.TryGetValue("VERSION_DATE", out versionDay))
            {
                if (string.IsNullOrEmpty(versionDay) == false)
                {
                    versionDate = LcdHelper.DbToDateTime(versionDay);
                }
            }

            return(versionDate);
        }
Exemplo n.º 15
0
        public static DateTime GetRptDate_1Hour(DateTime t, int baseMinute)
        {
            // 1H为单位
            //1시간 단위
            int baseHours = 1;

            //ex) HH:30:00
            DateTime rptDate = LcdHelper.Trim(t, "HH").AddMinutes(baseMinute);

            //超过baseMinute(ex.30min)时,后续时间段的baseMinute的Actual
            //baseMinute(ex.30분) 이상인 경우 이후 시간대 baseMinute의 실적
            //07:30 = 06:30(超过) ~ 07:30(以下)时, 06:40 --> 07:30, 07:30 --> 07:30, 07:40 --> 08:30
            //07:30 = 06:30(초과) ~ 07:30(이하)인경우, 06:40 --> 07:30, 07:30 --> 07:30, 07:40 --> 08:30
            if (t.Minute > baseMinute)
            {
                rptDate = rptDate.AddHours(baseHours);
            }

            return(rptDate);
        }
Exemplo n.º 16
0
        public static InOutType GetInOutType(string shopID, string stepID)
        {
            if (LcdHelper.Equals(shopID, LcdHelper.ARRAY))
            {
                if (LcdHelper.Equals(stepID, "1100"))
                {
                    return(InOutType.IN);
                }
                else if (LcdHelper.Equals(stepID, "9900"))
                {
                    return(InOutType.OUT);
                }
            }
            else if (LcdHelper.Equals(shopID, LcdHelper.CF))
            {
                if (LcdHelper.Equals(stepID, "0100"))
                {
                    return(InOutType.IN);
                }
                else if (LcdHelper.Equals(stepID, "9990"))
                {
                    return(InOutType.OUT);
                }
            }
            else if (LcdHelper.Equals(shopID, LcdHelper.CELL))
            {
                if (LcdHelper.Equals(stepID, "2100"))
                {
                    return(InOutType.IN);
                }
                else if (LcdHelper.Equals(stepID, "2300"))
                {
                    return(InOutType.OUT);
                }
            }

            return(InOutType.NONE);
        }
Exemplo n.º 17
0
        private static void Add_ENG_FAB_IN_OUT_ACT()
        {
            var table = OutputMart.Instance.ENG_EQP_IN_OUT_ACT.Table;

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            var result = OutputMart.Instance.ENG_FAB_IN_OUT_ACT;

            if (MainHelper.CheckActiveAction(result.Table.TableName) == false)
            {
                return;
            }

            var modelContext = ModelContext.Current;

            DateTime versionDate = LcdHelper.GetVersionDate();
            string   versionNo   = modelContext.VersionNo;

            foreach (var entity in table.Rows)
            {
                //Shop In数量 = ARRAY(1100)/CF(0100)的Out数量 (2019.09.26 - by.刘健)
                //Shop In 수량 = ARRAY(1100)/CF(0100)의 Out 수량 (2019.09.26 - by.liujian(유건))
                //int inQty = entity.IN_QTY;
                int inQty  = entity.OUT_QTY;
                int outQty = entity.OUT_QTY;

                if (inQty <= 0 && outQty <= 0)
                {
                    continue;
                }

                string factoryID = entity.FACTORY_ID;
                string shopID    = entity.SHOP_ID;

                string stepID = entity.STEP_ID;

                var ioType = LcdHelper.GetInOutType(shopID, stepID);
                if (ioType == InOutType.NONE)
                {
                    continue;
                }

                if (ioType == InOutType.IN && inQty <= 0)
                {
                    continue;
                }

                if (ioType == InOutType.OUT && outQty <= 0)
                {
                    continue;
                }

                DateTime rptDate = entity.RPT_DATE;

                string processID      = entity.PROCESS_ID;
                string productID      = entity.PRODUCT_ID;
                string productVersion = entity.PRODUCT_VERSION;

                string ownerID   = entity.OWNER_ID;
                string ownerType = entity.OWNER_TYPE;

                var find = result.Find(versionDate,
                                       versionNo,
                                       factoryID,
                                       shopID,
                                       rptDate,
                                       processID,
                                       productID,
                                       productVersion,
                                       ownerType,
                                       ownerID);

                if (find == null)
                {
                    find = new ENG_FAB_IN_OUT_ACT();

                    find.VERSION_DATE = versionDate;
                    find.VERSION_NO   = versionNo;

                    find.FACTORY_ID      = factoryID;
                    find.SHOP_ID         = shopID;
                    find.RPT_DATE        = rptDate;
                    find.PROCESS_ID      = processID;
                    find.PRODUCT_ID      = productID;
                    find.PRODUCT_VERSION = productVersion;
                    find.OWNER_TYPE      = ownerType;
                    find.OWNER_ID        = ownerID;
                    find.IN_QTY          = 0;
                    find.OUT_QTY         = 0;

                    result.Add(find);
                }

                if (ioType == InOutType.IN)
                {
                    find.IN_QTY += entity.IN_QTY;
                }

                if (ioType == InOutType.OUT)
                {
                    find.OUT_QTY += entity.OUT_QTY;
                }

                find.UPDATE_TIME = entity.UPDATE_TIME;
            }
        }
Exemplo n.º 18
0
 public static string CreateKey(string shopID, string productID, string productVersion)
 {
     return(LcdHelper.CreateKey(shopID, productID, productVersion));
 }
Exemplo n.º 19
0
        public static bool IsChamberEqp(string factoryID, string shopID, string eqpID)
        {
            var chamberType = GetChamberType(factoryID, shopID, eqpID);

            return(LcdHelper.IsChamberType(chamberType));
        }
Exemplo n.º 20
0
 public static bool IsSTB1(string stepID)
 {
     return(LcdHelper.Equals(stepID, LcdHelper.STEP_STB1));
 }
Exemplo n.º 21
0
 public static bool IsCellShop(string shopID)
 {
     return(LcdHelper.Equals(shopID, LcdHelper.CELL));
 }
Exemplo n.º 22
0
 public static bool IsArrayShop(string shopID)
 {
     return(LcdHelper.Equals(shopID, LcdHelper.ARRAY));
 }
Exemplo n.º 23
0
        private static void Load_IF_MACHINE()
        {
            var table = InputMart.Instance.IF_MACHINE;

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            if (MainHelper.CheckActiveAction(table.TableName) == false)
            {
                return;
            }

            var      modelContext = ModelContext.Current;
            DateTime now          = modelContext.StartTime;

            string factoryID = LcdHelper.GetTargetFactoryID();
            //DateTime versionDate = LcdHelper.GetVersionDate();

            var result = OutputMart.Instance.RSL_RTS_EQP_STATUS_IF;

            foreach (var entity in table.DefaultView)
            {
                string shopID = entity.FACTORYNAME;
                string eqpID  = entity.MACHINENAME;

                if (DataVaildHelper.IsVaildEqp(eqpID) == false)
                {
                    continue;
                }

                var find = result.Find(factoryID, shopID, eqpID);
                if (find == null)
                {
                    find            = new RSL_RTS_EQP_STATUS_IF();
                    find.FACTORY_ID = factoryID;
                    find.SHOP_ID    = shopID;
                    find.EQP_ID     = eqpID;

                    result.Add(find);
                }

                find.STATUS      = entity.MACHINESTATENAME;
                find.REASON_CODE = entity.LASTEVENTNAME;

                DateTime eventStartTime = LcdHelper.DbToDateTime(LcdHelper.SafeSubstring(entity.LASTEVENTTIMEKEY, 0, 14));
                find.EVENT_START_TIME = LcdHelper.DbDateTime(eventStartTime);

                DateTime dueDate = LcdHelper.DbToDateTime(LcdHelper.SafeSubstring(entity.DUEDATE, 0, 14));
                find.EVENT_END_TIME = LcdHelper.DbDateTime(dueDate);

                find.UPDATE_DTTM = now;
            }

            //更新最新的 BATCH信息(by LotHistory)
            //LAST진행 BATCH 정보 업데이트(by LotHistory)
            Update_RSL_RTS_EQP_STATUS_IF();

            //LAST ACID浓度信息
            //LAST ACID 농도 정보
            Load_IF_CT_FACILITYRESULTHISTORY();

            //更新CHAMBER EQP STATUS信息
            //CHAMBER EQP STATUS 정보 업데이트
            Load_IF_MACHINESPEC_CHAMBER();

            var dashboard = InputMart.Instance.Dashboard;

            //设定时间 (lastLotEventTime)
            //확정된 시간 (lastLotEventTime) 설정
            DateTime lastLotEventTime = dashboard.LastLotEventTime;

            foreach (var entity in result.Table.Rows)
            {
                entity.IF_TIME = lastLotEventTime;
            }
        }
Exemplo n.º 24
0
 public static ChamberType GetChamberType(string simType)
 {
     return(LcdHelper.ToEnum(simType, ChamberType.NONE));
 }
Exemplo n.º 25
0
        private static void Update_RSL_RTS_EQP_STATUS_IF()
        {
            var table = InputMart.Instance.IF_LOTHISTORY;

            if (MainHelper.CheckActiveAction(table.TableName) == false)
            {
                return;
            }

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            var      dashboard         = InputMart.Instance.Dashboard;
            DateTime lastInterfaceTime = dashboard.LastInterfaceTime;

            //仅统计“设定时间(lastInterfaceTime)” 后的信息
            //확정된 시간 (lastInterfaceTime) 이후의 정보만으로 정보 집계
            var list = table.Rows.ToList().FindAll(t => t.EVENTNAME == "TrackIn" && t.EVENTTIME > lastInterfaceTime);

            if (list == null || list.Count == 0)
            {
                return;
            }

            var result = OutputMart.Instance.RSL_RTS_EQP_STATUS_IF;

            var      modelContext = ModelContext.Current;
            DateTime now          = modelContext.StartTime;

            string factoryID = LcdHelper.GetTargetFactoryID();

            var group = list.GroupBy(t => t.MACHINENAME);

            foreach (var it in group)
            {
                string eqpID = it.Key;
                var    infos = it.OrderBy(t => t.EVENTTIME);
                if (infos == null)
                {
                    continue;
                }

                var finds = InputMart.Instance.RTS_EQPbyEqpID.FindRows(eqpID);
                if (finds == null)
                {
                    continue;
                }

                var eqp = finds.FirstOrDefault();
                if (eqp == null)
                {
                    continue;
                }

                string shopID = eqp.SHOP_ID;

                var find = result.Find(factoryID, shopID, eqpID);
                if (find == null)
                {
                    find                     = new RSL_RTS_EQP_STATUS_IF();
                    find.FACTORY_ID          = factoryID;
                    find.SHOP_ID             = shopID;
                    find.EQP_ID              = eqpID;
                    find.LAST_CONTINUOUS_QTY = 0;

                    result.Add(find);
                }

                foreach (var entity in infos)
                {
                    DateTime evnetTime = entity.EVENTTIME;
                    int      qty       = entity.PRODUCTQUANTITY;

                    bool isLastPlan = IsLastPlan(find, entity);
                    if (isLastPlan)
                    {
                        find.LAST_CONTINUOUS_QTY += qty;
                    }
                    else
                    {
                        find.LAST_SHOP_ID         = entity.FACTORYNAME;
                        find.LAST_STEP_ID         = entity.PROCESSOPERATIONNAME;
                        find.LAST_PRODUCT_ID      = entity.PRODUCTSPECNAME;
                        find.LAST_PRODUCT_VERSION = entity.PRODUCTSPECVERSION;
                        find.LAST_OWNER_TYPE      = GetOwnerType(entity.OWNERID);

                        find.LAST_CONTINUOUS_QTY = qty;
                    }

                    find.UPDATE_DTTM = now;
                }
            }
        }
Exemplo n.º 26
0
        private static void Load_IF_MACHINESPEC_CHAMBER()
        {
            var table = InputMart.Instance.IF_MACHINESPEC_CHAMBER;

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            if (MainHelper.CheckActiveAction(table.TableName) == false)
            {
                return;
            }

            var result = OutputMart.Instance.RSL_RTS_EQP_STATUS_IF;

            string   factoryID   = LcdHelper.GetTargetFactoryID();
            DateTime versionDate = LcdHelper.GetVersionDate();

            var eqpGroup = table.Rows.GroupBy(t => new Tuple <string, string>(t.FACTORYNAME, t.SUPERMACHINENAME));

            foreach (var it in eqpGroup)
            {
                var key         = it.Key;
                var chamberList = it.ToList();

                string shopID = key.Item1;
                string eqpID  = key.Item2;

                if (chamberList == null || chamberList.Count == 0)
                {
                    continue;
                }

                //parent EQP基准的EqpStatus最新信息
                //parent EQP 기준의 EqpStatus 최신 정보
                var parent = result.Find(factoryID, shopID, eqpID);
                if (parent == null)
                {
                    continue;
                }

                foreach (var chamber in chamberList)
                {
                    string chamberID  = chamber.MACHINENAME;
                    string lastStepID = ConfigHelper.GetCodeMap_LineOperMode(chamber.LINEOPERMODE);

                    var find = result.Find(factoryID, shopID, chamberID);
                    if (find == null)
                    {
                        find            = new RSL_RTS_EQP_STATUS_IF();
                        find.FACTORY_ID = factoryID;
                        find.SHOP_ID    = shopID;
                        find.EQP_ID     = chamberID;

                        result.Add(find);
                    }

                    if (parent.LAST_STEP_ID == lastStepID)
                    {
                        Set_RSL_RTS_EQP_STATUS_IF(parent, find);
                    }
                    else
                    {
                        Set_RSL_RTS_EQP_STATUS_IF(eqpID, lastStepID, parent, find);
                    }
                }
            }
        }
Exemplo n.º 27
0
        private static void Load_IF_CT_FACILITYRESULTHISTORY()
        {
            var table = InputMart.Instance.IF_CT_FACILITYRESULTHISTORY;

            if (MainHelper.CheckActiveAction(table.TableName) == false)
            {
                return;
            }

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            var result = OutputMart.Instance.RSL_RTS_EQP_STATUS_IF;

            var      modelContext = ModelContext.Current;
            DateTime now          = modelContext.StartTime;

            string factoryID = LcdHelper.GetTargetFactoryID();

            var group = table.Rows.GroupBy(t => t.MACHINENAME);

            foreach (var it in group)
            {
                string eqpID = it.Key;

                //按时间最近进行排序
                //최근 순으로 정렬
                var infos = it.OrderByDescending(t => t.EVENTTIME);
                if (infos == null)
                {
                    continue;
                }

                var finds = InputMart.Instance.RTS_EQPbyEqpID.FindRows(eqpID);
                if (finds == null)
                {
                    continue;
                }

                var eqp = finds.FirstOrDefault();
                if (eqp == null)
                {
                    continue;
                }

                var entity = infos.FirstOrDefault();
                if (entity == null)
                {
                    continue;
                }

                string shopID = eqp.SHOP_ID;

                float density = LcdHelper.ToFloat(entity.PARAVALUE);
                if (density <= 0)
                {
                    continue;
                }

                var find = result.Find(factoryID, shopID, eqpID);
                if (find == null)
                {
                    find                   = new RSL_RTS_EQP_STATUS_IF();
                    find.FACTORY_ID        = factoryID;
                    find.SHOP_ID           = shopID;
                    find.EQP_ID            = eqpID;
                    find.LAST_ACID_DENSITY = 0;

                    result.Add(find);
                }

                find.LAST_ACID_DENSITY = density;
                find.UPDATE_DTTM       = now;
            }
        }
Exemplo n.º 28
0
        private static void Update_RSL_RTS_EQP_IN_OUT_ACT_IF()
        {
            var table = InputMart.Instance.IF_LOTHISTORY;

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            var result = OutputMart.Instance.RSL_RTS_EQP_IN_OUT_ACT_IF;

            if (MainHelper.CheckActiveAction(result.Table.TableName) == false)
            {
                return;
            }

            var dashboard = InputMart.Instance.Dashboard;
            var runType   = dashboard.RunType;

            var      modelContext = ModelContext.Current;
            DateTime now          = modelContext.StartTime;

            string factoryID = LcdHelper.GetTargetFactoryID();
            string isFixed   = runType == InboudRunType.INBOUND_IF ? "Y" : "N";

            DateTime currRptDate = GetRptDate_1Hour(now);

            foreach (var entity in table.DefaultView)
            {
                int qty = entity.PRODUCTQUANTITY;
                if (qty <= 0)
                {
                    continue;
                }

                string eventName = entity.EVENTNAME;
                string shopID    = entity.FACTORYNAME;
                string eqpID     = entity.MACHINENAME;

                //IN : TrackIn, OUT : TrackOut / Ship(9900, 9990)
                bool baseTrackIn = LcdHelper.Equals(eventName, "TrackIn");

                DateTime rptDate = GetRptDate_1Hour(entity.EVENTTIME);

                //已保存到RTS_EQP_IN_OUT_ACT_IF table的时间排除在Update对象里
                //이미 RTS_EQP_IN_OUT_ACT_IF table에 확정 저장된 시간은 Update 제외
                if (rptDate <= dashboard.ActFixedDate)
                {
                    continue;
                }

                //TrackOut의 경우 OLD값 기준으로 기록
                string stepID         = baseTrackIn ? entity.PROCESSOPERATIONNAME : entity.OLDPROCESSOPERATIONNAME;
                string processID      = baseTrackIn ? entity.PROCESSFLOWNAME : entity.OLDPROCESSFLOWNAME;
                string productID      = baseTrackIn ? entity.PRODUCTSPECNAME : entity.OLDPRODUCTSPECNAME;
                string productVersion = baseTrackIn ? entity.PRODUCTSPECVERSION : entity.OLDPRODUCTSPECVERSION;

                string ownerID   = entity.OWNERID;
                string ownerType = GetOwnerType(ownerID);

                Add_RSL_RTS_EQP_IN_OUT_ACT_IF(result, factoryID, shopID, rptDate,
                                              eqpID, stepID, processID, productID, productVersion,
                                              ownerType, ownerID, qty,
                                              isFixed, baseTrackIn, currRptDate, now);

                //新增ARRAY/CF 9900/9990 TrackIn Event (按9900/9990前面站点的TrackInOut为基准)
                //ARRAY/CF 9900/9990 TrackIn 이벤트 추가 생성 (9900/9990 이전 공정의 TrackInOut을 기준으로 생성)
                if (LcdHelper.Equals(eventName, "TrackInOut") == false && LcdHelper.IsCellShop(shopID) == false)
                {
                    string chkStepID = entity.PROCESSOPERATIONNAME;
                    var    ioType    = LcdHelper.GetInOutType(shopID, chkStepID);
                    if (ioType == InOutType.OUT)
                    {
                        string dummyEqpID = LcdHelper.IdentityNull();

                        //9900/9990 TrackIn
                        Add_RSL_RTS_EQP_IN_OUT_ACT_IF(result, factoryID, shopID, rptDate,
                                                      dummyEqpID, chkStepID,
                                                      entity.PROCESSFLOWNAME,
                                                      entity.PRODUCTSPECNAME,
                                                      entity.PRODUCTSPECVERSION,
                                                      ownerType, ownerID, qty,
                                                      isFixed, true, currRptDate, now);

                        //Ship(9900, 9990) Event记录,做例外处理 (2019.09.26 - by.刘健)
                        //Ship(9900, 9990) 이벤트에서 기록되어 제외 처리 (2019.09.26 - by.liujian(유건))
                        //以9900/9990 Track Out --> 9900/9990 Ship基准进行记录
                        //9900/9990 Track Out --> 9900/9990 Ship 기준으로 기록
                        //Add_RSL_RTS_EQP_IN_OUT_ACT_IF(result, factoryID, shopID, rptDate,
                        //                              dummyEqpID, chkStepID,
                        //                              entity.PROCESSFLOWNAME,
                        //                              entity.PRODUCTSPECNAME,
                        //                              entity.PRODUCTSPECVERSION,
                        //                              ownerType, ownerID, qty,
                        //                              isFixed, false, currRptDate, now);
                    }
                }
            }
        }