| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod CallInterfaceForSAPGet ( | 
|   InterfaceDataset owner, | 
|   InterfaceLoginfo loginfo | 
| ) as owning InterfaceSAPResponseLoginfos | 
| { | 
|   Description: '调用数据中台接口' | 
|   TextBody: | 
|   [* | 
|     // 甄兰鸽 Jul-22-2024 (created) | 
|     address           := Translations::InterfaceDataset_SAP_Address();  | 
|     httpinterface     := HTTPInterface::Create( address,8080); | 
|     httpinterface.PostMethod( false );  | 
|     httpinterface.MediaType( Translations::InterfaceDataset_ContentType() ); | 
|     try{ | 
|       if( loginfo.Name() = Translations::InterfaceDataset_AOnlineAndMOfflinePlanPIR_Name() ){//装配上线计划PIR | 
|         httpinterface.URL( Translations::InterfaceDataset_AOnlineAndMOfflinePlanPIR_URL() ); | 
|       }  | 
|       if( loginfo.Name() = Translations::InterfaceDataset_AOnlineAndMOfflinePlanMS64_Name() ){//装配上线计划MS64 | 
|         httpinterface.URL( Translations::InterfaceDataset_AOnlineAndMOfflinePlanMS64_URL() ); | 
|       }  | 
|       httpinterface.Call(); | 
|       result         := httpinterface.Result(); | 
|       loginfo.Response( result ); | 
|       loginfo.Success( true ); | 
|     }onerror{ | 
|       loginfo.ReturnMsg( e.GeneralInformation() ); | 
|     } | 
|      | 
|     //后续公共处理 | 
|     loginfo.FinishTime( DateTime::ActualTime() ); | 
|     data             := JSON::Null().Build(); | 
|     saploginfos      := construct( InterfaceSAPResponseLoginfos ); | 
|     if( loginfo.Success() ){ | 
|       resultJson     := JSON::Parse( loginfo.Response() ); | 
|       code           := resultJson.Get( "code" ).GetNumber(); | 
|       msg            := resultJson.Get( "message" ).GetString(); | 
|       data           := resultJson.Get( "data" ); | 
|        | 
|       loginfo.ReturnMsg( msg ); | 
|       if( code = 200 ){ | 
|     //    total        := resultJson.Get( "dataSize" ).GetNumber(); | 
|         loginfo.ReturnSuccess( true ); | 
|     //    loginfo.TotalRow( total ); | 
|         loginfo.UpdateLast(); | 
|       } | 
|       for( i := 0; i < data.Size(); i++ ){ | 
|         item := data.Get( i ); | 
|         saploginfos.Add( InterfaceSAPResponseLoginfo::GenerateData( loginfo, item ) ); | 
|       } | 
|     } | 
|      | 
|     return &saploginfos; | 
|   *] | 
| } |