admin
2024-10-10 8870e507249378c76b63364603969ed6e706e1b6
包装计划优化
已添加2个文件
已修改4个文件
60 ■■■■ 文件已修改
_Main/BL/Type_PackagingPlanCell/Attribute_CC_PackagingInventory.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/Attribute_CC_UnpackagedInventory.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/Function_CalcUnpackagedInventory.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_TransferPlanCell/StaticMethod_GenerateReport.qbl 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/Attribute_CC_PackagingInventory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute CC_PackagingInventory
{
  #keys: '3[415754.0.351286657][415754.0.351286656][415754.0.351286658]'
  Description: '长春工厂包装库存'
  ValueType: Real
}
_Main/BL/Type_PackagingPlanCell/Attribute_CC_UnpackagedInventory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute CC_UnpackagedInventory
{
  #keys: '3[415754.0.351197962][415754.0.351197961][415754.0.351197963]'
  Description: '长春工厂非包装库存'
  ValueType: Real
}
_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
@@ -6,11 +6,13 @@
  [*
    // lihongji Jul-26-2024 (created)
    
    value := this.InitialPackagingInventory() + guard( this.Previous().PackagingInventory()                 +
                                                       guard( this.Previous().Package(), 0.0 )              -
    value := ifexpr( this.PackagingPlanRow().Factory() = "长春工厂", this.CC_PackagingInventory(),
                     this.InitialPackagingInventory() + guard( this.Previous().PackagingInventory()                 +
                                                       guard( this.Package(), 0.0 )                         -
                                                       ifexpr( this.TransferIn() > 0.0, 0, this.Unpacking() ), 
                                                       0.0 )
                                              - this.Out();
                                              - this.Out()
                    );
    
    this.PackagingInventory( value );
  *]
_Main/BL/Type_PackagingPlanCell/Function_CalcUnpackagedInventory.qbl
@@ -6,7 +6,8 @@
  [*
    // lihongji Jul-24-2024 (created)
    
    value := guard( this.EndingInventory() - this.PackagingInventory(), 0.0 );
    value := ifexpr( this.PackagingPlanRow().Factory() = "长春工厂", this.UnpackagedInventory(),
                     guard( this.EndingInventory() - this.PackagingInventory(), 0.0 ) );
    
    this.UnpackagedInventory( value );
  *]
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -17,6 +17,7 @@
               ( pisp.StockingPointID().Regex( "CC" ) or pisp.StockingPointID().Regex( "DL" ) or pisp.StockingPointID().Regex( "大连" ) or pisp.StockingPointID().Regex( "长春" ) ) ) {
      // å½“前pisp所处地点
      factory := ifexpr( pisp.StockingPointID().Regex( "CC" ) or pisp.StockingPointID().Regex( "长春" ), "长春工厂", "大连工厂" );
      factoryAbbreviation := ifexpr( pisp.StockingPointID().Regex( "CC" ) or pisp.StockingPointID().Regex( "长春" ), "CC", "DL" );
      
      // åˆ›å»ºè¡Œ
      ppr := select( macroPlan, PackagingPlanRow, tempPPR, tempPPR.ProductID() = pisp.ProductID() and tempPPR.Factory() = factory );
@@ -25,11 +26,13 @@
      }
      
      // å‡ºå‘地库存点Trip
      originTrips      := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID() = pisp.StockingPointID() );
      originTrips      := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( factoryAbbreviation )      and
                                     TransferPlanRow::IdentifyTheFactory( tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ) <> TransferPlanRow::IdentifyTheFactory( tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ) );
      // ç›®çš„地库存点Trip
      destinationTrips := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = pisp.StockingPointID() );
      destinationTrips := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( factoryAbbreviation ) and
                                     TransferPlanRow::IdentifyTheFactory( tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ) <> TransferPlanRow::IdentifyTheFactory( tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ) );
      
      // åˆ›å»ºå•元格
      // å¾ªçޝpispippl
      traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispipl, not pispipl.IsPeriodFrozen() ) {
        // åˆ›å»ºåˆ—
        ppc := select( macroPlan, PackagingPlanColumn, tempPPC, tempPPC.StartDate() = pispipl.Start().Date() );
@@ -51,14 +54,23 @@
        
        // è®¾ç½®è°ƒå‡º
        outs := selectset( originTrips, Elements, tempT, tempT.Departure().Date() = pispipl.Start().Date() );
        traverse ( outs, Elements, out ) {
          cell.Out( cell.Out() + out.Quantity() );
        traverse ( outs, Elements.ProductInTrip, outPIT, outPIT.ProductID() = pisp.ProductID() ) {
          cell.Out( cell.Out() + outPIT.Quantity() );
        }
        
        // è®¾ç½®è°ƒè¿›
        transferIns := selectset( destinationTrips, Elements, tempT, tempT.Arrival().Date() = pispipl.Start().Date() );
        traverse ( transferIns, Elements, ti ) {
          cell.TransferIn( cell.TransferIn() + ti.Quantity() );
        traverse ( transferIns, Elements.ProductInTrip, tiPIT, tiPIT.ProductID() = pisp.ProductID() ) {
          cell.TransferIn( cell.TransferIn() + tiPIT.Quantity() );
        }
        // é•¿æ˜¥å·¥åŽ‚ç‰¹æ®Šæƒ…å†µè®¾ç½®åŒ…è£…åº“å­˜å’ŒéžåŒ…è£…åº“å­˜
        if ( factory = "长春工厂" ) {
          if ( pisp.StockingPointID().Regex( "外租库" ) ) {
            cell.CC_PackagingInventory( pispipl.InventoryLevelEnd() );
          } else if ( pisp.StockingPointID().Regex( "线边库" ) ) {
            cell.CC_UnpackagedInventory( pispipl.InventoryLevelEnd() );
          }
        }
        
        // è®¾ç½®å‰ä¸€å¤©åº“å­˜
_Main/BL/Type_TransferPlanCell/StaticMethod_GenerateReport.qbl
@@ -14,7 +14,12 @@
    // ç”Ÿæˆè°ƒæ‹¨è®¡åˆ’
    traverse ( macroPlan, Unit, u, u.HasCapacityTypeTransportQuantity() ) {
      traverse ( u, Lane.LaneLeg.Trip, t ) {
        traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0 and exists( pit.Product_MP(), AllParent.AsParent, tempP, tempP.ID() = "机加件" ) ) {
        originFactory      := TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() );      // èµ·å§‹å·¥åŽ‚
        destinationFactory := TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ); // ç›®æ ‡å·¥åŽ‚
        traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0                                           and // æ•°é‡å¤§äºŽ0
                   exists( pit.Product_MP(), AllParent.AsParent, tempP, tempP.ID() = "机加件" )          and // åªå–机加件
                   originFactory                                                   <> destinationFactory     // èµ·å§‹å·¥åŽ‚ä¸èƒ½å’Œç›®æ ‡å·¥åŽ‚ä¸€è‡´
                  ) {
          // æ‰¾è¡Œ
          tpr := TransferPlanRow::FindTransferPlanRowTypeIndex( TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ),
                                                                TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ),