admin
2024-10-17 d060843d402641d8cdeadad086ed5c867de7f2ea
包装计划最小最大容量优化
已修改4个文件
已添加4个文件
已删除1个文件
266 ■■■■■ 文件已修改
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl 175 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanNewCapability/Attribute_Factory.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanNewCapability/Attribute_ProductID.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Component_pnlContent.def 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlActions_btnOk_OnClick.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlContent_ddslProductID_OnCreated.def 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlContent_ddslProductionLine_OnCreated.def 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanCapability/Component_lstContent.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -6,95 +6,96 @@
{
  TextBody:
  [*
    macroPlan.PackagingPlanRow( relflush );
    macroPlan.PackagingPlanColumn( relflush );
    // åˆ›å»ºè®¡åˆ’前一天列
    planPre     := macroPlan.PackagingPlanColumn( relnew, StartDate := macroPlan.StartOfPlanning().Date() - 1 );
    // ç”ŸæˆæŠ¥è¡¨
    traverse ( macroPlan, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() and
               ( 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 );
      if ( isnull( ppr ) ) {
        ppr := macroPlan.PackagingPlanRow( relnew, ProductID := pisp.ProductID(), Factory := factory, Category := guard( pisp.Product_MP().ParentID(), "" ) );
      }
      // å¾ªçޝpispippl
      traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispipl, not pispipl.IsPeriodFrozen() ) {
        // åˆ›å»ºåˆ—
        ppc := select( macroPlan, PackagingPlanColumn, tempPPC, tempPPC.StartDate() = pispipl.Start().Date() );
        if ( isnull( ppc ) ) {
          ppc := macroPlan.PackagingPlanColumn( relnew, StartDate := pispipl.Start().Date() );
        }
        // åˆ›å»ºå•元格
        cell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc );
        if ( isnull( cell ) ) {
          cell := ppr.PackagingPlanCell( relnew );
          cell.NetDemand( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() );
          cell.EndingInventory( pispipl.InventoryLevelEnd() );
          cell.PackagingPlanColumn( relset, ppc );
        } else {
          cell.NetDemand( cell.NetDemand() + ( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() ) );
          cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
        }
        // è®¾ç½®è°ƒå‡º
        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() );
        }
        // è®¾ç½®è°ƒè¿›
        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() );
        }
        // é•¿æ˜¥å·¥åŽ‚ç‰¹æ®Šæƒ…å†µè®¾ç½®åŒ…è£…åº“å­˜å’ŒéžåŒ…è£…åº“å­˜
        if ( factory = "长春工厂" ) {
          if ( pisp.StockingPointID().Regex( "外租库" ) ) {
            cell.CC_PackagingInventory( pispipl.InventoryLevelEnd() );
          } else if ( pisp.StockingPointID().Regex( "线边库" ) ) {
            cell.CC_UnpackagedInventory( pispipl.InventoryLevelEnd() );
          }
        }
        // è®¾ç½®å‰ä¸€å¤©åº“å­˜
        if ( pispipl.Start().Date() = macroPlan.StartOfPlanning().Date() ) {
          prePISPIPL  := pispipl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf ); // å‰ä¸€ä¸ªpispippl
          // åˆ›å»ºè®¡åˆ’前一天格子
          preCell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = planPre );
          if ( isnull( preCell ) ) {
            preCell := ppr.PackagingPlanCell( relnew );
            preCell.EndingInventory( prePISPIPL.InventoryLevelEnd() );
            preCell.PackagingPlanColumn( relset, planPre );
          } else {
            preCell.EndingInventory( preCell.EndingInventory() + prePISPIPL.InventoryLevelEnd() );
          }
        }
      }
    }
    Transaction::Transaction().Propagate( attribute( PackagingPlanRow, FactoryAbbreviation ) );
    PackagingPlanCell::CalculationPackagingPlanProperties();
    Transaction::Transaction().Propagate( relation( PackagingPlanCell, Next ) );
    //macroPlan.PackagingPlanRow( relflush );
    //macroPlan.PackagingPlanColumn( relflush );
    //
    //// åˆ›å»ºè®¡åˆ’前一天列
    //planPre     := macroPlan.PackagingPlanColumn( relnew, StartDate := macroPlan.StartOfPlanning().Date() - 1 );
    //
    //// ç”ŸæˆæŠ¥è¡¨
    //traverse ( macroPlan, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() and
    //           ( 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 );
    //  if ( isnull( ppr ) ) {
    //    ppr := macroPlan.PackagingPlanRow( relnew, ProductID := pisp.ProductID(), Factory := factory, Category := guard( pisp.Product_MP().ParentID(), "" ) );
    //  }
    //
    //  // å¾ªçޝpispippl
    //  traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispipl, not pispipl.IsPeriodFrozen() ) {
    //    // åˆ›å»ºåˆ—
    //    ppc := select( macroPlan, PackagingPlanColumn, tempPPC, tempPPC.StartDate() = pispipl.Start().Date() );
    //    if ( isnull( ppc ) ) {
    //      ppc := macroPlan.PackagingPlanColumn( relnew, StartDate := pispipl.Start().Date() );
    //    }
    //
    //    // åˆ›å»ºå•元格
    //    cell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc );
    //    if ( isnull( cell ) ) {
    //      cell := ppr.PackagingPlanCell( relnew );
    //      cell.NetDemand( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() );
    //      cell.EndingInventory( pispipl.InventoryLevelEnd() );
    //      cell.PackagingPlanColumn( relset, ppc );
    //    } else {
    //      cell.NetDemand( cell.NetDemand() + ( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() ) );
    //      cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
    //    }
    //
    //    // è®¾ç½®è°ƒå‡º
    //    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() );
    //    }
    //
    //    // è®¾ç½®è°ƒè¿›
    //    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() );
    //    }
    //
    //    // é•¿æ˜¥å·¥åŽ‚ç‰¹æ®Šæƒ…å†µè®¾ç½®åŒ…è£…åº“å­˜å’ŒéžåŒ…è£…åº“å­˜
    //    if ( factory = "长春工厂" ) {
    //      if ( pisp.StockingPointID().Regex( "外租库" ) ) {
    //        cell.CC_PackagingInventory( pispipl.InventoryLevelEnd() );
    //      } else if ( pisp.StockingPointID().Regex( "线边库" ) ) {
    //        cell.CC_UnpackagedInventory( pispipl.InventoryLevelEnd() );
    //      }
    //    }
    //
    //    // è®¾ç½®å‰ä¸€å¤©åº“å­˜
    //    if ( pispipl.Start().Date() = macroPlan.StartOfPlanning().Date() ) {
    //      prePISPIPL  := pispipl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf ); // å‰ä¸€ä¸ªpispippl
    //      // åˆ›å»ºè®¡åˆ’前一天格子
    //      preCell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = planPre );
    //      if ( isnull( preCell ) ) {
    //        preCell := ppr.PackagingPlanCell( relnew );
    //        preCell.EndingInventory( prePISPIPL.InventoryLevelEnd() );
    //        preCell.PackagingPlanColumn( relset, planPre );
    //      } else {
    //        preCell.EndingInventory( preCell.EndingInventory() + prePISPIPL.InventoryLevelEnd() );
    //      }
    //    }
    //  }
    //}
    //
    //Transaction::Transaction().Propagate( attribute( PackagingPlanRow, FactoryAbbreviation ) );
    //PackagingPlanCell::CalculationPackagingPlanProperties();
    //Transaction::Transaction().Propagate( relation( PackagingPlanCell, Next ) );
    
    // è®¾ç½®åŒ…装&拆包-数量
    PackagingPlanCell::SetPackagingAndUnpackingValues( 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_SetPackagingAndUnpackingValues.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SetPackagingAndUnpackingValues (
  MacroPlan macroPlan
)
{
}
_Main/BL/Type_PackagingPlanNewCapability/Attribute_Factory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute Factory
{
  #keys: '3[415754.0.412692725][415754.0.412692724][415754.0.412692726]'
  Description: '工厂'
  ValueType: String
}
_Main/BL/Type_PackagingPlanNewCapability/Attribute_ProductID.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute ProductID
{
  #keys: '3[415754.0.412692742][415754.0.412692741][415754.0.412692743]'
  Description: '产品ID'
  ValueType: String
}
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Component_pnlContent.def
@@ -5,14 +5,15 @@
  BaseType: 'WebPanel'
  Children:
  [
    Component ddslProductionLine
    Component ddslFactory
    {
      #keys: '[413988.0.1596148502]'
      BaseType: 'WebDropDownStringList'
      Properties:
      [
        DataBinding: 'DataHolderDialogData.Data.ProductionLine'
        DataBinding: 'DataHolderDialogData.Data.Factory'
        Label: 'Production line'
        Strings: '大连工厂;长春工厂'
        Taborder: 0
      ]
    }
@@ -24,7 +25,7 @@
      [
        DataBinding: 'DataHolderDialogData.Data.MaximumDailyPackagingQuantity'
        Label: 'Maximum daily packaging quantity'
        Taborder: 1
        Taborder: 2
      ]
    }
    Component npMaximumDailyUnpackingQuantity
@@ -35,7 +36,18 @@
      [
        DataBinding: 'DataHolderDialogData.Data.MaximumDailyUnpackingQuantity'
        Label: 'Maximum daily unpacking quantity'
        Taborder: 2
        Taborder: 3
      ]
    }
    Component ddslProductID
    {
      #keys: '[415754.0.415211304]'
      BaseType: 'WebDropDownStringList'
      Properties:
      [
        DataBinding: 'DataHolderDialogData.Data.ProductID'
        Label: 'Product ID'
        Taborder: 1
      ]
    }
  ]
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlActions_btnOk_OnClick.def
@@ -6,7 +6,7 @@
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not exists( MacroPlan, PackagingPlanNewCapability, tempPPNC, true, tempPPNC.ProductionLine() = ddslProductionLine.Text() );
    return not exists( MacroPlan, PackagingPlanNewCapability, tempPPNC, true, tempPPNC.ProductionLine() = ddslFactory.Text() );
  *]
  QuillAction
  {
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlContent_ddslProductID_OnCreated.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
Quintiq file version 2.0
#parent: pnlContent/ddslProductID
Response OnCreated () id:Response_pnlContent_ddslProductID_OnCreated
{
  #keys: '[415754.0.415211358]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnCreated'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      pmpids := selectuniquevalues( MacroPlan, Product_MP, tempPMP, true, tempPMP.ID() );
      this.Strings( pmpids.Concatenate( ";" ) );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlContent_ddslProductionLine_OnCreated.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanCapability/Component_lstContent.def
@@ -28,7 +28,7 @@
      ]
      Properties:
      [
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductionLine","title":"ProductionLine","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductionLine"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MaximumDailyPackagingQuantity","title":"MaximumDailyPackagingQuantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MaximumDailyPackagingQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MaximumDailyUnpackingQuantity","title":"MaximumDailyUnpackingQuantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MaximumDailyUnpackingQuantity"}}]'
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Factory","title":"Factory","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Factory"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductID","title":"ProductID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MaximumDailyPackagingQuantity","title":"MaximumDailyPackagingQuantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MaximumDailyPackagingQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MaximumDailyUnpackingQuantity","title":"MaximumDailyUnpackingQuantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MaximumDailyUnpackingQuantity"}}]'
        ContextMenu: 'cmContent'
        Taborder: 2
      ]