陈清红
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
Quintiq file version 2.0
#parent: #root
StaticMethod InterfaceArchive (
  MacroPlan macroPlan,
  InterfaceDataset interfaceDataset
)
{
  TextBody:
  [*
    nopt  := maxselect( macroPlan, NewOfflinePlanTable, tempNOPT, true, tempNOPT.SaveDateTime() );
    
    // 选择指定版本下线计划接口数据
    inopv   := select( interfaceDataset, InterfaceNewOfflinePlanVersion, tempINOPV, tempINOPV.ScenarioName() = macroPlan.ScenarioName() );
    if ( isnull( inopv ) ) {
      inopv := interfaceDataset.InterfaceNewOfflinePlanVersion( relnew, ScenarioName := macroPlan.ScenarioName() );
    } else {
      inopv.Delete();
      inopv := interfaceDataset.InterfaceNewOfflinePlanVersion( relnew, ScenarioName := macroPlan.ScenarioName() );
    }
    
    // 创建下线计划接口数据
    traverse ( nopt, NewOfflinePlanRow.NewOfflinePlanCell, nopcell, nopcell.NewOfflinePlanRow().Type() = "1" ) {
      inopv.InterfaceNewOfflinePlanDetailData( relnew,
                                               Order             := nopcell.Order(),
                                               OrderNr           := nopcell.OrderNr(),
                                               ProductID         := nopcell.NewOfflinePlanRow().ProductID(),
                                               ProductionLine    := nopcell.NewOfflinePlanRow().ProductionLine(),
                                               Quantity          := nopcell.Quantity(),
                                               ShiftPatternEnd   := nopcell.ShiftPatternEnd(),
                                               ShiftPatternName  := nopcell.ShiftPatternName(),
                                               ShiftPatternStart := nopcell.ShiftPatternStart(),
                                               StartDate         := nopcell.StartDate()
                                              );
    }
  *]
}