| | |
| | | CapacityAndSaleBudgeFilterItems items, |
| | | CapacityAndSaleBudgeFilterYears years, |
| | | CapacityAndSaleBudgeFilterMonths months, |
| | | const GlobalOTDTable otdTable |
| | | const GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: 'todo : mappingParentæ¹ä¸ºmpSync, randomå äº' |
| | | TextBody: |
| | | [* |
| | | // ====ä¸éæ¶é»è®¤å
¨é==== |
| | | if ( years.Size() = 0 ) { |
| | | years := selectset( this, CapacityAndSaleBudgeFilterYear, tempCASBFY, tempCASBFY.YearNo() = Date::ActualDate().Year() ); |
| | | } |
| | |
| | | this.CapacityAndSaleBudgeCompareItemRow( relflush ); |
| | | this.CapacityAndSaleBudgeCompareItemColumn( relflush ); |
| | | |
| | | // ====æ±æ»ææåºç°ç产å==== |
| | | targetglobal_MappingAnnualBudgetData := selectset( otdTable, Global_MappingAnnualBudgetData, item, true ); |
| | | CapacityAndSaleBudgeCompareItemCell::CreateData( globalOTDTable, this ); |
| | | |
| | | traverse ( targetglobal_MappingAnnualBudgetData, Elements, gmabd ) { |
| | | productCode := gmabd.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 := bom.OrganCode(); |
| | | // ç¸å颿¿åºå°åäºä¸é¨çæ¾ä¸è¡ |
| | | row := CapacityAndSaleBudgeCompareItemRow::CreateIfNotExist( this, gmabd.BusinessType(), gmabd.OrganCode() ); |
| | | // è®°å½æ¯è¡å
å«åªäºproduct |
| | | CapacityAndSaleBudgeCompareItemRowProduct::CreateIfNotExist( row, productCode ); |
| | | // } else { |
| | | // debuginfo( "no boms for product : " + productCode ); |
| | | // } |
| | | } |
| | | |
| | | // ====ä»å·¦åå³çæå头ä¸å
容==== |
| | | // äºä¸é¨ï¼é¢æ¿åºå° |
| | | columnBusinessType := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "äºä¸é¨" ); |
| | | columnPlaceOfProductionOfArray := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "颿¿åºå°" ); |
| | | traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | cell := columnBusinessType.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := row.BusinessType() ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | cell := columnPlaceOfProductionOfArray.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := row.PlaceOfProductionOfArray() ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | } |
| | | |
| | | // 颿¿åé
é - 年度é¢ç® (sheets) |
| | | // æ ¼å¼ï¼ 颿¿åé
é - å¹´ - æï¼1-12 & totalï¼ - 年度é¢ç®/scenarioName |
| | | if ( CapacityAndSaleBudgeFilterItem::Contains( items, "颿¿åé
é" ) ) { |
| | | traverse ( years, Elements, year ) { |
| | | // å岿°æ® |
| | | // traverse ( months, Elements, month ) { |
| | | // columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "颿¿åé
é-" + [String]year.YearNo() + "å¹´-" + [String]month.MonthNo() + "æ-年度é¢ç®" ); |
| | | // traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // cellReal := Global_MappingForecast::GetQuantityByMonth( row.GetProductCodes(), otdTable, 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 := Global_MappingForecast::GetQuantityByYear( row.GetProductCodes(), otdTable, year.YearNo() ); |
| | | // cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | |
| | | traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) { |
| | | total := 0.0; |
| | | traverse ( months, Elements, m ) { |
| | | columnName := "颿¿åé
é-" + [String]year.YearNo() + "å¹´-" + [String]m.MonthNo() + "æ-年度é¢ç®"; |
| | | columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, columnName ); |
| | | cellReal := Global_MappingForecast::GetQuantityByMonth( casbcir.GetProductCodes(), otdTable, DateTime::Now().Year(), m.MonthNo() ); |
| | | cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | total := total + cellReal; |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir ); |
| | | } |
| | | columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "颿¿åé
é-" + [String]year.YearNo() + "å¹´-total-年度é¢ç®" ); |
| | | cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]total ); |
| | | columnYear.TotalIdentification( year.YearNo() ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir ); |
| | | } |
| | | |
| | | // S&OPæ°æ® |
| | | // traverse ( macroPlans, Elements, macroPlan ) { |
| | | // traverse ( months, Elements, month ) { |
| | | // columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, |
| | | // "颿¿åé
é-" + [String]year.YearNo() + "å¹´-" + [String]month.MonthNo() + "æ-" + macroPlan.ScenarioName() ); |
| | | // traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // cellReal := Product_MP::GetNewSupplyByMonth( row.GetProductCodes(), macroPlan, year.YearNo(), month.MonthNo() ); |
| | | // cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | // } |
| | | // columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, |
| | | // "颿¿åé
é-" + [String]year.YearNo() + "å¹´-total-" + macroPlan.ScenarioName() ); |
| | | // traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // cellReal := Product_MP::GetNewSupplyByYear( row.GetProductCodes(), macroPlan, year.YearNo() ); |
| | | // cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | // } |
| | | traverse ( macroPlans, Elements, mp ) { |
| | | traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) { |
| | | total := 0.0; |
| | | traverse ( months, Elements, m ) { |
| | | columnName := "颿¿åé
é-" + [String]year.YearNo() + "å¹´-" + [String]m.MonthNo() + "æ-" + mp.ScenarioName(); |
| | | columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, columnName ); |
| | | cellReal := Product_MP::GetNewSupplyByMonth( casbcir.GetProductCodes(), mp, year.YearNo(), m.MonthNo() ); |
| | | cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | total := total + cellReal; |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir ); |
| | | } |
| | | columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "颿¿åé
é-" + [String]year.YearNo() + "å¹´-total-" + mp.ScenarioName() ); |
| | | cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]total ); |
| | | columnYear.TotalIdentification( year.YearNo() ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir ); |
| | | } |
| | | } |
| | | CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationBudget( this, months, year, globalOTDTable ); |
| | | CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationByScenario( macroPlans, this, months, year ); |
| | | } |
| | | } |
| | | |
| | | // 年度éå®é¢ |
| | | if ( CapacityAndSaleBudgeFilterItem::Contains( items, "éå®é¢" ) ) { |
| | | traverse ( years, Elements, year ) { |
| | | // å岿°æ® |
| | | // traverse ( months, Elements, month ) { |
| | | // columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "对å¤éå®é¢-" + [String]year.YearNo() + "å¹´-" + [String]month.MonthNo() + "æ-年度é¢ç®" ); |
| | | // traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // cellReal := Global_MappingAnnualBudgetData::GetSaleByMonth( row.GetProductCodes(), otdTable, 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 := Global_MappingAnnualBudgetData::GetSaleByYear( row.GetProductCodes(), otdTable, year.YearNo() ); |
| | | // cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) { |
| | | total := 0.0; |
| | | traverse ( months, Elements, m ) { |
| | | columnName := "对å¤éå®é¢-" + [String]year.YearNo() + "å¹´-" + [String]m.MonthNo() + "æ-年度é¢ç®"; |
| | | columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, columnName ); |
| | | cellReal := Global_MappingAnnualBudgetData::GetSaleByMonth( casbcir.GetProductCodes(), otdTable, year.YearNo(), m.MonthNo() ); |
| | | cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | total := total + cellReal; |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir ); |
| | | } |
| | | columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "对å¤éå®é¢-" + [String]year.YearNo() + "å¹´-total-年度é¢ç®" ); |
| | | cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]total ); |
| | | columnYear.TotalIdentification( year.YearNo() ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir ); |
| | | } |
| | | |
| | | // S&OPæ°æ® |
| | | // traverse ( macroPlans, Elements, macroPlan ) { |
| | | // traverse ( months, Elements, month ) { |
| | | // columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "对å¤éå®é¢-" + [String]year.YearNo() + "å¹´-" + [String]month.MonthNo() + "æ-" + macroPlan.ScenarioName() ); |
| | | // traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // cellReal := Forecast::GetFulfilledBalanceByMonth( row.GetProductCodes(), macroPlan, year.YearNo(), month.MonthNo() ); |
| | | // cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | // } |
| | | // columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "对å¤éå®é¢-" + [String]year.YearNo() + "å¹´-total-" + macroPlan.ScenarioName() ); |
| | | // traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // // QID 23 |
| | | // cellReal := Forecast::GetFulfilledBalanceByYear( row.GetProductCodes(), macroPlan, year.YearNo() ); |
| | | // cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | // } |
| | | traverse ( macroPlans, Elements, mp ) { |
| | | traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) { |
| | | total := 0.0; |
| | | traverse ( months, Elements, m ) { |
| | | columnName := "对å¤éå®é¢-" + [String]year.YearNo() + "å¹´-" + [String]m.MonthNo() + "æ-" + mp.ScenarioName(); |
| | | columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, columnName ); |
| | | cellReal := Forecast::GetFulfilledBalanceByMonth( casbcir.GetProductCodes(), mp, year.YearNo(), m.MonthNo() ); |
| | | cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal ); |
| | | total := total + cellReal; |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir ); |
| | | } |
| | | columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "对å¤éå®é¢-" + [String]year.YearNo() + "å¹´-total-" + mp.ScenarioName() ); |
| | | cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]total ); |
| | | columnYear.TotalIdentification( year.YearNo() ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir ); |
| | | } |
| | | } |
| | | CapacityAndSaleBudgeCompareItemCell::CreateSalesVolume( this, months, year, globalOTDTable ); |
| | | CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeByScenario( macroPlans, this, months, year ); |
| | | } |
| | | } |
| | | |
| | | // å¤§å¼ çå©é¢ |
| | | traverse ( years, Elements, year ) { |
| | | // å岿°æ® |
| | | columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "å¤§å¼ çå©é¢-" + [String]year.YearNo() + "å¹´-年度é¢ç®" ); |
| | | traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]Number::Random( 0, 0 ) ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | } |
| | | // S&OPæ°æ® |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "å¤§å¼ çå©é¢-" + [String]year.YearNo() + "å¹´-" + macroPlan.ScenarioName() ); |
| | | traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]Number::Random( 0, 0 ) ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | } |
| | | } |
| | | } |
| | | // 产åçå©é¢ |
| | | traverse ( years, Elements, year ) { |
| | | // å岿°æ® |
| | | columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "产åçå©é¢-" + [String]year.YearNo() + "å¹´-年度é¢ç®" ); |
| | | traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]Number::Random( 0, 0 ) ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | } |
| | | // S&OPæ°æ® |
| | | traverse ( macroPlans, Elements, macroPlan ) { |
| | | columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "产åçå©é¢-" + [String]year.YearNo() + "å¹´-" + macroPlan.ScenarioName() ); |
| | | traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // todo |
| | | cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]Number::Random( 0, 0 ) ); |
| | | cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | } |
| | | } |
| | | } |
| | | //traverse ( years, Elements, year ) { |
| | | // // å岿°æ® |
| | | // columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "å¤§å¼ çå©é¢-" + [String]year.YearNo() + "å¹´-年度é¢ç®" ); |
| | | // traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]Number::Random( 0, 0 ) ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | // // S&OPæ°æ® |
| | | // traverse( macroPlans, Elements, macroPlan ) { |
| | | // columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "å¤§å¼ çå©é¢-" + [String]year.YearNo() + "å¹´-" + macroPlan.ScenarioName() ); |
| | | // traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]Number::Random( 0, 0 ) ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | // } |
| | | //} |
| | | //// 产åçå©é¢ |
| | | //traverse ( years, Elements, year ) { |
| | | // // å岿°æ® |
| | | // columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "产åçå©é¢-" + [String]year.YearNo() + "å¹´-年度é¢ç®" ); |
| | | // traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]Number::Random( 0, 0 ) ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | // // S&OPæ°æ® |
| | | // traverse ( macroPlans, Elements, macroPlan ) { |
| | | // columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "产åçå©é¢-" + [String]year.YearNo() + "å¹´-" + macroPlan.ScenarioName() ); |
| | | // traverse ( this, CapacityAndSaleBudgeCompareItemRow, row ) { |
| | | // // todo |
| | | // cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]Number::Random( 0, 0 ) ); |
| | | // cell.CapacityAndSaleBudgeCompareItemRow( relset, row ); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | // 设置rowNoåcolumnNo |
| | | rowNo := 1; |