示例#1
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);
        }
示例#2
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);
                    }
                }
            }
        }