diff --git a/LSL2/STPROC/NCR_SERVICES.txt b/LSL2/STPROC/NCR_SERVICES.txt index 6f7f57f..b471b9b 100644 --- a/LSL2/STPROC/NCR_SERVICES.txt +++ b/LSL2/STPROC/NCR_SERVICES.txt @@ -48,11 +48,14 @@ Compile function NCR_Services(@Service, @Params) ***********************************************************************************************************************/ $insert APP_INSERTS $Insert SERVICE_SETUP +$Insert NCR_EQUATES +$Insert REACTOR_EQUATES Declare subroutine Set_Status, Logging_Services, Error_Services, Obj_Notes, Set_Property, Obj_Wo_Mat, Hold_Services +Declare subroutine Btree.Extract, SRP_JSon Declare function Environment_Services, Logging_Services, SRP_Datetime, Utility, Scan_Services, Error_Services Declare function Database_Services, Signature_Services, Epipro_Services, Rds_Services, Memberof, Datetime -Declare function Get_Property +Declare function Get_Property, SRP_Json, obj_ncr EQU COL$RDS_NO TO 1 EQU COL$REACTOR TO 2 @@ -588,3 +591,74 @@ Service SendToSPC(NCRNo, RDSList, ReactorType, PSNo, DeptResp, LossCode, LossDes end service +Service GetOpenNCRKeys() + table = "NCR" + ErrorMessage = '' + RDSRecords = '' + Open "DICT ":table To @DICT Else + ErrorMessage = 'Error opening NCR dictionary' + End + If ErrorMessage EQ '' then + srch_strng = "STATUS":@VM:'O':@FM + option = "" + flag = "" + Btree.Extract(srch_strng, table, @DICT, RDSRecords, option, flag) + end + If ErrorMessage NE '' then + Error_Services('Add', ErrorMessage) + end + Response = RDSRecords +end service + +Service ConvertRecordToJson(NCRId) + NCRJson = '' + ErrorMessage = '' + If RowExists('NCR', NCRId) then + NCRRecord = Database_Services('ReadDataRow', 'NCR', NCRId, True$, 0, False$) + If Error_Services('NoError') then + objNCR = '' + If SRP_JSON(objNCR, 'New', 'Object') then + SRP_JSON(objNCR, 'SetValue', 'NCRId', NCRId) + ThisNCREntryDate = NCRRecord + ThisNCREntryTime = NCRRecord + If ThisNCREntryTime EQ '' then ThisNCREntryTime = 0 + ThisNCREntryDateTime = OConv(SRP_DateTime('Combine', ThisNCREntryDate, ThisNCREntryTime), 'DT') + SRP_JSON(objNCR, 'SetValue', 'EntryDateTime', ThisNCREntryDateTime, 'String') + SRP_JSON(objNCR, 'SetValue', 'Shift', NCRRecord) + ThisNCRReactorNo = NCRRecord + SRP_JSON(objNCR, 'SetValue', 'Reactor', ThisNCRReactorNo);//This needs to be a list to support EpiPro + ThisNCRCassId = '' + ThisNCRReactorType = Xlate('REACTOR', ThisNCRReactorNo, REACTOR_REACT_TYPE$, 'X') + If ThisNCRReactorType NE 'EPP' then + ThisNCRCassId = NCRRecord + end else + ThisNCRWONo = NCRRecord + ThisNCRStepNo = NCRRecord + ThisNCRCassNo = NCRRecord + ThisNCRCassId = ThisNCRWONo : '*' : ThisNCRStepNo : '*' : ThisNCRCassNo + end + SRP_JSON(objNCR, 'SetValue', 'CasetteId', ThisNCRCassId) + SRP_JSON(objNCR, 'SetValue', 'LossStage', NCRRecord) + ThisNCRRejectCount = 0 + ThisNCRRejectCount = Obj_Ncr('RejQty', NCRId:@RM:NCRRecord) + SRP_JSON(objNCR, 'SetValue', 'TotalRejected', ThisNCRRejectCount) + SRP_JSON(objNCR, 'SetValue', 'LossComments', NCRRecord) + NCRJson = SRP_JSON(objNCR, 'Stringify', 'Styled') + SRP_JSON(objNCR, 'Release') + end else + ErrorMessage = 'Error creating NCR Json Object' + end + + end else + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = 'Non-existent NCR Id passed to routine' + end + If ErrorMessage NE '' then + Error_Services('Add', ErrorMessage) + end + Response = NCRJson +end service + + diff --git a/LSL2/STPROC/REPORTS_API.txt b/LSL2/STPROC/REPORTS_API.txt index dfc8ff7..5f22b79 100644 --- a/LSL2/STPROC/REPORTS_API.txt +++ b/LSL2/STPROC/REPORTS_API.txt @@ -135,6 +135,8 @@ CreateHALItem: RepJSON = Report_Services('GetDailyReactorUptimeDataJSON', ReportStartDtm, ReportEndDtm) Case ReportID = 'TestWaferWIPReport' RepJSON = Report_Services('GetOpenTestWaferLotWIPReportJson') + Case ReportID = 'OpenNCRReport' + RepJson = Report_Services('GetOpenNCRReportJson') Case Otherwise$ Error_Services('Add', 'Unsupported report') End Case @@ -232,3 +234,4 @@ API reports.GET end api + diff --git a/LSL2/STPROC/REPORT_SERVICES.txt b/LSL2/STPROC/REPORT_SERVICES.txt index c93bd80..efd700e 100644 --- a/LSL2/STPROC/REPORT_SERVICES.txt +++ b/LSL2/STPROC/REPORT_SERVICES.txt @@ -82,7 +82,7 @@ Declare function Set_Printer, Get_Printer, Msg, Get_Status, Printer_Select, ob Declare function Schedule_Services, Error_Services, Location_Services, SRP_Array, Signature_Services, obj_RDS_Test Declare function Epi_Part_Services, SRP_Math, Database_Services, SRP_JSON, Reactor_Services, SRP_Datetime Declare function SRP_Array, Environment_Services, Logging_Services, Datetime, Select_Into, Wafer_Counter_Services -Declare function Lot_Services, Test_Run_Services +Declare function Lot_Services, Test_Run_Services, NCR_Services Equ TAB TO \09\ @@ -2330,6 +2330,40 @@ Service PrintMaterialTrackReport(RptColumns, LocationFilter, NoMatFlag, OldRepor end service +Service GetOpenNCRReportJson() + ErrorMessage = '' + OpenNCRReportJson = '' + OpenNCRKeyList = NCR_Services('GetOpenNCRKeys') + objJson = '' + If SRP_Json(objJson, 'New') then + objOpenNCRJsonArray = '' + If SRP_Json(objOpenNCRJsonArray, 'New', 'Array') then + for each NCRKey in OpenNCRKeyList using @VM + ThisNCRJsonString = NCR_Services('ConvertRecordToJson', NCRKey) + ThisNCRJsonObj = '' + ParseResult = SRP_Json(ThisNCRJsonObj, 'Parse', ThisNCRJsonString) + If ParseResult EQ '' then + SRP_Json(objOpenNCRJsonArray, 'Add', ThisNCRJsonObj) + SRP_Json(ThisNCRJsonObj, 'Release') + end else + SRP_Json(ThisNCRJsonObj, 'Release') + end + Next NCRKey + SRP_Json(objJson, 'Set', 'OpenNCRReport', objOpenNCRJsonArray) + SRP_Json(objOpenNCRJsonArray, 'Release') + end else + ErrorMessage = 'Error creating Open NCR JSON Array.' + end + OpenNCRReportJson = SRP_JSON(objJSON, 'Stringify', 'Styled') + SRP_JSON(objJSON, 'Release') + end else + ErrorMessage = 'Error creating root JSON object.' + end + If ErrorMessage NE '' then + Error_Services('Add', ErrorMessage) + end + Response = OpenNCRReportJson +end service //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal GoSubs @@ -2352,3 +2386,4 @@ OipiPrintError: return +