From 8271787feb2fc9e74a4e814bd43f93aef91a1f54 Mon Sep 17 00:00:00 2001 From: admin <admin@admin.com> Date: 星期四, 10 十月 2024 19:54:03 +0800 Subject: [PATCH] 长春料架优化 --- _Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 51 insertions(+), 2 deletions(-) diff --git a/_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl index 9a3cdd1..aa152d7 100644 --- a/_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl +++ b/_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl @@ -9,12 +9,21 @@ macroPlan.CC_EngineRackRow( relflush ); macroPlan.CC_EngineRackColumn( relflush ); + sumNumberOfEmptyShelves := 0.0; + sumStorageFeesForRentedWarehouses := 0.0; + sumOutboundExpensesForRentedWarehouses := 0.0; + sumExternalRentalWarehouseTransportationCosts := 0.0; + sumRentalWarehouseStorageFees := 0.0; + sumCleaningCost := 0.0; + sumEstimatedTotalCost := 0.0; + sumTotalCost := 0.0; + // 鍒涘缓琛� genrations := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.Generation().TrimBoth() <> "", tempPMP.Generation() ); mqbmlbs := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.MQBMLB().TrimBoth() <> "", tempPMP.MQBMLB() ); traverse ( genrations, Elements, g ) { traverse ( mqbmlbs, Elements, m ) { - macroPlan.CC_EngineRackRow( relnew, Generation := g, MLB_MQB := m ); + macroPlan.CC_EngineRackRow( relnew, Generation := g, MLB_MQB := m, Index := 1 ); } } @@ -56,6 +65,8 @@ tempPISPIP.PlannedInventoryLevelEnd() ); cell.PackagingCapacity( guard( lce.PackagingCapacity(), 1 ) ); cell.PlannedInventory( plannedInventory ); + cell.NumberOfEmptyShelves( guard( [Number] ( cell.TotalQuantityOfMaterialRacks() - ( plannedInventory / lce.PackagingCapacity() ) ), 0 ) ); + sumNumberOfEmptyShelves := sumNumberOfEmptyShelves + cell.NumberOfEmptyShelves(); // 澶栫搴撳叆搴撹垂鐢紙鍙戝姩鏈洪攢閲� / 鍖呰瀹归噺[鍚戜笂鍙栨暣] * 鏂欐灦鍏ュ簱鍗曚环锛� engineSales := sum( macroPlan, FSImportData, tempFSID, @@ -65,8 +76,8 @@ tempFSID.StartDate().Year() = ccerc.StartDate().Year() and tempFSID.StartDate().Month() = ccerc.StartDate().Month(), tempFSID.Quantity() ); - cell.StorageFeesForRentedWarehouses( [Number] ( engineSales / guard( lce.PackagingCapacity(), 1 ) * guard( lcmr.WarehousingPrice(), 1 ) ) ); + sumStorageFeesForRentedWarehouses := sumStorageFeesForRentedWarehouses + cell.StorageFeesForRentedWarehouses(); // 澶栫搴撳嚭搴撹垂鐢紙鍙戝姩鏈轰骇閲� / 鍖呰瀹归噺[鍚戜笂鍙栨暣] * 鏂欐灦鍑哄簱鍗曚环锛� engineProductions := sum( macroPlan, FPImportData, tempFPID, @@ -77,6 +88,7 @@ tempFPID.StartDate().Month() = ccerc.StartDate().Month(), tempFPID.Quantity() ); cell.OutboundExpensesForRentedWarehouses( [Number] ( engineProductions / guard( lce.PackagingCapacity(), 1 ) ) * guard( lcmr.OutboundPrice(), 1 ) ); + sumOutboundExpensesForRentedWarehouses := sumOutboundExpensesForRentedWarehouses + cell.OutboundExpensesForRentedWarehouses(); // 澶栫搴撹繍杈撹垂鐢細鍙戝姩鏈鸿繍杈撻噺 / 鍖呰瀹归噺 / 瑁呰浇瀹归噺锛堝悜涓婂彇鏁达級 * 鏂欐灦杩愯緭鍗曚环 transportationQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, @@ -90,15 +102,52 @@ ); // info( "鏃堕棿锛�", ccerc.StartDate().Format( "Y-M2-D2" ), " 杩愯緭鏁版嵁锛�", transportationQuantity, " 杩愯緭鍗曚环锛�", lct.TransportPrice() ); cell.ExternalRentalWarehouseTransportationCosts( transportationQuantity / guard( lce.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) ); + sumExternalRentalWarehouseTransportationCosts := sumExternalRentalWarehouseTransportationCosts + cell.ExternalRentalWarehouseTransportationCosts(); // 澶栫搴撲粨鍌ㄨ垂鐢細鏂欐灦鎬绘暟閲� - 鍙戝姩鏈哄簱瀛� / 鍖呰瀹归噺锛堝悜涓婂彇鏁达級锛屽啀涔樹互绌烘枡鏋朵粨鍌ㄥ崟浠峰緱鍒扮┖鏂欐灦浠撳偍璐圭敤銆傚彂鍔ㄦ満搴撳瓨鍙朅ctual inventories閲屽彇鍒伴暱鏄ュ绉熷簱璇ュ彂鍔ㄦ満鐨勪粨鍌ㄩ噺锛屾枡鏋舵�绘暟閲忛渶瑕佹墜鍔ㄧ淮鎶ゃ�� cell.UnitPriceOfEmptyShelfStorage( lcmr.StoragePrice() ); + cell.RentalWarehouseStorageFees( guard( ( cell.TotalQuantityOfMaterialRacks() - [Number]( plannedInventory / lce.PackagingCapacity() ) ) * lcmr.StoragePrice(), 0 ) ); + sumRentalWarehouseStorageFees := sumRentalWarehouseStorageFees + cell.RentalWarehouseStorageFees(); // 娓呮礂璐圭敤锛氬彂鍔ㄦ満鍏ュ簱閲� / 鍖呰瀹归噺 * 鏂欐灦娓呮礂鍗曚环銆傚彂鍔ㄦ満鍏ュ簱閲忓彇鍙戝姩鏈洪攢閲忥紝鍖呰瀹归噺鍙栬嚜鍙戝姩鏈烘垚鏈〃銆傛枡鏋舵竻娲楀崟浠峰彇鏂欐灦鎴愭湰琛ㄣ�� cell.CleaningCost( engineSales / guard( lce.PackagingCapacity(), 1 ) * lcmr.CleanPrice() ); + sumCleaningCost := sumCleaningCost + cell.CleaningCost(); + + // 棰勮鎬昏垂鐢� + cell.EstimatedTotalCost( cell.StorageFeesForRentedWarehouses() + + cell.OutboundExpensesForRentedWarehouses() + + cell.ExternalRentalWarehouseTransportationCosts() + + cell.RentalWarehouseStorageFees() + + cell.CleaningCost() + ); + sumEstimatedTotalCost := sumEstimatedTotalCost + cell.EstimatedTotalCost(); + + // 绯绘暟 + cell.Coefficient( 1 ); + + // 鎬昏垂鐢� + cell.TotalCost( cell.EstimatedTotalCost() * cell.Coefficient() ); + sumTotalCost := sumTotalCost + cell.TotalCost(); cell.CC_EngineRackColumn( relset, ccerc ); } } + + // 鍒涘缓SUM琛� + sumR := macroPlan.CC_EngineRackRow( relnew, Generation := "SUM", MLB_MQB := "", Index := 2 ); + traverse ( macroPlan, CC_EngineRackColumn, ccerc ) { + cell := sumR.CC_EngineRackCell( relnew ); + + cell.NumberOfEmptyShelves( sumNumberOfEmptyShelves ); + cell.StorageFeesForRentedWarehouses( sumStorageFeesForRentedWarehouses ); + cell.OutboundExpensesForRentedWarehouses( sumOutboundExpensesForRentedWarehouses ); + cell.ExternalRentalWarehouseTransportationCosts( sumExternalRentalWarehouseTransportationCosts ); + cell.RentalWarehouseStorageFees( sumRentalWarehouseStorageFees ); + cell.CleaningCost( sumCleaningCost ); + cell.EstimatedTotalCost( sumEstimatedTotalCost ); + cell.TotalCost( sumTotalCost ); + + cell.CC_EngineRackColumn( relset, ccerc ); + } *] } -- Gitblit v1.9.3