Quintiq file version 2.0
|
#parent: #root
|
StaticMethod DispatchCC (
|
const RecycleBin recycleBin
|
) as owning JSON
|
{
|
TextBody:
|
[*
|
// Akari Oct-28-2024 (created)
|
// 接口地址:172.18.1.12/PPPS/AddPlan ---长春地址
|
address := "172.18.1.12";
|
url := "/PPPS/AddPlan";
|
|
datas := selectset( recycleBin,DispatchShiftSchedulingLine.DispatchShiftSchedulingProduct,object,object.DispatchShiftSchedulingLine().Fac() = "CC" );
|
|
datas_Json := JSON::Array();
|
traverse( datas,Elements,product ,product.DispatchShiftSchedulingDetail( relsize ) <> 0 ){
|
line := product.DispatchShiftSchedulingLine();
|
|
data_Json := JSON::Object();
|
data_Json.Add( "LineName" , line.LineName() );
|
data_Json.Add( "ProductionDate",line.ShiftDate().Format( "Y-M2-D2" ));
|
data_Json.Add( "shiftCode" , line.ShiftName() );
|
|
details_Json := JSON::Array();
|
traverse( product,DispatchShiftSchedulingDetail,detail ){
|
detail_Json := JSON::Object();
|
detail_Json.Add( "ShiftName",detail.SingleShiftName() );
|
detail_Json.Add( "Quantity",detail.ShiftVolume().Format( "N(Dec)" ) );
|
detail_Json.Add( "ProductNo",detail.DispatchShiftSchedulingProduct().ProductID() );
|
|
details_Json.Add( detail_Json );
|
}
|
|
data_Json.Add( "planItems",details_Json );
|
datas_Json.Add( data_Json );
|
}
|
|
i := HTTPInterface::Create( address, 80 );
|
i.URL( url );
|
i.PostMethod( true );
|
i.MediaType( "application/json" );
|
i.TimeOut( Duration::Minutes( 5 ) );
|
|
resultJson := JSON::Object();
|
resultJson.Add( "jsonStr", datas_Json.Build().AsString() );
|
|
json := resultJson.Build().AsString();
|
|
LocalTool::WriteStringToFile( json );
|
|
i.Call( json );
|
|
htmlresult := i.Result();
|
|
respJSON := JSON::Parse( htmlresult );
|
|
return &respJSON;
|
*]
|
}
|