From 13275e4c638e430100ab4bf4cb49dbee6ba06fc0 Mon Sep 17 00:00:00 2001
From: lihongji <3117313295@qq.com>
Date: 星期三, 16 十月 2024 18:45:02 +0800
Subject: [PATCH] 包装计划优化
---
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl | 33 +++++++++++++++++----------------
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_ddslFactorySelection_OnCreated.def | 16 ++++++++++++++++
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def | 1 -
3 files changed, 33 insertions(+), 17 deletions(-)
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
index 9eb8dff..8a41f88 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
+++ b/_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() );
}
// 闀挎槬宸ュ巶鐗规畩鎯呭喌璁剧疆鍖呰搴撳瓨鍜岄潪鍖呰搴撳瓨
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def
index f81dab7..9200e4d 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def
@@ -61,7 +61,6 @@
BaseType: 'WebDropDownStringList'
Properties:
[
- InitialValue: '澶ц繛宸ュ巶'
Label: '宸ュ巶'
Sorting: 'none'
Strings: '澶ц繛宸ュ巶;闀挎槬宸ュ巶'
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_ddslFactorySelection_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_ddslFactorySelection_OnCreated.def
new file mode 100644
index 0000000..a956c23
--- /dev/null
+++ b/_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
+ }
+}
--
Gitblit v1.9.3