From 00141e8e299943448c60f5f6d2031a8510812e2c Mon Sep 17 00:00:00 2001 From: lazhen <17772815105@139.com> Date: 星期四, 14 十一月 2024 18:19:19 +0800 Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg --- _Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackage_Lotsize.qbl | 13 +++++- _Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesCC.qbl | 53 +++++++++++++++++--------- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackage_Lotsize.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackage_Lotsize.qbl index 9012f37..ac6c367 100644 --- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackage_Lotsize.qbl +++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackage_Lotsize.qbl @@ -44,9 +44,16 @@ tempSP.Outcome() <> "" ) and needPackagingQuantity > 0 ) { // 鑳藉寘瑁呯殑鏁伴噺 - canPackagingQuantity := ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ), - ceil( needPackagingQuantity / ppls.LotSize() ), - floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ) ) * ppls.LotSize(); + canPackagingQuantity := [Number]ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ), + ceil( needPackagingQuantity / ppls.LotSize() ), + floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ) ) * ppls.LotSize(); + // 鏀圭被涓嬪叾浠栦骇鍝佸寘瑁呮�诲拰 + categoryPackageQuantity := sum( indexPPCell, PackagingPlanColumn.PackagingPlanCell, tempPPCell, + tempPPCell <> indexPPCell and + tempPPCell.PackagingPlanRow().Factory() = indexPPCell.PackagingPlanRow().Factory() and + tempPPCell.PackagingPlanRow().Category() = indexPPCell.PackagingPlanRow().Category(), + tempPPCell.Package() ); + canPackagingQuantity := minvalue( [Number] ( ppnc.MaximumDailyPackagingQuantity() - categoryPackageQuantity ), canPackagingQuantity ); // info( "寮�濮嬪寘瑁呯殑鏃ユ湡锛�", indexPPCell.StartDate().Format( "Y-M2-D2" ), " 鑳藉寘瑁呯殑鏁伴噺:", canPackagingQuantity ); indexPPCell.Package( canPackagingQuantity ); diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesCC.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesCC.qbl index b8ca3b8..f2c0576 100644 --- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesCC.qbl +++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValuesCC.qbl @@ -6,26 +6,43 @@ { TextBody: [* - traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "闀挎槬宸ュ巶" /*and ppr.ProductID() = "06K103011CM"*/ ) { - traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) { - unpackagedQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, - tempPIT.ProductID() = ppcell.PackagingPlanRow().ProductID() and - tempPIT.Trip().Departure().Date() = ppcell.StartDate() and - tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "澶栫搴�" ) and - tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "绾胯竟搴�" ), - tempPIT.Quantity() - ); - ppcell.Unpacking( unpackagedQuantity ); + traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "闀挎槬宸ュ巶" /*and ppr.Category() = "ZKG" and ppr.ProductID() = "06K103011CP"*/ ) { + + u := select( macroPlan, Unit, tempU, tempU.ID() = "CC " + ppr.Category() + " 绾胯竟鍜屽绉熷簱闂�"); + + ts := selectset( u, Lane.LaneLeg.Trip, tempT, + guard( select( tempT, ProductInTrip, tempPIT, tempPIT.ProductID() = ppr.ProductID() ).Quantity() > 0, false ) ); + + traverse ( ts, Elements.ProductInTrip, pit, pit.Quantity() > 0 and pit.ProductID() = ppr.ProductID() ) { + ppcell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn().StartDate() = pit.Trip().Departure().Date() ); - packagedQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, - tempPIT.ProductID() = ppcell.PackagingPlanRow().ProductID() and - tempPIT.Trip().Departure().Date() = ppcell.StartDate() and - tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "绾胯竟搴�" ) and - tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "澶栫搴�" ), - tempPIT.Quantity() - ); - ppcell.Package( packagedQuantity ); + if ( pit.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "澶栫搴�" ) and pit.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "绾胯竟搴�" ) ) { + ppcell.Unpacking( pit.Quantity() ); + } + + if ( pit.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "绾胯竟搴�" ) and pit.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "澶栫搴�" ) ) { + ppcell.Package( pit.Quantity() ); + } } + // traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) { + // unpackagedQuantity := sum( u, Lane.LaneLeg.Trip.ProductInTrip, tempPIT, + // tempPIT.ProductID() = ppcell.PackagingPlanRow().ProductID() and + // tempPIT.Trip().Departure().Date() = ppcell.StartDate() and + // tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "澶栫搴�" ) and + // tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "绾胯竟搴�" ), + // tempPIT.Quantity() + // ); + // ppcell.Unpacking( unpackagedQuantity ); + // + // packagedQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, + // tempPIT.ProductID() = ppcell.PackagingPlanRow().ProductID() and + // tempPIT.Trip().Departure().Date() = ppcell.StartDate() and + // tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "绾胯竟搴�" ) and + // tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "澶栫搴�" ), + // tempPIT.Quantity() + // ); + // ppcell.Package( packagedQuantity ); + // } } *] } -- Gitblit v1.9.3