yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Quintiq file version 2.0
#parent: #root
MethodOverride Execute
{
  TextBody:
  [*
    // OVERRIDE logic to import sales demand
    opt := DatasetFindOptions::Construct( this.MacroPlanDatasetName() );
    mp := MDSMacroPlan::Find( opt );
    
    opt := DatasetFindOptions::Construct();
    db := MDSLibDEF_DataBroker::Find( opt );
    
    this
    ->SetStatusInProgress()
    ->( streamImportSalesDemand )
    {
     mp->ImportFromDM( null( MPSync ), // null mpsync as not integrating with Scheduler
                       true,           // true for importing sales demand
                       select( db, System.SetTypeMeta.SetMeta, sm, sm.Name() = this.SetMetaName() 
                                                                   and sm.ChannelName() = LibDEC_ChannelManufacturingDemand::CHANNEL_NAME() ), // sales demand set meta
                       false,                      // false for not importing mp-sc def
                       false,                      // false for not importing mp params
                       null( LibDEF_SetMeta ),     // null mpscparams
                       BinaryValue::Construct(),   // null binary data as not importing excel
                       false,                      // false for not importing scplan
                       null( LibDEF_SetMeta ),     // null scplan
                       BinaryValue::Construct() ); // null binary data 
    }
    ->|this->SetStatusDone()
    ->|mp->SetLastImportTime();
  *]
}