Quintiq file version 2.0
|
#parent: #root
|
Method MappingCustomerOrderData (
|
Strings businessTypes
|
)
|
{
|
Description: 'ETL订单预测'
|
TextBody:
|
[*
|
toDels := selectset( this, IOSalesDemandBase, item, item.istype( IOCustomerOrder ) );
|
traverse( toDels, Elements, toDel ) {
|
toDel.Delete();
|
}
|
// 待处理数据
|
toDealList := selectset( this, MappingCustomerOrder, item, true );
|
if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) {
|
toDealList := selectset( toDealList, Elements, item, businessTypes.Find( item.BusinessType() ) >= 0 );
|
}
|
// todo 没macroPlan怎么搞
|
//queryStartDate := guard( DateTime::Now() - Duration::Days( 30 ), DateTime::MinDateTime() ).Date();
|
//queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() );
|
//listToDeal := selectset( listToDeal, Elements, item, item.StartDate() >= queryStartDate and item.EndDate() <= queryEndDate );
|
// 处理
|
traverse( toDealList, Elements, item ) {
|
this.IOSalesDemandBase( relnew,
|
IOCustomerOrder,
|
ID := item.ID(),
|
CurrencyID := item.CurrencyID(),
|
PriorityName := item.PriorityName(),
|
ProductID := item.ProductID(),
|
SalesSegmentName := item.SalesSegmentName(),
|
StockingPointID := item.StockPointID(),
|
UnitOfMeasureName := item.UnitOfMeasureName(),
|
CustomerID := item.CustomerID(),
|
CustomerName := item.Customer(),
|
OrderID := item.OrderID(),
|
OrderLineID := item.OrderLineID(),
|
Price := item.Price(),
|
Quantity := item.Quantity(),
|
StartDate := item.OrderDate() );
|
|
}
|
*]
|
}
|