From ead7f5c6ccba143a88fb38568606a8a8e8be419d Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期五, 06 九月 2024 14:54:31 +0800
Subject: [PATCH] 删除无用方法

---
 _Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl b/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl
index 2139612..1ccd93d 100644
--- a/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl
+++ b/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl
@@ -2,6 +2,7 @@
 #parent: #root
 StaticMethod GenerateData (
   const MacroPlan macroplan,
+  RecycleBin recycle,
   const Archive archive,
   InterfaceDataset interfaceDataset,
   String executor,
@@ -33,6 +34,7 @@
                                                                  , Success                   := true
                                                                   );
     traverse( macroplan, SalesDemand.astype( Forecast ), forecast, forecast.Origin() = 'PPA' ){
+      info( forecast.ProductID() );
       cd                  :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product           := forecast.ProductID()
                                                                    , DemandDate              := forecast.StartDate()
                                                                    , DemandQty               := [Number]forecast.Quantity()
@@ -43,25 +45,30 @@
       loginfo.CustomerDemandPPAIDS( relinsert, cd );
     }
     binaryValue           := TemplateManager::GetIDSFullTable( archive, Date::ActualDate().Year() );
-    CustomerDemandIDS::ReadStructure( binaryValue, interfaceDataset );
-    productcolumn         := select( interfaceDataset, CustomerDemandIDS.Column, column, column.Index() = 1 );
+    source                := GeneralExcelImportAndExportDataSource::Upload( recycle, binaryValue, OS::TempPath() + "template.xlsx" );
+    source.ReadStructure();
+    Transaction::Transaction().Propagate( attribute( GeneralExcelImportAndExportDataColumn, ColumnIndex ) );
     cnv2 := StringToDate::StandardConverter();
     cnv2.SetCustomConversion();
     cnv2.CustomFormatString( "dd/MM/yyyy" );
-    traverse( interfaceDataset, CustomerDemandIDS.Row, row ){
-      product             := selectobject( row, Cell, cell, cell.Column() = productcolumn );
-      traverse( row, Cell, cell, cell.Column().Index() > 3 ){
-        period := cnv2.Convert( cell.Column().Name() );
-        cd                  :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product           := product.Value()
-                                                                     , DemandDate              := period
-                                                                     , DemandQty               := [Number]cell.Value()
-                                                                     , VersionName             := macroplan.ScenarioName()
-                                                                     , InterfaceTime           := nowdate
-                                                                     , VersionFlag             := versionflag
-                                                                     );
-        loginfo.CustomerDemandPPAIDS( relinsert, cd );
+    traverse( recycle, GeneralExcelImportAndExportDataSource.GeneralExcelImportAndExportDataTable, table ){
+      traverse( table, GeneralExcelImportAndExportDataRow, row ){
+        product             := selectobject( row, GeneralExcelImportAndExportDataCell, cell, cell.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 2 );
+        traverse( row, GeneralExcelImportAndExportDataCell, cell, cell.GeneralExcelImportAndExportDataColumn().ColumnIndex() > 2 ){
+          info( cell.GeneralExcelImportAndExportDataColumn().ColumnIndex(), cell.Value(), product.Value() );
+          period := cnv2.Convert( cell.GeneralExcelImportAndExportDataColumn().Name() );
+          cd                :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product           := product.Value()
+                                                                       , DemandDate              := period
+                                                                       , DemandQty               := [Number]cell.Value()
+                                                                       , VersionName             := macroplan.ScenarioName()
+                                                                       , InterfaceTime           := nowdate
+                                                                       , VersionFlag             := versionflag
+                                                                       );
+          loginfo.CustomerDemandPPAIDS( relinsert, cd );
+        }
       }
     }
+    source.Delete();
     loginfo.TotalRow( loginfo.CustomerDemandPPAIDS( relsize ) );
   *]
 }

--
Gitblit v1.9.3