_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateAnnualPlanReport.qbl
@@ -75,12 +75,18 @@ and pispippl.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day()); if( pispippls.Size() <> 0 ){ traverse( pispippls,Elements.NewSupply,newSupply ){ unit := newSupply.PeriodTask_MP().UnitPeriod().Unit(); localRow := null( LocalRow ); { localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + pisp_mp.StockingPoint_MP().Unit().Name() ); localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + unit.Name() ); localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); if( isnull( localRowIndex )){ localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.ProductID() + " in " + pisp_mp.StockingPoint_MP().Unit().Name(),ProductID := pisp_mp.ProductID(),ProductionLine := pisp_mp.StockingPoint_MP().Unit().Name(),Index := localTable.GetRowIndexCache() ); localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.ProductID() + " in " + unit.Name(), ProductID := pisp_mp.ProductID(), ProductionLine := unit.Name(), Index := localTable.GetRowIndexCache() ); localRows.Add( localRow ); localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); }else{ @@ -88,7 +94,51 @@ } } column := null( LocalColumn ); { columnHandle := localColumnIndexTree.GetHandle( newSupply.PeriodTask_MP().UnitPeriod().Period_MP().StartDate().AsQUILL() ); columnIndex := guard( localColumnIndexTree.Root().Child( columnHandle ),null( NamedValue )); if( not isnull( columnIndex )){ column := localColumns.Element( columnIndex.GetValueAsNumber() ); }else{ column := localTable.LocalColumn( relnew,CustomDate := newSupply.PeriodTask_MP().UnitPeriod().Period_MP().StartDate() ,TimeUnit := "Day"); localColumns.Add( column ); localColumnIndexTree.Root().AddChild( columnHandle,localColumns.Size() - 1 ); } } localCellHandle := localCellIndexTree.GetHandle( localRow.ProductID() + localRow.ProductionLine() + column.CustomDate().AsQUILL() + column.TimeUnit() ); localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue )); if( isnull( localCellIndex )){ localCell := localRow.LocalCell( relnew,LocalCell_Default,LocalColumn := column ); localCell.RealValue( newSupply.Quantity() ); localCells.Add( localCell ); localCellIndexTree.Root().AddChild( localCellHandle,localCells.Size() - 1 ); }else{ localCell := localCells.Element( localCellIndex.GetValueAsNumber() ); localCell.RealValue( localCell.RealValue() + newSupply.Quantity() ); } } traverse( pispippls,Elements,pispippl ){ unit := pispippl.ProductInStockingPoint_MP().StockingPoint_MP().Unit(); localRow := null( LocalRow ); { localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + unit.Name() ); localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); if( isnull( localRowIndex )){ localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.ProductID() + " in " + unit.Name(), ProductID := pisp_mp.ProductID(), ProductionLine := unit.Name(), Index := localTable.GetRowIndexCache() ); localRows.Add( localRow ); localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); }else{ localRow := localRows.Element( localRowIndex.GetValueAsNumber() ); } } column := null( LocalColumn ); { columnHandle := localColumnIndexTree.GetHandle( pispippl.Period_MP().StartDate().AsQUILL() ); _Main/BL/Type_MP_Cell_AnnualPlanReport0/StaticMethod_CreateFullTable.qbl
@@ -74,12 +74,15 @@ and pispippl.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day()); if( pispippls.Size() <> 0 ){ traverse( pispippls,Elements.NewSupply,newSupply ){ unit := newSupply.PeriodTask_MP().UnitPeriod().Unit(); localRow := null( LocalRow ); { localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + pisp_mp.StockingPoint_MP().Unit().Name() ); localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + unit.Name() ); localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); if( isnull( localRowIndex )){ localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.Name(),ProductID := pisp_mp.ProductID(),ProductionLine := pisp_mp.StockingPoint_MP().Unit().Name(),Index := localTable.GetRowIndexCache() ); localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.Name(),ProductID := pisp_mp.ProductID(),ProductionLine := unit.Name(),Index := localTable.GetRowIndexCache() ); localRows.Add( localRow ); localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); }else{ @@ -87,15 +90,14 @@ } } traverse( pispippls,Elements,pispippl ){ column := null( LocalColumn ); { columnHandle := localColumnIndexTree.GetHandle( pispippl.Period_MP().StartDate().AsQUILL() ); columnHandle := localColumnIndexTree.GetHandle( newSupply.PeriodTask_MP().UnitPeriod().Period_MP().StartDate().AsQUILL() ); columnIndex := guard( localColumnIndexTree.Root().Child( columnHandle ),null( NamedValue )); if( not isnull( columnIndex )){ column := localColumns.Element( columnIndex.GetValueAsNumber() ); }else{ column := localTable.LocalColumn( relnew,CustomDate := pispippl.Period_MP().StartDate() ,TimeUnit := "Day"); column := localTable.LocalColumn( relnew,CustomDate := newSupply.PeriodTask_MP().UnitPeriod().Period_MP().StartDate() ,TimeUnit := "Day"); localColumns.Add( column ); localColumnIndexTree.Root().AddChild( columnHandle,localColumns.Size() - 1 ); } @@ -105,12 +107,12 @@ localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue )); if( isnull( localCellIndex )){ localCell := localRow.LocalCell( relnew,LocalCell_Default,LocalColumn := column ); localCell.RealValue( pispippl.NewSupplyQuantity() ); localCell.RealValue( newSupply.Quantity() ); localCells.Add( localCell ); localCellIndexTree.Root().AddChild( localCellHandle,localCells.Size() - 1 ); }else{ localCell := localCells.Element( localCellIndex.GetValueAsNumber() ); localCell.RealValue( localCell.RealValue() + pispippl.NewSupplyQuantity() ); localCell.RealValue( localCell.RealValue() + newSupply.Quantity() ); } } } _Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_CreateFullTable.qbl
@@ -169,7 +169,7 @@ } } // 循环时间为计划开始日期之前的时间 traverse( localColumns,Elements,localColumn , localColumn.CustomDate() < macroPlan.StartOfPlanning().Date() or LocalTool::GetYYYYMM( localColumn.CustomDate() ) = LocalTool::GetYYYYMM( macroPlan.StartOfPlanning().Date() )){ traverse( localColumns,Elements,localColumn , (localColumn.CustomDate() < macroPlan.StartOfPlanning().Date() or LocalTool::GetYYYYMM( localColumn.CustomDate() ) = LocalTool::GetYYYYMM( macroPlan.StartOfPlanning().Date() )) and localColumn.CustomDate() <> macroPlan.StartOfPlanning().Date()){ archiveCells := selectset( row,LocalCell.astype( LocalCell_ScheduleSummary ),cell, cell.LocalColumn().CustomDate() >= localColumn.CustomDate() and cell.LocalColumn().CustomDate() < localColumn.CustomDate().StartOfNextMonth() );