Quintiq file version 2.0
|
#parent: #root
|
StaticMethod PushOfflinePlanData (
|
const MacroPlan macroPlan,
|
InterfaceDataset interfaceDataset,
|
String executor,
|
Boolean isofflineplandl,
|
Boolean isofflineplancc
|
)
|
{
|
Description: '发送下线计划数据接口'
|
TextBody:
|
[*
|
table := selectobject( interfaceDataset, OfflinePlanArchiveVersion, version, not version.IsShow() );
|
|
totalRow := 0;
|
interfaceTime := DateTime::ActualTime().Format( "Y-M2-D2 H2:m:s" );
|
|
jsonarray := JSON::Array();
|
|
traverse ( table, Row, r, ifexpr( isofflineplandl, r.Unit().Regex( "DL" ), false ) or ifexpr( isofflineplancc, r.Unit().Regex( "CC" ), false ) ){
|
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( "planningDate", c.StartDate().Format( 'Y-M2-D2' ) )
|
.Add( "planningQty", cell.Quantity() )
|
.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 );
|
totalRow++;
|
}
|
}
|
}
|
|
requestbody := jsonarray.Build().AsString();
|
|
//info( requestbody );
|
|
loginfo := interfaceDataset.InterfaceLoginfo( relnew,
|
ExecuteUser := executor,
|
Name := "Offline plan data",
|
InterfaceDateTime := DateTime::ActualTime(),
|
Message := "下线计划数据",
|
RequestBody := requestbody,
|
TotalRow := totalRow );
|
|
InterfaceLoginfo::CallInterfaceForDataCenter_OfflinePlan( interfaceDataset, loginfo );
|
*]
|
}
|