lazhen
2024-12-03 6031e3a259a15dff61ef18bfe90f8c1b27cfcb12
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
34
35
36
37
38
39
40
41
Quintiq file version 2.0
#parent: #root
StaticMethod Synchronize (
  InterfaceDataset owner,
  String executor
)
{
  TextBody:
  [*
    //// 甄兰鸽 Jul-17-2024 (created)
    date    := Date::ActualDate() - Duration::Days( 1 );
    loginfo := owner.InterfaceLoginfo( relnew, ExecuteUser := executor
                                       , Name := Translations::InterfaceDataset_MachineStockData_Name()
                                       , InterfaceDateTime := DateTime::ActualTime()
                                       , Message := '库存数据(机加库存)'
                                       , RequestBody := MachineStockData::GetRequestBody( date.Date() ) );
    
    data := InterfaceLoginfo::CallInterface( owner, loginfo );
    if( not isnull( data ) ){
      
      cnv2 := StringToDate::StandardConverter();
      cnv2.SetCustomConversion();
      cnv2.CustomFormatString( 'yyyy-MM-dd' );
      
    //  sadatalist := construct( ShippingActualDatas );
      for( seq := 0;seq < data.Size();seq++){
        item         := data.Get(seq);
        inventory    :=MachineStockData::GenerateData( loginfo, cnv2, item );
        inventoryname := inventory.Lgort();
        if( inventory.Fac() = 'DL' and inventory.Lgort() = 'All' ){
          inventoryname := inventory.LineType();
        }
        options := DatasetFindOptions::Construct( 'MacroPlan' ).IncludeOffline( true ); //to load we must search offline datasets.
        mdskey := DatasetController::FindUnique( options );
      
        MDSMacroPlan::Root( mdskey ) -> InventoryInterfaceData::Generate( owner, inventory.DDay(), inventory.MaterialNo(), inventoryname, inventory.Fac(), [Number]inventory.Total() );
    //    sadatalist.Add( sadata );
      }
    }
  *]
}