lihongji
2024-07-09 5ed2c2076e3b8a907ac2d271ea627cc9f9c9b3f4
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 RefreshData (
  MacroPlan macroPlan,
  OfflinePlanTable opt
)
{
  TextBody:
  [*
    macroPlan.AssemblyOnlinePlanRow( relflush );
    macroPlan.AssemblyOnlinePlanColumn( relflush );
    
    // 找装配线行
    oprs := selectsortedset( opt, OfflinePlanRow, tempOPR, tempOPR.ProductionLine() = "Spider Assy Line 1", tempOPR.ProductionLine(), tempOPR.ProductID(), tempOPR.Type() );
    opcs := selectsortedset( opt, OfflinePlanColumn, tempOPC, true, tempOPC.ColumnDate() );
    
    // 生成表格
    traverse ( opcs, Elements, opc ) {
      aopc := macroPlan.AssemblyOnlinePlanColumn( relnew, ColumnDate := opc.ColumnDate(), ColumnIndex := opc.ColumnIndex() );
      traverse ( oprs, Elements, opr ) {
        aopr := select( macroPlan, AssemblyOnlinePlanRow, tempAOPR, tempAOPR.ProductID() = opr.ProductID() and tempAOPR.ProductionLine() = opr.ProductionLine() and tempAOPR.Type() = opr.Type() );
        if ( isnull( aopr ) ) {
          aopr := macroPlan.AssemblyOnlinePlanRow( relnew, ProductID := opr.ProductID(), ProductionLine := opr.ProductionLine(), Type := opr.Type() );
        }
        
        cellOPC := select( opr, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanColumn() = opc );
        if ( not isnull( cellOPC ) ) {
          cellAOPC := aopc.AssemblyOnlinePlanCell( relnew, Value := cellOPC.Value() );
          cellAOPC.AssemblyOnlinePlanRow( relset, aopr );
        }
      }
    }
    
    // 处理日历事件
  *]
}