From 4d55fab94e0e4e1412c64ffd23606850afc72c7a Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期五, 13 十二月 2024 16:33:39 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
---
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl | 6 +-
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl | 2
_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl | 4 +-
_Main/Sys/Repr/Global/NewOfflinePlanCell.qrp | 8 ++++
_Main/BL/Type_PackagingPlanCell/StaticMethod_CreateData.qbl | 8 ++--
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetUnpackage_Lotsize.qbl | 38 ++++++++++++------
_Main/Sys/Repr/Global/NewAssemblyOnlinePlanCell.qrp | 8 ++++
7 files changed, 51 insertions(+), 23 deletions(-)
diff --git a/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl b/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
index c4e2762..9f02a64 100644
--- a/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
@@ -10,11 +10,11 @@
this.InitialPackagingInventory() + guard( this.Previous().PackagingInventory() +
this.TransferIn() +
guard( this.Package(), 0.0 ) -
- ifexpr( this.TransferIn() > 0.0, 0, this.Unpacking() ),
+ guard( this.Unpacking(), 0.0 ),
0.0 )
- this.Out()
);
- this.PackagingInventory( value );
+ this.PackagingInventory( [Number]value );
*]
}
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_CreateData.qbl
index 7f720f8..3d2de5e 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_CreateData.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_CreateData.qbl
@@ -65,13 +65,13 @@
if ( factory = "澶ц繛宸ュ巶" ) {
// 鍑�闇�姹�&鍓╀綑搴撳瓨&渚涘簲閲�
cell.NetDemand( cell.NetDemand() + pispipl.DependentDemandAndSalesDemandQuantity() );
- cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
+ cell.EndingInventory( [Number] ( cell.EndingInventory() + pispipl.InventoryLevelEnd() ) );
}
// 闀挎槬宸ュ巶璁剧疆鍊�
if ( factory = "闀挎槬宸ュ巶" ) {
// 鍓╀綑搴撳瓨&渚涘簲閲�
- cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
+ cell.EndingInventory( [Number] ( cell.EndingInventory() + pispipl.InventoryLevelEnd() ) );
// 鍑�闇�姹傘�愬彧鍙栫嚎杈瑰簱銆�&鍖呰搴撳瓨&闈炲寘瑁呭簱瀛�
if ( pisp.StockingPointID().Regex( "澶栫搴�" ) ) {
@@ -94,10 +94,10 @@
preCell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = planPre );
if ( isnull( preCell ) ) {
preCell := ppr.PackagingPlanCell( relnew );
- preCell.EndingInventory( prePISPIPL.InventoryLevelEnd() );
+ preCell.EndingInventory( [Number]prePISPIPL.InventoryLevelEnd() );
preCell.PackagingPlanColumn( relset, planPre );
} else {
- preCell.EndingInventory( preCell.EndingInventory() + prePISPIPL.InventoryLevelEnd() );
+ preCell.EndingInventory( [Number] ( preCell.EndingInventory() + prePISPIPL.InventoryLevelEnd() ) );
}
}
}
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
index abccc2e..3fd117e 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -8,13 +8,13 @@
TextBody:
[*
// 鍒涘缓鏁版嵁
- //PackagingPlanCell::CreateData( macroPlan );
+ PackagingPlanCell::CreateData( macroPlan );
// 璁剧疆鍖呰&鎷嗗寘-鏁伴噺锛堝ぇ杩炲伐鍘傦級
- //PackagingPlanCell::SetPackagingAndUnpackingValuesDL( macroPlan );
+ PackagingPlanCell::SetPackagingAndUnpackingValuesDL( macroPlan );
// 璁剧疆鍖呰&鎷嗗寘-鏁伴噺锛堥暱鏄ュ伐鍘傦級
- //PackagingPlanCell::SetPackagingAndUnpackingValuesCC( macroPlan );
+ PackagingPlanCell::SetPackagingAndUnpackingValuesCC( macroPlan );
// 璁剧疆璧峰鍖呰搴撳瓨
PackagingPlanCell::SetInitialPackagingInventory( macroPlan, interfaceDataset );
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl
index c7b0782..2f61481 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl
@@ -17,7 +17,7 @@
tempPPCell.PackagingPlanRow().ProductID() = iidd.PartNumber() and
tempPPCell.PackagingPlanColumn().StartDate() = ( macroPlan.StartOfPlanning().Date() - 1 ) and
tempPPCell.PackagingPlanRow().Factory() = factory );
- ppcell.PackagingInventory( iidd.Quantity() );
+ ppcell.InitialPackagingInventory( iidd.Quantity() );
}
}
*]
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetUnpackage_Lotsize.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetUnpackage_Lotsize.qbl
index 128015d..86de67a 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetUnpackage_Lotsize.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetUnpackage_Lotsize.qbl
@@ -10,8 +10,12 @@
plannedStartDate := macroPlan.StartOfPlanning().Date();
// 璁剧疆鎷嗗寘鍊硷紙绗﹀悎lotsize鍜屼竴鏃ユ渶澶у寘瑁呴噺锛�
- traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "澶ц繛宸ュ巶" /*and ppr.ProductID() = "06K103011CM"*/ ) {
- traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) {
+ traverse ( macroPlan, PackagingPlanRow, ppr
+ // , ppr.Factory() = "澶ц繛宸ュ巶" and ppr.ProductID() = "06K103011CM"
+ ) {
+ traverse ( ppr, PackagingPlanCell, ppcell
+ // , ppcell.StartDate() <= Date::Construct( 2025, 1, 8 )
+ ) {
// Product_MP
pmp := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() );
// 鍖呰lotsize
@@ -27,12 +31,12 @@
// Unit
us := selectset( macroPlan, Unit, tempU, tempU.ID().Regex( ppr.FactoryAbbreviation() + " " + ppr.Category() ) );
- // 褰撳墠闈炲寘瑁呭簱瀛� + 涓嬩竴澶╃殑NewSupply < 涓嬩竴澶╃殑鍑�闇�姹�
- if ( ppcell.UnpackagedInventory() < guard( ppcell.Next().NetDemand(), 0 ) and not isnull( ppls ) and not isnull( ppnc ) ) {
+ // 闈炲寘瑁呭簱瀛樺嚭鐜拌礋鍊硷紝闇�瑕佽缃媶鍖呴噺
+ if ( ppcell.UnpackagedInventory() < 0 and not isnull( ppls ) and not isnull( ppnc ) ) {
// 闇�瑕佸寘瑁呯殑鏁伴噺
- needPackagingQuantity := abs( ppcell.PackagingInventory() ).Round( 0 );
- // 鍖呰寮�濮嬬殑绱㈠紩
- indexPPCell := ppcell.Previous();
+ needPackagingQuantity := abs( ppcell.UnpackagedInventory() ).Round( 0 );
+ // 鎷嗗寘寮�濮嬬殑绱㈠紩
+ indexPPCell := ppcell;
// info( "浜х嚎涓暟锛�", us.Size(), " 寮�濮嬫椂闂达細", ppcell.StartDate().Format( "Y-M2-D2" ), " 鍖呰搴撳瓨鏁伴噺锛�", ppcell.PackagingInventory(), " 闇�瑕佸寘瑁呯殑鏁伴噺锛�", needPackagingQuantity,
// " 鍖呰lotsize锛�",guard( ppls.LotSize(), 0 ), " 鏈�澶у寘瑁呭閲忥細", ppnc.MaximumDailyPackagingQuantity() );
@@ -44,13 +48,21 @@
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 := minvalue( canPackagingQuantity, [Number]indexPPCell.PackagingInventory() );
- // info( "寮�濮嬪寘瑁呯殑鏃ユ湡锛�", indexPPCell.StartDate().Format( "Y-M2-D2" ), " 鑳藉寘瑁呯殑鏁伴噺:", canPackagingQuantity );
+ canPackagingQuantity := [Number]ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyUnpackingQuantity() / 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.Unpacking() );
+ canPackagingQuantity := minvalue( [Number] ( ppnc.MaximumDailyPackagingQuantity() - categoryPackageQuantity ),
+ canPackagingQuantity,
+ ifexpr( floor( indexPPCell.PackagingInventory() / ppls.LotSize() ) * ppls.LotSize() > 0, floor( indexPPCell.PackagingInventory() / ppls.LotSize() ) * ppls.LotSize(), 0 ) );
+ // info( "寮�濮嬪寘瑁呯殑鏃ユ湡锛�", indexPPCell.StartDate().Format( "Y-M2-D2" ), " 鑳藉寘瑁呯殑鏁伴噺:", canPackagingQuantity, " 鍘熸媶鍖呭�硷細", indexPPCell.Unpacking() );
- indexPPCell.Next().Unpacking( canPackagingQuantity );
+ indexPPCell.Unpacking( ifexpr( indexPPCell.Unpacking() > 0.0 and canPackagingQuantity = 0, indexPPCell.Unpacking(), canPackagingQuantity ) );
Transaction::Transaction().Propagate( attribute( PackagingPlanCell, PackagingInventory ) );
Transaction::Transaction().Propagate( attribute( PackagingPlanCell, UnpackagedInventory ) );
diff --git a/_Main/Sys/Repr/Global/NewAssemblyOnlinePlanCell.qrp b/_Main/Sys/Repr/Global/NewAssemblyOnlinePlanCell.qrp
index 34543c5..4a46956 100644
--- a/_Main/Sys/Repr/Global/NewAssemblyOnlinePlanCell.qrp
+++ b/_Main/Sys/Repr/Global/NewAssemblyOnlinePlanCell.qrp
@@ -31,6 +31,14 @@
DefaultBackgroundColor: false
InheritConversion: false
}
+ DataRepresentation.Conditional
+ {
+ BackgroundColor: 'Red'
+ ConditionBody: 'object.Quantity() < 0.0'
+ ConversionBody: ''
+ DefaultBackgroundColor: false
+ InheritConversion: false
+ }
]
}
AttributeRepresentation ShiftPatternEnd
diff --git a/_Main/Sys/Repr/Global/NewOfflinePlanCell.qrp b/_Main/Sys/Repr/Global/NewOfflinePlanCell.qrp
index 01af5d5..33e0f8f 100644
--- a/_Main/Sys/Repr/Global/NewOfflinePlanCell.qrp
+++ b/_Main/Sys/Repr/Global/NewOfflinePlanCell.qrp
@@ -26,6 +26,14 @@
DefaultBackgroundColor: false
InheritConversion: false
}
+ DataRepresentation.Conditional
+ {
+ BackgroundColor: 'Red'
+ ConditionBody: 'object.Quantity() < 0.0'
+ ConversionBody: ''
+ DefaultBackgroundColor: false
+ InheritConversion: false
+ }
]
}
AttributeRepresentation ShiftPatternEnd
--
Gitblit v1.9.3