Quintiq file version 2.0
|
#parent: #root
|
StaticMethod PushPlanInventoryData (
|
const MacroPlan macroPlan,
|
InterfaceDataset interfaceDataset
|
)
|
{
|
Description: '发送计划库存数据接口'
|
TextBody:
|
[*
|
table := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, not version.IsShow() );
|
|
interfaceTime := DateTime::ActualTime().Format( "Y-M2-D2 h2:m:s" );
|
|
jsonarray := JSON::Array();
|
|
traverse ( table, Row, r ){
|
traverse ( table, Column, c, c.TimeUnit() = Translations::MP_GlobalParameters_Day() ) {
|
cell := select( r, Cell, tempC, tempC.Column() = c );
|
|
if ( not isnull( cell ) ) {
|
idsjson := JSON::Object().Add( "product", r.ProductID() )
|
.Add( "inventoryDate", c.StartDate().Format( 'Y-M2-D2' ) )
|
.Add( "planningInventory", cell.PlanQuantity() )
|
.Add( "versionName", macroPlan.ScenarioName() )
|
.Add( "factoryName", ifexpr( r.Unit().Regex( "CC" ), "长春工厂", "大连工厂" ) )
|
.Add( "fac", ifexpr( r.Unit().Regex( "CC" ), "CC", "DL" ) )
|
.Add( "interfaceTime", interfaceTime ).Build();
|
jsonarray.Add( idsjson );
|
}
|
}
|
}
|
|
requestbody := jsonarray.Build().AsString();
|
info( requestbody );
|
//loginfo := owner.InterfaceLoginfo( relnew, ExecuteUser := executor
|
// , Name := Translations::InterfaceDataset_CustomerDemandPPAIDS_Name()
|
// , InterfaceDateTime := DateTime::ActualTime()
|
// , Message := '客户需求(PPA+IDS)'
|
// , RequestBody := requestbody);
|
////error( '--------------------', requestbody );
|
//data := InterfaceLoginfo::CallInterfaceForDataCenter( owner, loginfo );
|
//info( '----------------', data.AsString() );
|
*]
|
}
|