hongji.li
2023-11-03 d6bd7a69bc31efa79b21c7be12ba9547a921c251
_Main/BL/Type_GlobalOTDSOP/Method_CapacityAndSaleBudgeCompare.qbl
@@ -2,40 +2,41 @@
#parent: #root
Method CapacityAndSaleBudgeCompare (
  MacroPlans macroPlans,
  CapacityAndSaleBudgeFilterItems items,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months,
  owning CapacityAndSaleBudgeFilterItems items,
  owning CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays casbfpopoas,
  owning CapacityAndSaleBudgeFilterBusinessTypes casbfbts,
  owning CapacityAndSaleBudgeFilterYears years,
  owning CapacityAndSaleBudgeFilterMonths months,
  const GlobalOTDTable globalOTDTable
)
{
  Description: 'todo : mappingParent改为mpSync, random删了'
  TextBody:
  [*
    if ( years.Size() = 0 ) {
      years := selectset( this, CapacityAndSaleBudgeFilterYear, tempCASBFY, tempCASBFY.YearNo() = Date::ActualDate().Year() );
    }
    if ( months.Size() = 0 ) {
      months := selectsortedset( this, CapacityAndSaleBudgeFilterMonth, item, item.MonthNo() );
    }
    this.CapacityAndSaleBudgeCompareItemRow( relflush );
    this.CapacityAndSaleBudgeCompareItemColumn( relflush );
    
    CapacityAndSaleBudgeCompareItemCell::CreateData( globalOTDTable, this );
    CapacityAndSaleBudgeCompareItemCell::SetFilterCriteria( this, &items, &casbfpopoas, &casbfbts, &years, &months );
    
    if ( CapacityAndSaleBudgeFilterItem::Contains( items, "面板分配量" ) ) {
      traverse ( years, Elements, year ) {
        CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationBudget( this, months, year, globalOTDTable );
        CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationByScenario( macroPlans, this, months, year );
      }
    }
    CapacityAndSaleBudgeCompareItemCell::GenerateBasicDataBasedOnFilteringCriteria( this, globalOTDTable, items, casbfpopoas, casbfbts );
    
    if ( CapacityAndSaleBudgeFilterItem::Contains( items, "销售额" ) ) {
      traverse ( years, Elements, year ) {
        CapacityAndSaleBudgeCompareItemCell::CreateSalesVolume( this, months, year, globalOTDTable );
        CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeByScenario( macroPlans, this, months, year );
      }
    }
    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeData( macroPlans, globalOTDTable, this, items, years, months );
    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocation( macroPlans, globalOTDTable, this, items, years, months );
    //if ( CapacityAndSaleBudgeFilterItem::Contains( items, "面板分配量" ) ) {
    //  traverse ( years, Elements, year ) {
    //    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationBudget( this, months, year, globalOTDTable );
    //    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationByScenario( macroPlans, this, months, year );
    //  }
    //}
    //
    //if ( CapacityAndSaleBudgeFilterItem::Contains( items, "销售额" ) ) {
    //  traverse ( years, Elements, year ) {
    //    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolume( this, months, year, globalOTDTable );
    //    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeByScenario( macroPlans, this, months, year );
    //  }
    //}
    
    // 大张盈利额
    //traverse ( years, Elements, year ) {
@@ -74,16 +75,16 @@
    //}
    
    // 设置rowNo和columnNo
    rowNo := 1;
    rowSorted := selectsortedset( this, CapacityAndSaleBudgeCompareItemRow, item, item.PlaceOfProductionOfArray() + "_" + item.BusinessType() );
    traverse( rowSorted, Elements, item ) {
      item.RowNo( rowNo );
      rowNo := rowNo + 1;
    }
    columnNo := 1;
    traverse( this, CapacityAndSaleBudgeCompareItemColumn, item ) {
      item.ColumnNo( columnNo );
      columnNo := columnNo + 1;
    }
    //rowNo := 1;
    //rowSorted := selectsortedset( this, CapacityAndSaleBudgeCompareItemRow, item, item.PlaceOfProductionOfArray() + "_" + item.BusinessType() );
    //traverse( rowSorted, Elements, item ) {
    //  item.RowNo( rowNo );
    //  rowNo := rowNo + 1;
    //}
    //columnNo := 1;
    //traverse( this, CapacityAndSaleBudgeCompareItemColumn, item ) {
    //  item.ColumnNo( columnNo );
    //  columnNo := columnNo + 1;
    //}
  *]
}