From 565049764c3dc38f9e74423ce93f317a21c95d77 Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期日, 22 九月 2024 15:44:28 +0800
Subject: [PATCH] 优化

---
 _Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl b/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
index 955bdcf..98e9f56 100644
--- a/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
+++ b/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
@@ -13,7 +13,7 @@
     // 鐢熸垚涓嬬嚎璁″垝琛�
     traverse ( macroPlan, Unit, u, u.HasCapacityTypeTime() 
     //           and u.Name() = "eMotor Assy (France)" // 娴嬭瘯鏈湴鍦烘櫙鏃跺彲浠ヨ繃婊�
-    //           and u.Name() = "CC-MoMo"              // 娴嬭瘯瀹為檯鍦烘櫙鏃跺彲浠ヨ繃婊�
+    //           and u.Name() = "DL-MoMo"              // 娴嬭瘯瀹為檯鍦烘櫙鏃跺彲浠ヨ繃婊�
               ) {
       // 鍒涘缓浜х嚎琛�
       opt.OfflinePlanRow( relnew, ProductionLine := u.ID(), ProductID := "", Type := "0" );
@@ -145,9 +145,12 @@
       previousColumn := indexColumn.PreviousColumn();
       nextColumn     := indexColumn.NextColumn();
       
-      while ( not isnull( indexColumn.NextColumn() ) ) {
+      while ( not isnull( indexColumn.NextColumn() ) 
+    //          and indexColumn.ColumnDate() <= Date::Construct( 2024, 4, 16 ) // 娴嬭瘯瀹為檯鍦烘櫙鏃跺彲浠ヨ繃婊�
+             ) {
         productionSerialNumber := 1;
         opcs                   := selectsortedset( indexColumn, OfflinePlanCell, tempOPC, tempOPC.FindType( "2", pl ), tempOPC.InventoryWeight() );
+        initialSize            := opcs.Size();
         if ( opcs.Size() > 0 ) {
           // 鍒ゅ畾1
           previousOPC := maxselect( previousColumn, OfflinePlanCell, tempOPC, tempOPC.FindType( "2", pl ), tempOPC.ProductionSerialNumber() );
@@ -172,8 +175,8 @@
                                  exists( nextColumn, OfflinePlanCell, nextOPC, nextOPC.FindType( "2", pl ) and nextOPC.OfflinePlanRow().ProductID() = tempOPC.OfflinePlanRow().ProductID() ) );
           if ( nextOPCs.Size() = 1 ) {
             opc := nextOPCs.Element( 0 );
-            opc.Value( "#" + opcs.Size().Format( "N(LPad0(2))" ) );
-            opc.ProductionSerialNumber( opcs.Size() );
+            opc.Value( "#" + initialSize.Format( "N(LPad0(2))" ) );
+            opc.ProductionSerialNumber( initialSize );
             opcs.Remove( opc );
           }
           

--
Gitblit v1.9.3