陈清红
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
57
58
59
60
61
62
63
64
Quintiq file version 2.0
#parent: #root
StaticMethod GenerateReport (
  MacroPlan macroPlan,
  InterfaceDataset interfaceDataset
)
{
  TextBody:
  [*
    // 创建数据
    PackagingPlanCell::CreateData( macroPlan );
    
    // 设置起始包装库存
    PackagingPlanCell::SetInitialPackagingInventory( macroPlan, interfaceDataset );
    
    // 设置包装&拆包-数量(大连工厂)
    PackagingPlanCell::SetPackagingAndUnpackingValuesDL( macroPlan );
    
    // 设置包装&拆包-数量(长春工厂)
    PackagingPlanCell::SetPackagingAndUnpackingValuesCC( macroPlan );
    
    //traverse ( macroPlan, PackagingPlanRow, ppr, ( ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Bosch" ) or ( ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Components (Spain)" ) ) {
    //  traverse ( ppr, PackagingPlanCell, ppc/*, ppc.StartDate() = Date::Construct( 2020, 4, 1 )*/ ) {
    //    // 设置包装数量
    //    if ( ppc.PackagingInventory() < ppc.Out() ) { // 包装库存是否小于调出
    //      prePPC                := ppc.Previous();
    //      needPackagingQuantity := ppc.Out() - prePPC.PackagingInventory();
    //      while ( not isnull( prePPC ) and needPackagingQuantity > 0.0 ) {
    //        // 获取包装lotsize
    //        ppls                   := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() =  ppc.PackagingPlanRow().Factory()    and 
    //                                                                                    tempPPLS.ProductID() = ppc.PackagingPlanRow().ProductID() );
    //        
    //        // 获取最大包装数量
    //        maxPackageReflection   := Reflection::FindAttribute( "PackagingPlanCapability", ppc.PackagingPlanRow().FactoryAbbreviation() + "_" + ppc.PackagingPlanRow().Category() + "_Package" );
    ////        maxPackageQuantity     := maxPackageReflection.GetNumber( macroPlan.PackagingPlanCapability() ); // 此处需要修改
    //        maxPackageQuantity     := 100000;
    //        
    //        // 获取最终包装数量
    //        finalPackagingQuantity := minvalue( ceil( needPackagingQuantity / ppls.LotSize() ), ceil( ( maxPackageQuantity - prePPC.Package() ) / ppls.LotSize() ) ) * ppls.LotSize();
    //        needPackagingQuantity  := needPackagingQuantity - finalPackagingQuantity;
    //        
    //        // 设置包装值
    //        prePPC.Package( prePPC.Package() + finalPackagingQuantity );
    //        
    //        //debuginfo( "需要包装数量:", needPackagingQuantity, "    lotsize: ", ppls.LotSize(), "    最大包装数量:", maxPackageQuantity, "    最终补的数量:", finalPackagingQuantity );
    //        PackagingPlanCell::CalculationPackagingPlanProperties();
    //      
    //        prePPC := prePPC.Previous();
    //      }
    //    }
    //    
    //    // 设置拆包数量
    //    if ( ppc.TransferIn() > 0.0 ) { // 有调入数量
    //      // 获取包装lotsize
    //      ppls                 := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() =  ppc.PackagingPlanRow().Factory()    and 
    //                                                                                 tempPPLS.ProductID() = ppc.PackagingPlanRow().ProductID() );
    //    
    //      // 设置拆包值
    //      ppc.Unpacking( ppc.TransferIn() );
    //    }
    //  }
    //}
  *]
}