Quintiq file version 2.0
|
#parent: #root
|
StaticMethod Synchronize (
|
InterfaceDataset owner
|
)
|
{
|
TextBody:
|
[*
|
// 甄兰鸽 Jul-17-2024 (created)
|
column := owner.ShippingActualColumn( relnew, StartDate := Date::ActualDate(), Index := owner.ShippingActualColumn( relsize ) );
|
url := "http://localhost:8080/api/shippingActual" + "?date=" + column.StartDate().Format( "Y-M2-D2" );
|
i := HTTPInterface::Create( url, 80 );
|
|
i.PostMethod( true );
|
i.Call();
|
result := i.Result();
|
|
cnv1 := StringToDateTime::StandardConverter();
|
cnv1.SetCustomConversion();
|
cnv1.CustomFormatString( 'yyyy-MM-dd HH:mm:ss' );
|
|
cnv2 := StringToDate::StandardConverter();
|
cnv2.SetCustomConversion();
|
cnv2.CustomFormatString( 'yyyy-MM-dd' );
|
|
data := InterfaceDataset::GetResponseJsonData( result );
|
|
sadatalist := construct( ShippingActualDatas );
|
for( seq := 0;seq < data.Size();seq++){
|
item := data.Get(seq);
|
sadata := ShippingActualData::GenerateData( owner, cnv1, cnv2, item );
|
sadatalist.Add( sadata );
|
}
|
beforerowsize := owner.ShippingActualRow( relsize );
|
traverse( sadatalist, Elements, e ){
|
row := selectobject( owner, ShippingActualRow, row, row.Name() = e.FourCode() );
|
if( isnull( row ) ){
|
owner.ShippingActualRow( relnew, Name := e.FourCode() );
|
}
|
|
cell := row.ShippingActualCell( relnew, Quantity := e.Quantity() );
|
column.ShippingActualCell( relinsert, cell );
|
}
|
if( beforerowsize <> owner.ShippingActualRow( relsize ) ){
|
rows := selectsortedset( owner, ShippingActualRow, row, row.Name() );
|
nr := 0;
|
traverse( rows, Elements, e ){
|
e.RowNr( nr );
|
nr := nr + 1;
|
}
|
}
|
*]
|
}
|