From e8619d825e5f09daf129b4847bf2bf4e660d40c5 Mon Sep 17 00:00:00 2001
From: yunchai <yunying.chai@capgemini.com>
Date: 星期四, 12 十月 2023 09:29:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'refs/remotes/origin/dev'

---
 _Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl b/_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl
index 90a0bff..ccbd232 100644
--- a/_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl
+++ b/_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl
@@ -5,9 +5,7 @@
   CapacityAndSaleBudgeFilterItems items,
   CapacityAndSaleBudgeFilterYears years,
   CapacityAndSaleBudgeFilterMonths months,
-  MPSync mpSync,
-  GlobalOTDTable otdTable,
-  MacroPlan mappingParent
+  GlobalOTDTable otdTable
 )
 {
   Description: 'todo : mappingParent鏀逛负mpSync, random鍒犱簡'
@@ -37,16 +35,16 @@
     this.CapacityAndSaleBudgeCompareItemRow( relflush );
     this.CapacityAndSaleBudgeCompareItemColumn( relflush );
     // ====姹囨�绘墍鏈夊嚭鐜扮殑浜у搧====
-    historyData := selectset( mpSync, MappingCapacityAndSaleBudge, item, true );
+    historyData := selectset( this, Global_MappingAnnualBudgetData, item, true );
     debuginfo( "historyData : " + [String]historyData.Size() )
     traverse( historyData, Elements, one ) {
-      productCode := one.ProductCode();
-      MappingBOM::CreateTestData( mappingParent, "浜嬩笟閮�" + [String](productCode.Length() mod 3), [String](productCode.Length() mod 4), productCode );
-      boms := selectset( mappingParent, MappingBOM, bom, bom.ProductCode() = productCode );
+      productCode := one.ProductID();
+      Global_MappingOperationBOM::CreateTestData( otdTable, "浜嬩笟閮�" + [String](productCode.Length() mod 3), "闈㈡澘鍩哄湴" + [String](productCode.Length() mod 4), productCode );
+      boms := selectset( otdTable, Global_MappingOperationBOM, bom, bom.ProductCode() = productCode );
       if( boms.Size() > 0 ) {
         bom := boms.First();
         businessType := bom.BusinessType();
-        placeOfProductionOfArray := one.PlaceOfProductionOfArray();
+        placeOfProductionOfArray := bom.OrganCode();
         // 鐩稿悓闈㈡澘鍩哄湴鍜屼簨涓氶儴鐨勬斁涓�琛�
         row := CapacityAndSaleBudgeCompareItemRow::CreateIfNotExist( this, businessType, placeOfProductionOfArray );
         // 璁板綍姣忚鍖呭惈鍝簺product
@@ -57,7 +55,7 @@
     }
     debuginfo( "CapacityAndSaleBudgeCompareItemRow : " + [String]selectset( this, CapacityAndSaleBudgeCompareItemRow, item, true ).Size() );
     // ====浠庡乏鍚戝彸鐢熸垚鍒楀ご涓庡唴瀹�====
-    // 浜嬩笟閮紝缁勭粐
+    // 浜嬩笟閮紝闈㈡澘鍩哄湴
     debuginfo( "dealing businessType and placeOfProductionOfArray" )
     columnBusinessType := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "浜嬩笟閮�" );
     columnPlaceOfProductionOfArray := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "闈㈡澘鍩哄湴" );
@@ -69,7 +67,7 @@
     }
     // 闈㈡澘鍒嗛厤閲� - 骞村害棰勭畻 (sheets)
     // 鏍煎紡锛� 闈㈡澘鍒嗛厤閲� - 骞� - 鏈堬紙1-12 & total锛� - 骞村害棰勭畻/scenarioName
-    info( "dealing 闈㈡澘鍒嗛厤閲�" )
+    debuginfo( "dealing 闈㈡澘鍒嗛厤閲�" )
     if( CapacityAndSaleBudgeFilterItem::Contains( items, "闈㈡澘鍒嗛厤閲�" ) ) {
       traverse( years, Elements, year ) {
         debuginfo( "闈㈡澘鍒嗛厤閲�" + [String]year.YearNo() + "骞�" );
@@ -78,14 +76,14 @@
         traverse( months, Elements, month ) {
           columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "闈㈡澘鍒嗛厤閲�-" + [String]year.YearNo() + "骞�-" + [String]month.MonthNo() + "鏈�-骞村害棰勭畻" );
           traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) {
-            cellReal := MappingCapacityAndSaleBudge::GetSheetByMonth( row.GetProductCodes(), mpSync, DateTime::Now().Year(), month.MonthNo() );
+            cellReal := Global_MappingForecast::GetQuantityByMonth( row.GetProductCodes(), this, DateTime::Now().Year(), month.MonthNo() );
             cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
             cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
           }
         }
         columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "闈㈡澘鍒嗛厤閲�-" + [String]year.YearNo() + "骞�-total-骞村害棰勭畻" );
         traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) {
-          cellReal := MappingCapacityAndSaleBudge::GetSheetByYear( row.GetProductCodes(), mpSync, year.YearNo() );
+          cellReal := Global_MappingForecast::GetQuantityByYear( row.GetProductCodes(), this, year.YearNo() );
           cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
           cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
         }
@@ -121,14 +119,14 @@
         traverse( months, Elements, month ) {
           columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "瀵瑰閿�鍞-" + [String]year.YearNo() + "骞�-" + [String]month.MonthNo() + "鏈�-骞村害棰勭畻" );
           traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) {
-            cellReal := MappingCapacityAndSaleBudge::GetSaleByMonth( row.GetProductCodes(), mpSync, year.YearNo(), month.MonthNo() );
+            cellReal := Global_MappingAnnualBudgetData::GetSaleByMonth( row.GetProductCodes(), this, year.YearNo(), month.MonthNo() );
             cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
             cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
           }
         }
         columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "瀵瑰閿�鍞-" + [String]year.YearNo() + "骞�-骞村害棰勭畻" );
         traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) {
-          cellReal := MappingCapacityAndSaleBudge::GetSaleByYear( row.GetProductCodes(), mpSync, year.YearNo() );
+          cellReal := Global_MappingAnnualBudgetData::GetSaleByYear( row.GetProductCodes(), this, year.YearNo() );
           cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
           cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
         }
@@ -138,7 +136,7 @@
           traverse( months, Elements, month ) {
             columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "瀵瑰閿�鍞-" + [String]year.YearNo() + "骞�-" + [String]month.MonthNo() + "鏈�-" + macroPlan.ScenarioName() );
             traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) {
-              cellReal := MappingAnnualBudget::GetSaleByMonth( row.GetProductCodes(), mpSync, year.YearNo(), month.MonthNo() );
+              cellReal := Forecast::GetFulfilledBalanceByMonth( row.GetProductCodes(), macroPlan, year.YearNo(), month.MonthNo() );
               cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
               cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
             }
@@ -146,7 +144,7 @@
           columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "瀵瑰閿�鍞-" + [String]year.YearNo() + "骞�-total-" + macroPlan.ScenarioName() );
           traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) {
             // QID 23
-            cellReal := MappingAnnualBudget::GetSaleByYear( row.GetProductCodes(), mpSync, year.YearNo() );
+            cellReal := Forecast::GetFulfilledBalanceByYear( row.GetProductCodes(), macroPlan, year.YearNo() );
             cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
             cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
           }

--
Gitblit v1.9.3