From f7e27cb24f4cdbe6a25af74549867dbd49b1b401 Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期四, 17 十月 2024 19:21:11 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev

---
 _Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl b/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
index fad645a..b4505ca 100644
--- a/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
+++ b/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
@@ -61,7 +61,7 @@
                                );
       
       u           := select( macroPlan, Unit, tempU, tempU.ID() = pl );
-      drainPs     := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "鎷夌┖" ), false ) );
+      drainPs     := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "鎷夌┖" ) or tempP.Event().Subject().Regex( "鎺掔┖" ), false ) );
       lineLyingPs := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "閾虹嚎" ), false ) );
       
       // 澶勭悊鎷夌┖
@@ -69,13 +69,24 @@
       traverse ( drainPs, Elements, p ) {
         traverse ( p, ExplicitTimeInterval, eti ) {
     //      info( "寮�濮嬫椂闂达細", eti.Start().Format( "Y-M2-D2" ), "    缁撴潫鏃堕棿锛�", eti.End().Format( "Y-M2-D2" ) );
+          naopc := select( macroPlan, NewAssemblyOnlinePlanColumn, tempNAOPC, tempNAOPC.StartDate() = ( eti.Start().Date() - 1 ) );
           
           cell  := maxselect( macroPlan, NewAssemblyOnlinePlanRow.NewAssemblyOnlinePlanCell, tempNAOPCell, 
-                              tempNAOPCell.NewAssemblyOnlinePlanRow().ProductionLine() = pl                         and 
-                              tempNAOPCell.NewAssemblyOnlinePlanColumn().StartDate()   = ( eti.Start().Date() - 1 ) and
-                              tempNAOPCell.NewAssemblyOnlinePlanRow().Type()           = "1",
+                              tempNAOPCell.NewAssemblyOnlinePlanRow().ProductionLine() = pl    and 
+                              tempNAOPCell.NewAssemblyOnlinePlanColumn()               = naopc and
+                              tempNAOPCell.NewAssemblyOnlinePlanRow().Type()           = "1"   and
+                              tempNAOPCell.Quantity()                                  > 0,
                               tempNAOPCell.OrderNr() ); 
-          
+          while ( isnull( cell ) and not isnull( naopc ) ){
+            naopc := naopc.PreviousNAOPColumn();
+            
+            cell  := maxselect( macroPlan, NewAssemblyOnlinePlanRow.NewAssemblyOnlinePlanCell, tempNAOPCell, 
+                              tempNAOPCell.NewAssemblyOnlinePlanRow().ProductionLine() = pl    and 
+                              tempNAOPCell.NewAssemblyOnlinePlanColumn()               = naopc and
+                              tempNAOPCell.NewAssemblyOnlinePlanRow().Type()           = "1"   and
+                              tempNAOPCell.Quantity()                                  > 0,
+                              tempNAOPCell.OrderNr() );
+          }
           if ( not isnull( cell ) ) {
             cell.Quantity( cell.Quantity() - targetQuantity );
           }

--
Gitblit v1.9.3