From 7da84821eb07cfa1370adfe4144e41416cf1cefa Mon Sep 17 00:00:00 2001
From: lihongji <3117313295@qq.com>
Date: 星期四, 07 十一月 2024 11:46:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 _Main/BL/Type_AssemblyOnlinePlanPush/StaticMethod_GenerateData.qbl |   39 +++++++++++++++++----------------------
 1 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/_Main/BL/Type_AssemblyOnlinePlanPush/StaticMethod_GenerateData.qbl b/_Main/BL/Type_AssemblyOnlinePlanPush/StaticMethod_GenerateData.qbl
index a06d769..b7670aa 100644
--- a/_Main/BL/Type_AssemblyOnlinePlanPush/StaticMethod_GenerateData.qbl
+++ b/_Main/BL/Type_AssemblyOnlinePlanPush/StaticMethod_GenerateData.qbl
@@ -1,10 +1,9 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod GenerateData (
-  const MacroPlan macroplan,
   InterfaceDataset interfaceDataset,
-  String executor,
-  Boolean versionflag
+  const MacroPlan macroplan,
+  String executor
 )
 {
   Description: '鐢熸垚鍙互涓嬪彂鐨勫鎴烽渶姹傦紙PPA+IDS锛夋暟鎹�'
@@ -25,32 +24,28 @@
                                                                  , Name := Translations::InterfaceDataset_AssemblyOnlinePlanPPPSPush_Name()
                                                                  , InterfaceDateTime := nowdate
                                                                  , Message := '瑁呴厤涓婄嚎璁″垝-PPPS浼犺緭鑷虫暟鎹腑鍙帮紙鍖呭惈鎺掑簭锛�/SAP锛堜笉鍖呭惈鎺掑簭锛�'
-                                                                 , IsShow := false
-                                                                 , Last := true
-                                                                 , ReturnSuccess := true
-                                                                 , ReturnMsg := 'Success'
-                                                                 , Success := true
+                                                                 , Last                      := true
                                                                   );
-    traverse( macroplan, AssemblyOnlinePlanColumn, column ){
-      traverse( column, AssemblyOnlinePlanCell, cell, cell.Value() <> '' and cell.AssemblyOnlinePlanRow().Type() = '1' ){
-        quantityrow        := cell.AssemblyOnlinePlanRow();
-        ordercell          := selectobject( column, AssemblyOnlinePlanCell, ocell, ocell.AssemblyOnlinePlanRow().ProductID() = quantityrow.ProductID() 
-                                            and ocell.AssemblyOnlinePlanRow().ProductionLine() = quantityrow.ProductionLine() 
-                                            and ocell.AssemblyOnlinePlanRow().Type() = '2' );
-        product            := selectobject( macroplan, Product_MP, product, product.ID() = quantityrow.ProductID() );
-    
-        cd                  :=interfaceDataset.AssemblyOnlinePlanPPPSPush( relnew, Product           := product.ID()
-                                                                           , PlanningDate            := column.ColumnDate()
-                                                                           , PlanningQty             := [Number]cell.Value()
-                                                                           , Sequence                := ordercell.Value()
+    traverse( interfaceDataset, AssemblyOnlinePlanVersion, verison, not verison.IsShow() ){
+      traverse( verison, Column, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() ){
+        traverse( column, Cell, cell ){
+          row              := cell.Row();
+          cd               :=interfaceDataset.AssemblyOnlinePlanPPPSPush( relnew, Product            := row.ProductID()
+                                                                           , PlanningDate            := column.StartDate()
+                                                                           , PlanningQty             := [Number]cell.Quantity()
+                                                                           , Sequence                := cell.Order()
                                                                            , VersionName             := macroplan.ScenarioName()
                                                                            , InterfaceTime           := nowdate
-                                                                           , VersionFlag             := versionflag
-                                                                           , ProductFourCode         := product.Notes()
+                                                                           , FactoryName             := row.Unit()
+                                                                          , Fac                     := ifexpr( row.Unit() = FinancialProductionReport::GetDefaultCCUnit(), 'CC', 'DL' )  
+    //                                                                       , VersionFlag             := versionflag
+                                                                           , ProductFourCode         := ifexpr( row.ProductID() = row.Name(), '', row.Name() )
                                                                            );
         loginfo.AssemblyOnlinePlanPPPSPush( relinsert, cd );
+        }
       }
     }
     loginfo.TotalRow( loginfo.AssemblyOnlinePlanPPPSPush( relsize ) );
+    AssemblyOnlinePlanPPPSPush::Publish( interfaceDataset, loginfo );
   *]
 }

--
Gitblit v1.9.3