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); }
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); } }
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); } }
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; } }
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); } } } }