lihongji
2024-10-16 13275e4c638e430100ab4bf4cb49dbee6ba06fc0
包装计划优化
已修改2个文件
已添加1个文件
50 ■■■■■ 文件已修改
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_ddslFactorySelection_OnCreated.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -22,15 +22,8 @@
      // åˆ›å»ºè¡Œ
      ppr := select( macroPlan, PackagingPlanRow, tempPPR, tempPPR.ProductID() = pisp.ProductID() and tempPPR.Factory() = factory );
      if ( isnull( ppr ) ) {
        ppr := macroPlan.PackagingPlanRow( relnew, ProductID := pisp.ProductID(), StockingPointID := pisp.StockingPointID(), Factory := factory, Category := guard( pisp.Product_MP().ParentID(), "" ) );
        ppr := macroPlan.PackagingPlanRow( relnew, ProductID := pisp.ProductID(), Factory := factory, Category := guard( pisp.Product_MP().ParentID(), "" ) );
      }
      // å‡ºå‘地库存点Trip
      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().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() ) {
@@ -44,24 +37,32 @@
        cell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc );
        if ( isnull( cell ) ) {
          cell := ppr.PackagingPlanCell( relnew );
          cell.NetDemand( pispipl.DependentDemandAndSalesDemandQuantity() - pispipl.NewSupplyQuantity() );
          cell.NetDemand( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() );
          cell.EndingInventory( pispipl.InventoryLevelEnd() );
          cell.PackagingPlanColumn( relset, ppc );
        } else {
          cell.NetDemand( cell.NetDemand() + ( pispipl.DependentDemandAndSalesDemandQuantity() - pispipl.NewSupplyQuantity() ) );
          cell.NetDemand( cell.NetDemand() + ( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() ) );
          cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
        }
        
        // è®¾ç½®è°ƒå‡º
        outs := selectset( originTrips, Elements, tempT, tempT.Departure().Date() = pispipl.Start().Date() );
        traverse ( outs, Elements.ProductInTrip, outPIT, outPIT.ProductID() = pisp.ProductID() ) {
          cell.Out( cell.Out() + outPIT.Quantity() );
        traverse ( pispipl, AsDeparturePISPIP, pit,
                   pit.Quantity()                > 0                                                                         and
                   pit.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( factoryAbbreviation )      and
                   TransferPlanRow::IdentifyTheFactory( pit.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ) <> TransferPlanRow::IdentifyTheFactory( pit.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() )
                  )
        {
          cell.Out( cell.Out() + pit.Quantity() );
        }
        
        // è®¾ç½®è°ƒè¿›
        transferIns := selectset( destinationTrips, Elements, tempT, tempT.Arrival().Date() = pispipl.Start().Date() );
        traverse ( transferIns, Elements.ProductInTrip, tiPIT, tiPIT.ProductID() = pisp.ProductID() ) {
          cell.TransferIn( cell.TransferIn() + tiPIT.Quantity() );
        traverse ( pispipl, AsArrivalPISPIP, pit,
                   pit.Quantity()              > 0                                                                           and
                   pit.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( factoryAbbreviation ) and
                   TransferPlanRow::IdentifyTheFactory( pit.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ) <> TransferPlanRow::IdentifyTheFactory( pit.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() )
                  )
        {
          cell.TransferIn( cell.TransferIn() + pit.Quantity() );
        }
        
        // é•¿æ˜¥å·¥åŽ‚ç‰¹æ®Šæƒ…å†µè®¾ç½®åŒ…è£…åº“å­˜å’ŒéžåŒ…è£…åº“å­˜
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def
@@ -61,7 +61,6 @@
      BaseType: 'WebDropDownStringList'
      Properties:
      [
        InitialValue: '大连工厂'
        Label: '工厂'
        Sorting: 'none'
        Strings: '大连工厂;长春工厂'
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_ddslFactorySelection_OnCreated.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: pHeader/ddslFactorySelection
Response OnCreated () id:Response_pHeader_ddslFactorySelection_OnCreated
{
  #keys: '[413988.1.1602019]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnCreated'
  QuillAction
  {
    Body:
    [*
      this.Text( dhSelectedFactory.Data() );
    *]
    GroupServerCalls: false
  }
}