lazhen
2024-10-31 fa55a671f97d901ab03bc7a258cf3da8c4f9c0de
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
已重命名1个文件
已修改4个文件
已添加1个文件
92 ■■■■ 文件已修改
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_DeductionOfReplacementLoss.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesCC.qbl 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesDL.qbl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl
@@ -94,11 +94,11 @@
        
        // å¤–租库运输费用:发动机运输量 / åŒ…装容量 / è£…载容量(向上取整) * æ–™æž¶è¿è¾“单价
        transportationQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, 
                                       tempPIT.Product_MP().Generation()                                                =  ccerr.Generation() and
                                       tempPIT.Product_MP().MQBMLB()                                                    =  ccerr.MLB_MQB()    and
                                       tempPIT.Trip().Departure().Date()                                                >= ccerc.StartDate()  and
                                       tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth and
                                       tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "CC åŽ‚å†…åº“"         and
                                       tempPIT.Product_MP().Generation()                                                = ccerr.Generation()        and
                                       tempPIT.Product_MP().MQBMLB()                                                    = ccerr.MLB_MQB()           and
                                       tempPIT.Trip().Departure().Date().Year()                                         = ccerc.StartDate().Year()  and
                                       tempPIT.Trip().Departure().Date().Month()                                        = ccerc.StartDate().Month() and
                                       tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "CC åŽ‚å†…åº“"               and
                                       tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "长春外租库",
                                       tempPIT.Quantity()
                                      );
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -60,7 +60,9 @@
                           tempMRTCell.MaterialRackTotalRow().Generation() = dlerr.Generation()        and
                           tempMRTCell.MaterialRackTotalRow().MLB_MQB()    = dlerr.MLB_MQB()           and
                           tempMRTCell.MaterialRackColumn().Month()        = dlerc.StartDate().Month() );
        cell.TotalQuantityOfMaterialRacks( mrtcell.Quantity() );
        if ( dlerr.Generation() = "350bar" and dlerr.MLB_MQB() = "MQB" ) {
          cell.TotalQuantityOfMaterialRacks( mrtcell.Quantity() );
        }
       
        // å¤§è¿žå¤–租库空料架数量:【350bar MQB料架总数量 - æ‰€æœ‰350bar MQB总库存 / åŒ…装容量 - å®¢æˆ·åº“料架数量】* å¤§è¿žå¤–租库空料架比例
        plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
@@ -84,8 +86,8 @@
                                        tempF.StartDate().Year()        = dlerc.StartDate().Year()  and
                                        tempF.StartDate().Month()       = dlerc.StartDate().Month(),
                                        tempF.FulfilledQuantity() );
        info( "时间:", dlerc.StartDate().Format( "Y-M2-D2" ), "    å…¥åº“数量:", transportationQuantity1, "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ),
              "    å…¥åº“单价:", guard( lcmrCC.WarehousingPrice(), 0 ) ); // æµ‹è¯•输出
    //    info( "时间:", dlerc.StartDate().Format( "Y-M2-D2" ), "    å…¥åº“数量:", transportationQuantity1, "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ),
    //          "    å…¥åº“单价:", guard( lcmrCC.WarehousingPrice(), 0 ) ); // æµ‹è¯•输出
        cell.CCStorageFeesForRentedWarehouses( [Number] ( guard( transportationQuantity1 / lce.PackagingCapacity(), 0 ) * lcmrCC.WarehousingPrice() ) );
        
        // CC外租库出库费用:发动机销量 / åŒ…装容量(向上取整)* æ–™æž¶å‡ºåº“单价
