lazhen
2024-10-08 c75cd6f6eb1e06a27e28c26ca9df0324b7ed675f
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
Method IsRoundingOrZeroFilling4 (
  MacroPlan macroPlan,
  Unit unit
)
{
  Description: '车道整班'
  TextBody:
  [*
    traverse ( unit, Lane.LaneLeg.Trip, t ) {
      traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0 ) {
        info( pit.Product_MP().ParentID() );
        // 获取产品lotsize倍数
        lotsize := 1;
        if ( pit.Product_MP().ParentID().Regex( "ZKG" ) ) {
          lotsize := macroPlan.CylinderBlock();
        } else if ( pit.Product_MP().ParentID().Regex( "ZKM" ) ) {
          lotsize := macroPlan.CylinderHead();
        } else if ( pit.Product_MP().ParentID().Regex( "PL" ) ) {
          lotsize := macroPlan.ConnectingRod();
        } else if ( pit.Product_MP().ParentID().Regex( "KW" ) ) {
          lotsize := macroPlan.Crankshaft();
        } else if ( pit.Product_MP().ParentID().Regex( "AGW" ) ) {
          lotsize := macroPlan.BalanceAxis();
        }
        
        if ( lotsize > 1 ) {
          debuginfo( "产品ID:", pit.ProductID(), "    产品数量:", pit.Quantity(), "    lotsize:", lotsize );
          quantityToBeSupplemented := lotsize - ( pit.Quantity() mod lotsize );
          pit.Update( pit.Quantity() + quantityToBeSupplemented, true );
        }
      }
    }
  *]
}