| | |
| | | MacroPlan mappingParent |
| | | ) |
| | | { |
| | | Description: '按入参处理数据,产生需要的CapacityAndSaleBudgeChartElement' |
| | | Description: |
| | | [* |
| | | 按入参处理数据,产生需要的CapacityAndSaleBudgeChartElement |
| | | !!!!废弃!!!! |
| | | *] |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-19-2023 (created) |
| | |
| | | this.CapacityAndSaleBudgeChartElement( relflush ); |
| | | |
| | | // ====按面板基地和事业部对产品进行筛选分组==== |
| | | historyData := selectset( otdTable, CapacityAndSaleBudge, item, true ); |
| | | historyData := selectset( mpSync, MappingCapacityAndSaleBudge, item, true ); |
| | | if( placeOfProductionOfArrayChosen <> "" ) { |
| | | historyData := selectset( historyData, Elements, item, item.PlaceOfProductionOfArray() = placeOfProductionOfArrayChosen ); |
| | | } |
| | | if( businessTypeChosen <> "" ) { |
| | | historyData := selectset( historyData, Elements, item, item.BusinessType() = businessTypeChosen ); |
| | | } |
| | | //info( "historyData : " + [String]historyData.Size() ); |
| | | traverse( historyData, Elements, item ) { |
| | | row := CapacityAndSaleBudgeChartRow::CreateIfNotExist( this, item.BusinessType(), item.PlaceOfProductionOfArray() ); |
| | | // 记录每行包含哪些product |
| | | CapacityAndSaleBudgeChartRowProduct::CreateIfNotExist( row, item.ProductCode() ); |
| | | } |
| | | rows := selectset( this, CapacityAndSaleBudgeChartRow, item, true ); |
| | | //info( "rows : " + [String]rows.Size() ); |
| | | placeOfProductionOfArrayList := selectuniquevalues( historyData, Elements, item, item.PlaceOfProductionOfArray() ); |
| | | businessTypeList := selectuniquevalues( historyData, Elements, item, item.BusinessType() ); |
| | | // 生成图表元素 |
| | |
| | | productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray ); |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-目标", |
| | | BusinessTypeOrOrgCode := placeOfProductionOfArray, |
| | | BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray, |
| | | Quantity := ifexpr( isCapacity, |
| | | CapacityAndSaleBudge::GetSheetByYear( productCodeList, otdTable, [Number]year ), |
| | | MappingForecast::GetQuantityByYear( productCodeList, mappingParent, [Number]year ) ) |
| | | MappingCapacityAndSaleBudge::GetSheetByYear( productCodeList, mpSync, [Number]year ), |
| | | // todo QID 23 |
| | | MappingAnnualBudget::GetSheetByYear( productCodeList, mpSync, [Number]year ) ) |
| | | ); |
| | | // S&OP |
| | | // S&OP |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrOrgCode := placeOfProductionOfArray, |
| | | BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray, |
| | | Quantity := ifexpr( isCapacity, |
| | | Product_MP::GetNewSupplyByYear( productCodeList, macroPlan, [Number]year ), |
| | | // todo |
| | | 0.0 ) |
| | | ); |
| | | } |
| | |
| | | productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray ); |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-目标", |
| | | BusinessTypeOrOrgCode := placeOfProductionOfArray, |
| | | BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray, |
| | | Quantity := ifexpr( isCapacity, |
| | | CapacityAndSaleBudge::GetSheetByHalfYear( productCodeList, otdTable, [Number]year, halfNo ), |
| | | MappingForecast::GetQuantityByHalfYear( productCodeList, mappingParent, [Number]year, halfNo ) ) |
| | | MappingCapacityAndSaleBudge::GetSheetByHalfYear( productCodeList, mpSync, [Number]year, halfNo ), |
| | | MappingAnnualBudget::GetSheetByHalfYear( productCodeList, mpSync, [Number]year, halfNo ) ) |
| | | ); |
| | | // S&OP |
| | | // S&OP |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrOrgCode := placeOfProductionOfArray, |
| | | BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray, |
| | | Quantity := ifexpr( isCapacity, |
| | | Product_MP::GetNewSupplyByHalfYear( productCodeList, macroPlan, [Number]year, halfNo ), |
| | | 0.0 ) |
| | |
| | | for( seasonNo := 1; seasonNo <= 4; seasonNo := seasonNo + 1 ) { |
| | | traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) { |
| | | productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray ); |
| | | // info( "productCodeList : " + [String]productCodeList.Size() ); |
| | | // info( "MappingCapacityAndSaleBudge::GetSheetBySeason : " + [String]MappingCapacityAndSaleBudge::GetSheetBySeason( productCodeList, mpSync, [Number]year, seasonNo ) ); |
| | | // info( "seasonNo : " + [String]seasonNo ); |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + [String]seasonNo + "季度-目标", |
| | | BusinessTypeOrOrgCode := placeOfProductionOfArray, |
| | | BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray, |
| | | Quantity := ifexpr( isCapacity, |
| | | CapacityAndSaleBudge::GetSheetBySeason( productCodeList, otdTable, [Number]year, seasonNo ), |
| | | MappingForecast::GetQuantityBySeason( productCodeList, mappingParent, [Number]year, seasonNo ) ) |
| | | MappingCapacityAndSaleBudge::GetSheetBySeason( productCodeList, mpSync, [Number]year, seasonNo ), |
| | | MappingAnnualBudget::GetSheetBySeason( productCodeList, mpSync, [Number]year, seasonNo ) ) |
| | | ); |
| | | // S&OP |
| | | // info( "productCodeList : " + [String]productCodeList.Size() ); |
| | | // S&OP |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + [String]seasonNo + "季度-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrOrgCode := placeOfProductionOfArray, |
| | | BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray, |
| | | Quantity := ifexpr( isCapacity, |
| | | Product_MP::GetNewSupplyBySeason( productCodeList, macroPlan, [Number]year, seasonNo ), |
| | | 0.0 ) |
| | |
| | | } |
| | | if ( byBusinessTypeOrByOrgCode = "面板基地" and groupBy = "月" ) { |
| | | for( monthNo := 1; monthNo <= 12; monthNo := monthNo + 1 ) { |
| | | monthNoString := ifexpr( monthNo <= 9, "0" + [String]monthNo, [String]monthNo ); |
| | | traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) { |
| | | productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray ); |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + [String]monthNo + "月-目标", |
| | | BusinessTypeOrOrgCode := placeOfProductionOfArray, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + monthNoString + "月-目标", |
| | | BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray, |
| | | Quantity := ifexpr( isCapacity, |
| | | CapacityAndSaleBudge::GetSheetByMonth( productCodeList, otdTable, [Number]year, monthNo ), |
| | | MappingForecast::GetQuantityByMonth( productCodeList, mappingParent, [Number]year, monthNo ) ) |
| | | MappingCapacityAndSaleBudge::GetSheetByMonth( productCodeList, mpSync, [Number]year, monthNo ), |
| | | MappingAnnualBudget::GetSheetByMonth( productCodeList, mpSync, [Number]year, monthNo ) ) |
| | | ); |
| | | // S&OP |
| | | // S&OP |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + [String]monthNo + "月-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrOrgCode := placeOfProductionOfArray, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + monthNoString + "月-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray, |
| | | Quantity := ifexpr( isCapacity, |
| | | Product_MP::GetNewSupplyByMonth( productCodeList, macroPlan, [Number]year, monthNo ), |
| | | 0.0 ) |
| | |
| | | productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType ); |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-目标", |
| | | BusinessTypeOrOrgCode := businessType, |
| | | BusinessTypeOrPlaceOfProductionOfArray := businessType, |
| | | Quantity := ifexpr( isCapacity, |
| | | CapacityAndSaleBudge::GetSheetByYear( productCodeList, otdTable, [Number]year ), |
| | | MappingForecast::GetQuantityByYear( productCodeList, mappingParent, [Number]year ) ) |
| | | MappingCapacityAndSaleBudge::GetSheetByYear( productCodeList, mpSync, [Number]year ), |
| | | MappingAnnualBudget::GetSheetByYear( productCodeList, mpSync, [Number]year ) ) |
| | | ); |
| | | // S&OP |
| | | // S&OP |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrOrgCode := businessType, |
| | | BusinessTypeOrPlaceOfProductionOfArray := businessType, |
| | | Quantity := ifexpr( isCapacity, |
| | | Product_MP::GetNewSupplyByYear( productCodeList, macroPlan, [Number]year ), |
| | | 0.0 ) |
| | |
| | | productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType ); |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-目标", |
| | | BusinessTypeOrOrgCode := businessType, |
| | | BusinessTypeOrPlaceOfProductionOfArray := businessType, |
| | | Quantity := ifexpr( isCapacity, |
| | | CapacityAndSaleBudge::GetSheetByHalfYear( productCodeList, otdTable, [Number]year, halfNo ), |
| | | MappingForecast::GetQuantityByHalfYear( productCodeList, mappingParent, [Number]year, halfNo ) ) |
| | | MappingCapacityAndSaleBudge::GetSheetByHalfYear( productCodeList, mpSync, [Number]year, halfNo ), |
| | | MappingAnnualBudget::GetSheetByHalfYear( productCodeList, mpSync, [Number]year, halfNo ) ) |
| | | ); |
| | | // S&OP |
| | | // S&OP |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrOrgCode := businessType, |
| | | BusinessTypeOrPlaceOfProductionOfArray := businessType, |
| | | Quantity := ifexpr( isCapacity, |
| | | Product_MP::GetNewSupplyByHalfYear( productCodeList, macroPlan, [Number]year, halfNo ), |
| | | 0.0 ) |
| | |
| | | productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType ); |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + [String]seasonNo + "季度-目标", |
| | | BusinessTypeOrOrgCode := businessType, |
| | | BusinessTypeOrPlaceOfProductionOfArray := businessType, |
| | | Quantity := ifexpr( isCapacity, |
| | | CapacityAndSaleBudge::GetSheetBySeason( productCodeList, otdTable, [Number]year, seasonNo ), |
| | | MappingForecast::GetQuantityBySeason( productCodeList, mappingParent, [Number]year, seasonNo ) ) |
| | | MappingCapacityAndSaleBudge::GetSheetBySeason( productCodeList, mpSync, [Number]year, seasonNo ), |
| | | MappingAnnualBudget::GetSheetBySeason( productCodeList, mpSync, [Number]year, seasonNo ) ) |
| | | ); |
| | | // S&OP |
| | | // S&OP |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + [String]seasonNo + "季度-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrOrgCode := businessType, |
| | | BusinessTypeOrPlaceOfProductionOfArray := businessType, |
| | | Quantity := ifexpr( isCapacity, |
| | | Product_MP::GetNewSupplyBySeason( productCodeList, macroPlan, [Number]year, seasonNo ), |
| | | 0.0 ) |
| | |
| | | } |
| | | if ( byBusinessTypeOrByOrgCode = "事业部" and groupBy = "月" ) { |
| | | for( monthNo := 1; monthNo <= 12; monthNo := monthNo + 1 ) { |
| | | monthNoString := ifexpr( monthNo <= 9, "0" + [String]monthNo, [String]monthNo ); |
| | | traverse( businessTypeList, Elements, businessType ) { |
| | | productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType ); |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + [String]monthNo + "月-目标", |
| | | BusinessTypeOrOrgCode := businessType, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + monthNoString + "月-目标", |
| | | BusinessTypeOrPlaceOfProductionOfArray := businessType, |
| | | Quantity := ifexpr( isCapacity, |
| | | CapacityAndSaleBudge::GetSheetByMonth( productCodeList, otdTable, [Number]year, monthNo ), |
| | | MappingForecast::GetQuantityByMonth( productCodeList, mappingParent, [Number]year, monthNo ) ) |
| | | MappingCapacityAndSaleBudge::GetSheetByMonth( productCodeList, mpSync, [Number]year, monthNo ), |
| | | MappingAnnualBudget::GetSheetByMonth( productCodeList, mpSync, [Number]year, monthNo ) ) |
| | | ); |
| | | // S&OP |
| | | // S&OP |
| | | traverse( macroPlans, Elements, macroPlan ) { |
| | | this.CapacityAndSaleBudgeChartElement( relnew, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + [String]monthNo + "月-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrOrgCode := businessType, |
| | | TimeStringAndScenarioName := [String]year + "年-第" + monthNoString + "月-" + macroPlan.ScenarioName(), |
| | | BusinessTypeOrPlaceOfProductionOfArray := businessType, |
| | | Quantity := ifexpr( isCapacity, |
| | | Product_MP::GetNewSupplyByMonth( productCodeList, macroPlan, [Number]year, monthNo ), |
| | | 0.0 ) |
| | |
| | | } |
| | | } |
| | | } |
| | | //info( "CapacityAndSaleBudgeChartElement : " + [String]selectset( this, CapacityAndSaleBudgeChartElement, item, true ).Size() ); |
| | | //traverse( this, CapacityAndSaleBudgeChartRow, row ) { |
| | | // info( "==↓==" ); |
| | | // info( row.BusinessType() ); |
| | | // info( row.PlaceOfProductionOfArray() ); |
| | | // elements := selectset( row, CapacityAndSaleBudgeChartRowProduct, cell, true ); |
| | | // info( elements.Size() ); |
| | | // info( row.GetProductCodes().Concatenate( " | " ) ); |
| | | // info( "==↑==" ); |
| | | //} |
| | | *] |
| | | } |