@@ -96,14 +98,15 @@
        
        // CC长途运输费用:调拨数量 / åŒ…装容量 / è£…载容量 * æ–™æž¶è¿è¾“单价
        transportationQuantity2 := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, 
                                        tempPIT.Product_MP().Generation()                                                =  dlerr.Generation()      and
                                        tempPIT.Product_MP().MQBMLB()                                                    =  dlerr.MLB_MQB()         and
                                        tempPIT.Trip().Departure().Date()                                                >= dlerc.StartDate()       and
                                        tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth      and
                                        tempPIT.Product_MP().Generation()                                                =  dlerr.Generation()       and
                                        tempPIT.Product_MP().MQBMLB()                                                    =  dlerr.MLB_MQB()          and
                                        tempPIT.Trip().Departure().Date().Year()                                         = dlerc.StartDate().Year()  and
                                        tempPIT.Trip().Departure().Date().Month()                                        = dlerc.StartDate().Month() and
                                        tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "大连厂内库"              and
                                        tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "大连发动机的长春外租库",
                                        tempPIT.Quantity()
                                       );
    //    info( "数量:", transportationQuantity2 );
        cell.CCLineHaulCost( [Number] ( guard( transportationQuantity2 / lce.PackagingCapacity() / lct1.LoadingCapacity(), 0 ) * guard( lct1.TransportPrice(), 1 ) ) );
        
        // CC短途运输费用:调拨数量 / åŒ…装容量 / è£…载容量 * æ–™æž¶è¿è¾“单价
