| | |
| | | tableHandle := TableHandle::ImportXML( BinaryValue::Construct( this.FinalXML())); |
| | | }onerror{ |
| | | this.Delete(); |
| | | error( e ); |
| | | error( e.GeneralInformation() ); |
| | | } |
| | | tableGroupHandle.Add( tableHandle ); |
| | | binaryData := XLS::SaveTableGroupToBinaryData( tableGroupHandle, true ); |
| | |
| | | StaticMethod AsyncExport ( |
| | | RecycleBin recycleBin, |
| | | const constcontent LocalRows rows, |
| | | const constcontent LocalColumns columns |
| | | const constcontent LocalColumns columns, |
| | | const Strings attributeNames |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | // rislai Jun-20-2024 (created) |
| | | sortColumns := selectsortedset( columns,Elements,column,true,column.Index()); |
| | | |
| | | attributeNames := LocalCell_ScheduleSummary::GetAttributeNames(); |
| | | // attributeNames := LocalCell_ScheduleSummary::GetAttributeNames(); |
| | | |
| | | columnstring := emit( "" ); |
| | | flag := true; |
对比新文件 |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute IsFristWeekData |
| | | { |
| | | #keys: '3[414996.1.43574725][414996.1.43574724][414996.1.43574726]' |
| | | ValueType: Boolean |
| | | } |
| | |
| | | table := owner.MP_Table( relnew,Name := MP_Cell_ScheduleSummary::GetTableName()); |
| | | |
| | | startDate := owner.StartOfPlanning().Date(); |
| | | endDate := startDate + 7; |
| | | |
| | | endDate := maxselect( owner,Unit.UnitPeriod.astype( UnitPeriodTime ).Period_MP,period,period.TimeUnit() = Translations::MP_GlobalParameters_Day(),period.EndDate()).EndDate(); |
| | | |
| | | columns := construct( MP_Columns ); |
| | | columnIndexTree := NamedValueTree::Create(); |
| | |
| | | capacity := workDay * throughput * workHours.Capacity().HoursAsReal() |
| | | } |
| | | |
| | | isFirstWeekData := true; |
| | | |
| | | if( column.CustomDate() > startDate + 7 ){ |
| | | isFirstWeekData := false; |
| | | } |
| | | |
| | | row.MP_Cell( relnew,MP_Cell_ScheduleSummary,MP_Column := column, |
| | | IsFristWeekData := isFirstWeekData, |
| | | ShiftPattern := unitPeriodTime.ShiftPatternName(), |
| | | WorkingDay := workDay, |
| | | Capacity := capacity, |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | traverse( table,MP_Column,column,column.MP_Cell( relsize ) = 0 ){ |
| | | column.Delete(); |
| | | } |
| | | return table; |
| | | *] |
| | | } |
| | |
| | | localColumns.Add( localColumn ); |
| | | localColumnIndexTree.Root().AddChild( localColumnHandle,localColumns.Size() - 1 ); |
| | | } |
| | | traverse( tables,Elements.MP_Row,row ){ |
| | | |
| | | localRow := localTable.LocalRow( relnew,CustomName := row.Name(),Index := localTable.GetRowIndexCache() ); |
| | | |
| | | localRows := construct( LocalRows ); |
| | | localRowIndexTree := NamedValueTree::Create(); |
| | | |
| | | localCells := construct( LocalCell_ScheduleSummarys ); |
| | | localCellIndexTree := NamedValueTree::Create(); |
| | | |
| | | //shiftPatternCount := NamedValueTree::Create(); |
| | | traverse( tables,Elements.MP_Row,row ){ |
| | | rowMacroPlan := row.MP_Table().MacroPlan(); |
| | | localRow := null( LocalRow ); |
| | | { |
| | | localRowHandle := localRowIndexTree.GetHandle( row.Name() ); |
| | | localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); |
| | | if( isnull( localRowIndex )){ |
| | | localRow := localTable.LocalRow( relnew,CustomName := row.Name(),Index := localTable.GetRowIndexCache() ); |
| | | localRows.Add( localRow ); |
| | | localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); |
| | | }else{ |
| | | localRow := localRows.Element( localRowIndex.GetValueAsNumber()); |
| | | } |
| | | } |
| | | traverse( localColumns,Elements,localColumn ){ |
| | | cells := selectset( row,MP_Cell.astype( MP_Cell_ScheduleSummary ),cell,cell.MP_Column().CustomDate() >= localColumn.CustomDate() and cell.MP_Column().CustomDate() < localColumn.CustomDate().StartOfNextMonth() ); |
| | | cells := selectset( row,MP_Cell.astype( MP_Cell_ScheduleSummary ),cell, |
| | | ifexpr( rowMacroPlan = owner , true , cell.IsFristWeekData()) and |
| | | cell.MP_Column().CustomDate() >= localColumn.CustomDate() and |
| | | cell.MP_Column().CustomDate() < localColumn.CustomDate().StartOfNextMonth() ); |
| | | |
| | | output := 0.0; |
| | | |
| | |
| | | traverse( cells,Elements,cell ){ |
| | | workingDay := workingDay + cell.WorkingDay(); |
| | | capacity := capacity + cell.Capacity(); |
| | | |
| | | |
| | | // shiftPatternHanlde := shiftPatternCount.GetHandle( cell.ShiftPattern() ); |
| | | // shiftPatternCountValue := guard( shiftPatternCount.Root().Child( shiftPatternHanlde ),null( NamedValue )); |
| | | // if( isnull( shiftPatternCountValue )){ |
| | | // shiftPatternCount.Root().AddChild( shiftPatternHanlde,1 ); |
| | | // }else{ |
| | | // shiftPatternCountValue.SetValue( shiftPatternCountValue.GetValueAsNumber() + 1 ); |
| | | // } |
| | | |
| | | if( maxShiftPattern <> cell.ShiftPattern() ){ |
| | | if( maxShiftPatternCount = 0 ){ |
| | | maxShiftPattern := cell.ShiftPattern(); |
| | |
| | | maxShiftPatternCount ++; |
| | | } |
| | | } |
| | | localCell := null( LocalCell_ScheduleSummary ); |
| | | { |
| | | localCellHandle := localCellIndexTree.GetHandle( row.Name() + localColumn.CustomDate().AsQUILL() ); |
| | | localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue )); |
| | | if( isnull( localCellIndex )){ |
| | | localCell := localRow.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := localColumn ); |
| | | localCells.Add( localCell ); |
| | | localCellIndexTree.Root().AddChild( localCellHandle , localCells.Size() - 1 ); |
| | | }else{ |
| | | localCell := localCells.Element( localCellIndex.GetValueAsNumber() ); |
| | | } |
| | | } |
| | | |
| | | localCell := localRow.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := localColumn ); |
| | | localCell.ShiftPattern( maxShiftPattern ); |
| | | localCell.WorkingDay( workingDay ); |
| | | localCell.Capacity( capacity ); |
| | | localCell.Output( output ); |
| | | localCell.WorkingDay( localCell.WorkingDay() + workingDay ); |
| | | localCell.Capacity( localCell.Capacity() + capacity ); |
| | | localCell.Output( localCell.Output() + output ); |
| | | } |
| | | } |
| | | |
| | |
| | | index := [String]year; |
| | | if( month < 10 ){ |
| | | index := index + "0" + [String]month; |
| | | }else{ |
| | | index := index + [String]month; |
| | | } |
| | | if( day < 10 ){ |
| | | index := index + "0" + [String]day; |
| | | }else{ |
| | | index := index + [String]day; |
| | | } |
| | | |
| | | |
| | |
| | | [* |
| | | rows := selectset( dhComparisonData854.Data(),LocalRow,row,exists( dhFinelProduct.Data(),Elements,entity,entity.ID() = row.ProductID()) and exists( dhFinelStockingPoint.Data(),Elements,entity,entity.DisplayName() = row.StockingPointID())); |
| | | columns := selectset( dhComparisonData854.Data(),LocalColumn,column,dhStartDate.Data() <= column.Date() and dhEndDate.Data() > column.Date() ); |
| | | LocalCell_ScheduleSummary::AsyncExport( RecycleBin,rows,columns ); |
| | | LocalCell_Default::AsyncExport( RecycleBin,rows,columns ); |
| | | //Application.Download( "浜у嚭瀵煎叆妯℃澘.xlsx",data.AsBinaryData() ); |
| | | *] |
| | | GroupServerCalls: false |
| | |
| | | [* |
| | | rows := selectset( dhComparisonData854.Data(),LocalRow,row,exists( dhFinelEntity.Data(),Elements,entity,entity.DisplayName() = row.Name() )); |
| | | columns := selectset( dhComparisonData854.Data(),LocalColumn,column,dhStartDate.Data() <= column.Date() and dhEndDate.Data() > column.Date() ); |
| | | LocalCell_ScheduleSummary::AsyncExport( RecycleBin,rows,columns ); |
| | | attrbutes := construct( Strings ); |
| | | if( cbShiftPlan.Checked() ){ |
| | | attrbutes.Add( "ShiftPattern" ); |
| | | } |
| | | if( cbWorkday.Checked() ){ |
| | | attrbutes.Add( "WorkingDay" ); |
| | | } |
| | | if( cbCapacity.Checked() ){ |
| | | attrbutes.Add( "Capacity" ); |
| | | } |
| | | if( cbOutput.Checked() ){ |
| | | attrbutes.Add( "Output" ); |
| | | } |
| | | LocalCell_ScheduleSummary::AsyncExport( RecycleBin,rows,columns ,attrbutes ); |
| | | //Application.Download( "浜у嚭瀵煎叆妯℃澘.xlsx",data.AsBinaryData() ); |
| | | *] |
| | | GroupServerCalls: false |