From a2faf022c1a8359aa6d5bce2d3c36f003d03cbaa Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期二, 22 十月 2024 16:13:59 +0800
Subject: [PATCH] 整班连续生产
---
_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl | 72 ++++++++++++++++++++++++++++++++++++
_Main/BL/Type_WholeShift/Method_PostProcessing2.qbl | 7 ++-
_Main/BL/Type_Archive/StaticMethod_MobileCycleTask.qbl | 13 ++++++
3 files changed, 90 insertions(+), 2 deletions(-)
diff --git a/_Main/BL/Type_Archive/StaticMethod_MobileCycleTask.qbl b/_Main/BL/Type_Archive/StaticMethod_MobileCycleTask.qbl
new file mode 100644
index 0000000..4e3939d
--- /dev/null
+++ b/_Main/BL/Type_Archive/StaticMethod_MobileCycleTask.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod MobileCycleTask (
+ UnitPeriodTimeBase fillUPTB,
+ UnitPeriodTimeBase targetUPTB
+)
+{
+ Description: '绉诲姩鍛ㄦ湡浠诲姟'
+ TextBody:
+ [*
+ // vwedadmin Oct-22-2024 (created)
+ *]
+}
diff --git a/_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl b/_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl
new file mode 100644
index 0000000..b00d481
--- /dev/null
+++ b/_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl
@@ -0,0 +1,72 @@
+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" ), " 澶勭悊鐨勪釜鏁帮細", 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 ( needFillUPTB.UsedCapacity().HoursAsReal() <= 0.0 and handleIndexStartDate <= handleIndexEndDate ) {
+ targetUPTB := minselect( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() > handleIndexStartDate and tempUPTB.UsedCapacity().HoursAsReal() > 0.0, tempUPTB.StartDate() );
+
+ // 绉诲姩鍛ㄦ湡浠诲姟
+
+ 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_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