陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Quintiq file version 2.0
#parent: #root
StaticMethod GenerateData (
  InterfaceDataset interfaceDataset,
  const MacroPlan macroplan,
  Boolean iscc,
  Boolean isdl,
  String executor
)
{
  Description: '生成可以下发的客户需求(PPA+IDS)数据'
  TextBody:
  [*
    // 甄兰鸽 Aug-20-2024 (created)
    loginfo                := maxobject(  interfaceDataset, InterfaceLoginfo, loginfo, loginfo.Name() = Translations::InterfaceDataset_AssemblyOnlinePlanPPPsPush_Name(), loginfo.InterfaceDateTime() );
    if( not isnull( loginfo ) ){
      if( not loginfo.IsShow() ){
        loginfo.Delete();
      }else{
        loginfo.Last( false );
      }
      interfaceDataset.AssemblyOnlinePlanPPPSPush( relflush );
    }
    nowdate                := DateTime::ActualTime();
    loginfo                := interfaceDataset.InterfaceLoginfo( relnew, ExecuteUser := executor
                                                                 , Name := Translations::InterfaceDataset_AssemblyOnlinePlanPPPsPush_Name()
                                                                 , InterfaceDateTime := nowdate
                                                                 , Message := '装配上线计划-PPPS传输至数据中台(包含排序)/SAP(不包含排序)'
                                                                 , Last                      := true
                                                                  );
    traverse( interfaceDataset, AssemblyOnlinePlanVersion, verison, not verison.IsShow() ){
      traverse( verison, Column, column ){//, column.TimeUnit() = Translations::MP_GlobalParameters_Day()
        traverse( column, Cell, cell ){
          row              := cell.Row();
          if( ( iscc and row.Unit() = FinancialProductionReport::GetDefaultCCUnit() ) or ( isdl and row.Unit() = FinancialProductionReport::GetDefaultDLUnit() ) ){
            cd               :=interfaceDataset.AssemblyOnlinePlanPPPSPush( relnew, Product            := row.Name()
                                                                             , PlanningDate            := column.StartDate()
                                                                             , PlanningQty             := [Number]cell.Quantity()
                                                                             , Sequence                := cell.Order()
                                                                             , VersionName             := macroplan.ScenarioName()
                                                                             , InterfaceTime           := nowdate
                                                                             , FactoryName             := row.Unit()
                                                                             , Note                    := cell.Note()
                                                                             , Fac                     := ifexpr( row.Unit() = FinancialProductionReport::GetDefaultCCUnit(), 'CC', 'DL' )  
      //                                                                       , VersionFlag             := versionflag
                                                                             , ProductFourCode         := ifexpr( row.ProductID() = row.Name(), '', row.Name() )
                                                                             );
            loginfo.AssemblyOnlinePlanPPPSPush( relinsert, cd );
          }
        }
      }
    }
    loginfo.TotalRow( loginfo.AssemblyOnlinePlanPPPSPush( relsize ) );
    AssemblyOnlinePlanPPPSPush::Publish( interfaceDataset, loginfo );
  *]
}