| Quintiq file version 2.0 | 
| #parent: #root | 
| Method DoCall () as ERPResponseOfPR | 
| { | 
|   TextBody: | 
|   [* | 
|     // yypsybs Sep-11-2023 (created) | 
|     conv := DateTimeToString::StandardConverter(); | 
|     conv.SetCustomConversion(); | 
|     conv.CustomFormatString( 'yyyyMMdd' ); | 
|      | 
|     requestJSON := JSON::Object(); | 
|     requestJSON.Add( "BusinessType", this.BusinessType() ); | 
|     requestJSON.Add( "DataID", this.DataID() ); | 
|     requestJSON.Add( "DeliveryDate", conv.Convert( this.DeliveryDate().DateTime() ) ); | 
|     requestJSON.Add( "MRPCalverNo", this.MRPCalverNo() ); | 
|     requestJSON.Add( "OrganCode", this.OrganCode() ); | 
|     requestJSON.Add( "ProductID", this.ProductID() ); | 
|     requestJSON.Add( "ProductName", this.ProductName() ); | 
|     requestJSON.Add( "ProvideCode", this.ProviderCode() ); | 
|     requestJSON.Add( "ProviderName", this.ProviderName() ); | 
|     requestJSON.Add( "Quantity", this.Quantity() ); | 
|     requestJSON.Add( "StockingPointID", this.StockingPointID() ); | 
|     requestJSON.Add( "UnitOfMeasure", this.UnitOfMeasure() ); | 
|      | 
|     requestString := requestJSON.AsString(); | 
|      | 
|     // 构造http请求 todo | 
|     httpInterface := HTTPInterface::Create( "127.0.0.1", 443 ); | 
|     httpInterface.URL( "/url" ); | 
|     httpInterface.PostMethod( true ); | 
|     httpInterface.AddHeader( "content-type", "application/json" ); | 
|      | 
|     // 发送请求 | 
|     result := null( ERPResponseOfPR ); | 
|     try { | 
|       httpInterface.Call( requestString ); | 
|       responseString := httpInterface.Result(); | 
|        | 
|       responseJSON := JSON::Parse( responseString ); | 
|       dataID := responseJSON.Get( "DataID" ).GetString(); | 
|       status := responseJSON.Get( "Status" ).GetString(); | 
|       errorDescription := responseJSON.Get( "ErrorDescription" ).GetString(); | 
|        | 
|       result := this.ERPResponseOfPR( relnew,  | 
|                                       DataID := dataID, | 
|                                       Status := status,  | 
|                                       ErrorDescription := errorDescription ); | 
|     } onerror { | 
|       result := this.ERPResponseOfPR( relnew,  | 
|                                       DataID := this.DataID(), | 
|                                       Status := "E",  | 
|                                       ErrorDescription := e.GeneralInformation() ); | 
|     } | 
|      | 
|     return result; | 
|   *] | 
| } |