@@ -133,7 +136,14 @@
        cell.DLOutboundExpensesForRentedWarehouses( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.OutboundPrice(), 1 ) ) );
        
        // DL外租库运输费用:发动机运输量 / åŒ…装容量 / è£…载容量(向上取整)* æ–™æž¶è¿è¾“单价
        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( inventoryQuantity / lce.PackagingCapacity() / lct2.LoadingCapacity(), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
        outboundQuantity1 := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), tempPISPIPPL,
                                 tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().Generation() = dlerr.Generation()  and
                                 tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().MQBMLB()     = dlerr.MLB_MQB()     and
                                 tempPISPIPPL.ProductInStockingPoint_MP().StockingPointID()         = "大连外租库"        and
                                 tempPISPIPPL.Start().Date()                                        >= dlerc.StartDate()  and
                                 tempPISPIPPL.End().Date()                                          <= lastDayOfThisMonth,
                                 tempPISPIPPL.NewSupplyQuantity() );
        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( outboundQuantity1 / lce.PackagingCapacity() / lct2.LoadingCapacity(), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
        
        // å¤§è¿žå¤–租库仓储费用:【350bar MQB料架总数量-所有350bar MQB总库存/包装容量-客户库料架数量】*大连外租库空料架比例
        // DL外租库仓储费用:料架总数量 - å‘动机库存 / åŒ…装容量(向上取整)* ç©ºæ–™æž¶ä»“储单价
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_DeductionOfReplacementLoss.qbl
@@ -14,7 +14,7 @@
    allProductionLines := selectuniquevalues( newNOPT, NewOfflinePlanRow, tempNOPR, true, tempNOPR.ProductionLine() );
    
    traverse ( allProductionLines, Elements, pl
    //           , pl = "eMotor Assy (France)"
    //           , pl = "CC MoMo"
             ) 
    {
      // ä¸‹çº¿è®¡åˆ’当前产线下的行
@@ -24,11 +24,12 @@
      preNOPCell := null( NewOfflinePlanCell );
      
      traverse ( newNOPT, NewOfflinePlanColumn, nopc
    //             , nopc.StartDate() >= macroPlan.StartOfPlanning().Date() and nopc.StartDate() <= Date::Construct( 2024, 4, 17 ) // æµ‹è¯•时可以过滤时间
    //             , nopc.StartDate() >= macroPlan.StartOfPlanning().Date() and nopc.StartDate() <= Date::Construct( 2025, 1, 16 ) // æµ‹è¯•时可以过滤时间
               ) 
      {         
        for ( i := 1; i < 10; i++ ) {
          nopcell := select( noprs, Elements.NewOfflinePlanCell, tempNOPC, tempNOPC.NewOfflinePlanColumn() = nopc and tempNOPC.OrderNr() = i );
          nopcell := select( noprs, Elements.NewOfflinePlanCell, tempNOPC, tempNOPC.NewOfflinePlanColumn() = nopc and tempNOPC.OrderNr() = i and tempNOPC.Order() <> "" );
          // æ¢åž‹æŸå¤±å‚æ•°
          cls     := select( macroPlan, ChangeLossSetting, tempCLS, 
                             tempCLS.ProductFirst().ID()  = guard( preNOPCell.NewOfflinePlanRow().ProductID(), "" ) and
@@ -39,10 +40,12 @@
    
          // æ‰£å‡æ¢åž‹æŸå¤±
          if ( not isnull( preNOPCell ) and not isnull( nopcell ) and not isnull( cls ) ) {
            preNOPCell.Quantity( preNOPCell.Quantity() - cls.ChangeLossNumber() );
    //        info( "当前产品序号:", nopcell.OrderNr(),  "    ", nopcell.Order(), "    ", i );
    //        info( "当前列时间:", nopc.StartDate().Format( "Y-M2-D2" ), 
    //              "    ä¸Šä¸€ä¸ªäº§å“å½“前序号:", preNOPCell.Order(), "    ä¸Šä¸€ä¸ªäº§å“æ•°é‡ï¼š", preNOPCell.Quantity(), "    ä¸Šä¸€ä¸ªäº§å“åï¼š", preNOPCell.NewOfflinePlanRow().ProductID(),
    //              "    å½“前产品序号:"      , nopcell.Order()   , "    å½“前产品数量:"     , nopcell.Quantity(), "    å½“前产品名:"  , nopcell.NewOfflinePlanRow().ProductID() );
    //              "    å½“前产品序号:"      , nopcell.Order()   , "    å½“前产品数量:"     , nopcell.Quantity(), "    å½“前产品名:"  , nopcell.NewOfflinePlanRow().ProductID(),
    //              "    éœ€è¦æ‰£å‡çš„æ•°é‡ï¼š", cls.ChangeLossNumber() );
            preNOPCell.Quantity( preNOPCell.Quantity() - cls.ChangeLossNumber() );
          }
          
          // è®¾ç½®ä¸Šä¸€ä¸ªç”Ÿäº§çš„产品Cell
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -106,8 +106,10 @@
    PackagingPlanCell::CalculationPackagingPlanProperties();
    Transaction::Transaction().Propagate( relation( PackagingPlanCell, Next ) );
    
    // è®¾ç½®åŒ…装&拆包-数量
    PackagingPlanCell::SetPackagingAndUnpackingValues( macroPlan );
    // è®¾ç½®åŒ…装&拆包-数量(大连工厂)
    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 )*/ ) {
    //    // è®¾ç½®åŒ…装数量
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesCC.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SetPackagingAndUnpackingValuesCC (
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "长春工厂" /*and ppr.ProductID() = "06K103011CM"*/ ) {
      traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) {
        unpackagedQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT,
                                   tempPIT.ProductID()          = ppcell.PackagingPlanRow().ProductID()                               and
                                   tempPIT.Trip().Departure().Date() = ppcell.StartDate()                                             and
                                   tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "外租库" )      and
                                   tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "线边库" ),
                                   tempPIT.Quantity()
                                  );
        ppcell.Unpacking( unpackagedQuantity );
        packagedQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT,
                                 tempPIT.ProductID()          = ppcell.PackagingPlanRow().ProductID()                               and
                                 tempPIT.Trip().Departure().Date() = ppcell.StartDate()                                             and
                                 tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "线边库" )      and
                                 tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "外租库" ),
                                 tempPIT.Quantity()
                                );
        ppcell.Package( packagedQuantity );
      }
    }
  *]
}
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesDL.qbl
ÎļþÃû´Ó _Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl ÐÞ¸Ä
@@ -1,6 +1,6 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SetPackagingAndUnpackingValues (
StaticMethod SetPackagingAndUnpackingValuesDL (
  MacroPlan macroPlan
)
{
@@ -10,7 +10,7 @@
    plannedStartDate := macroPlan.StartOfPlanning().Date();
    
    // è®¾ç½®åŒ…装值(符合lotsize和一日最大包装量)
    traverse ( macroPlan, PackagingPlanRow, ppr/*, ppr.Factory() = "大连工厂" and ppr.ProductID() = "06K103011CM"*/ ) {
    traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "大连工厂" /*and ppr.ProductID() = "06K103011CM"*/ ) {
      traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) {
        // Product_MP
        pmp                     := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() );
@@ -93,7 +93,7 @@
    }
    
    // è®¾ç½®æ‹†åŒ…值(符合lotsize和一日最大包装量)
    traverse ( macroPlan, PackagingPlanRow, ppr/*, ppr.Factory() = "大连工厂" and ppr.ProductID() = "06K103011CM"*/ ) {
    traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "大连工厂" /*and ppr.ProductID() = "06K103011CM"*/ ) {
      traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) {
        // Product_MP
        pmp                     := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() );