From 6fae3f0b2ce8365d8c75d7acfd79a0a1675ac8fc Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期二, 22 十月 2024 17:47:56 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
---
_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl | 76 ++++++++++++++++++++++++++++++++++++++
_Main/BL/Type_WholeShift/Method_PostProcessing2.qbl | 7 ++-
_Main/BL/Type_WholeShift/Method_MobileCycleTask.qbl | 24 ++++++++++++
3 files changed, 105 insertions(+), 2 deletions(-)
diff --git a/_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl b/_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl
new file mode 100644
index 0000000..a430caf
--- /dev/null
+++ b/_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl
@@ -0,0 +1,76 @@
+Quintiq file version 2.0
+#parent: #root
+Method ContinuousProductionScheduling (
+ MacroPlan macroPlan,
+ UnitPeriodTimeBases uptbs
+)
+{
+ Description: '涓�鍛ㄥ唴杩炵画鎺掍骇'
+ TextBody:
+ [*
+ debuginfo( "寮�濮嬭缃繛缁帓浜�" );
+
+ // 涓�鍛ㄧ殑寮�濮嬫椂闂淬�愬惊鐜储寮曘��
+ indexStartDate := macroPlan.StartOfPlanning().Date().StartOfWeek();
+
+ needHandleUPTBs := selectsortedset( uptbs, Elements, tempUPTB, tempUPTB.StartDate().StartOfWeek() = indexStartDate, tempUPTB.StartDate() );
+
+
+ while ( needHandleUPTBs.Size() > 0 ) {
+ debuginfo( "-------------------------------------------", "姝e湪澶勭悊鐨勫懆寮�濮嬫椂闂达細", indexStartDate.Format( "Y-M2-D2" ),
+ " 姝e湪澶勭悊鐨勫懆缁撴潫鏃堕棿锛�", ( indexStartDate.StartOfNextWeek() - 1 ).Format( "Y-M2-D2" ), " 澶勭悊鐨勪釜鏁帮細", needHandleUPTBs.Size() );
+
+ // 闇�瑕佸鐞嗘爣蹇�
+ needHandleFlag := false;
+ // 绗竴娆″嚭鐜颁骇鑳芥棩鏈�
+ firstAppearCapacityDate := Date::MinDate();
+ // 绗竴娆″嚭鐜颁骇鑳芥棩鏈熴�愬鐞嗚繛缁帓浜х敤鍒般��
+ firstAppearCapacityDate1 := Date::MinDate();
+
+ // 璇嗗埆鏄惁闇�瑕佽繛缁帓浜�
+ traverse ( needHandleUPTBs, Elements, uptb ) {
+ // 缁欑涓�娆′骇鑳借祴鍊�
+ if ( firstAppearCapacityDate.IsMinInfinity() and uptb.UsedCapacity().HoursAsReal() > 0.0 ) {
+ firstAppearCapacityDate := uptb.StartDate();
+ firstAppearCapacityDate1 := uptb.StartDate();
+ }
+
+ // 鍒ゆ柇鏄惁闇�瑕佽繛缁帓浜�
+ if ( not firstAppearCapacityDate.IsMinInfinity() and firstAppearCapacityDate <> uptb.StartDate() and uptb.UsedCapacity().HoursAsReal() > 0.0 ) {
+ if ( ( firstAppearCapacityDate + 1 ) = uptb.StartDate() ) {
+ firstAppearCapacityDate := uptb.StartDate();
+ } else {
+ needHandleFlag := true;
+ }
+ }
+ }
+
+ // 澶勭悊杩炵画鎺掍骇
+ if ( needHandleFlag ) {
+ // 绱㈠紩寮�濮嬫椂闂�
+ handleIndexStartDate := firstAppearCapacityDate1 + 1;
+ // 闇�瑕佸鐞嗙殑UPTB鐨勬渶澶ф椂闂�
+ handleIndexEndDate := maxobject( needHandleUPTBs, Elements, tempUPTB, true, tempUPTB.StartDate() ).StartDate();
+
+ // debuginfo( "闇�瑕佸鐞嗙殑鍛ㄥ紑濮嬫椂闂达細", indexStartDate.Format( "Y-M2-D2" ), " 闇�瑕佸鐞嗙殑鍛ㄧ粨鏉熸椂闂达細", handleIndexEndDate.Format( "Y-M2-D2" ),
+ // " 绗竴娆″嚭鐜颁骇鑳界殑鏃ユ湡锛�", firstAppearCapacityDate1.Format( "Y-M2-D2" ) );
+ needFillUPTB := select( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() = handleIndexStartDate );
+
+ while ( guard( needFillUPTB.UsedCapacity().HoursAsReal(), -1 ) <= 0.0 and handleIndexStartDate <= handleIndexEndDate ) {
+ targetUPTB := minselect( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() > handleIndexStartDate and tempUPTB.UsedCapacity().HoursAsReal() > 0.0, tempUPTB.StartDate() );
+
+ // 绉诲姩鍛ㄦ湡浠诲姟
+ if ( not isnull( needFillUPTB ) and not isnull( targetUPTB ) ) {
+ this.MobileCycleTask( needFillUPTB, targetUPTB );
+ }
+
+ handleIndexStartDate := handleIndexStartDate + 1;
+ needFillUPTB := select( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() = handleIndexStartDate );
+ }
+ }
+
+ indexStartDate := indexStartDate.StartOfNextWeek();
+ needHandleUPTBs := selectsortedset( uptbs, Elements, tempUPTB, tempUPTB.StartDate().StartOfWeek() = indexStartDate, tempUPTB.StartDate() );
+ }
+ *]
+}
diff --git a/_Main/BL/Type_WholeShift/Method_MobileCycleTask.qbl b/_Main/BL/Type_WholeShift/Method_MobileCycleTask.qbl
new file mode 100644
index 0000000..e561a1a
--- /dev/null
+++ b/_Main/BL/Type_WholeShift/Method_MobileCycleTask.qbl
@@ -0,0 +1,24 @@
+Quintiq file version 2.0
+#parent: #root
+Method MobileCycleTask (
+ UnitPeriodTimeBase fillUPTB,
+ UnitPeriodTimeBase targetUPTB
+)
+{
+ Description: '杩炵画鐢熶骇锛岀Щ鍔ㄤ袱涓懆鏈熶换鍔�'
+ TextBody:
+ [*
+ debuginfo( "闇�瑕佸~鍏呯殑鏃ユ湡锛�", fillUPTB.StartDate().Format( "Y-M2-D2" ), " 鐩爣琚彇鏁版棩鏈燂細", targetUPTB.StartDate().Format( "Y-M2-D2" ) );
+
+ // 鍒ゆ柇鍙敤浜ц兘鏄惁涓�鑷�
+ if ( fillUPTB.BaseAvailableCapacity().HoursAsReal() = targetUPTB.BaseAvailableCapacity().HoursAsReal() ) {
+ traverse ( targetUPTB, PeriodTaskOperation, pto ) {
+ PeriodTaskOperation::Create( pto.Operation(), fillUPTB, pto.Quantity(), false );
+ }
+
+ PeriodTaskOperation::Delete( selectset( targetUPTB, PeriodTaskOperation, tempPTO, true ) );
+ }
+
+ Transaction::Transaction().Propagate();
+ *]
+}
diff --git a/_Main/BL/Type_WholeShift/Method_PostProcessing2.qbl b/_Main/BL/Type_WholeShift/Method_PostProcessing2.qbl
index 90057d1..dc433ec 100644
--- a/_Main/BL/Type_WholeShift/Method_PostProcessing2.qbl
+++ b/_Main/BL/Type_WholeShift/Method_PostProcessing2.qbl
@@ -15,8 +15,8 @@
uptbs := selectsortedset( unit, UnitPeriod.astype( UnitPeriodTimeBase ), tempUPTB, not tempUPTB.IsPeriodFrozen() and tempUPTB.IsPlanning(), tempUPTB.Start() );
// 鍦嗘暣鎴栬ˉ闆跺綋鍓嶄骇绾夸笅鎵�鐢熶骇鐨勪骇鍝�
- this.IsRoundingOrZeroFilling3( macroPlan, uptbs ); // 鍊熻繕閫昏緫
- Transaction::Transaction().Propagate();
+ // this.IsRoundingOrZeroFilling3( macroPlan, uptbs ); // 鍊熻繕閫昏緫
+ // Transaction::Transaction().Propagate();
// // 骞宠 褰撳墠浜х嚎涓嬫墍鐢熶骇鐨勪骇鍝佸簱瀛橈紙搴撳瓨 < 鏈�澶у簱瀛橈級
// // this.A_balanceInventory( macroPlan, unitPeriodTimeBases );
@@ -44,6 +44,9 @@
// this.A_generateRequirements( macroPlan, unit.ID() );
// Transaction::Transaction().Propagate();
// }
+
+ // 璁剧疆杩炵画鎺掍骇
+ this.ContinuousProductionScheduling( macroPlan, uptbs );
}
// 杞﹂亾鏁寸彮
--
Gitblit v1.9.3