From 3a871621096a949fe8c897b89d9a66d1adb8e110 Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期五, 25 十月 2024 13:20:00 +0800
Subject: [PATCH] 料架总数优化
---
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl | 21 +++++++++++++++++----
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl | 20 +++++++++++++++++---
2 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl
index fcff038..128058b 100644
--- a/_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl
+++ b/_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl
@@ -40,12 +40,25 @@
// 杩愯緭鎴愭湰鍙傛暟
lct := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = "鍙戝姩鏈烘枡鏋�" and tempLCT.Origin() = "闀挎槬澶栫搴�" and tempLCT.Destination() = "CC 鍘傚唴搴�" );
+ // 绌烘枡鏋舵瘮渚�
+ mrpc := select( macroPlan, MaterialRackProportionRow.MaterialRackProportionCell, tempMRPCell, tempMRPCell.MaterialRackProportionRow().Generation() = "闀挎槬澶栫搴�" and tempMRPCell.MaterialRackColumn().Month() = ccerc.StartDate().Month() );
+
+ // 瀹㈡埛搴撴枡鏋舵�绘暟閲�
+ mrcc := select( macroPlan, MaterialRackCustomRow.MaterialRackCustomCell, tempMRCCell, tempMRCCell.MaterialRackCustomRow().Generation() = ccerr.Generation() and tempMRCCell.MaterialRackCustomRow().MLB_MQB() = ccerr.MLB_MQB() and tempMRCCell.MaterialRackColumn().Month() = ccerc.StartDate().Month() );
+
// 褰撳墠鏈堟湯鏈�鍚庝竴澶╂棩鏈�
lastDayOfThisMonth := ccerc.StartDate().StartOfNextMonth() - 1;
cell := ccerr.CC_EngineRackCell( relnew );
- // 绌烘枡鏋舵暟閲忥紙闀挎槬鍘傝浜у搧鐨勬枡鏋舵�绘暟閲� - 鍙戝姩鏈哄簱瀛� / 鍖呰瀹归噺 锛�
+ // 鏂欐灦鎬绘暟閲�
+ mrtcell := select( macroPlan, MaterialRackTotalRow.MaterialRackTotalCell, tempMRTCell,
+ tempMRTCell.MaterialRackTotalRow().Generation() = ccerr.Generation() and
+ tempMRTCell.MaterialRackTotalRow().MLB_MQB() = ccerr.MLB_MQB() and
+ tempMRTCell.MaterialRackColumn().Month() = ccerc.StartDate().Month() );
+ cell.TotalQuantityOfMaterialRacks( mrtcell.Quantity() );
+
+ // 绌烘枡鏋舵暟閲忥細銆�350bar MQB鏂欐灦鎬绘暟閲� - 鎵�鏈�350bar MQB鎬诲簱瀛� / 鍖呰瀹归噺-瀹㈡埛搴撴枡鏋舵暟閲忋��* 闀挎槬澶栫搴撶┖鏂欐灦姣斾緥
plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf() and
exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() = "鍙戝姩鏈�" ) and
@@ -57,7 +70,7 @@
tempPISPIP.PlannedInventoryLevelEnd() );
cell.PackagingCapacity( guard( lce.PackagingCapacity(), 1 ) );
cell.PlannedInventory( plannedInventory );
- cell.NumberOfEmptyShelves( guard( [Number] ( cell.TotalQuantityOfMaterialRacks() - ( plannedInventory / lce.PackagingCapacity() ) ), 0 ) );
+ cell.NumberOfEmptyShelves( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - ( plannedInventory / lce.PackagingCapacity() ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ), 0 ) );
// 澶栫搴撳叆搴撹垂鐢紙鍙戝姩鏈洪攢閲� / 鍖呰瀹归噺[鍚戜笂鍙栨暣] * 鏂欐灦鍏ュ簱鍗曚环锛�
engineSales := sum( macroPlan, FSImportData, tempFSID,
@@ -92,9 +105,9 @@
// info( "鏃堕棿锛�", ccerc.StartDate().Format( "Y-M2-D2" ), " 杩愯緭鏁版嵁锛�", transportationQuantity, " 杩愯緭鍗曚环锛�", lct.TransportPrice() );
cell.ExternalRentalWarehouseTransportationCosts( [Number] ( transportationQuantity / guard( lce.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) ) );
- // 澶栫搴撲粨鍌ㄨ垂鐢細鏂欐灦鎬绘暟閲� - 鍙戝姩鏈哄簱瀛� / 鍖呰瀹归噺锛堝悜涓婂彇鏁达級锛屽啀涔樹互绌烘枡鏋朵粨鍌ㄥ崟浠峰緱鍒扮┖鏂欐灦浠撳偍璐圭敤銆傚彂鍔ㄦ満搴撳瓨鍙朅ctual inventories閲屽彇鍒伴暱鏄ュ绉熷簱璇ュ彂鍔ㄦ満鐨勪粨鍌ㄩ噺锛屾枡鏋舵�绘暟閲忛渶瑕佹墜鍔ㄧ淮鎶ゃ��
+ // 澶栫搴撲粨鍌ㄨ垂鐢細銆�350bar MQB鏂欐灦鎬绘暟閲� - 鎵�鏈�350bar MQB鎬诲簱瀛� / 鍖呰瀹归噺 - 瀹㈡埛搴撴枡鏋舵暟閲忋��* 闀挎槬澶栫搴撶┖鏂欐灦姣斾緥*鏂欐灦浠撳偍鍗曚环銆傚彂鍔ㄦ満搴撳瓨鍙朅ctual inventories閲屽彇鍒伴暱鏄ュ绉熷簱璇ュ彂鍔ㄦ満鐨勪粨鍌ㄩ噺锛屾枡鏋舵�绘暟閲忛渶瑕佹墜鍔ㄧ淮鎶ゃ��
cell.UnitPriceOfEmptyShelfStorage( lcmr.StoragePrice() );
- cell.RentalWarehouseStorageFees( [Number] ( guard( ( cell.TotalQuantityOfMaterialRacks() - [Number]( plannedInventory / lce.PackagingCapacity() ) ) * lcmr.StoragePrice(), 0 ) ) );
+ cell.RentalWarehouseStorageFees( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - [Number]( plannedInventory / lce.PackagingCapacity() ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ) * lcmr.StoragePrice(), 0 ) );
// 娓呮礂璐圭敤锛氬彂鍔ㄦ満鍏ュ簱閲� / 鍖呰瀹归噺 * 鏂欐灦娓呮礂鍗曚环銆傚彂鍔ㄦ満鍏ュ簱閲忓彇鍙戝姩鏈洪攢閲忥紝鍖呰瀹归噺鍙栬嚜鍙戝姩鏈烘垚鏈〃銆傛枡鏋舵竻娲楀崟浠峰彇鏂欐灦鎴愭湰琛ㄣ��
cell.CleaningCost( [Number] ( engineProductions / guard( lce.PackagingCapacity(), 1 ) * lcmr.CleanPrice() ) );
diff --git a/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
index 40e0407..a95a5bc 100644
--- a/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
+++ b/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -42,12 +42,25 @@
lct2 := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = "鍙戝姩鏈烘枡鏋�" and tempLCT.Origin() = "澶ц繛澶栫搴�" and tempLCT.Destination() = "澶ц繛鍘傚唴搴�" );
lct3 := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = "鍙戝姩鏈烘枡鏋�" and tempLCT.Origin() = "CC 瀹㈡埛搴�" and tempLCT.Destination() = "CC 澶栫搴�" );
+ // 绌烘枡鏋舵瘮渚�
+ mrpc := select( macroPlan, MaterialRackProportionRow.MaterialRackProportionCell, tempMRPCell, tempMRPCell.MaterialRackProportionRow().Generation() = "澶ц繛澶栫搴�" and tempMRPCell.MaterialRackColumn().Month() = dlerc.StartDate().Month() );
+
+ // 瀹㈡埛搴撴枡鏋舵�绘暟閲�
+ mrcc := select( macroPlan, MaterialRackCustomRow.MaterialRackCustomCell, tempMRCCell, tempMRCCell.MaterialRackCustomRow().Generation() = dlerr.Generation() and tempMRCCell.MaterialRackCustomRow().MLB_MQB() = dlerr.MLB_MQB() and tempMRCCell.MaterialRackColumn().Month() = dlerc.StartDate().Month() );
+
// 褰撳墠鏈堟湯鏈�鍚庝竴澶╂棩鏈�
lastDayOfThisMonth := dlerc.StartDate().StartOfNextMonth() - 1;
cell := dlerr.DL_EngineRackCell( relnew );
- // 绌烘枡鏋舵暟閲忥細澶ц繛鍘傝浜у搧鐨勬枡鏋舵�绘暟閲� - 鍙戝姩鏈哄簱瀛� / 鍖呰瀹归噺锛堝悜涓婂彇鏁达級
+ // 鏂欐灦鎬绘暟閲�
+ mrtcell := select( macroPlan, MaterialRackTotalRow.MaterialRackTotalCell, tempMRTCell,
+ tempMRTCell.MaterialRackTotalRow().Generation() = dlerr.Generation() and
+ tempMRTCell.MaterialRackTotalRow().MLB_MQB() = dlerr.MLB_MQB() and
+ tempMRTCell.MaterialRackColumn().Month() = dlerc.StartDate().Month() );
+ cell.TotalQuantityOfMaterialRacks( mrtcell.Quantity() );
+
+ // 澶ц繛澶栫搴撶┖鏂欐灦鏁伴噺锛氥��350bar MQB鏂欐灦鎬绘暟閲� - 鎵�鏈�350bar MQB鎬诲簱瀛� / 鍖呰瀹归噺 - 瀹㈡埛搴撴枡鏋舵暟閲忋��* 澶ц繛澶栫搴撶┖鏂欐灦姣斾緥
plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf() and
exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() = "鍙戝姩鏈�" ) and
@@ -59,7 +72,7 @@
tempPISPIP.PlannedInventoryLevelEnd() );
cell.PackagingCapacity( guard( lce.PackagingCapacity(), 1 ) );
cell.PlannedInventory( plannedInventory );
- cell.NumberOfEmptyShelves( [Number] ( cell.TotalQuantityOfMaterialRacks() - guard( cell.PlannedInventory() / cell.PackagingCapacity(), 0 ) ) );
+ cell.NumberOfEmptyShelves( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - guard( cell.PlannedInventory() / cell.PackagingCapacity(), 0 ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ), 0 ) );
// CC澶栫搴撳叆搴撹垂鐢細鍙戝姩鏈洪攢閲� / 鍖呰瀹归噺锛堝悜涓婂彇鏁达級* 鏂欐灦鍏ュ簱鍗曚环
transportationQuantity1 := sum( macroPlan, SalesDemand.astype( Forecast ), tempF,
@@ -118,6 +131,7 @@
// DL澶栫搴撹繍杈撹垂鐢細鍙戝姩鏈鸿繍杈撻噺 / 鍖呰瀹归噺 / 瑁呰浇瀹归噺锛堝悜涓婂彇鏁达級* 鏂欐灦杩愯緭鍗曚环
cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( inventoryQuantity / lce.PackagingCapacity() / lct2.LoadingCapacity(), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
+ // 澶ц繛澶栫搴撲粨鍌ㄨ垂鐢細銆�350bar MQB鏂欐灦鎬绘暟閲�-鎵�鏈�350bar MQB鎬诲簱瀛�/鍖呰瀹归噺-瀹㈡埛搴撴枡鏋舵暟閲忋��*澶ц繛澶栫搴撶┖鏂欐灦姣斾緥
// DL澶栫搴撲粨鍌ㄨ垂鐢細鏂欐灦鎬绘暟閲� - 鍙戝姩鏈哄簱瀛� / 鍖呰瀹归噺锛堝悜涓婂彇鏁达級* 绌烘枡鏋朵粨鍌ㄥ崟浠�
plannedInventory1 := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf() and
@@ -128,7 +142,7 @@
tempPISPIP.Start().Date() >= dlerc.StartDate() and
tempPISPIP.End().Date() <= lastDayOfThisMonth,
tempPISPIP.PlannedInventoryLevelEnd() );
- cell.DLRentalWarehouseStorageFees( [Number] ( guard( ( cell.TotalQuantityOfMaterialRacks() - plannedInventory1 ) / lce.PackagingCapacity(), 0 ) * guard( lcmr.StoragePrice(), 1 ) ) );
+ cell.DLRentalWarehouseStorageFees( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - guard( plannedInventory1 / lce.PackagingCapacity(), 0 ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ) * guard( lcmr.StoragePrice(), 1 ), 0 ) );
// CC澶栫搴撴竻娲楄垂鐢細鍙戝姩鏈哄叆搴撻噺 / 鍖呰瀹归噺 * 鏂欐灦娓呮礂鍗曚环銆傚彂鍔ㄦ満鍏ュ簱閲忓彇鍙戝姩鏈洪攢閲忥紝鍖呰瀹归噺鍙栬嚜鍙戝姩鏈烘垚鏈〃銆傛枡鏋舵竻娲楀崟浠峰彇鏂欐灦鎴愭湰琛ㄣ��
clearnQuantity := sum( macroPlan, SalesDemand.astype( Forecast ), tempF,
--
Gitblit v1.9.3