From 1b757f9c9b887a7151ce0a11b2e2f77098e344be Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期四, 26 九月 2024 18:55:30 +0800
Subject: [PATCH] 下线计划优化

---
 _Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_MatrixEditor951_OnUpdateValue.def |    2 ++
 _Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl                                |   15 +++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl b/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
index 98e9f56..ee04590 100644
--- a/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
+++ b/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
@@ -92,12 +92,14 @@
     shiftStartDateOPRs := selectset( opt, OfflinePlanRow, tempOPR, tempOPR.Type() = "5" );
     shiftEndDateOPRs   := selectset( opt, OfflinePlanRow, tempOPR, tempOPR.Type() = "6" );
     traverse ( opt, OfflinePlanColumn, opc, opc.OfflinePlanCell( relsize ) > 0 and opc.ColumnDate() >= macroPlan.StartOfPlanning().Date() ) {
+      // 琛ュ叏鎬婚噺
       traverse ( totalOPRs, Elements, totalOPR ) {
         total     := sum( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow().ProductionLine() = totalOPR.ProductionLine() and tempOPC.OfflinePlanRow().Type() = "1", [Real]tempOPC.Value() );
         totalCell := opc.OfflinePlanCell( relnew, Value := [String]total );
         totalCell.OfflinePlanRow( relset, totalOPR );
       }
       
+      // &鐝
       traverse ( shiftOPRs, Elements, shiftOPR ) {
         shift := select( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow().ProductionLine() = shiftOPR.ProductionLine() and tempOPC.OfflinePlanRow().Type() = "1" ); 
         if ( not isnull( shift ) ) {
@@ -106,6 +108,7 @@
         }
       }
       
+      // 鐝寮�濮嬫椂闂�
       traverse ( shiftStartDateOPRs, Elements, ssdOPR ) {
         shift := select( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow().ProductionLine() = ssdOPR.ProductionLine() and tempOPC.OfflinePlanRow().Type() = "1" ); 
         if ( not isnull( shift ) ) {
@@ -115,6 +118,7 @@
         }
       }
       
+      // 鐝缁撴潫鏃堕棿
       traverse ( shiftEndDateOPRs, Elements, sedOPR ) {
         shift := select( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow().ProductionLine() = sedOPR.ProductionLine() and tempOPC.OfflinePlanRow().Type() = "1" ); 
         if ( not isnull( shift ) ) {
@@ -136,6 +140,17 @@
       indexDate := indexDate + 1;
     }
     
+    // 琛ュ叏绌烘牸瀛�
+    traverse ( opt, OfflinePlanRow, opr ) {
+      traverse ( opt, OfflinePlanColumn, opc ) {
+        cell := select( opr, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanColumn() = opc );
+        if ( isnull( cell ) ) {
+          cell := opc.OfflinePlanCell( relnew, Value := "" );
+          cell.OfflinePlanRow( relset, opr );
+        }
+      }
+    }
+    
     Transaction::Transaction().PropagateAll();
     
     // 璁剧疆鐢熶骇椤哄簭
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_MatrixEditor951_OnUpdateValue.def b/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_MatrixEditor951_OnUpdateValue.def
index a646cdb..4aeee49 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_MatrixEditor951_OnUpdateValue.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_MatrixEditor951_OnUpdateValue.def
@@ -23,6 +23,8 @@
         cell.IsQuantityChange( true );
         cell.Value( value );
         cell.Quantity( [Real]value );
+      } else if ( row.Type() = "2" and column.ColumnDate() >= MacroPlan.StartOfPlanning().Date() ) {
+        cell.Value( value );
       }
     *]
     GroupServerCalls: false

--
Gitblit v1.9.3